# @embedpdf/react — ./redaction REDACTION_DEFAULTS [VariableDeclaration] (from packages/plugin/redaction/src/contract.ts): REDACTION_DEFAULTS: RedactionSettings ={ overlay:{ fill: '#000000', text:{ color: '#ffffff', fontFamily: 'helvetica', fontSize: 0} , } , } RedactionAppliedEvent [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionAppliedEvent{ readonly result: RedactionApplyResult; readonly origin: EventOrigin; } RedactionApplyResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/RedactionApplyResult.ts): export interface RedactionApplyResult{ scope: RedactionApplyScope; results: RedactionApplyItemResult[]; removedAnnotationCount: number; meta: MutationMeta; } RedactionCapability [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionCapability extends SettingsApi{ canMark(): boolean; canUnmark(ref: AnnotationRef): boolean; canUpdateLabel(ref: AnnotationRef): boolean; canApply(): boolean; isApplying(): boolean; getLastResult(): RedactionApplyResult | null; listPending(filter?: RedactionMarkFilter): readonly RedactionMark[]; getPending(ref: AnnotationRef): RedactionMark | null; getPendingCount(page?: PageRef | number): number; estimateCollateral(refs?: readonly AnnotationRef[]): RedactionCollateral; markSelection(options?: OperationOptions): Promise<{ marks: readonly RedactionMark[]} >; markArea( page: PageRef | number, bounds: Rect, options?: OperationOptions, ): Promise<{ mark: RedactionMark} >; markPage(page: PageRef | number, options?: OperationOptions): Promise<{ mark: RedactionMark} >; markMatches( query: SearchQuery, options?:{ pages?: readonly (PageRef | number)[]} & OperationOptions, ): Promise<{ marks: readonly RedactionMark[]} >; unmark( refs: readonly AnnotationRef[], options?: OperationOptions, ): Promise>; clearPending(options?: OperationOptions): Promise>; updateLabel( ref: AnnotationRef, patch: RedactionLabelPatch, options?: OperationOptions, ): Promise<{ mark: RedactionMark} >; apply(refs: readonly AnnotationRef[], options?: OperationOptions): Promise; applyAll(options?: OperationOptions): Promise; applyPages( pages: readonly (PageRef | number)[], options?: OperationOptions, ): Promise; readonly onApplied: EventHook; readonly onPendingChanged: EventHook; } RedactionCollateral [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionCollateral{ readonly count: number; readonly refs: readonly AnnotationRef[]; } RedactionConfig [TypeAliasDeclaration] (from packages/plugin/redaction/src/contract.ts): export type RedactionConfig = DeepPartial; RedactionLabelPatch [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionLabelPatch{ overlayText?: string | null; repeat?: boolean; } RedactionMark [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionMark{ readonly ref: AnnotationRef; readonly page: PageRef; readonly pageIndex: number; readonly kind: 'area' | 'text'; readonly bounds: Rect; readonly overlayText: string | null; readonly repeat: boolean; } RedactionMarkFilter [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionMarkFilter{ readonly page?: PageRef | number; } RedactionPendingChangedEvent [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionPendingChangedEvent{ readonly pages: readonly PageRef[]; } RedactionSettings [InterfaceDeclaration] (from packages/plugin/redaction/src/contract.ts): export interface RedactionSettings{ readonly overlay:{ readonly fill: string; readonly text:{ readonly color: string; readonly fontFamily: FontName; readonly fontSize: number; } ; } ; } RedactionState [InterfaceDeclaration] (from packages/plugin/redaction/src/state.ts): export interface RedactionState{ readonly pendingCount: number; readonly applying: boolean; readonly lastResult: RedactionApplyResult | null; } RedactionToken [VariableDeclaration] (from packages/plugin/redaction/src/token.ts): RedactionToken = createCapabilityToken('redaction', { hint: `add redactionPlugin() from '@embedpdf/plugin-redaction' to your plugins list`, promises:{ markSelection: true, markArea: true, markPage: true, markMatches: true, unmark: true, clearPending: true, updateLabel: true, apply: true, applyAll: true, applyPages: true, } , } ) redactionPlugin [VariableDeclaration] (from packages/plugin/redaction/src/redaction.plugin.ts): redactionPlugin = (config?: RedactionConfig) => definePlugin({ id: 'redaction', token: RedactionToken, scope: 'document', requires: [AnnotationToken], optional: [SelectionToken, SearchToken], state: initialRedactionModel, settings:{ defaults: REDACTION_DEFAULTS, registered: config} , create: createRedactionController, } ) redactionState [VariableDeclaration] (from packages/plugin/redaction/src/state.ts): redactionState = defineState(RedactionToken, { read: (redaction): RedactionState => ({ pendingCount: redaction.getPendingCount(), applying: redaction.isApplying(), lastResult: redaction.getLastResult(), } ), empty:{ pendingCount: 0, applying: false, lastResult: null, } , } ) usePendingRedactions [FunctionDeclaration]: export function usePendingRedactions(filter?: RedactionMarkFilter): readonly RedactionMark[]{ const scoped = useDocumentScope(); const page = filter?.page; return useKernelValue( (kernel) => kernel .tryCapability(RedactionToken, scoped ?? undefined) ?.listPending(page === undefined ? undefined :{ page} ) ?? NO_MARKS, ); } useRedaction [FunctionDeclaration]: export function useRedaction(): RedactionCapability{ return useCapability(RedactionToken); } useRedactionEvent [FunctionDeclaration]: export function useRedactionEvent( select: (redaction: RedactionCapability) => EventHook, handler: (event: T) => void, ): void{ useCapabilityEvent(RedactionToken, select, handler); } useRedactionSettings [VariableDeclaration]: useRedactionSettings = settingsHook(RedactionToken) useRedactionState [VariableDeclaration]: useRedactionState = stateHook(redactionState)