# @embedpdf/angular — . ACTIONS_DEFAULTS [VariableDeclaration] (from packages/plugin/actions/src/contract.ts): ACTIONS_DEFAULTS: ActionsSettings ={ policy:{ goto:{ user: 'allow', hover: 'allow', lifecycle: 'allow'} , named:{ user: 'allow', hover: 'allow', lifecycle: 'allow'} , hide:{ user: 'allow', hover: 'allow', lifecycle: 'allow'} , 'reset-form':{ user: 'allow', hover: 'allow', lifecycle: 'allow'} , javascript:{ user: 'allow', hover: 'allow', lifecycle: 'allow'} , uri:{ user: 'adapter', hover: 'report', lifecycle: 'report'} , print:{ user: 'adapter', hover: 'block', lifecycle: 'block'} , 'submit-form':{ user: 'adapter', hover: 'block', lifecycle: 'block'} , } , triggers:{ document: true, page: true, annotation: true} , openSequence: 'auto', javascript:{ enabled: false, identity: null} , } ANNOTATION_DEFAULTS [VariableDeclaration] (from packages/plugin/annotation/src/contract.ts): ANNOTATION_DEFAULTS: AnnotationSettings ={ tools: [], afterCreate:{ select: true, tool: 'stay', editText: true} , chrome:{ accent: null, outline:{ color: null, style: 'solid', width: 1} , handles:{ shape: 'square', size: 8, hitSize: 24, fill: '#ffffff', stroke: null} , rotationHandle:{ enabled: true, size: 10, hitSize: 24, offset: 32, stalk: true, fill: null, stroke: null, } , guides:{ enabled: true, color: '#e91e63', rotationColor: null, style: 'solid', width: 1.5} , marquee:{ fill: null, stroke: null} , textOutline: null, readout:{ enabled: true, background: 'rgb(0 0 0 / 0.8)', color: '#ffffff'} , } , snap:{ alignment: true, alignmentThresholdPx: 6, rotation: true, rotationAngles: [0, 90, 180, 270], rotationThresholdDeg: 4, } , editable: true, } ARMED_STAMP_TOOL_ID [VariableDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): ARMED_STAMP_TOOL_ID = 'stamp' AbortablePromise [ClassDeclaration] (from packages/engine/core/src/promise/AbortablePromise.ts): export class AbortablePromise extends Promise{ static override get [Symbol.species](): PromiseConstructor{ return Promise; } readonly signal: AbortSignal; private readonly _ctrl: AbortController; private readonly _progressCbs: Set<(p: P) => void>; private readonly _state:{ settled: boolean} ; private readonly _internalReject: (reason: unknown) => void; constructor(executor: AbortableExecutor){ const ctrl = new AbortController(); const progressCbs = new Set<(p: P) => void>(); const state ={ settled: false} ; let capturedReject!: (reason: unknown) => void; super((resolve, reject) =>{ capturedReject = reject; const wrappedResolve = (value: T | PromiseLike) =>{ if (state.settled) return; state.settled = true; resolve(value); } ; const wrappedReject = (reason: unknown) =>{ if (state.settled) return; state.settled = true; reject(reason); } ; const progress = (p: P) =>{ if (state.settled) return; for (const cb of progressCbs){ try{ cb(p); } catch{ } } } ; executor(wrappedResolve, wrappedReject, progress, ctrl.signal); } ); this._ctrl = ctrl; this.signal = ctrl.signal; this._progressCbs = progressCbs; this._state = state; this._internalReject = capturedReject; } abort(reason?: unknown): void{ if (this._state.settled) return; if (this._ctrl.signal.aborted) return; const err = reason instanceof AbortError ? reason : new AbortError(reason); this._state.settled = true; this._ctrl.abort(err); this._internalReject(err); } abortWith(signal: AbortSignal): this{ if (signal.aborted){ this.abort(signal.reason); return this; } const onAbort = () => this.abort(signal.reason); signal.addEventListener('abort', onAbort, { once: true} ); const detach = () => signal.removeEventListener('abort', onAbort); Promise.prototype.then.call(this, detach, detach); return this; } onProgress(cb: (p: P) => void): () => void{ this._progressCbs.add(cb); return () =>{ this._progressCbs.delete(cb); } ; } static resolveValue(value: T | PromiseLike): AbortablePromise{ return new AbortablePromise((resolve) => resolve(value)); } static rejectReason(reason: unknown): AbortablePromise{ return new AbortablePromise((_resolve, reject) => reject(reason)); } static run( fn: (signal: AbortSignal, progress: (p: P) => void) => Promise, ): AbortablePromise{ return new AbortablePromise((resolve, reject, progress, signal) =>{ fn(signal, progress).then(resolve, reject); } ); } } ActionContext [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionContext{ readonly origin: ActionOrigin; readonly source: ActionSource; readonly event: ActionTriggerEvent; } ActionDiagnostic [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionDiagnostic{ readonly code: | 'incomplete-tree' | 'blocked' | 'no-executor' | 'no-adapter' | 'no-session-sink' | 'unresolved-target' | 'duplicate-executor' | 'executor-inert' | 'executor-failed' | 'trigger-disabled' | 'no-commit-sink' | 'trigger-failed' | 'cascade-budget' | 'open-sequence-replayed' | 'no-submit-sink' | 'no-submit-resolver' | 'submit-payload-unavailable' | 'submit-entry-unsupported' | 'reentrant-print'; readonly message: string; } ActionDiagnosticReportedEvent [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionDiagnosticReportedEvent{ readonly code: ActionDiagnostic['code']; readonly action: PdfActionType | null; readonly source: ActionSource | null; } ActionDispatchResult [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionDispatchResult{ readonly status: 'executed' | 'partial' | 'inert' | 'refused' | 'cancelled'; readonly nodes: ActionNodeResult[]; readonly diagnostics: ActionDiagnostic[]; } ActionExecutedEvent [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionExecutedEvent{ readonly tree: PdfActionTree; readonly result: ActionDispatchResult; readonly source: ActionSource; } ActionExecutor [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionExecutor = ( node: PdfActionNode, actionContext: ActionContext, ) => Promise | ActionExecutorResult; ActionExecutorResult [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionExecutorResult = |{ status: 'executed'} |{ status: 'inert'; reason: string} |{ status: 'failed'; error: string} ; ActionNodeResult [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionNodeResult{ readonly path: number[]; readonly type: PdfActionType; readonly status: ActionNodeStatus; readonly detail?: string; } ActionNodeStatus [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionNodeStatus = | 'executed' | 'blocked' | 'no-executor' | 'inert' | 'failed' | 'skipped'; ActionOrigin [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionOrigin = 'user' | 'hover' | 'lifecycle'; ActionPolicy [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionPolicy{ readonly goto: ActionPolicyRow; readonly named: ActionPolicyRow; readonly hide: ActionPolicyRow; readonly 'reset-form': ActionPolicyRow; readonly javascript: ActionPolicyRow; readonly uri: ActionPolicyRow; readonly print: ActionPolicyRow; readonly 'submit-form': ActionPolicyRow; } ActionPolicyDecision [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionPolicyDecision = 'allow' | 'adapter' | 'report' | 'block'; ActionPolicyRow [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionPolicyRow = Readonly>; ActionSource [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionSource = |{ kind: 'widget'; field: FormFieldRef; annotation: AnnotationRef; page: PageRef} |{ kind: 'link'; annotation?: AnnotationRef; page?: PageRef} |{ kind: 'outline'; item: OutlineItemRef} |{ kind: 'annotation'; annotation: AnnotationRef; page: PageRef} |{ kind: 'page'; page: PageRef} |{ kind: 'document'} |{ kind: 'api'} ; ActionStepResult [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionStepResult{ readonly source: ActionSource; readonly tree: PdfActionTree; readonly result: ActionDispatchResult; } ActionSubmitHandler [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionSubmitHandler = ( request: ActionSubmitRequest, chain:{ submitToDocumentHome: (() => Promise) | null} , ) => void | Promise; ActionSubmitRequest [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionSubmitRequest{ url: string | null; method: 'post' | 'get'; format: 'fdf' | 'html' | 'xfdf' | 'pdf'; charSet?: string; entries: FormSubmissionEntry[]; origin: ActionOrigin; event: ActionTriggerEvent; } ActionTreeSource [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionTreeSource = |{ kind: 'annotation'; annotation: AnnotationRef; page: PageRef; event?: 'activate' | PdfAnnotationEventKind; } |{ kind: 'field'; field: FormFieldRef; event: PdfFieldEventKind} |{ kind: 'page'; page: PageRef; event?: 'open' | 'close'} |{ kind: 'document'; event?: DocumentTriggerEvent} |{ kind: 'outline'; item: OutlineItemRef} ; ActionTrigger [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionTrigger = |{ type: 'activate'; annotation: AnnotationRef; page: PageRef; source?: ActionSource} |{ type: 'annotation'; event: PdfAnnotationEventKind; annotation: AnnotationRef; page: PageRef; source?: ActionSource; } |{ type: 'page'; event: 'open' | 'close' | 'visible' | 'invisible'; page: PageRef} |{ type: 'document'; event: DocumentTriggerEvent} ; ActionTriggerEvent [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionTriggerEvent = |{ type: 'activate'} |{ type: 'annotation'; event: PdfAnnotationEventKind} |{ type: 'page'; event: 'open' | 'close' | 'visible' | 'invisible'} |{ type: 'document'; event: DocumentTriggerEvent} ; ActionTriggerResult [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionTriggerResult{ readonly status: 'executed' | 'partial' | 'inert' | 'refused' | 'cancelled'; readonly steps: ActionStepResult[]; readonly diagnostics: ActionDiagnostic[]; } ActionUiAdapter [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionUiAdapter{ openUri(uri: string, options:{ isMap: boolean; origin: ActionOrigin} ): void; print(uiContext?: ActionUiContext): void; alert?(message: string, options: ActionUiContext &{ icon: number; title?: string} ): void; goToPage?(pageIndex: number, uiContext: ActionUiContext): void; } ActionUiContext [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionUiContext{ readonly origin: ActionOrigin; readonly phase: 'boot' | 'user'; } ActionsCapability [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionsCapability extends SettingsApi{ execute( tree: PdfActionTree, actionContext: ActionContext, options?: OperationOptions, ): Promise; canExecute(tree: PdfActionTree, actionContext: ActionContext): boolean; executeNamed( name: PdfNamedAction, context?: Partial, options?: OperationOptions, ): Promise; canExecuteNamed(name: PdfNamedAction, context?: Partial): boolean; readActionTree( source: ActionTreeSource, options?: OperationOptions, ): Promise; isScriptingEnabled(): boolean; dispatch(trigger: ActionTrigger, options?: OperationOptions): Promise; canDispatch(trigger: ActionTrigger): boolean; setUiAdapter(adapter: ActionUiAdapter | null): Unsubscribe; runDocumentVerb( verb: 'save' | 'print', operation: () => Promise | T, options?: OperationOptions, ): Promise; prepareClose(options?: OperationOptions): Promise; setSubmitHandler(handler: ActionSubmitHandler | null): Unsubscribe; registerExecutor(type: PdfActionType, executor: ActionExecutor): Unsubscribe; readonly onExecuted: EventHook; readonly onDiagnosticReported: EventHook; readonly onScriptDiagnosticReported: EventHook; readonly onScriptFailed: EventHook; readonly onOpenSequenceCompleted: EventHook; } ActionsConfig [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionsConfig extends DeepPartial>{ readonly javascript?: DeepPartial & ActionsScriptEnvironment; } ActionsScriptEnvironment [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionsScriptEnvironment{ readonly sandboxFactory?: ScriptSandboxFactory; readonly fileName?: () => string; readonly now?: () => number; readonly utcOffsetMinutes?: () => number; readonly randomSeed?: () => number; readonly budget?: ScriptBudget; readonly maxScriptNodesPerDispatch?: number; } ActionsScriptIdentity [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ActionsScriptIdentity = Partial | (() => Partial); ActionsSettings [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ActionsSettings{ readonly policy: ActionPolicy; readonly triggers:{ readonly document: boolean; readonly page: boolean; readonly annotation: boolean; } ; readonly openSequence: 'auto' | 'headless' | 'off'; readonly javascript:{ readonly enabled: boolean; readonly identity: ActionsScriptIdentity | null; } ; } ActionsToken [VariableDeclaration] (from packages/plugin/actions/src/token.ts): ActionsToken = createCapabilityToken('actions', { hint: `add actionsPlugin() from '@embedpdf/plugin-actions' to your plugins list`, promises:{ execute: true, executeNamed: true, readActionTree: true, dispatch: true, runDocumentVerb: true, prepareClose: true, } , } ) ActionsUiHandlers [TypeAliasDeclaration] (from packages/framework/angular/actions/src/actions.ts): export type ActionsUiHandlers = Partial; AfterCreateSettings [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AfterCreateSettings{ readonly select: boolean; readonly tool: 'stay' | 'default'; readonly editText: boolean; } Align [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type Align = 'start' | 'center' | 'end'; AlignValue [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type AlignValue = Align | number; Alignment [InterfaceDeclaration] (from packages/core/stage/src/index.ts): export interface Alignment{ x: Align; y: Align; } AlignmentValue [InterfaceDeclaration] (from packages/core/stage/src/index.ts): export interface AlignmentValue{ x: AlignValue; y: AlignValue; } AnalyzeInput [InterfaceDeclaration] (from packages/engine/core/src/signature/analysis/types.ts): export interface AnalyzeInput{ since:{ signatureIndex: number} |{ revisionIndex: number} ; until?: 'persisted' | 'working-copy' |{ revisionIndex: number} ; exploratoryLevel?: ModificationLevel; detail?: 'summary' | 'full'; } AnchorTarget [InterfaceDeclaration] (from packages/framework/web/src/anchored-position.ts): export interface AnchorTarget{ page: PageRef; bounds: AnchoredRect; boundsIn?: (view: PageViewEnv) => AnchoredRect | null; avoid?: AnchoredPoint[]; } AnchoredPlacement [TypeAliasDeclaration] (from packages/framework/web/src/anchored-position.ts): export type AnchoredPlacement = AnchoredSide | `${ AnchoredSide} -${ 'start' | 'end'} `; AnchoredSide [TypeAliasDeclaration] (from packages/framework/web/src/anchored-position.ts): export type AnchoredSide = 'top' | 'right' | 'bottom' | 'left'; Annotation [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/declarations.ts): export type Annotation = ReadOf; AnnotationAnchor [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationAnchor{ readonly page: PageRef; readonly bounds: Rect; readonly boundsIn?: (view: ViewEnv) => Rect | null; } AnnotationAppearanceImage [InterfaceDeclaration] (from packages/engine/core/src/dto/AnnotationRender.ts): export interface AnnotationAppearanceImage{ ref: AnnotationRef; mode: AnnotationAppearanceMode; state: string | null; rect: C['box']; image: PageImageHandle; } AnnotationBehaviorRenderer [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface AnnotationBehaviorRenderer{ readonly behavior: string; } AnnotationBundle [InterfaceDeclaration] (from packages/engine/core/src/transfer/AnnotationBundle.ts): export interface AnnotationBundle{ readonly format: 'embedpdf/annotations'; readonly version: 1; readonly pages: readonly BundlePage[]; readonly items: readonly AnnotationBundleItem[]; readonly resources: Readonly>; } AnnotationCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationCapability extends SettingsApi{ get(ref: AnnotationRef): Annotation | null; list(filter?: AnnotationFilter): readonly Annotation[]; getAt(page: PageRef | number, point: Point): Annotation | null; isPending(ref: AnnotationRef): boolean; getStatus(): ResourceStatus; getHovered(): Annotation | null; refresh(options?: OperationOptions): Promise; create( page: PageRef | number, draft: AnnotationDraft | Annotation, resources?: AnnotationResources, options?: OperationOptions &{ tool?: string; select?: boolean} , ): Promise<{ annotation: Annotation} >; createFromSelection( tool: string, options?: OperationOptions &{ clear?: boolean} , ): Promise<{ annotations: readonly Annotation[]} >; update( ref: AnnotationRef, patch: AnnotationPatch, resources?: AnnotationResources, options?: OperationOptions, ): Promise<{ annotation: Annotation} >; delete(ref: AnnotationRef, options?: OperationOptions): Promise; reorder( refs: readonly AnnotationRef[], position: AnnotationPosition, options?: OperationOptions, ): Promise; duplicate( refs: readonly AnnotationRef[], options?: AnnotationDuplicateOptions & OperationOptions, ): Promise; export( selection?: AnnotationExportSelection, options?: OperationOptions, ): Promise; import( bundle: AnnotationBundle, options?: AnnotationImportOptions & OperationOptions & HistoryOptions, ): Promise; downloadResource( ref: AnnotationRef, role: AnnotationResourceRole, options?: OperationOptions, ): Promise; readonly links: AnnotationLinksCapability; readonly selection: AnnotationSelectionCapability; readonly draft: AnnotationDraftCapability; readonly text: AnnotationTextCapability; readonly tools: AnnotationToolsCapability; readonly stamps: AnnotationStampsCapability; readonly comments: CommentsCapability; setFilePickerProvider(provider: FilePickerProvider | null): Unsubscribe; canRead(): boolean; canCreate(): boolean; canUpdate(ref: AnnotationRef): boolean; canDelete(ref: AnnotationRef): boolean; canDuplicate(refs: readonly AnnotationRef[]): boolean; isEditable(ref: AnnotationRef): boolean; isMovable(ref: AnnotationRef): boolean; cancel(): void; readonly onCreated: EventHook; readonly onUpdated: EventHook; readonly onDeleted: EventHook; readonly onReordered: EventHook; readonly onResynced: EventHook; readonly onWriteFailed: EventHook; readonly onSelectionChanged: EventHook; readonly onDraftChanged: EventHook; readonly onEditingChanged: EventHook; readonly onHoverChanged: EventHook; } AnnotationConfig [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationConfig = DeepPartial; AnnotationCreatedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationCreatedEvent{ readonly annotation: Annotation; readonly origin: EventOrigin; } AnnotationDeletedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDeletedEvent{ readonly refs: readonly AnnotationRef[]; readonly page: PageRef; readonly origin: EventOrigin; } AnnotationDraft [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/declarations.ts): export type AnnotationDraft = CreateOf< WritableAnnotationDeclaration, C >; AnnotationDraftCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDraftCapability{ get(): CreationDraft | null; finish(options?: OperationOptions): Promise<{ annotation: Annotation} | null>; cancel(): void; } AnnotationDraftChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDraftChangedEvent{ readonly draft: CreationDraft | null; } AnnotationDuplicateOptions [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDuplicateOptions{ readonly page?: PageRef | number; readonly offset?:{ readonly x: number; readonly y: number} ; readonly select?: boolean; } AnnotationDuplicateResult [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDuplicateResult{ readonly annotations: readonly Annotation[]; readonly dropped: readonly AnnotationImportDrop[]; } AnnotationEditingChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationEditingChangedEvent{ readonly ref: AnnotationRef | null; } AnnotationExportSelection [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationExportSelection{ readonly refs?: readonly AnnotationRef[]; readonly pages?: readonly (PageRef | number)[]; } AnnotationFilter [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationFilter{ readonly pages?: readonly (PageRef | number)[]; readonly subtype?: AnnotationSubtype; } AnnotationFlags [InterfaceDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export interface AnnotationFlags{ invisible: boolean; hidden: boolean; print: boolean; noZoom: boolean; noRotate: boolean; noView: boolean; readOnly: boolean; locked: boolean; toggleNoView: boolean; lockedContents: boolean; } AnnotationFrame [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface AnnotationFrame{ readonly width: number; readonly height: number; readonly rotation: number; readonly scale: number; } AnnotationHoverChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationHoverChangedEvent{ readonly ref: AnnotationRef | null; } AnnotationImportDrop [InterfaceDeclaration] (from packages/engine/core/src/transfer/annotationImport.ts): export interface AnnotationImportDrop{ readonly ref: AnnotationRef; readonly field?: string; readonly reason: AnnotationDropReason; } AnnotationImportOptions [InterfaceDeclaration] (from packages/engine/core/src/transfer/annotationImport.ts): export interface AnnotationImportOptions extends WriteOptions{ readonly pages?: BundleImportPages; readonly attribution?: 'restore' | 'stamp'; } AnnotationImportResult [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationImportResult{ readonly annotations: readonly Annotation[]; readonly refMap: ReadonlyArray<{ readonly from: AnnotationRef; readonly to: AnnotationRef} >; readonly dropped: readonly AnnotationImportDrop[]; } AnnotationInteractive [TypeAliasDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export type AnnotationInteractive = boolean | ((context: AnnotationInteractiveContext) => boolean); AnnotationInteractiveContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface AnnotationInteractiveContext{ readonly annotation: Annotation; readonly toolId: string; } AnnotationLinksCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationLinksCapability{ get(ref: AnnotationRef): PdfLinkTarget | null; set(ref: AnnotationRef, target: PdfLinkTarget, options?: OperationOptions): Promise; clear(ref: AnnotationRef, options?: OperationOptions): Promise; } AnnotationLookRenderer [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface AnnotationLookRenderer{ readonly for: (annotation: Annotation) => boolean; readonly interactive: AnnotationInteractive; readonly scale: boolean; } AnnotationMatch [TypeAliasDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export type AnnotationMatch = ((annotation: Annotation) => boolean) | AnnotationSubtype; AnnotationOption [InterfaceDeclaration] (from packages/core/annotation/src/kinds/define.ts): export interface AnnotationOption{ readonly value: string; readonly label: string; readonly labelKey: string; } AnnotationPatch [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/declarations.ts): export type AnnotationPatch = UpdateOf< WritableAnnotationDeclaration, C >; AnnotationPosition [TypeAliasDeclaration] (from packages/engine/core/src/mutation/ListPosition.ts): export type AnnotationPosition = ListPosition; AnnotationProperties [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationProperties{ readonly properties: readonly AnnotationProperty[]; readonly values: FieldValues; readonly mixed: readonly string[]; } AnnotationProperty [TypeAliasDeclaration] (from packages/core/annotation/src/kinds/define.ts): export type AnnotationProperty = |{ readonly key: 'color' | 'interiorColor' | 'fontColor'; readonly control: 'color'; readonly label: string; readonly labelKey: string; readonly allowsNone?: boolean; } |{ readonly key: 'opacity' | 'strokeWidth' | 'fontSize'; readonly control: 'number'; readonly label: string; readonly labelKey: string; readonly min: number; readonly max: number; readonly step: number; } |{ readonly key: 'borderStyle'; readonly control: 'choice'; readonly label: string; readonly labelKey: string; readonly options: readonly AnnotationOption[]; readonly cloudy: boolean; } |{ readonly key: 'lineEndings' | 'fontFamily' | 'textAlign' | 'blendMode' | 'icon' | 'subtype'; readonly control: 'choice'; readonly label: string; readonly labelKey: string; readonly options: readonly AnnotationOption[]; } |{ readonly key: 'orientation'; readonly control: 'choice'; readonly label: string; readonly labelKey: string; readonly options: readonly AnnotationOption[]; } |{ readonly key: FlagKey; readonly control: 'flag'; readonly label: string; readonly labelKey: string; } |{ readonly key: 'overlayText'; readonly control: 'text'; readonly label: string; readonly labelKey: string; } |{ readonly key: 'bold' | 'italic' | 'underline'; readonly control: 'textFormat'; readonly label: string; readonly labelKey: string; readonly format: 'bold' | 'italic' | 'underline'; } |{ readonly key: 'link'; readonly control: 'link'; readonly label: string; readonly labelKey: string; } ; AnnotationRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/AnnotationRef.ts): export type AnnotationRef = |{ kind: 'objectNumber'; page: PageRef; objectNumber: number; } |{ kind: 'baseIndex'; page: PageRef; baseIndex: number; } ; AnnotationRendererEntry [TypeAliasDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export type AnnotationRendererEntry = AnnotationLookRenderer | AnnotationBehaviorRenderer; AnnotationReorderedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationReorderedEvent{ readonly page: PageRef; readonly order: readonly AnnotationRef[]; readonly origin: EventOrigin; } AnnotationResourceRole [TypeAliasDeclaration] (from packages/engine/core/src/annotation/resources.ts): export type AnnotationResourceRole = (typeof ANNOTATION_RESOURCE_ROLE_NAMES)[number]; AnnotationResources [TypeAliasDeclaration] (from packages/engine/core/src/annotation/resources.ts): export type AnnotationResources = Partial>; AnnotationResyncedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationResyncedEvent{ readonly pages: readonly PageRef[] | 'all'; } AnnotationRotationAnchor [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationRotationAnchor = RotationAnchor; AnnotationSelectionAnchor [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSelectionAnchor{ readonly page: PageRef; readonly bounds: Rect; readonly rotationHandle?: Point; } AnnotationSelectionCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSelectionCapability{ select(refs: readonly AnnotationRef[]): void; add(refs: readonly AnnotationRef[]): void; selectAll(page?: PageRef | number): void; selectInRect(page: PageRef | number, rect: Rect): void; clear(): void; getSelected(): readonly Annotation[]; update( changes: AnnotationPatch | ((annotation: Annotation) => AnnotationPatch), options?: OperationOptions, ): Promise>; updateLink( target: PdfLinkTarget | null, options?: OperationOptions, ): Promise>; getProperties(): AnnotationProperties; delete(options?: OperationOptions): Promise>; rotateBy(degrees: 90 | -90, options?: OperationOptions): Promise; resetRotation(options?: OperationOptions): Promise; group(options?: OperationOptions): Promise; ungroup(options?: OperationOptions): Promise; canGroup(): boolean; canUngroup(): boolean; duplicate( options?: OperationOptions &{ offset?:{ readonly x: number; readonly y: number} } , ): Promise; canDuplicate(): boolean; getAnchor(): AnnotationSelectionAnchor | null; getRotationAnchor(): AnnotationRotationAnchor | null; } AnnotationSelectionChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSelectionChangedEvent{ readonly refs: readonly AnnotationRef[]; readonly previousRefs: readonly AnnotationRef[]; } AnnotationSettings [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSettings{ readonly tools: readonly AnnotationToolInput[]; readonly afterCreate: AfterCreateSettings; readonly chrome: ChromeSettings; readonly snap: SnapSettings; readonly editable: EditableKinds; } AnnotationStampsCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationStampsCapability{ arm(stamp: StampInput, options?: OperationOptions): Promise; disarm(): void; isArmed(): boolean; place( stamp: StampInput, placement: StampPlacement, options?: OperationOptions, ): Promise<{ annotation: Annotation} >; } AnnotationState [InterfaceDeclaration] (from packages/plugin/annotation/src/state.ts): export interface AnnotationState{ readonly status: ResourceStatus; readonly selected: readonly Annotation[]; readonly hovered: Annotation | null; readonly editing: Annotation | null; } AnnotationSubtype [TypeAliasDeclaration] (from packages/engine/core/src/annotation/subtype.ts): export type AnnotationSubtype = (typeof ANNOTATION_SUBTYPES)[number]; AnnotationTextCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationTextCapability{ begin(ref: AnnotationRef): void; end(options?: OperationOptions): Promise; getEditing(): Annotation | null; toggleFormat(format: TextFormat, options?: OperationOptions): Promise; } AnnotationToken [VariableDeclaration] (from packages/plugin/annotation/src/token.ts): AnnotationToken = createCapabilityToken('annotation', { hint: `add annotationPlugin() from '@embedpdf/plugin-annotation' to your plugins list`, promises:{ refresh: true, create: true, createFromSelection: true, update: true, delete: true, reorder: true, duplicate: true, export: true, import: true, downloadResource: true, 'links.set': true, 'links.clear': true, 'selection.update': true, 'selection.updateLink': true, 'selection.delete': true, 'selection.rotateBy': true, 'selection.resetRotation': true, 'selection.group': true, 'selection.ungroup': true, 'selection.duplicate': true, 'draft.finish': true, 'text.end': true, 'text.toggleFormat': true, 'stamps.arm': true, 'stamps.place': true, 'comments.reply': true, 'comments.setText': true, 'comments.setStatus': true, 'comments.setMarked': true, 'comments.delete': true, 'comments.deleteThread': true, } , } ) AnnotationTool [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationTool{ readonly id: string; readonly subtype: KindName; readonly preset: string; readonly cursor: string; readonly enables: readonly string[]; readonly defaults?: FieldValues; readonly ghost: ResolvedGhost; readonly meta?: Readonly>; } AnnotationToolDefinition [InterfaceDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export interface AnnotationToolDefinition{ id: string; extends?: string; subtype?: KindName; fieldsKind?: string; preset?: string; defaults?: ToolDefaultsFor; flags?: Partial; cursor?: string; enables?: string[]; source?: K extends 'stamp' ? StampSourceSpec : K extends 'file-attachment' ? PromptSourceSpec : never; selection?: SelectionAuthoring; ink?: K extends 'ink' ? InkAuthoringOptions : never; upright?: boolean; clickCreate?: ClickCreate | false; ghost?: GhostPolicy; afterCreate?: Partial; meta?: Record; } AnnotationToolInput [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type AnnotationToolInput = DirectToolDef | BuiltinToolOverride | ExtendedBuiltinToolDef; AnnotationToolsCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationToolsCapability{ list(): readonly AnnotationTool[]; get(id: string): AnnotationTool | null; register(tool: AnnotationToolInput): Unsubscribe; getDefaults(id: string): ToolDefaults; updateDefaults(id: string, changes: FieldValues): void; getProperties(id: string): AnnotationProperties; readonly onDefaultsChanged: EventHook; } AnnotationTransfer [VariableDeclaration] (from packages/engine/core/src/transfer/AnnotationTransfer.ts): AnnotationTransfer = bundleCodec({ kind: 'annotation', keys: ANNOTATION_BUNDLE_KEYS, assertManifest: assertAnnotationBundleManifest, } ) AnnotationUpdatedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationUpdatedEvent{ readonly annotation: Annotation; readonly origin: EventOrigin; } AnnotationWriteFailedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationWriteFailedEvent{ readonly refs: readonly AnnotationRef[]; readonly error: PluginErrorInfo; } AnyPlugin [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type AnyPlugin = PluginDefinition; AppliedValidationTime [TypeAliasDeclaration] (from packages/core/signature/src/trust.ts): export type AppliedValidationTime = |{ readonly kind: 'now'} |{ readonly kind: 'timestamp'; readonly stampedAt: string; readonly tokenVerified: true; readonly genTime: string; } ; AreaUnit [TypeAliasDeclaration] (from packages/engine/core/src/measure/units.ts): export type AreaUnit = `${ LengthUnit} 2` | 'ha' | 'acre'; ArmedSelectionHandle [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface ArmedSelectionHandle{ base: Point; drag: SelectionHandleDragSession; } ArmedStampInfo [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ArmedStampInfo{ readonly width: number; readonly height: number; readonly name?: string; readonly subject?: string; } ArmedStampPreview [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ArmedStampPreview{ readonly bytes: Uint8Array; readonly mimeType?: string; } ArrivalAlignValue [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type ArrivalAlignValue = AlignValue | 'keep'; ArrivalAlignment [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface ArrivalAlignment{ readonly x: ArrivalAlignValue; readonly y: ArrivalAlignValue; } AssetFromAnnotationsInput [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type AssetFromAnnotationsInput = Omit; AttachedFile [InterfaceDeclaration] (from packages/plugin/attachment/src/contract.ts): export interface AttachedFile extends Readonly{ readonly id: string; readonly home: AttachedFileHome; } AttachedFileHome [TypeAliasDeclaration] (from packages/plugin/attachment/src/contract.ts): export type AttachedFileHome = |{ readonly kind: 'document'; readonly ref: AttachmentRef} |{ readonly kind: 'page'; readonly ref: AnnotationRef} ; AttachmentCapability [InterfaceDeclaration] (from packages/plugin/attachment/src/contract.ts): export interface AttachmentCapability{ list(): readonly AttachedFile[]; get(id: string): AttachedFile | null; getSelected(): readonly AttachedFile[]; select(files: readonly AttachedFile[]): void; isPending(file: AttachedFile): boolean; getStatus(): ResourceStatus; ensureLoaded(options?: OperationOptions): Promise; refresh(options?: OperationOptions): Promise; canDownload(): boolean; canCreate(): boolean; canDelete(file: AttachedFile): boolean; create( files: readonly AttachmentFileSource[], options?: OperationOptions, ): Promise; delete(file: AttachedFile, options?: OperationOptions): Promise; download(file: AttachedFile, options?: OperationOptions): Promise; reveal(file: AttachedFile): void; readonly onChanged: EventHook; readonly onResynced: EventHook; } AttachmentContent [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentContent{ bytes: Uint8Array; name: string; mimeType: string | null; } AttachmentFileInfo [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentFileInfo{ name: string; mimeType: string | null; description: string | null; sizeBytes: number | null; md5: string | null; createdAt: IsoDateTime | null; modifiedAt: IsoDateTime | null; } AttachmentFileSource [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentFileSource{ data: Uint8Array | ArrayBuffer | Blob; name?: string; mimeType?: string; description?: string; } AttachmentRef [TypeAliasDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export type AttachmentRef ={ kind: 'key'; key: string} ; AttachmentState [InterfaceDeclaration] (from packages/plugin/attachment/src/state.ts): export interface AttachmentState{ readonly files: readonly AttachedFile[]; readonly selected: readonly AttachedFile[]; readonly status: ResourceStatus; readonly canCreate: boolean; readonly canDownload: boolean; } AttachmentToken [VariableDeclaration] (from packages/plugin/attachment/src/token.ts): AttachmentToken = createCapabilityToken('attachment', { hint: "add attachmentPlugin() from '@embedpdf/plugin-attachment' to your plugins list", promises:{ ensureLoaded: true, refresh: true, create: true, delete: true, download: true, } , } ) AttachmentsChangedEvent [InterfaceDeclaration] (from packages/plugin/attachment/src/contract.ts): export interface AttachmentsChangedEvent{ readonly type: 'created' | 'deleted' | 'restored'; readonly files: readonly AttachedFile[]; readonly origin: EventOrigin; } AttachmentsResyncedEvent [InterfaceDeclaration] (from packages/plugin/attachment/src/contract.ts): export interface AttachmentsResyncedEvent{ readonly files: readonly AttachedFile[]; } AuthorableFormKind [TypeAliasDeclaration] (from packages/plugin/form/src/tools/definitions.ts): export type AuthorableFormKind = Exclude; BarChild [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type BarChild = BarItem | CustomItem | string; BarGroup [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarGroup{ readonly id: string; readonly labelKey?: string; readonly role?: 'buttons' | 'tabs'; readonly shed?: boolean; readonly collapse?: 'menu' | 'select'; readonly importance?: Importance; readonly dependent?: boolean; readonly items: readonly BarChild[]; } BarItem [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarItem{ readonly command: string; readonly variants?: readonly Variant[]; readonly importance?: Importance; readonly emphasis?: Emphasis; } BarSchema [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarSchema{ readonly id: string; readonly sections: BarSections; } BarSections [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarSections{ readonly start?: readonly BarGroup[]; readonly center?: readonly BarGroup[]; readonly end?: readonly BarGroup[]; } BatchResult [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface BatchResult{ readonly applied: readonly T[]; readonly skipped: readonly{ readonly ref: R; readonly reason: string} []; readonly failed: readonly{ readonly ref: R; readonly error: PluginErrorInfo} []; } Behavior [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface Behavior{ readonly id: string; matches(annotation: Annotation): boolean; engaged(annotation: Annotation): boolean; } BlendMode [TypeAliasDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export type BlendMode = | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity'; BoundCommand [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface BoundCommand extends ResolvedCommand{ readonly run: () => Promise; readonly shortcutLabel: string | null; } Box [InterfaceDeclaration] (from packages/plugin/form/src/model.ts): export interface Box{ readonly x: number; readonly y: number; readonly width: number; readonly height: number; } BoxQuery [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface BoxQuery{ readonly minWidth?: number; readonly maxWidth?: number; readonly minHeight?: number; readonly maxHeight?: number; readonly orientation?: 'portrait' | 'landscape'; } ByteStore [InterfaceDeclaration] (from packages/framework/web/src/byte-store.ts): export interface ByteStore{ list(): Promise>; put(id: string, bytes: Uint8Array): Promise; delete(id: string): Promise; } COMMANDS_DEFAULTS [VariableDeclaration] (from packages/plugin/commands/src/contract.ts): COMMANDS_DEFAULTS: CommandsSettings ={ commands: [], appState: undefined, disabledCategories: [], disabledCommands: [], notAllowed: 'hide', } CONTINUOUS_RENDER_POLICY [VariableDeclaration] (from packages/engine/core/src/engine/DocumentRenderService.ts): CONTINUOUS_RENDER_POLICY: EngineRenderPolicy ={ kind: 'continuous'} CalibrateInput [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface CalibrateInput{ page: PageRef | number; from: Point; to: Point; distance:{ value: number; unit: LengthUnit} ; } CalibrationCompletedEvent [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface CalibrationCompletedEvent{ readonly page: PageRef; } CalibrationDismissedEvent [TypeAliasDeclaration] (from packages/plugin/measurement/src/contract.ts): export type CalibrationDismissedEvent = Record; CalibrationRequest [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface CalibrationRequest{ page: PageRef; from: Point; to: Point; userSpaceLength: number; } CalibrationRequestedEvent [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface CalibrationRequestedEvent{ readonly request: CalibrationRequest; } CallFacts [InterfaceDeclaration] (from packages/engine/core/src/scheduling/facts.ts): export interface CallFacts{ readonly priority?: CallPriority; readonly view?: string; } CallPriority [TypeAliasDeclaration] (from packages/engine/core/src/scheduling/facts.ts): export type CallPriority = 'high' | 'auto' | 'low'; Camera [InterfaceDeclaration] (from packages/core/stage/src/index.ts): export interface Camera{ x: number; y: number; zoom: number; } Cancel [TypeAliasDeclaration] (from packages/core/main/src/clock.ts): export type Cancel = () => void; CancelledError [ClassDeclaration] (from packages/core/main/src/scope.ts): export class CancelledError extends Error{ constructor(what: string){ super(`[kernel] cancelled: ${ what} `); this.name = 'CancelledError'; } } CapabilityBinding [ClassDeclaration] (from packages/framework/angular/runtime/src/capability.ts): export class CapabilityBinding{ readonly capability: Signal; constructor( readonly host: EpdfKernelHost, private readonly token: () => CapabilityToken, private readonly documentId: () => string | null, ){ this.capability = host.read( (kernel) => this.resolve(kernel), () => null, ); } select( read: (capability: Capability) => R, empty: R, equal: (left: R, right: R) => boolean = shallowEqual, ): Signal{ return this.host.read( (kernel) =>{ const capability = this.resolve(kernel); if (!capability) return empty; try{ return read(capability); } catch{ return empty; } } , () => empty, equal, ); } require(call: string): Capability{ const token = this.token(); const kernel = this.host.requireKernel(token.name, call); const documentId = untracked(this.documentId) ?? undefined; const capability = kernel.tryCapability(token, documentId); if (capability) return capability; if (kernel.scopeOf(token) === 'document'){ throw new PluginError('not-ready', token.name, 'no document is open'); } return kernel.capability(token, documentId); } method(name: Name): Capability[Name]{ return this.late(String(name), (capability) => capability, name); } namespaceMethod( namespace: Key, name: Name, ): Capability[Key][Name]{ return this.late( `${ String(namespace)} .${ String(name)} `, (capability) => capability[namespace], name, ); } stream(pick: (capability: Capability) => EventHook): Observable{ return new Observable((subscriber) =>{ let current: Capability | null = null; let listening: AbortController | null = null; const follow = () =>{ const kernel = untracked(this.host.kernel); const next = kernel ? untracked(() => this.resolve(kernel)) : null; if (next === current) return; listening?.abort(); listening = null; current = next; if (!next) return; listening = new AbortController(); pick(next)((event) => subscriber.next(event), { signal: listening.signal} ); } ; const stop = this.host.subscribe(follow); follow(); return () =>{ stop(); listening?.abort(); } ; } ); } private resolve(kernel: Kernel): Capability | null{ return kernel.tryCapability(this.token(), this.documentId() ?? undefined); } private late( label: string, owner: (capability: Capability) => Owner, name: Name, ): Owner[Name]{ const call = `${ label} ()`; const run = (args: unknown[]): unknown =>{ let target: Owner; try{ target = owner(this.require(call)); } catch (error){ if (isPluginError(error, 'not-ready') && returnsPromise(this.token(), label)){ return Promise.reject(error); } throw error; } return (target[name] as unknown as (...args: unknown[]) => unknown).apply(target, args); } ; if (!isReadMember(String(name))){ return ((...args: unknown[]) => untracked(() => run(args))) as Owner[Name]; } return ((...args: unknown[]) => computed(() =>{ this.documentId(); this.host.revision(); return run(args); } )()) as Owner[Name]; } } CapabilityToken [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface CapabilityToken{ readonly name: string; readonly hint?: string; readonly promises?: Readonly>; readonly __type?: T; } ChangeAnalysis [InterfaceDeclaration] (from packages/engine/core/src/signature/analysis/types.ts): export interface ChangeAnalysis{ mode: 'authoritative' | 'exploratory'; policyVersion: number; basis:{ version: BaseVersionInfo; editsVersion: number; source: 'persisted' | 'working-copy'} ; since:{ revisionIndex: number; signatureIndex: number | null} ; until:{ revisionIndex: number} ; restrictions: RestrictionAnchor[]; current: Assessment &{ method: 'net-state' | 'net-state+replay'} ; later:{ revisionCount: number; undoneObjectNumbers: number[]; } ; verdict: StepVerdict; steps: RevisionAnalysis[]; } ChangeLabel [InterfaceDeclaration] (from packages/core/main/src/changes.ts): export interface ChangeLabel{ readonly key: string; readonly [value: string]: string | number; } ChangeQueue [InterfaceDeclaration] (from packages/core/main/src/changes.ts): export interface ChangeQueue{ stage(change: StagedChange): PendingChange; hold(label: ChangeLabel, options?: HoldOptions): HeldChange; sendHolds(): void; group(label: ChangeLabel, run: () => T): T; takeObjectNumber(): number | null; reserveObjectNumbers(count: number): Promise; listPending(): readonly PendingChange[]; hasPending(): boolean; whenSettled(): Promise; readonly onStaged: EventHook; readonly onSettled: EventHook; } ChromeSettings [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ChromeSettings{ readonly accent: string | null; readonly outline:{ readonly color: string | null; readonly style: LineStyle; readonly width: number; } ; readonly handles:{ readonly shape: 'square' | 'circle'; readonly size: number; readonly hitSize: number; readonly fill: string; readonly stroke: string | null; } ; readonly rotationHandle:{ readonly enabled: boolean; readonly size: number; readonly hitSize: number; readonly offset: number; readonly stalk: boolean; readonly fill: string | null; readonly stroke: string | null; } ; readonly guides:{ readonly enabled: boolean; readonly color: string; readonly rotationColor: string | null; readonly style: LineStyle; readonly width: number; } ; readonly marquee:{ readonly fill: string | null; readonly stroke: string | null; } ; readonly textOutline: string | null; readonly readout:{ readonly enabled: boolean; readonly background: string; readonly color: string; } ; } ClickCreate [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type ClickCreate = |{ width: number; height: number; anchor?: 'center' | 'top-left'} |{ length: number; rotation?: number; anchor?: 'center' | 'start' | 'end'} ; CmsSigner [InterfaceDeclaration] (from packages/core/signature/src/sign.ts): export interface CmsSigner{ readonly kind: 'cms'; readonly hash?: Exclude; sign(input:{ digest: Uint8Array; algorithm: Exclude; subFilter: SignatureSubFilter | 'ETSI.RFC3161'; } ): Promise; } CollapsedGroupView [TypeAliasDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export type CollapsedGroupView = CollapsedGroupViewOf; Color [TypeAliasDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export type Color = string; CommandContext [InterfaceDeclaration] (from packages/core/main/src/command-types.ts): export interface CommandContext{ readonly documentId: string | null; readonly appState: AppState; readonly args?: unknown; readonly signal?: AbortSignal; get(token: CapabilityToken): T; tryGet(token: CapabilityToken): T | null; } CommandDefinition [InterfaceDeclaration] (from packages/core/main/src/command-types.ts): export interface CommandDefinition{ readonly id: string; readonly label?: string; readonly labelKey?: string; readonly icon?: string; iconAccent?(context: CommandContext): IconAccent | null; readonly shortcut?: string | readonly string[]; readonly shortcutInTextFields?: boolean; readonly categories?: readonly string[]; readonly requires?: readonly Permission[]; allowed?(context: CommandContext): boolean; readonly notAllowedKey?: string; locked?(context: CommandContext): SettingLock | null; readonly menu?: string; readonly panel?: | string |{ readonly id: string; readonly exclusive?: string; readonly focus?: boolean} ; readonly modal?: string; enabled?(context: CommandContext): boolean; active?(context: CommandContext): boolean; visible?(context: CommandContext): boolean; labelParams?(context: CommandContext): Readonly>; run?(context: CommandContext): void | Promise; } CommandExecutedEvent [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface CommandExecutedEvent{ readonly commandId: CommandId; readonly documentId: string | null; readonly args: unknown; } CommandExecutionFailedEvent [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface CommandExecutionFailedEvent{ readonly commandId: CommandId; readonly documentId: string | null; readonly error: PluginErrorInfo; } CommandFamily [InterfaceDeclaration] (from packages/core/main/src/command-types.ts): export interface CommandFamily{ readonly prefix: string; readonly names: (context: CommandContext) => readonly string[]; readonly command: (name: string) => Omit; } CommandId [TypeAliasDeclaration] (from packages/plugin/commands/src/contract.ts): export type CommandId = string; CommandRefusal [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface CommandRefusal{ readonly reason: 'turned-off' | 'not-allowed' | 'locked'; readonly message: string; } CommandsCapability [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface CommandsCapability extends SettingsApi{ registerCommand(definition: CommandDefinition, options?: RegisterCommandOptions): Unsubscribe; registerCommands( definitions: readonly CommandDefinition[], options?: RegisterCommandOptions, ): Unsubscribe; hasCommand(id: CommandId): boolean; getCommand(id: CommandId): CommandDefinition | null; listCommandIds(): readonly CommandId[]; resolveCommand(id: CommandId, documentId?: string): ResolvedCommand | null; listCommands(documentId?: string): readonly ResolvedCommand[]; searchCommands(query: string, documentId?: string): readonly ResolvedCommand[]; listShortcuts(): readonly{ readonly commandId: CommandId; readonly shortcut: string} []; execute(id: CommandId, options?: ExecuteOptions): Promise; canExecute(id: CommandId, documentId?: string): boolean; getRefusal(id: CommandId, documentId?: string): CommandRefusal | null; getDisabledCategories(): readonly string[]; isCategoryDisabled(category: string): boolean; disableCategory(category: string): void; enableCategory(category: string): void; setDisabledCategories(categories: readonly string[]): void; getDisabledCommands(): readonly CommandId[]; isCommandDisabled(id: CommandId): boolean; disableCommand(id: CommandId): void; enableCommand(id: CommandId): void; setDisabledCommands(ids: readonly CommandId[]): void; readonly onExecuted: EventHook; readonly onExecutionFailed: EventHook; } CommandsConfig [TypeAliasDeclaration] (from packages/plugin/commands/src/contract.ts): export type CommandsConfig = Omit< DeepPartial, 'commands' | 'appState' > &{ readonly commands?: readonly (CommandDefinition | CommandFamily)[]; readonly appState?: AppState; } ; CommandsSettings [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface CommandsSettings{ readonly commands: readonly (CommandDefinition | CommandFamily)[]; readonly appState: unknown; readonly disabledCategories: readonly string[]; readonly disabledCommands: readonly CommandId[]; readonly notAllowed: NotAllowedMode; } CommandsToken [VariableDeclaration] (from packages/plugin/commands/src/token.ts): CommandsToken = createCapabilityToken('commands', { hint: `add commandsPlugin() from '@embedpdf/plugin-commands' to your plugins list`, } ) CommentThread [InterfaceDeclaration] (from packages/engine/core/src/annotation/comments.ts): export interface CommentThread{ root: T; page: PageRef; replies: T[]; groupedParts: T[]; review: CommentThreadReview; } CommentThreadChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface CommentThreadChangedEvent{ readonly rootRef: AnnotationRef; readonly type: 'reply' | 'text' | 'status' | 'marked' | 'deleted'; } CommentThreadReview [InterfaceDeclaration] (from packages/engine/core/src/annotation/comments.ts): export interface CommentThreadReview{ byReviewer: Record; lastChange: ReviewStatus | null; markedBy: string[]; statusRefs: AnnotationRef[]; mine: ReviewStatus | null; } CommentThreadView [InterfaceDeclaration] (from packages/framework/angular/annotation/src/comments.ts): export interface CommentThreadView extends CommentThread{ pageIndex: number; pageLabel: string; } CommentsCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface CommentsCapability{ listThreads(): readonly CommentThread[]; getThread(ref: AnnotationRef): CommentThread | null; reply( ref: AnnotationRef, text: string, options?: OperationOptions, ): Promise<{ annotation: Annotation} >; setText(ref: AnnotationRef, text: string, options?: OperationOptions): Promise; setStatus(ref: AnnotationRef, state: string, options?: OperationOptions): Promise; setMarked(ref: AnnotationRef, marked: boolean, options?: OperationOptions): Promise; delete(ref: AnnotationRef, options?: OperationOptions): Promise; deleteThread(ref: AnnotationRef, options?: OperationOptions): Promise; canReply(ref: AnnotationRef): boolean; canSetText(ref: AnnotationRef): boolean; canSetStatus(ref: AnnotationRef): boolean; canSetMarked(ref: AnnotationRef): boolean; canDelete(ref: AnnotationRef): boolean; canDeleteThread(ref: AnnotationRef): boolean; readonly onThreadChanged: EventHook; } CoreState [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface CoreState{ readonly documents: Readonly>; readonly pending: Readonly>; readonly order: readonly string[]; readonly activeId: string | null; } CreateAssetInput [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface CreateAssetInput{ libraryId?: string; name?: string; label?: string; kind?: StampAssetKind; subject?: string; categories?: string[]; source?: BinarySource; mark?: MarkSource; preview?: BinarySource; size?:{ width: number; height: number} ; } CreateLibraryOptions [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface CreateLibraryOptions extends OperationOptions{ readonly id?: string; readonly kind?: StampLibraryKind; readonly categories?: string[]; } CreateMeasurementInput [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface CreateMeasurementInput{ kind: MeasurementKind; page: PageRef | number; points: readonly Point[]; tool?: string; } CreatePaneOptions [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface CreatePaneOptions{ readonly documentIds?: readonly string[]; } CreationDraft [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type CreationDraft = CreationDraftAnchor; CreationDraftAnchor [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface CreationDraftAnchor{ kind: 'poly'; subtype: PolySubtype; page: PageRef; bounds: Rect; pointCount: number; minPoints: number; canFinish: boolean; } Cursor [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type Cursor = string; CustomItem [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface CustomItem{ readonly slot: string; readonly variants?: readonly string[]; readonly terminal?: string; readonly importance?: Importance; readonly grow?: boolean; } CustomMetadata [TypeAliasDeclaration] (from packages/engine/core/src/dto/CustomMetadata.ts): export type CustomMetadata = Record; CustomMetadataCapability [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface CustomMetadataCapability{ getSnapshot(): CustomMetadata | null; getStatus(): ResourceStatus; update( patch: CustomMetadataPatch, options?: OperationOptions, ): Promise<{ readonly custom: CustomMetadata} >; refresh(options?: OperationOptions): Promise; readonly onUpdated: EventHook; readonly onResynced: EventHook; } CustomMetadataPatch [TypeAliasDeclaration] (from packages/engine/core/src/dto/CustomMetadataPatch.ts): export type CustomMetadataPatch = Record; CustomMetadataResyncedEvent [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface CustomMetadataResyncedEvent{ readonly custom: CustomMetadata; } CustomMetadataUpdateResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/CustomMetadataUpdateResult.ts): export interface CustomMetadataUpdateResult{ custom: CustomMetadata; meta: MutationMeta; } CustomMetadataUpdatedEvent [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface CustomMetadataUpdatedEvent{ readonly custom: CustomMetadata; readonly previous: CustomMetadata | null; readonly changedKeys: readonly string[]; readonly origin: EventOrigin; } DEFAULT_IMPORTANCE [VariableDeclaration] (from packages/core/ui/src/schema.ts): DEFAULT_IMPORTANCE: Importance = 3 DEFAULT_LIBRARY_KIND [VariableDeclaration] (from packages/plugin/stamp/src/convention.ts): DEFAULT_LIBRARY_KIND = 'stamps' DEFAULT_RESPONSIVE [VariableDeclaration] (from packages/plugin/stage/src/settings.ts): DEFAULT_RESPONSIVE: readonly ResponsiveRule[] = [{ name: 'compact', when:{ maxWidth: 600} , settings:{ padding: 4} } , ] DEFAULT_SETTINGS [VariableDeclaration] (from packages/plugin/stage/src/settings.ts): DEFAULT_SETTINGS: StageSettings ={ flow: 'continuous', layout: 'vertical', spread: 'none', sizing: 'intrinsic', columns: 'square', bounded: true, padding: 24, gap: 16, pageFrame:{ top: 0, right: 0, bottom: 0, left: 0} , direction: 'ltr', fitAlign:{ x: 'center', y: 'center'} , arrivalAlign:{ x: 'start', y: 'start'} , zoomAlign:{ x: 'center', y: 'center'} , anchorAlign:{ x: 'start', y: 'start'} , viewRotation: 0, zoom:{ mode: ZoomMode.Automatic} , minZoom: ZOOM_MIN, maxZoom: ZOOM_MAX, scrollBehavior: 'smooth', interaction: true, panFallback: true, zoomGestures: true, turnGestures: true, scrollChaining: true, zoomBox:{ fill: null, stroke: null} , viewUnitsPerPoint: 96 / 72, } DEFAULT_TOOLS [VariableDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): DEFAULT_TOOLS: AnnotationToolInput[] = [{ id: 'square', subtype: 'square', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6} , clickCreate:{ width: 80, height: 60} , upright: true, } , { id: 'circle', subtype: 'circle', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6} , clickCreate:{ width: 80, height: 60} , upright: true, } , { id: 'line', subtype: 'line', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6} , clickCreate:{ length: 80} , upright: true, } , { id: 'distance', extends: 'line', clickCreate: false, defaults:{ intent: 'line-dimension', strokeWidth: 1, lineEndings:{ start: 'closed-arrow', end: 'closed-arrow'} , captionEnabled: true, captionPosition: 'inline', leader:{ length: 12, extension: 5, offset: 0} , } , } , { id: 'calibrate', extends: 'line', enables: ['annotation-draw'], defaults:{ strokeWidth: 1} , clickCreate: false, } , { id: 'polygon', subtype: 'polygon', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6} , } , { id: 'polyline', subtype: 'polyline', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6} , } , { id: 'perimeter', extends: 'polyline', defaults:{ intent: 'polyline-dimension', strokeWidth: 1, lineEndings:{ start: 'none', end: 'none'} , captionEnabled: true, } , } , { id: 'area', extends: 'polygon', defaults:{ intent: 'polygon-dimension', strokeWidth: 1, captionEnabled: true} , } , { id: 'ink', subtype: 'ink', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: '#ef4444', strokeWidth: 6, blendMode: 'normal'} , ink:{ groupStrokesMs: 800} , } , { id: 'ink-highlight', extends: 'ink', defaults:{ intent: 'ink-highlight', color: '#ffcd45', strokeWidth: 14, blendMode: 'multiply'} , ink:{ straighten:{ deviationThreshold: 0.15, axisSnapDegrees: 15} , } , } , { id: 'free-text', subtype: 'free-text', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 2, fontColor: '#ef4444'} , upright: true, clickCreate:{ width: 180, height: 40, anchor: 'top-left'} , } , { id: 'free-text-callout', subtype: 'free-text-callout', cursor: 'crosshair', enables: DRAW_TAGS, defaults:{ color: HOUSE_RED, strokeWidth: 6, lineEnding: 'open-arrow'} , upright: true, } , { id: 'highlight', subtype: 'highlight', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ffe16a', blendMode: 'multiply'} , selection:{ kind: 'markup'} , } , { id: 'redact', subtype: 'redact', cursor: 'crosshair', enables: ['text-select', 'annotation-draw', 'annotation-edit'], defaults:{ color: '#e44234', interiorColor: '#000000', fontSize: 14, fontColor: '#ffffff', opacity: 1, } , selection:{ kind: 'markup'} , } , { id: 'underline', subtype: 'underline', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ef4444'} , selection:{ kind: 'markup'} , } , { id: 'strikeout', subtype: 'strikeout', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ef4444'} , selection:{ kind: 'markup'} , } , { id: 'squiggly', subtype: 'squiggly', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ef4444'} , selection:{ kind: 'markup'} , } , { id: 'insert-text', subtype: 'caret', fieldsKind: 'caret', preset: 'caret', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ef4444'} , selection:{ kind: 'text-edit', operation: 'insert'} , } , { id: 'replace-text', subtype: 'strikeout', fieldsKind: 'strikeout', cursor: 'default', enables: MARKUP_TAGS, defaults:{ color: '#ef4444'} , selection:{ kind: 'text-edit', operation: 'replace'} , } , { id: ARMED_STAMP_TOOL_ID, subtype: 'stamp', cursor: 'copy', enables: ['annotation-place', 'annotation-edit'], source:{ kind: 'prompt', accept: 'image/png, image/jpeg, application/pdf'} , upright: true, ghost: true, } , { id: 'link', subtype: 'link', cursor: 'crosshair', enables: DRAW_TAGS, } , { id: 'note', subtype: 'text', cursor: 'crosshair', enables: ['annotation-place', 'annotation-edit'], defaults:{ icon: 'comment', color: '#facc15'} , flags:{ noZoom: true, noRotate: true} , upright: true, ghost: true, } , { id: 'attachment', subtype: 'file-attachment', cursor: 'crosshair', enables: ['annotation-place', 'annotation-edit'], source:{ kind: 'prompt'} , defaults:{ icon: 'paperclip', color: '#facc15'} , flags:{ noZoom: true, noRotate: true} , upright: true, ghost: true, } , ] DeepPartial [TypeAliasDeclaration] (from packages/core/main/src/settings.ts): export type DeepPartial ={ readonly [K in keyof T]?: DeepPartialValue} ; DeletePaneOptions [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface DeletePaneOptions{ readonly moveDocumentsTo?: PaneId; } Direction [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type Direction = 'ltr' | 'rtl'; DocCapability [TypeAliasDeclaration] (from packages/engine/core/src/auth/scope/types.ts): export type DocCapability = | 'doc.open' | 'doc.render' | 'doc.text.copy' | 'doc.text.search' | 'doc.content.copy' | 'doc.download' | 'doc.download.flattened' | 'doc.print' | 'doc.print.high' | 'doc.pages.modify' | 'doc.pages.assemble' | 'doc.forms.read' | 'doc.forms.fill' | 'doc.forms.modify' | 'doc.forms.import' | 'doc.forms.script' | 'doc.forms.submit' | 'doc.annotate.read' | 'doc.annotate.modify' | 'doc.annotate.import' | 'doc.metadata.modify' | 'doc.attachments.modify' | 'doc.outline.modify' | 'doc.redact' | 'doc.sign' | 'doc.sign.certify'; DocMdpPermission [TypeAliasDeclaration] (from packages/engine/core/src/signature/types.ts): export type DocMdpPermission = 1 | 2 | 3; DocumentActiveChangedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentActiveChangedEvent{ readonly documentId: string | null; readonly previousDocumentId: string | null; } DocumentClosedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentClosedEvent{ readonly documentId: string; } DocumentEvent [TypeAliasDeclaration] (from packages/engine/core/src/events/DocumentEvent.ts): export type DocumentEvent = | ({ type: 'pages.scaleSet'; origin: EventOrigin; pages: PageRef[]; measure: PdfMeasure | null; } & PageScaleResult) | ({ type: 'annotations.created'; page: PageRef; origin: EventOrigin; } & AnnotationCreateResult) | ({ type: 'annotations.updated'; page: PageRef; origin: EventOrigin; } & AnnotationUpdateResult) | ({ type: 'annotations.deleted'; page: PageRef; origin: EventOrigin; deleted: AnnotationRef[]; } & AnnotationDeleteResult) | ({ type: 'annotations.reordered'; page: PageRef; origin: EventOrigin; } & AnnotationReorderResult) |{ type: 'annotations.restored'; page: PageRef; origin: EventOrigin; annotations: Annotation[]; meta: AnnotationListMutationMeta; } | ({ type: 'annotations.flattened'; origin: EventOrigin; } & AnnotationFlattenResult) | ({ type: 'pages.reordered'; origin: EventOrigin} & PageReorderResult) | ({ type: 'pages.rotated'; pages: PageRef[]; rotation: PdfRotation; origin: EventOrigin; } & PageRotateResult) | ({ type: 'pages.deleted'; pages: PageRef[]; origin: EventOrigin; } & PageDeleteResult) | ({ type: 'pages.inserted'; origin: EventOrigin} & PageInsertResult) | ({ type: 'pages.restored'; origin: EventOrigin} & PageRestoreResult) | ({ type: 'pages.named'; name: string; page: PageRef | null; origin: EventOrigin; } & PageNameResult) | ({ type: 'attachments.created'; origin: EventOrigin} & AttachmentCreateResult) | ({ type: 'attachments.deleted'; origin: EventOrigin; deleted: AttachmentRef | null; } & AttachmentDeleteResult) |{ type: 'fonts.changed'; origin: EventOrigin; } | ({ type: 'attachments.restored'; origin: EventOrigin} & AttachmentRestoreResult) | ({ type: 'metadata.updated'; origin: EventOrigin} & MetadataUpdateResult) | ({ type: 'metadata.customUpdated'; origin: EventOrigin} & CustomMetadataUpdateResult) | ({ type: 'outline.created'; origin: EventOrigin} & OutlineCreateResult) | ({ type: 'outline.updated'; origin: EventOrigin} & OutlineUpdateResult) | ({ type: 'outline.moved'; origin: EventOrigin} & OutlineMoveResult) | ({ type: 'outline.deleted'; origin: EventOrigin; deleted: OutlineItemRef[]; } & OutlineDeleteResult) | ({ type: 'outline.restored'; origin: EventOrigin; } & OutlineRestoreResult) | ({ type: 'forms.valueSet'; origin: EventOrigin} & FormSetValueResult) | ({ type: 'forms.repaired'; origin: EventOrigin} & FormRepairResult) | ({ type: 'forms.created'; origin: EventOrigin} & FormFieldCreateResult) | ({ type: 'forms.updated'; origin: EventOrigin} & FormFieldUpdateResult) | ({ type: 'forms.deleted'; origin: EventOrigin; deleted: FormFieldRef | null; } & FormFieldDeleteResult) |{ type: 'forms.restored'; origin: EventOrigin; field: FormField; widgets: WidgetAnnotation[]; meta: FormMutationMeta; } | ({ type: 'forms.widgetAdded'; origin: EventOrigin} & FormWidgetLinkResult) | ({ type: 'forms.widgetRemoved'; origin: EventOrigin} & FormWidgetLinkResult) | ({ type: 'forms.widgetDeleted'; origin: EventOrigin} & FormWidgetDeleteResult) | ({ type: 'forms.widgetRestored'; origin: EventOrigin; } & FormWidgetRestoreResult) | ({ type: 'forms.widgetUpdated'; origin: EventOrigin} & FormWidgetUpdateResult) | ({ type: 'forms.widgetsReordered'; origin: EventOrigin; } & FormWidgetsReorderResult) | ({ type: 'forms.calculationsReordered'; origin: EventOrigin; } & FormCalculationsReorderResult) | ({ type: 'pages.flattened'; pages: PageRef[]; usage: PageFlattenUsage; origin: EventOrigin; } & PageFlattenResult) | ({ type: 'redaction.applied'; origin: EventOrigin; } & RedactionApplyResult) | ({ type: 'signatures.prepared'; field: FormFieldRef; origin: EventOrigin; } & SignaturePrepared) | ({ type: 'signatures.completed'; signingId: string; origin: EventOrigin; } & SignatureCompleteResult) |{ type: 'signatures.cancelled'; signingId: string; origin: EventOrigin; } | ({ type: 'signatures.validationInfoAdded'; origin: EventOrigin; } & ValidationInfoAddResult) |{ type: 'document.versioned'; version: BaseVersionInfo; origin: EventOrigin; } |{ type: 'stream.desynced'; reason: 'backlog-overflow' | 'unknown-change'; at: string; } ; DocumentHandle [InterfaceDeclaration] (from packages/engine/core/src/engine/DocumentHandle.ts): export interface DocumentHandle{ readonly id: string; readonly security: DocumentSecurityService; readonly metadata: MetadataService; readonly annotations: DocumentAnnotationsService; readonly actions: DocumentActionsService; readonly attachments: DocumentAttachmentsService; readonly forms: DocumentFormsService; readonly fonts: DocumentFontsService; readonly outline: DocumentOutlineService; readonly search: DocumentSearchService; readonly render: DocumentRenderService; readonly pages: DocumentPagesService; readonly redaction: DocumentRedactionService; readonly signatures: DocumentSignaturesService; readonly events: DocumentEventStream; readonly objectNumbers: ObjectNumberPool; readonly grant?: DocumentGrant; page(ref: PageRef): PageHandle; apply(change: Change, options?: WriteOptions): AbortablePromise; with(facts: CallFacts): DocumentHandle; setWorkingSet(view: string, pages: readonly WorkingSetPage[]): void; download(options?: DownloadOptions): AbortablePromise; close(): AbortablePromise; } DocumentInfo [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentInfo{ readonly id: string; readonly name?: string; readonly status: DocumentStatus; readonly pageCount: number; readonly hasUnsavedChanges: boolean; readonly passwordProvided?: boolean; readonly error?: PluginErrorInfo; readonly openRequest?: GrantOpenRequest; readonly identityRequest?: VisitorIdentityRequest; } DocumentLockedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentLockedEvent{ readonly documentId: string; readonly passwordProvided: boolean; } DocumentMeta [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentMeta{ readonly id: string; readonly instanceId: string; readonly name?: string; readonly pageCount: number; readonly pages: readonly PageLayout[]; readonly pageLabels: readonly PageLabelSection[]; readonly pendingPages: ReadonlyMap; readonly pagesSequence: number; readonly renderPolicy: EngineRenderPolicy; readonly hasUnsavedChanges: boolean; readonly identityRequest?: VisitorIdentityRequest; readonly openRequest?: GrantOpenRequest; } DocumentMetadata [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentMetadata.ts): export interface DocumentMetadata{ title: string | null; author: string | null; subject: string | null; keywords: string | null; producer: string | null; creator: string | null; createdAt: IsoDateTime | null; modifiedAt: IsoDateTime | null; trapped: DocumentMetadataTrapped; } DocumentMovedEvent [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface DocumentMovedEvent{ readonly documentId: string; readonly fromPaneId: PaneId | null; readonly toPaneId: PaneId | null; } DocumentOpenFailedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentOpenFailedEvent{ readonly documentId: string; readonly error: PluginErrorInfo; } DocumentOpenedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentOpenedEvent{ readonly documentId: string; readonly info: DocumentInfo; } DocumentOutline [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentOutline.ts): export interface DocumentOutline{ items: OutlineItem[]; incomplete: boolean; } DocumentPagesChangedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentPagesChangedEvent{ readonly documentId: string; readonly pagesSequence: number; readonly pages: readonly PageInfo[]; } DocumentProtection [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface DocumentProtection{ enforced: ModificationLevel | null; judged: ModificationLevel | null; certification:{ signatureIndex: number; permission: DocMdpPermission} | null; fieldLocks: DocumentFieldLock[]; policyVersion: number; } DocumentStatus [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type DocumentStatus = 'loading' | 'locked' | 'ready' | 'error'; DocumentTriggerEvent [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type DocumentTriggerEvent = | 'open' | 'will-save' | 'did-save' | 'will-print' | 'did-print' | 'will-close'; DocumentUnsavedChangesChangedEvent [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentUnsavedChangesChangedEvent{ readonly documentId: string; readonly hasUnsavedChanges: boolean; } DocumentsCapability [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DocumentsCapability{ open(source: OpenSource, options?: OpenDocumentOptions): Promise; canOpenFiles(): boolean; retry(id: string, options?: RetryOptions): Promise; identify(id: string, answers: VisitorAnswers): Promise; declineIdentity(id: string): void; rename(id: string, name: string): void; openAll(documents: readonly InitialDocument[]): readonly string[]; unlock(id: string, options: UnlockOptions): Promise; close(id: string): Promise; closeAll(): Promise; setActive(id: string): void; getActiveId(): string | null; getActive(): DocumentInfo | null; list(): readonly DocumentInfo[]; get(id?: string): DocumentInfo | null; has(id: string): boolean; getCount(): number; getOrder(): readonly string[]; setOrder(ids: readonly string[]): void; move(id: string, toIndex: number): void; swap(id: string, otherId: string): void; download(id?: string, options?: DownloadOptions): Promise; downloadLayer(id?: string, options?: OperationOptions): Promise; canDownload(id?: string): boolean; preparePrint(id?: string, options?: PrintOptions): Promise; print(id?: string, options?: PrintOptions): Promise; getPrintQuality(id?: string): PrintQuality | null; canPrint(id?: string): boolean; listPages(id?: string): readonly PageInfo[]; getPage(page: PageRef | number, id?: string): PageInfo | null; getPageIndex(ref: PageRef, id?: string): number; getRevision(id?: string): number; readonly onOpened: EventHook; readonly onOpenFailed: EventHook; readonly onLocked: EventHook; readonly onClosed: EventHook; readonly onActiveChanged: EventHook; readonly onPagesChanged: EventHook; readonly onUnsavedChangesChanged: EventHook; } DocumentsState [InterfaceDeclaration] (from packages/core/main/src/documents-state.ts): export interface DocumentsState{ readonly documents: readonly DocumentInfo[]; readonly activeId: string | null; } DocumentsToken [VariableDeclaration] (from packages/core/main/src/types.ts): DocumentsToken: CapabilityToken ={ name: 'documents'} DownloadOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface DownloadOptions extends OperationOptions{ readonly mode?: PdfSaveMode; } EPDF_DOCUMENT_SCOPE [VariableDeclaration] (from packages/framework/angular/runtime/src/tokens.ts): EPDF_DOCUMENT_SCOPE = new InjectionToken('EPDF_DOCUMENT_SCOPE') EPDF_PAGE [VariableDeclaration] (from packages/framework/angular/runtime/src/page-context.ts): EPDF_PAGE = new InjectionToken('EPDF_PAGE') EPDF_PROJECTOR [VariableDeclaration] (from packages/framework/angular/anchored/src/anchored.ts): EPDF_PROJECTOR = new InjectionToken('EPDF_PROJECTOR') EPDF_SCOPED_SERVICES [VariableDeclaration] (from packages/framework/angular/runtime/src/provide.ts): EPDF_SCOPED_SERVICES: Provider[] = scopedServices EPDF_SETUP [VariableDeclaration] (from packages/framework/angular/runtime/src/tokens.ts): EPDF_SETUP = new InjectionToken('EPDF_SETUP') EditableKind [TypeAliasDeclaration] (from packages/core/annotation/src/editable.ts): export type EditableKind = AnnotationSubtype | MeasurementIntent; EditableKinds [TypeAliasDeclaration] (from packages/core/annotation/src/editable.ts): export type EditableKinds = boolean | readonly EditableKind[]; EmbedPdfConfig [InterfaceDeclaration] (from packages/framework/angular/runtime/src/config.ts): export interface EmbedPdfConfig{ readonly engine: EngineSource; readonly initialDocuments?: readonly InitialDocument[]; readonly identity?: Identity | null; readonly scope?: readonly string[] | null; readonly accent?: string; readonly page?: Partial; readonly fetch?: HostFetch; } EmbedPdfFeature [InterfaceDeclaration] (from packages/framework/angular/runtime/src/config.ts): export interface EmbedPdfFeature{ readonly plugins: readonly AnyPlugin[]; readonly services?: readonly Type[]; readonly providers?: readonly Provider[]; readonly setup?: () => void; } EmbedPdfKernelConfig [InterfaceDeclaration] (from packages/framework/angular/runtime/src/config.ts): export interface EmbedPdfKernelConfig{ readonly kernel: Kernel; } EmbedPdfSetup [InterfaceDeclaration] (from packages/framework/angular/runtime/src/tokens.ts): export interface EmbedPdfSetup{ readonly config: EmbedPdfConfig | EmbedPdfKernelConfig; readonly features: readonly EmbedPdfFeature[]; } Engine [InterfaceDeclaration] (from packages/engine/core/src/engine/Engine.ts): export interface Engine{ readonly canOpenFiles: boolean; open(input: OpenInput, options?: OpenOptions): AbortablePromise; destroy(): AbortablePromise; } EngineFactory [TypeAliasDeclaration] (from packages/engine/core/src/engine/Engine.ts): export type EngineFactory = () => Engine; EngineRenderPolicy [TypeAliasDeclaration] (from packages/engine/core/src/engine/DocumentRenderService.ts): export type EngineRenderPolicy = |{ readonly kind: 'continuous'} |{ readonly kind: 'lattice'; readonly fullPage:{ readonly widths: readonly number[]} ; readonly tiles?:{ readonly tileSizes: readonly number[]; readonly scales: readonly number[]; } ; readonly appearances?:{ readonly scales: readonly number[]} ; readonly maxRenderPixels?: number; readonly formats: readonly ('webp' | 'png')[]; readonly background: 'white'; readonly enforced: boolean; } ; EngineSource [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/config.ts): export type EngineSource = Engine | (() => Engine | Promise); EpdfActions [ClassDeclaration] (from packages/framework/angular/actions/src/actions.ts): @Injectable({ providedIn: 'root'} ) export class EpdfActions extends pluginService({ name: 'EpdfActions', feature: 'withActions()', token: ActionsToken, methods: [ 'executeNamed', 'execute', 'dispatch', 'readActionTree', 'isScriptingEnabled', 'setUiAdapter', 'setSubmitHandler', 'registerExecutor', 'runDocumentVerb', 'prepareClose', 'canExecute', 'canExecuteNamed', 'canDispatch', ], events: [ 'onExecuted', 'onDiagnosticReported', 'onScriptFailed', 'onScriptDiagnosticReported', 'onOpenSequenceCompleted', ], } ){ } EpdfAnchor [TypeAliasDeclaration] (from packages/framework/angular/anchored/src/anchored.ts): export type EpdfAnchor = Omit &{ bounds?: AnchoredRect | null} ; EpdfAnchored [ClassDeclaration] (from packages/framework/angular/anchored/src/anchored.ts): @Component({ selector: 'epdf-anchored', changeDetection: ChangeDetectionStrategy.OnPush, host:{ style: 'display: contents'} , template: ` @if (position(); as position){
} `, } ) export class EpdfAnchored{ readonly anchor = input(null); readonly placement = input('top'); readonly gap = input(8); readonly pinned = input(false, { transform: booleanAttribute} ); private readonly binding: EpdfProjectorBinding; private readonly fit = signal(null); private readonly moved = signal(0); private readonly box = viewChild>('box'); protected readonly space = computed(() => this.binding.projector()?.space ?? 'overlay'); private readonly onShownPage = computed(() =>{ const anchor = this.anchor(); if (!anchor?.bounds) return false; const shown = this.binding.shownPages(); return !shown || shown.has(anchor.page.objectNumber); } ); protected readonly position = computed(() =>{ if (!this.onShownPage()) return null; this.binding.revision(); this.moved(); const projector = this.binding.projector(); const anchor = this.anchor(); if (!projector || !anchor?.bounds) return null; return projectAnchoredTarget( projector, { ...anchor, bounds: anchor.bounds} , { placement: this.placement(), gap: this.gap(), pinned: this.pinned()} , this.fit(), ); } ); constructor(){ const binding = inject(EPDF_PROJECTOR, { optional: true} ); if (!binding) throw outsideStageError(''); this.binding = binding; const injector = inject(Injector); if (binding.subscribe){ const subscribe = binding.subscribe; effect((onCleanup) =>{ if (!this.onShownPage()) return; onCleanup(subscribe(() => this.moved.update((count) => count + 1))); } ); } effect(() =>{ if (this.space() !== 'client' || !this.anchor()) return; afterNextRender(() => this.moved.update((count) => count + 1), { injector} ); } ); effect((onCleanup) =>{ const element = this.box()?.nativeElement; if (!element) return; const space = this.space(); onCleanup( observeAnchoredFit(element, space, (next) =>{ if (!sameAnchoredFit(untracked(this.fit), next)) this.fit.set(next); } ), ); } ); } } EpdfAnnotation [ClassDeclaration] (from packages/framework/angular/annotation/src/annotation.ts): @Injectable({ providedIn: 'root'} ) export class EpdfAnnotation extends pluginService({ name: 'EpdfAnnotation', feature: 'withAnnotation()', token: AnnotationToken, state: annotationState, methods: [ 'get', 'list', 'getAt', 'isPending', 'getStatus', 'getHovered', 'refresh', 'create', 'createFromSelection', 'update', 'delete', 'reorder', 'duplicate', 'export', 'import', 'downloadResource', 'setFilePickerProvider', 'canRead', 'canCreate', 'canUpdate', 'canDelete', 'canDuplicate', 'isMovable', 'cancel', ], events: [ 'onCreated', 'onUpdated', 'onDeleted', 'onReordered', 'onResynced', 'onWriteFailed', 'onSelectionChanged', 'onDraftChanged', 'onEditingChanged', 'onHoverChanged', ], } ){ private readonly host = new CapabilityBinding( this.binding.host, () => AnnotationHostToken, injectDocumentScope(), ); readonly selection: EpdfAnnotationSelection ={ select: this.binding.namespaceMethod('selection', 'select'), add: this.binding.namespaceMethod('selection', 'add'), selectAll: this.binding.namespaceMethod('selection', 'selectAll'), selectInRect: this.binding.namespaceMethod('selection', 'selectInRect'), clear: this.binding.namespaceMethod('selection', 'clear'), getSelected: this.binding.namespaceMethod('selection', 'getSelected'), update: this.binding.namespaceMethod('selection', 'update'), updateLink: this.binding.namespaceMethod('selection', 'updateLink'), getProperties: this.binding.namespaceMethod('selection', 'getProperties'), delete: this.binding.namespaceMethod('selection', 'delete'), rotateBy: this.binding.namespaceMethod('selection', 'rotateBy'), resetRotation: this.binding.namespaceMethod('selection', 'resetRotation'), group: this.binding.namespaceMethod('selection', 'group'), ungroup: this.binding.namespaceMethod('selection', 'ungroup'), canGroup: this.binding.namespaceMethod('selection', 'canGroup'), canUngroup: this.binding.namespaceMethod('selection', 'canUngroup'), duplicate: this.binding.namespaceMethod('selection', 'duplicate'), canDuplicate: this.binding.namespaceMethod('selection', 'canDuplicate'), getAnchor: this.binding.namespaceMethod('selection', 'getAnchor'), getRotationAnchor: this.binding.namespaceMethod('selection', 'getRotationAnchor'), properties: this.binding.select( (annotation) => annotation.selection.getProperties(), NO_PROPERTIES, Object.is, ), } ; readonly draft: AnnotationDraftCapability ={ get: this.binding.namespaceMethod('draft', 'get'), finish: this.binding.namespaceMethod('draft', 'finish'), cancel: this.binding.namespaceMethod('draft', 'cancel'), } ; readonly text: AnnotationTextCapability ={ begin: this.binding.namespaceMethod('text', 'begin'), end: this.binding.namespaceMethod('text', 'end'), getEditing: this.binding.namespaceMethod('text', 'getEditing'), toggleFormat: this.binding.namespaceMethod('text', 'toggleFormat'), } ; readonly tools: EpdfAnnotationTools ={ list: this.binding.namespaceMethod('tools', 'list'), get: this.binding.namespaceMethod('tools', 'get'), register: this.binding.namespaceMethod('tools', 'register'), getDefaults: this.binding.namespaceMethod('tools', 'getDefaults'), updateDefaults: this.binding.namespaceMethod('tools', 'updateDefaults'), getProperties: this.binding.namespaceMethod('tools', 'getProperties'), defaultsOf: (id) =>{ const idOf = typeof id === 'function' ? id : () => id; return this.binding.select( (annotation) => annotation.tools.getDefaults(idOf()), NO_DEFAULTS, Object.is, ); } , propertiesOf: (id) =>{ const idOf = typeof id === 'function' ? id : () => id; return this.binding.select( (annotation) => annotation.tools.getProperties(idOf()), NO_PROPERTIES, ); } , defaultsChanged$: this.binding.stream((annotation) => annotation.tools.onDefaultsChanged), } ; readonly stamps: AnnotationStampsCapability ={ arm: this.binding.namespaceMethod('stamps', 'arm'), disarm: this.binding.namespaceMethod('stamps', 'disarm'), isArmed: this.binding.namespaceMethod('stamps', 'isArmed'), place: this.binding.namespaceMethod('stamps', 'place'), } ; readonly links: AnnotationLinksCapability ={ get: this.binding.namespaceMethod('links', 'get'), set: this.binding.namespaceMethod('links', 'set'), clear: this.binding.namespaceMethod('links', 'clear'), } ; watch( filter?: AnnotationFilter | null | (() => AnnotationFilter | null | undefined), ): Signal{ const filterOf = typeof filter === 'function' ? filter : () => filter; return this.binding.select( (annotation) => annotation.list(filterOf() ?? undefined), NO_ANNOTATIONS, ); } anchorOf( ref: AnnotationRef | null | (() => AnnotationRef | null | undefined), ): Signal{ const refOf = typeof ref === 'function' ? ref : () => ref; return this.host.select( (annotation) =>{ const target = refOf(); return target ? annotation.getAnnotationAnchor(target) : null; } , null, sameAnnotationAnchor, ); } } EpdfAnnotationBehaviorTemplate [ClassDeclaration] (from packages/framework/angular/annotation/src/templates.ts): @Directive({ selector: 'ng-template[epdfAnnotationBehavior]'} ) export class EpdfAnnotationBehaviorTemplate{ readonly behavior = input(undefined, { alias: 'epdfAnnotationBehavior'} ); readonly template = inject>(TemplateRef); readonly renderer: Signal = computed(() =>{ const behavior = this.behavior(); if (!behavior) return null; let entry = behaviors.get(behavior); if (!entry) behaviors.set(behavior, (entry = Object.freeze({ behavior} ))); return entry; } ); static ngTemplateContextGuard( _directive: EpdfAnnotationBehaviorTemplate, context: unknown, ): context is EpdfAnnotationBehaviorTemplateContext{ return true; } } EpdfAnnotationBehaviorTemplateContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface EpdfAnnotationBehaviorTemplateContext{ $implicit: Annotation; annotation: Annotation; item: RenderItem; page: EpdfPageContext; native: TemplateRef; hovered: boolean; selected: boolean; interactive: boolean; } EpdfAnnotationDraftMenu [ClassDeclaration] (from packages/framework/angular/annotation/src/annotation-menu.ts): @Component({ selector: 'epdf-annotation-draft-menu', exportAs: 'epdfAnnotationDraftMenu', imports: [EpdfAnchored], changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, } ) export class EpdfAnnotationDraftMenu{ readonly placement = input('top'); readonly gap = input(8); private readonly annotation = annotationInScope(''); readonly draft: Signal = this.annotation.select( (annotation) => annotation.draft.get(), null, sameCreationDraftAnchor, ); constructor(){ if (!inject(EPDF_PROJECTOR, { optional: true} )){ throw outsideStageError(''); } } } EpdfAnnotationLayer [ClassDeclaration] (from packages/framework/angular/annotation/src/annotation-layer.ts): @Component({ selector: 'epdf-annotation-layer', imports: [ NgTemplateOutlet, EpdfAnnotationFrame, EpdfAnnotationNative, EpdfAnnotationChrome, EpdfFreeTextBox, ], changeDetection: ChangeDetectionStrategy.OnPush, host:{ style: 'position: absolute; inset: 0; display: block; pointer-events: none'} , template: ` @for (drawn of drawings(); track drawn.item.id){ @if (drawn.owner; as owner){
} @else{ @if (drawn.look; as look){
@if (look.scaled){
} @else{ }
} @else{
} } } @for (text of texts(); track text.id){
} @if (ghost(); as ghost){ } `, } ) export class EpdfAnnotationLayer{ protected readonly page = injectPage(''); private readonly injector = inject(Injector); private readonly annotation = annotationHostOf(this.page, ''); private readonly interaction = new CapabilityBinding( injectKernelHost(''), () => InteractionToken, () => this.page.documentId, ); private readonly render = new CapabilityBinding( injectKernelHost(''), () => RenderToken, () => this.page.documentId, ); private readonly chrome = injectChromeSettings(); private readonly looks = contentChildren(EpdfAnnotationTemplate, { descendants: true} ); private readonly behaviors = contentChildren(EpdfAnnotationBehaviorTemplate, { descendants: true, } ); protected readonly handleTemplate = contentChild(EpdfHandleTemplate, { descendants: true} ); protected readonly rotationHandleTemplate = contentChild(EpdfRotationHandleTemplate, { descendants: true, } ); private readonly renderers = computed( (): readonly AnnotationRendererEntry[] => [ ...this.behaviors().map((template) => template.renderer()), ...this.looks().map((template) => template.renderer()), ].filter((entry) => entry !== null), { equal: (left, right) => left.length === right.length && left.every((entry, index) => entry === right[index]), } , ); private readonly registrations = signal(0); private readonly view = pageViewOf(this.page); private readonly pixels = pagePixelsOf(this.page); private readonly items = this.annotation.select( (annotation) => annotation.listPageItems(this.page.ref, this.view()), NO_ITEMS, ); private readonly allTexts = this.annotation.select( (annotation) => annotation.listTextItems(this.page.ref, this.view()), NO_TEXTS, ); private readonly activeToolId = this.interaction.select( (interaction) => interaction.getActiveToolId() ?? '', '', ); private readonly urls = signal> | null>(null); private readonly shown = createShownUrls(); private readonly appearanceEpoch = this.annotation.select( (annotation) => annotation.getAppearanceEpoch(this.page.ref), '', ); private readonly appearanceScale = this.render.select( (render) => render.getAppearanceScale(this.page.transform().renderScale), 0, ); private readonly bakeScale = computed(() => this.render.capability() ? this.appearanceScale() : this.page.transform().renderScale, ); private readonly editingKey = computed(() => editingTextKeyOf(this.allTexts(), annotationKey)); private readonly lookInjectors = new Map(); protected readonly drawings = computed((): readonly Drawn[] =>{ this.activeToolId(); this.registrations(); const annotation = this.annotation.capability(); const renderers = this.renderers(); const looks = this.looks(); const behaviors = this.behaviors(); const pixels = this.pixels(); const urls = this.urls(); const editingKey = this.editingKey(); const drawings = this.items().map((item): Drawn =>{ const frame = frameInPixels(item.frame, pixels); const state = item.annotation?.appearanceState ?? null; const drawn: Drawn ={ item, frame, shows: pictureOrPainting({ pending: item.source !== 'baked', picture: urls && shownAppearance(urls, item.id, state), version: item.pictureVersion ?? 0, loaded: urls !== null, paint: () => (hasLiveDrawing(item) ? item : null), } ), appearance: urls && bakedAppearanceOf(urls, item.id, state), look: null, owner: null, interactive: false, inert: false, } ; const record = item.annotation; if (!record || !annotation) return drawn; const typing = editingKey !== null && annotationKey(record.ref) === editingKey; const drawing = annotationDrawingOf(record, annotation, renderers, typing); switch (drawing.kind){ case 'native': return{ ...drawn, inert: drawing.inert} ; case 'owned':{ const template = behaviors.find((behavior) => behavior.renderer() === drawing.entry); return template ?{ ...drawn, owner:{ template, annotation: record} } : drawn; } case 'look':{ const template = looks.find((look) => look.renderer() === drawing.entry); if (!template) return drawn; const scaled = drawing.entry.scale !== false; return{ ...drawn, look:{ template, annotation: record, frame: lookFrameOf(frame, scaled), scaled, injector: this.lookInjectorOf(item.id), } , interactive: drawing.interactive, inert: drawing.inert, } ; } } } ); const drawnLooks = new Set(drawings.flatMap((drawn) => (drawn.look ? [drawn.item.id] : []))); for (const id of this.lookInjectors.keys()){ if (!drawnLooks.has(id)) this.lookInjectors.delete(id); } return drawings; } ); private readonly lookScales = computed(() =>{ const scales = new Map(); for (const drawn of this.drawings()){ if (drawn.look) scales.set(drawn.item.id, drawn.look.scaled ? drawn.frame.scale : 1); } return scales; } ); protected readonly texts = computed((): readonly TextItem[] => layerTextBoxesOf(this.allTexts(), this.items(), this.renderers(), annotationKey), ); protected readonly textOutline = computed( () => annotationChromePaint(this.chrome.chrome(), this.chrome.accent()).textOutline, ); private readonly imageGhost = this.annotation.select( (annotation) => annotation.getImageGhost(this.page.ref), null, ); private readonly armedStamp = this.annotation.select( (annotation) => annotation.getArmedStamp(), null, Object.is, ); private readonly ghostBucket = computed(() =>{ const ghost = this.imageGhost(); return ghost ? previewBucket(ghost.box.width * this.page.transform().renderScale) : 0; } ); private readonly ghostUrl = signal(null); protected readonly ghost = computed(() =>{ const ghost = this.imageGhost(); const url = this.ghostUrl(); if (!ghost || !url) return null; return{ url, box: rectInPixels(ghost.box, this.pixels()), opacity: ghostOpacity(ghost.opacity), rotation: ghost.rot, } ; } ); constructor(){ paintsPagePart(() => this.page.ref, 'annotations'); this.registerBehaviors(); if (!isPlatformBrowser(inject(PLATFORM_ID))) return; inject(DestroyRef).onDestroy(() => this.shown.release()); this.loadAppearances(); this.loadGhost(); } private lookInjectorOf(id: string): Injector{ let injector = this.lookInjectors.get(id); if (!injector){ const scale = computed(() => this.lookScales().get(id) ?? 1); injector = Injector.create({ providers: [{ provide: EPDF_LOOK_SCALE, useValue: scale} ], parent: this.injector, } ); this.lookInjectors.set(id, injector); } return injector; } private registerBehaviors(): void{ effect((onCleanup) =>{ const annotation = this.annotation.capability(); const renderers = this.renderers(); if (annotation && renderers.length > 0){ onCleanup( untracked(() => registerRendererBehaviors(annotation, renderers, () => untracked(this.activeToolId)), ), ); } this.registrations.update((count) => count + 1); } ); } private loadAppearances(): void{ effect((onCleanup) =>{ const annotation = this.annotation.capability(); const scale = this.bakeScale(); this.appearanceEpoch(); if (!annotation || !scale) return; const page = this.page.ref; onCleanup( untracked(() => loadAppearanceUrls( this.shown, (abort) => annotation.renderAppearances(page, scale, abort), annotationKey, (urls) => this.urls.set(urls), ), ), ); } ); } private loadGhost(): void{ effect((onCleanup) =>{ const annotation = this.annotation.capability(); const bucket = this.ghostBucket(); this.armedStamp(); if (!annotation || !bucket){ this.ghostUrl.set(null); return; } onCleanup( untracked(() => loadObjectUrl( () => annotation.renderArmedStampPreview(bucket), (url) => this.ghostUrl.set(url), ), ), ); } ); } } EpdfAnnotationMenu [ClassDeclaration] (from packages/framework/angular/annotation/src/annotation-menu.ts): @Component({ selector: 'epdf-annotation-menu', imports: [EpdfAnchored], changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, } ) export class EpdfAnnotationMenu{ readonly placement = input('top'); readonly gap = input(15); private readonly annotation = annotationInScope(''); private readonly projection = inject(EPDF_PROJECTOR, { optional: true} ); private readonly selection = this.annotation.select( (annotation) =>{ const anchor = annotation.selection.getAnchor(); if (!anchor) return null; this.projection?.revision(); const view = this.projection?.projector()?.viewEnv(anchor.page); return view ? annotation.getSelectionAnchorIn(view) : anchor; } , null, sameSelectionAnchor, ); protected readonly anchor = computed((): EpdfAnchor | null =>{ const anchor = this.selection(); if (!anchor) return null; return{ page: anchor.page, bounds: anchor.bounds, ...(anchor.rotationHandle ?{ avoid: [anchor.rotationHandle]} :{ } ), } ; } ); constructor(){ if (!this.projection) throw outsideStageError(''); } } EpdfAnnotationRotationBadge [ClassDeclaration] (from packages/framework/angular/annotation/src/annotation-menu.ts): @Component({ selector: 'epdf-annotation-rotation-badge', exportAs: 'epdfAnnotationRotationBadge', imports: [EpdfAnchored, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (shown(); as rotation){ @if (custom(); as custom){ } @else{
{ { rotation.angle} } °
}
} `, } ) export class EpdfAnnotationRotationBadge{ readonly placement = input('right'); readonly gap = input(16); private readonly annotation = annotationInScope(''); private readonly settings = injectChromeSettings(); protected readonly custom = contentChild(EpdfRotationBadgeTemplate); readonly rotation: Signal = this.annotation.select( (annotation) => annotation.selection.getRotationAnchor(), null, sameRotationAnchor, ); protected readonly shown = computed(() =>{ const rotation = this.rotation(); return rotation && (this.custom() || this.settings.chrome().readout.enabled) ? rotation : null; } ); protected readonly anchor = computed((): EpdfAnchor | null =>{ const rotation = this.rotation(); return rotation ?{ page: rotation.page, bounds:{ ...rotation.at, width: 0, height: 0} } : null; } ); protected readonly fontFamily = paintDefault('font-mono'); protected readonly background = computed(() => paint('readout-background', this.settings.chrome().readout.background), ); protected readonly color = computed(() => paint('readout-color', this.settings.chrome().readout.color), ); constructor(){ if (!inject(EPDF_PROJECTOR, { optional: true} )){ throw outsideStageError(''); } } } EpdfAnnotationSelection [InterfaceDeclaration] (from packages/framework/angular/annotation/src/annotation.ts): export interface EpdfAnnotationSelection extends AnnotationSelectionCapability{ readonly properties: Signal; } EpdfAnnotationTemplate [ClassDeclaration] (from packages/framework/angular/annotation/src/templates.ts): @Directive({ selector: 'ng-template[epdfAnnotation]'} ) export class EpdfAnnotationTemplate{ readonly match = input(undefined, { alias: 'epdfAnnotation'} ); readonly interactive = input< AnnotationInteractive, AnnotationInteractive | '' | 'true' | 'false' | null | undefined >(false, { alias: 'epdfAnnotationInteractive', transform: interactiveAttribute} ); readonly scale = input(true, { alias: 'epdfAnnotationScale', transform: booleanAttribute} ); readonly template = inject>(TemplateRef); readonly renderer: Signal = computed(() =>{ const match = this.match(); return match ? lookRendererOf(match, this.interactive(), this.scale()) : null; } ); static ngTemplateContextGuard( _directive: EpdfAnnotationTemplate, context: unknown, ): context is EpdfAnnotationTemplateContext{ return true; } } EpdfAnnotationTemplateContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface EpdfAnnotationTemplateContext{ $implicit: Annotation; annotation: Annotation; frame: AnnotationFrame; native: TemplateRef; appearance:{ url: string} | null; hovered: boolean; selected: boolean; interactive: boolean; } EpdfAnnotationTools [InterfaceDeclaration] (from packages/framework/angular/annotation/src/annotation.ts): export interface EpdfAnnotationTools extends Omit{ defaultsOf(id: string | (() => string)): Signal; propertiesOf(id: string | (() => string)): Signal; readonly defaultsChanged$: Observable; } EpdfAttachment [ClassDeclaration] (from packages/framework/angular/attachment/src/attachment.ts): @Injectable({ providedIn: 'root'} ) export class EpdfAttachment extends pluginService({ name: 'EpdfAttachment', feature: 'withAttachment()', token: AttachmentToken, state: attachmentState, methods: [ 'get', 'select', 'isPending', 'canDelete', 'ensureLoaded', 'refresh', 'create', 'delete', 'download', 'reveal', ], events: ['onChanged', 'onResynced'], } ){ } EpdfCommand [ClassDeclaration] (from packages/framework/angular/commands/src/commands.ts): @Directive({ selector: '[epdfCommand]', exportAs: 'epdfCommand', host:{ '(click)': 'onClick()', '[attr.disabled]': 'enabled() ? null : ""', '[attr.aria-pressed]': 'command().pressable ? active() : null', '[attr.aria-expanded]': 'command().menu ? active() : null', '[attr.title]': 'label() || null', '[hidden]': '!visible()', } , } ) export class EpdfCommand{ readonly id = input.required({ alias: 'epdfCommand'} ); readonly command: Signal = inject(EpdfCommands).commandOf(() => this.id()); readonly label: Signal = computed(() => this.command().label); readonly icon: Signal = computed(() => this.command().icon); readonly shortcutLabel: Signal = computed(() => this.command().shortcutLabel); readonly enabled: Signal = computed(() => this.command().enabled); readonly active: Signal = computed(() => this.command().active); readonly visible: Signal = computed(() => this.command().visible); run(): Promise{ return untracked(this.command).run(); } protected onClick(): void{ this.run().catch(() =>{ } ); } } EpdfCommandShortcuts [ClassDeclaration] (from packages/framework/angular/commands/src/commands.ts): @Directive({ selector: '[epdfCommandShortcuts]'} ) export class EpdfCommandShortcuts{ readonly refused = output(); constructor(){ const element = inject>(ElementRef).nativeElement; const commands = shortcutCommands(injectKernelHost('epdfCommandShortcuts')); if (!isPlatformBrowser(inject(PLATFORM_ID))) return; effect((onCleanup) =>{ const current = commands(); if (!current) return; onCleanup( bindCommandShortcuts(current, { target: element, onRefused: (commandId, refusal) => this.refused.emit({ commandId, refusal} ), } ), ); } ); } } EpdfCommands [ClassDeclaration] (from packages/framework/angular/commands/src/commands.ts): @Injectable({ providedIn: 'root'} ) export class EpdfCommands extends pluginService({ name: 'EpdfCommands', feature: 'withCommands()', token: CommandsToken, methods: [ 'execute', 'canExecute', 'resolveCommand', 'listCommands', 'searchCommands', 'listShortcuts', 'registerCommand', 'registerCommands', 'getCommand', 'hasCommand', 'listCommandIds', 'getDisabledCategories', 'isCategoryDisabled', 'disableCategory', 'enableCategory', 'setDisabledCategories', ], events: ['onExecuted', 'onExecutionFailed'], } ){ commandOf(id: string | (() => string)): Signal{ const idOf = typeof id === 'function' ? id : () => id; const resolved = this.binding.select( (commands) => commands.resolveCommand(idOf()), null, resolvedCommandsEqual, ); const execute = this.binding.method('execute'); return computed(() =>{ const command = resolved(); const requested = idOf(); const commands = this.binding.capability(); if (command === null && commands !== null){ devWarn( `commandOf:${ requested} `, `commandOf(): ${ unknownCommandWarning(requested, commands.listCommandIds())} `, ); } return boundCommandOf(command ?? unregisteredCommand(requested), execute, { isMac: isMacPlatform(), } ); } ); } } EpdfComments [ClassDeclaration] (from packages/framework/angular/annotation/src/comments.ts): @Injectable({ providedIn: 'root'} ) export class EpdfComments extends EpdfPluginService{ constructor(){ super({ name: 'EpdfComments', feature: 'withAnnotation()', token: AnnotationToken} ); } readonly listThreads: CommentsCapability['listThreads'] = this.binding.namespaceMethod( 'comments', 'listThreads', ); readonly getThread: CommentsCapability['getThread'] = this.binding.namespaceMethod( 'comments', 'getThread', ); readonly reply: CommentsCapability['reply'] = this.binding.namespaceMethod('comments', 'reply'); readonly setText: CommentsCapability['setText'] = this.binding.namespaceMethod( 'comments', 'setText', ); readonly setStatus: CommentsCapability['setStatus'] = this.binding.namespaceMethod( 'comments', 'setStatus', ); readonly setMarked: CommentsCapability['setMarked'] = this.binding.namespaceMethod( 'comments', 'setMarked', ); readonly delete: CommentsCapability['delete'] = this.binding.namespaceMethod( 'comments', 'delete', ); readonly deleteThread: CommentsCapability['deleteThread'] = this.binding.namespaceMethod( 'comments', 'deleteThread', ); readonly canReply: CommentsCapability['canReply'] = this.binding.namespaceMethod( 'comments', 'canReply', ); readonly canSetText: CommentsCapability['canSetText'] = this.binding.namespaceMethod( 'comments', 'canSetText', ); readonly canSetStatus: CommentsCapability['canSetStatus'] = this.binding.namespaceMethod( 'comments', 'canSetStatus', ); readonly canSetMarked: CommentsCapability['canSetMarked'] = this.binding.namespaceMethod( 'comments', 'canSetMarked', ); readonly canDelete: CommentsCapability['canDelete'] = this.binding.namespaceMethod( 'comments', 'canDelete', ); readonly canDeleteThread: CommentsCapability['canDeleteThread'] = this.binding.namespaceMethod( 'comments', 'canDeleteThread', ); readonly threadChanged$: Observable = this.binding.stream( (annotation) => annotation.comments.onThreadChanged, ); private readonly scope = injectDocumentScope(); private readonly rawThreads = this.binding.select( (annotation) => annotation.comments.listThreads(), NO_THREADS, ); private readonly pages = this.binding.host.read( (kernel) =>{ const id = this.scope() ?? kernel.documents.getActiveId(); return id ? kernel.documents.listPages(id) : NO_PAGES; } , () => NO_PAGES, ); readonly threads: Signal = computed(() => enrichCommentThreads(this.rawThreads(), this.pages()), ); threadOf( ref: AnnotationRef | null | (() => AnnotationRef | null | undefined), ): Signal{ const refOf = typeof ref === 'function' ? ref : () => ref; const thread = this.binding.select( (annotation) =>{ const member = refOf(); return member ? annotation.comments.getThread(member) : null; } , null, Object.is, ); return computed(() =>{ const found = thread(); if (!found) return null; const root = annotationKey(found.root.ref); return this.threads().find((view) => annotationKey(view.root.ref) === root) ?? null; } ); } } EpdfCustomMetadata [InterfaceDeclaration] (from packages/framework/angular/metadata/src/metadata.ts): export interface EpdfCustomMetadata{ readonly fields: Signal; readonly status: Signal; readonly update: CustomMetadataCapability['update']; readonly refresh: CustomMetadataCapability['refresh']; readonly getSnapshot: CustomMetadataCapability['getSnapshot']; readonly getStatus: CustomMetadataCapability['getStatus']; readonly updated$: Observable; readonly resynced$: Observable; } EpdfDocument [ClassDeclaration] (from packages/framework/angular/runtime/src/services.ts): @Injectable({ providedIn: 'root'} ) export class EpdfDocument extends pluginService({ name: 'EpdfDocument', token: DocumentsToken, state: documentState, methods: [], } ){ readonly pages: Signal = this.binding.select( (documents) => documents.listPages(), NO_PAGES, Object.is, ); } EpdfDocumentGate [ClassDeclaration] (from packages/framework/angular/runtime/src/scope.ts): @Directive({ selector: '[epdfDocumentGate]'} ) export class EpdfDocumentGate{ readonly fallback = input | null | undefined>(null, { alias: 'epdfDocumentGateFallback', } ); readonly locked = input | null | undefined>(null, { alias: 'epdfDocumentGateLocked', } ); readonly error = input | null | undefined>(null, { alias: 'epdfDocumentGateError', } ); static ngTemplateContextGuard( _gate: EpdfDocumentGate, context: unknown, ): context is EpdfDocumentGateContext{ return true; } constructor(){ const document = new CapabilityBinding( injectKernelHost('*epdfDocumentGate'), () => DocumentsToken, injectDocumentScope(), ).select(documentState.read, documentState.empty); const content = inject>(TemplateRef); const container = inject(ViewContainerRef); const changes = inject(ChangeDetectorRef); let shown:{ template: TemplateRef; view: EmbeddedViewRef<{ $implicit: DocumentInfo} >; } | null = null; effect(() =>{ const current = document(); const template = this.templateFor(current, content); untracked(() =>{ if (shown && shown.template === template){ shown.view.context.$implicit = current; shown.view.markForCheck(); return; } container.clear(); shown = template ?{ template, view: container.createEmbeddedView(template, { $implicit: current} )} : null; changes.markForCheck(); } ); } ); } private templateFor( document: DocumentInfo, content: TemplateRef, ): TemplateRef<{ $implicit: DocumentInfo} > | null{ if (document.status === 'ready') return content; const locked = this.locked(); if (document.status === 'locked' && locked) return locked as TemplateRef<{ $implicit: DocumentInfo} >; const failed = this.error(); if (document.status === 'error' && failed) return failed as TemplateRef<{ $implicit: DocumentInfo} >; return (this.fallback() as TemplateRef<{ $implicit: DocumentInfo} > | null | undefined) ?? null; } } EpdfDocumentGateContext [InterfaceDeclaration] (from packages/framework/angular/runtime/src/scope.ts): export interface EpdfDocumentGateContext{ $implicit: DocumentInfo; } EpdfDocumentScope [ClassDeclaration] (from packages/framework/angular/runtime/src/scope.ts): @Directive({ selector: '[epdfDocumentScope]', providers: [{ provide: EPDF_DOCUMENT_SCOPE, useExisting: forwardRef(() => EpdfDocumentScope)} , EPDF_SCOPED_SERVICES, ], } ) export class EpdfDocumentScope implements EpdfDocumentScopeRef{ readonly id = input.required({ alias: 'epdfDocumentScope'} ); } EpdfDocumentScopeRef [InterfaceDeclaration] (from packages/framework/angular/runtime/src/tokens.ts): export interface EpdfDocumentScopeRef{ readonly id: Signal; } EpdfDocuments [ClassDeclaration] (from packages/framework/angular/runtime/src/services.ts): @Injectable({ providedIn: 'root'} ) export class EpdfDocuments extends pluginService({ name: 'EpdfDocuments', token: DocumentsToken, state: documentsState, methods: [ 'open', 'canOpenFiles', 'openAll', 'retry', 'rename', 'unlock', 'close', 'closeAll', 'setActive', 'getActiveId', 'getActive', 'list', 'get', 'has', 'getCount', 'getOrder', 'setOrder', 'move', 'swap', 'download', 'downloadLayer', 'preparePrint', 'print', 'getPrintQuality', 'canDownload', 'canPrint', 'listPages', 'getPage', 'getPageIndex', 'getRevision', ], events: [ 'onOpened', 'onOpenFailed', 'onLocked', 'onClosed', 'onActiveChanged', 'onPagesChanged', 'onUnsavedChangesChanged', ], } ){ } EpdfError [ClassDeclaration] (from packages/framework/angular/runtime/src/errors.ts): export class EpdfError extends Error{ override readonly name = 'EpdfError'; constructor( readonly code: `EPDF-${ number} `, problem: string, ){ super(`${ code} : ${ problem} See ${ ERRORS_PAGE} #${ code.toLowerCase()} `); } } EpdfFailedDocumentContext [InterfaceDeclaration] (from packages/framework/angular/runtime/src/scope.ts): export interface EpdfFailedDocumentContext{ $implicit: FailedDocumentInfo; } EpdfFallback [ClassDeclaration] (from packages/framework/angular/page-view/src/page-view.ts): @Directive({ selector: 'ng-template[epdfFallback]'} ) export class EpdfFallback{ readonly template = inject>(TemplateRef); } EpdfForm [ClassDeclaration] (from packages/framework/angular/form/src/form.ts): @Injectable({ providedIn: 'root'} ) export class EpdfForm extends pluginService({ name: 'EpdfForm', feature: 'withForm()', token: FormToken, state: formState, methods: [ 'getSnapshot', 'getStatus', 'getFormKind', 'list', 'get', 'getFieldForWidget', 'getWidget', 'getValue', 'listWidgets', 'getWidgetAt', 'getSelectedField', 'getFocusedField', 'validate', 'exportValues', 'setValue', 'setValues', 'importValues', 'reset', 'activateWidget', 'focus', 'focusNext', 'export', 'import', 'refresh', 'create', 'duplicate', 'duplicateWidgets', 'update', 'delete', 'removeWidget', 'deleteWidget', 'reorderCalculations', 'repair', 'canRead', 'canFill', 'canDesign', 'canRestoreAttribution', 'canWriteScripts', ], events: [ 'onValueChanged', 'onFieldCreated', 'onFieldUpdated', 'onFieldDeleted', 'onValidationRejected', 'onResynced', 'onFocusChanged', ], } ){ override valueOf(ref: FieldRefSource): Signal{ const refOf = refGetter(ref); return this.binding.select((form) => form.getValue(refOf()), null, Object.is); } controlOf(ref: FieldRefSource): FormControl{ assertInInjectionContext(this.controlOf); const refOf = refGetter(ref); const field = this.binding.select((form) => form.get(refOf()), null, Object.is); const value = this.binding.select( (form) =>{ const current = form.get(refOf()); return current ? (form.exportValues()[current.name] ?? null) : null; } , null, samePlain, ); const fillable = this.binding.select((form) =>{ const current = form.get(refOf()); return current !== null && !current.readOnly && form.canFill(current.ref); } , false); const control = new FormControl(untracked(value)); const show = (plain: FormPlainValue) =>{ if (!samePlain(plain, control.value)) control.setValue(plain, { emitEvent: false} ); } ; effect(() =>{ const plain = value(); untracked(() => show(plain)); } ); effect(() =>{ const enabled = fillable(); untracked(() => enabled ? control.enable({ emitEvent: false} ) : control.disable({ emitEvent: false} ), ); } ); const subscription = control.valueChanges.subscribe((plain) =>{ const name = untracked(field)?.name; if (name === undefined) return; void Promise.resolve() .then(() => this.importValues({ [name]: plain} )) .catch(() => undefined); } ); inject(DestroyRef).onDestroy(() => subscription.unsubscribe()); return control; } } EpdfFormLayer [ClassDeclaration] (from packages/framework/angular/form/src/form-layer.ts): @Component({ selector: 'epdf-form-layer', imports: [ EpdfFieldPictures, FormTextControl, FormToggleControl, FormComboControl, FormListControl, FormButtonControl, FormSignatureControl, ], changeDetection: ChangeDetectionStrategy.OnPush, template: `
@if (active()){ @for (item of widgets(); track item.key + ':' + item.annotObjectNumber){ @switch (item.control){ @case ('text'){
} @case ('toggle'){
} @case ('choice'){ @if (item.kind === 'list'){
} @else{
} } @case ('button'){
} @case ('signature'){
} } } }
`, } ) export class EpdfFormLayer{ private readonly page = injectPage(''); private readonly host = injectKernelHost(''); private bindTo(token: CapabilityToken): CapabilityBinding{ return new CapabilityBinding( this.host, () => token, () => this.page.documentId, ); } private readonly form = this.bindTo(FormHostToken); protected readonly active = this.bindTo(InteractionHostToken).select( (interaction) => interaction.activeToolEnables('form-fill'), false, ); protected readonly widgets = this.form.select( (form) => form.listWidgets(this.page.ref), NO_WIDGETS, ); private readonly settings: Signal = this.host.provides(FormToken) ? this.host.settingsOf(FormToken).current : signal(FORM_DEFAULTS).asReadonly(); protected readonly colors = computed(() =>{ const{ focus, fields} = this.settings(); return formColorsOf({ focus, fields} , this.host.viewerSettings().accent); } ); constructor(){ paintsPagePart(() => (this.form.capability() ? this.page.ref : null), 'formFields'); effect(() =>{ const form = this.form.capability(); if (form) untracked(() => void form.ensureLoaded(this.page.ref)); } ); } } EpdfHandleTemplate [ClassDeclaration] (from packages/framework/angular/annotation/src/templates.ts): @Directive({ selector: 'ng-template[epdfHandle]'} ) export class EpdfHandleTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfHandleTemplate, context: unknown, ): context is EpdfHandleTemplateContext{ return true; } } EpdfHandleTemplateContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface EpdfHandleTemplateContext{ $implicit: HandleProps; } EpdfHistory [ClassDeclaration] (from packages/framework/angular/history/src/history.ts): @Injectable({ providedIn: 'root'} ) export class EpdfHistory extends pluginService({ name: 'EpdfHistory', feature: 'withHistory()', token: HistoryToken, state: historyState, methods: ['undo', 'redo', 'clear', 'getUndoLabel', 'getRedoLabel'], events: ['onUndone', 'onUndoFailed'], } ){ } EpdfI18n [ClassDeclaration] (from packages/framework/angular/i18n/src/i18n.ts): @Injectable({ providedIn: 'root'} ) export class EpdfI18n extends pluginService({ name: 'EpdfI18n', feature: 'withI18n()', token: I18nToken, state: i18nState, methods: [ 't', 'getTranslator', 'hasKey', 'getLocale', 'getDirection', 'listLocales', 'getLoadingLocale', 'setLocale', 'registerLocale', 'addTranslations', ], events: ['onLocaleChanged', 'onLocaleLoadFailed'], } ){ readonly translator: Signal = this.binding.select( (i18n) => i18n.getTranslator(), untranslated, Object.is, ); } EpdfInteraction [ClassDeclaration] (from packages/framework/angular/interaction/src/interaction.ts): @Injectable({ providedIn: 'root'} ) export class EpdfInteraction extends pluginService({ name: 'EpdfInteraction', feature: 'withInteraction()', token: InteractionToken, state: interactionState, methods: [ 'getActiveTool', 'getActiveToolId', 'getDefaultToolId', 'listTools', 'getTool', 'hasTool', 'activateTool', 'activateDefaultTool', 'pushTool', 'popTool', 'setToolCursor', 'registerTool', ], events: ['onToolChanged', 'onGestureStarted', 'onGestureEnded', 'onGestureCancelled'], } ){ overrideCursor(spec: () => ToolCursorSpec | null): void{ const current = computed(spec, { equal: sameSpec} ); effect((onCleanup) =>{ const cursorSpec = current(); const interaction = this.binding.capability(); if (!cursorSpec || !interaction) return; interaction.setToolCursor(cursorSpec.toolId, toolCursorsOf(cursorSpec.cursors)); onCleanup(() => interaction.setToolCursor(cursorSpec.toolId, null)); } ); } } EpdfKernelHost [ClassDeclaration] (from packages/framework/angular/runtime/src/kernel-host.ts): @Injectable() export class EpdfKernelHost{ private readonly setup = inject(EPDF_SETUP); private readonly injector = inject(Injector); readonly browser = isPlatformBrowser(inject(PLATFORM_ID)); private readonly given: Kernel | null = 'kernel' in this.setup.config ? this.setup.config.kernel : null; readonly plugins: readonly AnyPlugin[] = this.given ? [] : this.setup.features.flatMap((feature) => feature.plugins); private readonly kernelState = signal(null); private readonly revisionState = signal(0); private readonly statusState = signal('starting'); private readonly errorState = signal(null); private readonly listeners = new Set<() => void>(); private readonly viewerSettingsBeforeStart = new SettingsBeforeStart({ defaults: VIEWER_DEFAULTS, registered: registeredViewerSettings(this.setup.config), whole: VIEWER_WHOLE_SETTINGS, } ); private readonly pluginSettings = new Map< CapabilityToken, PluginSettingsBinding >(); private readonly pluginSettingsBeforeStart = new Map>(); private engine: Engine | null = null; private ownsEngine = false; private stopListening: (() => void) | null = null; private destroyed = false; readonly kernel: Signal = this.kernelState.asReadonly(); readonly revision: Signal = this.revisionState.asReadonly(); readonly status: Signal = this.given ? this.read( (kernel) => statusOfKernel(kernel.getStatus()), () => 'starting', ) : this.statusState.asReadonly(); readonly error: Signal = this.errorState.asReadonly(); readonly viewerSettings: Signal = this.read( (kernel) => kernel.getSettings(), () => this.viewerSettingsBeforeStart.current(), shallowEqual, ); constructor(){ inject(DestroyRef).onDestroy(() => this.destroy()); const{ config} = this.setup; if ('kernel' in config) this.adopt(config.kernel); if (!this.browser) return; if (!('kernel' in config)) this.start(config); queueMicrotask(() => this.runFeatureSetups()); } read( select: (kernel: Kernel) => R, empty: () => R, equal: (left: R, right: R) => boolean = Object.is, ): Signal{ return computed( () =>{ this.revisionState(); const kernel = this.kernelState(); return kernel ? select(kernel) : empty(); } , { equal} , ); } subscribe(listener: () => void): () => void{ this.listeners.add(listener); return () => this.listeners.delete(listener); } stream(pick: (kernel: Kernel) => EventHook): Observable{ return new Observable((subscriber) =>{ let listening: AbortController | null = null; const listen = () =>{ const kernel = untracked(this.kernelState); if (!kernel || listening) return; listening = new AbortController(); pick(kernel)((event) => subscriber.next(event), { signal: listening.signal} ); } ; const stop = this.subscribe(listen); listen(); return () =>{ stop(); listening?.abort(); } ; } ); } provides(token: CapabilityToken): boolean{ if (token === DocumentsToken) return true; return this.given ? kernelProvides(this.given, token) : this.pluginFor(token) !== null; } hasSettings(token: CapabilityToken): boolean{ return this.given ? kernelSettingsOf(this.given, token) !== null : Boolean(this.pluginFor(token)?.settings); } requireKernel(capability: string, call: string): Kernel{ const kernel = this.kernelState(); if (kernel) return kernel; if (!this.browser) throw onServerError(call); throw new PluginError('not-ready', capability, 'the viewer is still starting'); } updateViewerSettings(change: DeepPartial): void{ const kernel = this.kernelState(); if (kernel) kernel.updateSettings(change); else this.viewerSettingsBeforeStart.update(change); } resetViewerSettings(): void{ const kernel = this.kernelState(); if (kernel) kernel.resetSettings(); else this.viewerSettingsBeforeStart.reset(); } settingsOf(token: CapabilityToken): PluginSettingsBinding{ const known = this.pluginSettings.get(token); if (known) return known as PluginSettingsBinding; const binding = this.given ? this.givenSettingsOf(this.given, token) : this.registeredSettingsOf(token); this.pluginSettings.set(token, binding as PluginSettingsBinding); return binding; } private registeredSettingsOf( token: CapabilityToken, ): PluginSettingsBinding{ const plugin = this.pluginFor(token); const declaration = plugin?.settings as SettingsDeclaration | undefined; if (!plugin || !declaration){ throw new PluginError('unsupported', token.name, 'this plugin has no settings'); } const before = new SettingsBeforeStart(declaration); this.pluginSettingsBeforeStart.set(plugin, before as SettingsBeforeStart); const store = (kernel: Kernel) => kernel.settingsOf(token) as unknown as SettingsApi; return{ current: this.read( (kernel) => store(kernel).getSettings(), () => before.current(), shallowEqual, ), update: (change) =>{ const kernel = this.kernelState(); if (kernel) store(kernel).updateSettings(change); else before.update(change); } , reset: () =>{ const kernel = this.kernelState(); if (kernel) store(kernel).resetSettings(); else before.reset(); } , } ; } private givenSettingsOf( kernel: Kernel, token: CapabilityToken, ): PluginSettingsBinding{ const store = kernelSettingsOf(kernel, token); if (!store) throw new PluginError('unsupported', token.name, 'this plugin has no settings'); const current = () => store.getSettings(); return{ current: this.read(current, current, shallowEqual), update: (change) => store.updateSettings(change), reset: () => store.resetSettings(), } ; } private pluginFor(token: CapabilityToken): AnyPlugin | null{ return this.plugins.find((plugin) => plugin.token === token) ?? null; } private adopt(kernel: Kernel): void{ this.stopListening = kernel.subscribe(() => this.changed()); this.kernelState.set(kernel); this.changed(); } private start(config: EmbedPdfConfig): void{ const source = config.engine; const owned = typeof source === 'function'; let made: Engine | Promise; try{ made = owned ? source() : source; } catch (error){ this.fail(error); return; } if (isPromiseLike(made)){ made.then( (engine) => this.attach(config, engine, owned), (error: unknown) => this.fail(error), ); } else{ this.attach(config, made, owned); } } private attach(config: EmbedPdfConfig, engine: Engine, owned: boolean): void{ if (this.destroyed){ if (owned) void engine.destroy(); return; } if (isLocalEngine(engine)) engine.warmup(); let kernel: Kernel; try{ kernel = createKernel({ engine, plugins: [...this.plugins], settings: registeredViewerSettings(config), clock: browserClock(), printer: browserPrinter(), measurer: browserTextMeasurer(), fetch: config.fetch, } ); } catch (error){ if (owned) void engine.destroy(); this.fail(error); return; } this.engine = engine; this.ownsEngine = owned; this.viewerSettingsBeforeStart.applyTo(kernel); for (const [plugin, before] of this.pluginSettingsBeforeStart){ before.applyTo(kernel.settingsOf(plugin.token as CapabilityToken)); } this.stopListening = kernel.subscribe(() => this.changed()); this.kernelState.set(kernel); this.changed(); kernel.start().then( () =>{ if (this.destroyed) return; this.statusState.set('ready'); kernel.documents.openAll(config.initialDocuments ?? []); } , (error: unknown) =>{ if (!this.destroyed) this.fail(error); } , ); } private changed(): void{ this.revisionState.update((revision) => revision + 1); for (const listener of [...this.listeners]) listener(); } private fail(error: unknown): void{ this.errorState.set(error); this.statusState.set('error'); console.error('[embedpdf] the viewer failed to start', error); } private runFeatureSetups(): void{ if (this.destroyed) return; for (const feature of this.setup.features){ if (feature.setup) runInInjectionContext(this.injector, feature.setup); } } private destroy(): void{ if (this.destroyed) return; this.destroyed = true; this.stopListening?.(); this.listeners.clear(); if (this.given) return; const kernel = this.kernelState(); const engine = this.engine; const owned = this.ownsEngine; if (kernel){ void kernel.destroy().then(() =>{ if (owned && engine) void engine.destroy(); } ); } } } EpdfLink [ClassDeclaration] (from packages/framework/angular/link/src/link.ts): @Injectable({ providedIn: 'root'} ) export class EpdfLink extends pluginService({ name: 'EpdfLink', feature: 'withLink()', token: LinkToken, methods: [ 'listLinks', 'getLink', 'getLinkAt', 'readAllLinks', 'ensureLoaded', 'isLoaded', 'getStatus', 'activate', 'activateAt', 'resolve', 'getLabel', ], events: ['onActivated', 'onLoaded'], } ){ constructor(){ super(); registerWebsiteOpener( new CapabilityBinding( this.binding.host, () => LinkHostToken, injectDocumentScope(), ).capability, ); } } EpdfLinkLayer [ClassDeclaration] (from packages/framework/angular/link/src/link-layer.ts): @Component({ selector: 'epdf-link-layer', imports: [NgTemplateOutlet, EpdfLinkPress], changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (items().length > 0){
@for (item of items(); track item.link.id){ }
} `, } ) export class EpdfLinkLayer{ private readonly page = injectPage(''); private readonly host = injectKernelHost(''); private readonly enclosingStage = inject(EpdfStage, { optional: true} ); protected readonly custom = contentChild(EpdfLinkTemplate); private bindTo(token: CapabilityToken): CapabilityBinding{ return new CapabilityBinding( this.host, () => token, () => this.page.documentId, ); } private readonly link = this.bindTo(LinkHostToken); private readonly actions = this.bindTo(ActionsToken).capability; private readonly editing = this.bindTo(InteractionHostToken).select( (interaction) => interaction.activeToolEnables('annotation-edit'), false, ); private readonly stage = new CapabilityBinding( this.host, () => this.enclosingStage?.token() ?? StageToken, () => this.page.documentId, ).capability; private readonly links = this.link.select((link) => link.listLinks(this.page.ref), NO_LINKS); private readonly engaged = this.link.select((link) => link.isNavigationEngaged(), false); protected readonly items = computed((): readonly LinkAnchor[] =>{ const link = this.link.capability(); if (!link || !this.engaged()) return []; const transform = this.page.transform(); return navigableLinksOf(this.links(), this.editing()).map((item) => linkAnchorOf(item, transform, (each) => link.getLabel(each)), ); } ); private readonly pump = computed(() =>{ const actions = this.actions(); return actions ? createHoverPump(actions.dispatch) : null; } ); constructor(){ registerWebsiteOpener(this.link.capability); effect(() =>{ const link = this.link.capability(); const page = this.page.ref; if (link) untracked(() => void link.ensureLoaded(page)); } ); } protected follow(event: MouseEvent, item: LinkAnchor): void{ if (item.href && isModifiedClick(event)) return; event.preventDefault(); this.activate(item.link); } protected followByKey(event: KeyboardEvent, link: Link): void{ if (event.key !== 'Enter' && event.key !== ' ') return; event.preventDefault(); this.activate(link); } protected hover(link: Link | null): void{ const pump = this.pump(); if (!link) return pump?.hover(null); hoverLink(pump, link, this.page.ref); } protected notify(link: Link, event: LinkAnchorEvent): void{ sendLinkEvent(this.actions(), link, this.page.ref, event); } private activate(link: Link): void{ const context = linkActivateContextOf(link, this.page.ref, this.stage()); this.link.capability()?.activate(link, context); } } EpdfLinkTemplate [ClassDeclaration] (from packages/framework/angular/link/src/link-layer.ts): @Directive({ selector: 'ng-template[epdfLink]'} ) export class EpdfLinkTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfLinkTemplate, context: unknown, ): context is EpdfLinkTemplateContext{ return true; } } EpdfLinkTemplateContext [InterfaceDeclaration] (from packages/framework/angular/link/src/link-layer.ts): export interface EpdfLinkTemplateContext{ $implicit: Link; native: TemplateRef; } EpdfLockedDocumentContext [InterfaceDeclaration] (from packages/framework/angular/runtime/src/scope.ts): export interface EpdfLockedDocumentContext{ $implicit: LockedDocumentInfo; } EpdfMeasurement [ClassDeclaration] (from packages/framework/angular/measurement/src/measurement.ts): @Injectable({ providedIn: 'root'} ) export class EpdfMeasurement extends pluginService({ name: 'EpdfMeasurement', feature: 'withMeasurement()', token: MeasurementToken, state: measurementState, methods: [ 'listPresets', 'setPreset', 'setScale', 'clearScale', 'startCalibration', 'calibrate', 'dismissCalibration', 'setUnit', 'setAreaUnit', 'setPrecision', 'listUnits', 'listAreaUnits', 'getPageScale', 'ensureLoaded', 'getReadout', 'measureDistance', 'measureArea', 'createMeasurement', 'canCalibrate', 'canMeasure', 'isBusy', 'getCalibrationRequest', 'listLastReports', ], events: [ 'onScaleChanged', 'onCalibrationRequested', 'onCalibrationCompleted', 'onCalibrationDismissed', ], } ){ scaleOf(page: PageInput): Signal; scaleOf(page: PageInput): Signal; scaleOf(page: PageInput): Signal{ const pageOf = typeof page === 'function' ? page : () => page; const scale = this.binding.select( (measurement) =>{ const wanted = pageOf(); return wanted === null ? NO_PAGE_SCALE : measurement.getPageScale(wanted); } , NO_PAGE_SCALE, Object.is, ); return computed(() => (pageOf() === null ? null : scale())); } readoutOf( ref: AnnotationRef | (() => AnnotationRef), ): Signal{ const refOf = typeof ref === 'function' ? ref : () => ref; return this.binding.select( (measurement) => measurement.getReadout(refOf()), NO_READOUT, ); } } EpdfMetadata [ClassDeclaration] (from packages/framework/angular/metadata/src/metadata.ts): @Injectable({ providedIn: 'root'} ) export class EpdfMetadata extends pluginService({ name: 'EpdfMetadata', feature: 'withMetadata()', token: MetadataToken, ensure: metadataState.ensure, methods: ['update', 'refresh', 'ensureLoaded', 'canUpdate', 'getSnapshot', 'getStatus'], events: ['onUpdated', 'onResynced'], } ){ readonly fields: Signal = this.binding.select( (metadata) => metadata.getSnapshot(), null, Object.is, ); readonly status: Signal = this.binding.select( (metadata) => metadata.getStatus(), 'idle', Object.is, ); readonly custom: EpdfCustomMetadata ={ fields: this.binding.select((metadata) => metadata.custom.getSnapshot(), null, Object.is), status: this.binding.select((metadata) => metadata.custom.getStatus(), 'idle', Object.is), update: this.binding.namespaceMethod('custom', 'update'), refresh: this.binding.namespaceMethod('custom', 'refresh'), getSnapshot: this.binding.namespaceMethod('custom', 'getSnapshot'), getStatus: this.binding.namespaceMethod('custom', 'getStatus'), updated$: this.binding.stream((metadata) => metadata.custom.onUpdated), resynced$: this.binding.stream((metadata) => metadata.custom.onResynced), } ; } EpdfOutline [ClassDeclaration] (from packages/framework/angular/outline/src/outline.ts): @Injectable({ providedIn: 'root'} ) export class EpdfOutline extends pluginService({ name: 'EpdfOutline', feature: 'withOutline()', token: OutlineToken, state: outlineState, methods: [ 'get', 'getChildren', 'isExpanded', 'getCurrentViewTarget', 'ensureLoaded', 'refresh', 'expand', 'collapse', 'toggle', 'expandAll', 'collapseAll', 'reveal', 'select', 'activate', 'create', 'update', 'move', 'delete', ], events: ['onChanged', 'onResynced'], } ){ } EpdfPageChrome [ClassDeclaration] (from packages/framework/angular/stage/src/templates.ts): @Directive({ selector: 'ng-template[epdfPageChrome]'} ) export class EpdfPageChrome{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfPageChrome, context: unknown, ): context is EpdfPageTemplateContext{ return true; } } EpdfPageContext [InterfaceDeclaration] (from packages/framework/angular/runtime/src/page-context.ts): export interface EpdfPageContext{ readonly documentId: string; readonly ref: PageRef; readonly pageIndex: Signal; readonly frame: Signal; readonly transform: Signal; readonly view: string; toPagePoint(clientX: number, clientY: number): Point; toClientPoint(point: Point): Point; toClientRect(rect: Rect): Rect; readonly getViewDemand?: () => PageViewDemand; } EpdfPageEdit [ClassDeclaration] (from packages/framework/angular/page-edit/src/page-edit.ts): @Injectable({ providedIn: 'root'} ) export class EpdfPageEdit extends pluginService({ name: 'EpdfPageEdit', feature: 'withPageEdit()', token: PageEditToken, state: pageEditState, methods: [ 'select', 'rotateBy', 'setRotation', 'reorder', 'delete', 'insertBlank', 'insertFromBytes', 'insertFromDocument', 'duplicate', 'extract', 'canEdit', 'canExtract', ], } ){ } EpdfPagePointerSource [ClassDeclaration] (from packages/framework/angular/interaction/src/page-pointer-source.ts): @Component({ selector: 'epdf-page-pointer-source', changeDetection: ChangeDetectionStrategy.OnPush, host:{ style: 'position: absolute; inset: 0; display: block; touch-action: none', '[style.cursor]': 'cursor()', } , template: '', } ) export class EpdfPagePointerSource{ private readonly page = injectPage(''); private readonly interaction = new CapabilityBinding( injectKernelHost(''), () => InteractionHostToken, () => this.page.documentId, ); protected readonly cursor = this.interaction.select( (interaction) => interaction.getCursor(), 'default', ); constructor(){ if (!isPlatformBrowser(inject(PLATFORM_ID))) return; const element = inject>(ElementRef).nativeElement; const page = this.page; effect((onCleanup) =>{ const interaction = this.interaction.capability(); if (!interaction) return; onCleanup( untracked(() => attachPagePointer(element, interaction, () => ({ ref: page.ref, transform: untracked(page.transform), toPagePoint: page.toPagePoint, } )), ), ); } ); } } EpdfPageTemplate [ClassDeclaration] (from packages/framework/angular/stage/src/templates.ts): @Directive({ selector: 'ng-template[epdfPage]'} ) export class EpdfPageTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfPageTemplate, context: unknown, ): context is EpdfPageTemplateContext{ return true; } } EpdfPageTemplateContext [InterfaceDeclaration] (from packages/framework/angular/stage/src/templates.ts): export interface EpdfPageTemplateContext{ $implicit: EpdfPageContext; } EpdfPageView [ClassDeclaration] (from packages/framework/angular/page-view/src/page-view.ts): @Component({ selector: 'epdf-page-view', imports: [NgTemplateOutlet, EpdfPagePointerSource], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: EPDF_DOCUMENT_SCOPE, useFactory: () => inject(EpdfPageView).documentScope} , { provide: EPDF_PAGE, useFactory: () => inject(EpdfPageView).pageContext} , { provide: EPDF_PROJECTOR, useFactory: () => inject(EpdfPageView).projection} , EPDF_SCOPED_SERVICES, ], host:{ style: 'position: relative; display: block', '[style.width.px]': 'shown() ? layout().outer.width : null', '[style.height.px]': 'shown() ? layout().outer.height : null', } , template: ` @if (shown()){
@if (takesPointer()){ }
@if (chromeTemplate(); as chrome){ } } @else if (fallbackTemplate(); as fallback){ } `, } ) export class EpdfPageView{ readonly page = input.required(); readonly documentId = input(undefined); readonly width = input(240); readonly pageFrame = input | null | undefined>(undefined); private readonly host = injectKernelHost(''); private readonly parentScope = inject(EPDF_DOCUMENT_SCOPE, { optional: true, skipSelf: true} ); private readonly content = viewChild>('content'); private readonly chromeDirective = contentChild(EpdfPageChrome); private readonly fallbackDirective = contentChild(EpdfFallback); protected readonly chromeTemplate = computed(() => this.chromeDirective()?.template ?? null); protected readonly fallbackTemplate = computed(() => this.fallbackDirective()?.template ?? null); private readonly activeId = this.host.read( (kernel) => kernel.documents.getActiveId(), () => null, ); private readonly docId = computed( () => this.documentId() ?? this.parentScope?.id() ?? this.activeId(), ); readonly documentScope: EpdfDocumentScopeRef ={ id: this.docId} ; private readonly interaction = new CapabilityBinding( this.host, () => InteractionHostToken, this.docId, ).capability; private readonly entry: Signal = this.host.read( (kernel) =>{ const id = this.docId(); if (!id) return null; const wanted = this.page(); const pages = kernel.documents.listPages(id); const found = typeof wanted === 'number' ? pages[wanted] : pages.find((page) => page.ref.objectNumber === wanted.objectNumber); return found ?? null; } , () => null, ); protected readonly shown = computed(() => this.entry() !== null); protected readonly takesPointer = computed(() => this.interaction() !== null); private readonly pageIndex = computed(() =>{ const wanted = this.page(); return this.entry()?.index ?? (typeof wanted === 'number' ? wanted : 0); } ); private readonly objectNumber = computed(() =>{ const wanted = this.page(); return ( this.entry()?.ref.objectNumber ?? (typeof wanted === 'number' ? wanted + 1 : wanted.objectNumber) ); } ); private readonly pageRef = computed(() => toPageRef(this.objectNumber())); protected readonly frame = computed( (): PageFrame =>{ const{ top = 0, right = 0, bottom = 0, left = 0} = this.pageFrame() ??{ } ; return{ top, right, bottom, left} ; } , { equal: frameEqual} , ); private readonly dpr = isPlatformBrowser(inject(PLATFORM_ID)) ? window.devicePixelRatio || 1 : 1; private readonly geometry = computed( () =>{ const entry = this.entry(); return{ width: entry?.size.width ?? 1, height: entry?.size.height ?? 1, rotation: entry?.rotation ?? 0, userUnit: entry?.userUnit ?? 1, target: this.width(), known: entry !== null, } ; } , { equal: shallowEqual} , ); protected readonly transform: Signal = computed(() =>{ const{ width, height, rotation, userUnit, target, known} = this.geometry(); const page = known ?{ size:{ width, height} , rotation, userUnit} : null; return pageTransform(pageViewTransformInput(page, target, this.dpr)); } ); protected readonly layout = computed(() => pageSurfaceLayout(this.transform(), this.frame())); private readonly look = computed(() => this.host.viewerSettings().page, { equal: shallowEqual, } ); protected readonly shadow = computed(() => paint('page-shadow', this.look().shadow)); protected readonly background = computed(() => paint('page-background', this.look().background)); private readonly viewId = `page-view:${ ++nextViewId} `; readonly pageContext: EpdfPageContext = createPageContext({ documentId: () => this.docId() ?? '', ref: () => this.pageRef(), view: () => this.viewId, pageIndex: this.pageIndex, frame: this.frame, transform: this.transform, getRect: () => this.content()?.nativeElement.getBoundingClientRect() ?? (NO_RECT as DOMRect), } ); protected readonly templateContext: EpdfPageTemplateContext ={ $implicit: this.pageContext} ; readonly projection: EpdfProjectorBinding ={ projector: signal( clientPageProjector(this.pageContext, () => this.content() !== undefined), ).asReadonly(), revision: computed(() => [this.pageRef(), this.transform()]), shownPages: computed(() => new Set([this.objectNumber()])), subscribe: observeClientGeometry, } ; } EpdfPanelToggle [ClassDeclaration] (from packages/framework/angular/shell/src/shell.ts): @Directive({ selector: '[epdfPanelToggle]', exportAs: 'epdfPanelToggle', host:{ '(click)': 'toggle()', '[attr.aria-expanded]': 'isOpen()', } , } ) export class EpdfPanelToggle{ readonly id = input.required({ alias: 'epdfPanelToggle'} ); readonly exclusive = input(undefined, { alias: 'epdfPanelToggleExclusive'} ); private readonly panel = inject(EpdfShell).surface(() => this.id()); readonly isOpen: Signal = this.panel.isOpen; toggle(): void{ const exclusive = this.exclusive(); this.panel.toggle(exclusive === undefined ? undefined :{ exclusive} ); } } EpdfPluginService [ClassDeclaration] (from packages/framework/angular/runtime/src/service.ts): export abstract class EpdfPluginService{ protected readonly binding: CapabilityBinding; protected constructor(spec:{ name: string; feature?: string; token: CapabilityToken; } ){ const host = inject(EpdfKernelHost, { optional: true} ); if (spec.feature && !host?.provides(spec.token)) throw noPluginError(spec.name, spec.feature); if (!host) throw noViewerError(`inject(${ spec.name} )`); this.binding = new CapabilityBinding(host, () => spec.token, injectDocumentScope()); } } EpdfProjectorBinding [InterfaceDeclaration] (from packages/framework/angular/anchored/src/anchored.ts): export interface EpdfProjectorBinding{ readonly projector: Signal; readonly revision: Signal; readonly shownPages: Signal | null>; readonly subscribe?: (callback: () => void) => () => void; } EpdfRedaction [ClassDeclaration] (from packages/framework/angular/redaction/src/redaction.ts): @Injectable({ providedIn: 'root'} ) export class EpdfRedaction extends pluginService({ name: 'EpdfRedaction', feature: 'withRedaction()', token: RedactionToken, state: redactionState, methods: [ 'markSelection', 'markArea', 'markPage', 'markMatches', 'unmark', 'clearPending', 'updateLabel', 'listPending', 'getPending', 'getPendingCount', 'estimateCollateral', 'applyAll', 'apply', 'applyPages', 'canMark', 'canUnmark', 'canUpdateLabel', 'canApply', 'isApplying', 'getLastResult', ], events: ['onApplied', 'onPendingChanged'], } ){ readonly pending: Signal = this.binding.select( (redaction) => redaction.listPending(), NO_MARKS, ); pendingOn(page: PageRef | number | (() => PageRef | number)): Signal{ const pageOf = typeof page === 'function' ? page : () => page; return this.binding.select((redaction) => redaction.listPending({ page: pageOf()} ), NO_MARKS); } } EpdfRender [ClassDeclaration] (from packages/framework/angular/render/src/render.ts): @Injectable({ providedIn: 'root'} ) export class EpdfRender extends pluginService({ name: 'EpdfRender', feature: 'withRender()', token: RenderToken, methods: [ 'canRender', 'renderPage', 'renderThumbnail', 'renderPages', 'getRenderPolicy', 'getRenderEpoch', 'invalidate', 'getPictureState', 'canSnapshot', 'getSnapshot', 'clearSnapshot', ], events: ['onInvalidated', 'onPictureStateChanged', 'onSnapshotChanged'], } ){ } EpdfRenderLayer [ClassDeclaration] (from packages/framework/angular/render/src/render-layer.ts): @Component({ selector: 'epdf-render-layer', imports: [EpdfPainterBox, EpdfTilePlane], changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (painting(); as painter){ } @else{ @if (tiles() && !thumbnail() && paintSettings().tiles && layers(); as drawn){ } } `, } ) export class EpdfRenderLayer{ readonly annotations = input(undefined); readonly formFields = input(undefined); readonly tiles = input(true); readonly thumbnail = input(false, { transform: booleanAttribute} ); private readonly page = injectPage(''); private readonly render = renderOf(this.page, ''); private readonly painter = this.render.select( (render) => render.getPicturePainter(), null, Object.is, ); protected readonly painting = computed(() =>{ const painter = this.painter(); return painter?.paints(this.page.view) ? (painter as PicturePainter) : null; } ); protected readonly paintSettings = this.render.select( (render) => render.getPaintSettings(), NO_PAINT_SETTINGS, Object.is, ); private readonly parts = computed(() => ({ annotations: this.annotations(), formFields: this.formFields(), } )); private readonly painted = injectPaintedParts(() => this.page.ref); private readonly may = this.render.select((render) => render.getLayerRights(), null, Object.is); protected readonly layers = computed(() =>{ if (this.painting()) return null; const painted = this.painted(); const may = this.may(); return painted && may ? pictureLayerOptionsOf(painted, this.parts(), may) : null; } ); private readonly sourceKey = this.render.select( (render) =>{ const layers = this.layers(); return layers ? render.getSourceKey(this.page.ref, { scale: this.page.transform().renderScale, ...(this.thumbnail() ?{ thumbnail: true} :{ } ), ...layers, } ) : null; } , null, Object.is, ); private readonly picture = viewChild>('picture'); private report: OpenPictureReport | null = null; constructor(){ effect(() =>{ const painted = this.painted(); if (this.painting()) return; if (painted && partsDrawnTwice(painted, this.parts()).length > 0){ devWarn( 'render-layer-draws-what-a-layer-paints', ' or [formFields] draws what an ' + ' or an on the page paints too, so it shows ' + 'twice. Leave the input out: the picture leaves out what a layer paints.', ); } } ); if (!isPlatformBrowser(inject(PLATFORM_ID))) return; effect((onCleanup) =>{ const render = this.render.capability(); const element = this.picture()?.nativeElement; const page = this.page.ref; const view = this.page.view; if (!render || !element) return; const report = untracked(() => render.reportPicture(view, page)); this.report = report; const stop = whenPresented(element, () => report.shown()); onCleanup(() =>{ stop(); report.close(); if (this.report === report) this.report = null; } ); } ); effect((onCleanup) =>{ const render = this.render.capability(); const key = this.sourceKey(); const layers = this.layers(); if (!render || key === null || !layers) return; const controller = new AbortController(); let revoke: (() => void) | undefined; onCleanup(() =>{ controller.abort(); revoke?.(); } ); const scale = untracked(() => this.page.transform().renderScale); const asked = untracked(() => (this.thumbnail() ?{ thumbnail: true} :{ } )); void (async () =>{ try{ const image = await render.renderSource(this.page.ref, { scale, ...asked, ...layers, view: this.page.view, signal: controller.signal, } ); const objectUrl = await image.objectUrl().abortWith(controller.signal); if (controller.signal.aborted){ objectUrl.revoke(); return; } const element = this.picture()?.nativeElement; if (!element){ objectUrl.revoke(); return; } revoke = objectUrl.revoke; element.src = objectUrl.url; } catch (error){ if (!controller.signal.aborted) this.report?.failed(error); } } )(); } ); } } EpdfRichTextEditor [ClassDeclaration] (from packages/framework/angular/annotation/src/text-box.ts): @Directive({ selector: '[epdfRichTextEditor]', exportAs: 'epdfRichTextEditor', host:{ '[style]': 'own()?.style ?? null'} , } ) export class EpdfRichTextEditor{ readonly annotation = input.required({ alias: 'epdfRichTextEditor'} ); private readonly page = injectPage('[epdfRichTextEditor]'); private readonly host = annotationHostOf(this.page, '[epdfRichTextEditor]'); private readonly lookScale = inject(EPDF_LOOK_SCALE, { optional: true} ); private readonly view = pageViewOf(this.page); private readonly pixels = pagePixelsOf(this.page); private readonly item = this.host.select( (annotation) => annotation.getTextItem(this.annotation().ref, this.view()), null, ); private readonly scale = computed(() => textBoxEditorScaleOf(this.item(), this.pixels(), this.lookScale?.() ?? 1), ); protected readonly own: Signal = computed(() =>{ const item = this.item(); return item ? ownTextBoxOf(item, this.scale()) : null; } ); readonly editing: Signal = computed(() => this.item()?.editing ?? false); constructor(){ bindTextBoxEditor( inject>(ElementRef).nativeElement, this.host.capability, this.item, computed(() => this.own()?.scale ?? this.scale()), ); injectFontMounts(() => this.item()?.programs ?? []); } } EpdfRotationBadgeTemplate [ClassDeclaration] (from packages/framework/angular/annotation/src/templates.ts): @Directive({ selector: 'ng-template[epdfRotationBadge]'} ) export class EpdfRotationBadgeTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfRotationBadgeTemplate, context: unknown, ): context is EpdfRotationBadgeTemplateContext{ return true; } } EpdfRotationBadgeTemplateContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface EpdfRotationBadgeTemplateContext{ $implicit: AnnotationRotationAnchor; } EpdfRotationHandleTemplate [ClassDeclaration] (from packages/framework/angular/annotation/src/templates.ts): @Directive({ selector: 'ng-template[epdfRotationHandle]'} ) export class EpdfRotationHandleTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfRotationHandleTemplate, context: unknown, ): context is EpdfRotationHandleTemplateContext{ return true; } } EpdfRotationHandleTemplateContext [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface EpdfRotationHandleTemplateContext{ $implicit: RotationHandleProps; } EpdfScrollbar [ClassDeclaration] (from packages/framework/angular/stage/src/scrollbar.ts): @Component({ selector: 'epdf-scrollbar', changeDetection: ChangeDetectionStrategy.OnPush, host:{ role: 'scrollbar', 'data-embedpdf-scrollbar': '', style: 'position: absolute; touch-action: none; user-select: none; transition: opacity 200ms', '[attr.aria-orientation]': "vertical() ? 'vertical' : 'horizontal'", '[attr.aria-valuemin]': '0', '[attr.aria-valuemax]': 'round(layout().maxOffset)', '[attr.aria-valuenow]': 'round(layout().offset)', '[attr.data-axis]': 'axis()', '[attr.data-state]': "shown() ? 'visible' : 'hidden'", '[attr.data-dragging]': "dragging() ? '' : null", '[style.display]': "scrollable() ? 'block' : 'none'", '[style.top.px]': 'vertical() ? 0 : null', '[style.left.px]': 'vertical() ? null : 0', '[style.right.px]': '0', '[style.bottom.px]': '0', '[style.width.px]': 'vertical() ? 12 : null', '[style.height.px]': 'vertical() ? null : 12', '[style.opacity]': 'shown() ? 1 : 0', '[style.pointer-events]': "shown() ? 'auto' : 'none'", '(pointerdown)': 'onTrackDown($event)', '(pointermove)': 'onMove($event)', '(pointerup)': 'endDrag()', '(pointercancel)': 'endDrag()', '(pointerenter)': 'hovered.set(true)', '(pointerleave)': 'hovered.set(false)', } , template: `
`, } ) export class EpdfScrollbar{ readonly axis = input.required(); readonly autoHide = input(1200, { transform: (value) => (value === false || value === 'false' ? false : Number(value)), } ); readonly minThumbSize = input(24); readonly trackPress = input<'page' | 'jump'>('page'); readonly thumbClass = input(null); private readonly stage: EpdfStage; private readonly element = inject>(ElementRef).nativeElement; private readonly trackPx = signal(0); protected readonly dragging = signal(false); protected readonly hovered = signal(false); private readonly active = signal(true); protected readonly vertical = computed(() => this.axis() === 'y'); protected readonly scrollable = computed(() =>{ const metrics = this.stage.scrollMetrics(); return this.vertical() ? metrics.scrollableY : metrics.scrollableX; } ); protected readonly layout = computed(() => scrollbarLayout( this.stage.scrollMetrics(), this.vertical(), this.trackPx(), this.minThumbSize(), ), ); protected readonly shown = computed( () => this.autoHide() === false || this.autoHide() === 0 || this.active() || this.hovered() || this.dragging(), ); protected readonly thumbColor = paintDefault('scrollbar-thumb'); protected readonly round = Math.round; private readonly presses = createScrollbarPresses((dragging) => this.dragging.set(dragging)); constructor(){ const stage = inject(EpdfStage, { optional: true} ); if (!stage) throw outsideStageError(''); this.stage = stage; effect((onCleanup) =>{ this.stage.scrollMetrics(); const hideAfter = this.autoHide(); if (hideAfter === false || hideAfter === 0) return; this.active.set(true); const timer = setTimeout(() => this.active.set(false), hideAfter); onCleanup(() => clearTimeout(timer)); } ); effect((onCleanup) =>{ const vertical = this.vertical(); if (!this.scrollable() || typeof ResizeObserver === 'undefined') return; const measure = () => this.trackPx.set(vertical ? this.element.clientHeight : this.element.clientWidth); const observer = new ResizeObserver(measure); observer.observe(this.element); measure(); onCleanup(() => observer.disconnect()); } ); inject(DestroyRef).onDestroy(() => this.endDrag()); } private track(): ScrollbarTrack{ const vertical = this.vertical(); return{ stage: this.stage, vertical, element: this.element, layout: this.layout(), liveLayout: () => scrollbarLayout(this.stage.scrollMetrics(), vertical, this.trackPx(), this.minThumbSize()), } ; } protected onThumbDown(event: PointerEvent): void{ this.presses.pressThumb(event, this.track()); } protected onTrackDown(event: PointerEvent): void{ this.presses.pressTrack(event, this.track(), this.trackPress()); } protected onMove(event: PointerEvent): void{ this.presses.move(event, this.track()); } protected endDrag(): void{ this.presses.release(); } } EpdfSearch [ClassDeclaration] (from packages/framework/angular/search/src/search.ts): @Injectable({ providedIn: 'root'} ) export class EpdfSearch extends pluginService({ name: 'EpdfSearch', feature: 'withSearch()', token: SearchToken, state: searchState, methods: [ 'search', 'nextHit', 'previousHit', 'goToHit', 'revealActiveHit', 'listHits', 'listPagesWithHits', 'cancel', 'clear', 'refresh', 'findAll', 'canSearch', 'getQuery', 'getStatus', 'getHitCount', 'getActiveHitIndex', 'getActiveHit', 'getProgress', 'getError', ], events: [ 'onStarted', 'onProgressChanged', 'onCompleted', 'onCancelled', 'onFailed', 'onActiveHitChanged', 'onCleared', ], } ){ readonly hits: Signal = this.binding.select( (search) => search.listHits(), NO_HITS, Object.is, ); hitsOn(page: PageRef | number | (() => PageRef | number)): Signal{ const pageOf = typeof page === 'function' ? page : () => page; return this.binding.select((search) => search.listHits({ page: pageOf()} ), NO_HITS, Object.is); } } EpdfSearchLayer [ClassDeclaration] (from packages/framework/angular/search/src/search-layer.ts): @Component({ selector: 'epdf-search-layer', changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (pieces().length > 0){
@for (piece of pieces(); track piece.key){ @if (piece.box; as box){
} @else{ } }
} `, } ) export class EpdfSearchLayer{ private readonly clicks$ = new Subject(); readonly hitClick = outputFromObservable(this.clicks$); private readonly page = injectPage(''); private readonly search = new CapabilityBinding( injectKernelHost(''), () => SearchToken, () => this.page.documentId, ); private readonly hits = this.search.select( (search) => search.listHits({ page: this.page.ref} ), NO_HITS, Object.is, ); private readonly active = this.search.select((search) => search.getActiveHit(), null, Object.is); private readonly highlight = this.search.select( (search) => search.getSettings().highlight, SEARCH_DEFAULTS.highlight, ); private readonly color = computed(() => paint('search-highlight', this.highlight().color)); private readonly activeColor = computed(() => paint('search-highlight-active', this.highlight().activeColor), ); protected readonly blendMode = computed(() => paint('search-blend-mode', this.highlight().blendMode), ); protected readonly pieces = computed((): readonly SearchHighlightPiece[] => searchHighlightsOf(this.hits(), { active: this.active(), page: this.page.transform(), color: this.color(), activeColor: this.activeColor(), } ), ); private readonly clickDetector = createClickDetector(); protected get clickable(): boolean{ return this.clicks$.observed; } protected press(event: PointerEvent): void{ if (this.clickable) this.clickDetector.press(event); } protected click(event: MouseEvent, hit: SearchHit): void{ if (this.clickable && this.clickDetector.isClick(event)) this.clicks$.next(hit); } } EpdfSelection [ClassDeclaration] (from packages/framework/angular/selection/src/selection.ts): @Injectable({ providedIn: 'root'} ) export class EpdfSelection extends pluginService({ name: 'EpdfSelection', feature: 'withSelection()', token: SelectionToken, state: selectionState, methods: [ 'select', 'selectWordAt', 'selectLineAt', 'selectPage', 'selectAll', 'extendTo', 'clear', 'readText', 'readTextInRange', 'listSegments', 'listRects', 'getAnchor', 'getSnapshot', 'getRange', 'listSelectedPages', 'canSelect', 'canCopy', ], events: ['onChanged', 'onCommitted', 'onCleared'], } ){ } EpdfSelectionClipboard [ClassDeclaration] (from packages/framework/angular/selection/src/selection-clipboard.ts): @Directive({ selector: 'epdf-selection-clipboard, [epdfSelectionClipboard]'} ) export class EpdfSelectionClipboard{ readonly prefetch = input(undefined); readonly refused = output(); private readonly selection = new CapabilityBinding( injectKernelHost(''), () => SelectionToken, injectDocumentScope(), ).capability; constructor(){ const host = inject>(ElementRef).nativeElement; if (!isPlatformBrowser(inject(PLATFORM_ID))) return; const target = host.localName === 'epdf-selection-clipboard' ? undefined : host; effect((onCleanup) =>{ const selection = this.selection(); const prefetch = this.prefetch(); if (!selection) return; onCleanup( wireSelectionClipboard(selection, { ...(prefetch === undefined ?{ } :{ prefetch} ), ...(target ?{ target} :{ } ), onRefused: () => this.refused.emit(), } ), ); } ); } } EpdfSelectionHandles [ClassDeclaration] (from packages/framework/angular/selection/src/selection-handles.ts): @Component({ selector: 'epdf-selection-handles', imports: [EpdfSelectionGrip], changeDetection: ChangeDetectionStrategy.OnPush, template: ` @for (handle of handles(); track handle.role){
} `, } ) export class EpdfSelectionHandles{ readonly token = input | undefined>(undefined); protected readonly pad = HANDLE_PAD; protected readonly bar = HANDLE_BAR; protected readonly head = HANDLE_HEAD; protected readonly gripWidth = HANDLE_BAR + 2 * HANDLE_PAD; private readonly host = injectKernelHost(''); private readonly enclosingStage = inject(EpdfStage, { optional: true} ); private readonly projection = inject(EPDF_PROJECTOR, { optional: true} ); private readonly documentId = injectDocumentScope(); private readonly selection = new CapabilityBinding( this.host, () => SelectionHostToken, this.documentId, ); private readonly stage = new CapabilityBinding( this.host, () => this.token() ?? this.enclosingStage?.token() ?? StageToken, this.documentId, ).capability; private readonly selecting = this.selection.select((selection) => selection.isSelecting(), false); private readonly visible = this.selection.select( (selection) => selection.isHighlightVisible(), true, ); private readonly settings = this.selection.select( (selection) => selection.getSettings().handles, SELECTION_DEFAULTS.handles, ); private readonly endpoints = this.selection.select( (selection) => selectionHandleEndpointsOf(selection.getSnapshot()), null, sameSelectionEndpoints, ); private readonly dragging = signal(null); protected readonly color = computed(() => paint('text-selection-handle', this.settings().color ?? this.host.viewerSettings().accent), ); protected readonly shadow = computed(() => paint('text-selection-handle-shadow', this.settings().shadow), ); private readonly overStage = computed(() => this.projection?.projector()?.space === 'overlay'); protected readonly handles = computed((): readonly HandleLayout[] =>{ const stage = this.stage(); const endpoints = this.endpoints(); if (!this.overStage() || !stage || !endpoints || !this.visible()) return NO_HANDLES; if (this.selecting() && !this.dragging()) return NO_HANDLES; this.projection?.revision(); const view = selectionHandleViewOf(stage); return (['start', 'end'] as const).flatMap((role) =>{ const layout = layoutOf(view, endpoints[role], role); return layout ? [layout] : []; } ); } ); protected readonly armStart = () => this.arm('start'); protected readonly armEnd = () => this.arm('end'); constructor(){ if (!this.projection) warnOutsideStage(); effect(() =>{ if (this.projection?.projector()?.space === 'client') warnOutsideStage(); } ); } private arm(role: Role): SelectionGripDrag{ const stage = untracked(this.stage); const endpoints = untracked(this.endpoints); const selection = untracked(this.selection.capability); if (!stage || !endpoints || !selection) return null; const armed = armSelectionHandle(selection, selectionHandleViewOf(stage), endpoints, role); if (!armed) return null; this.dragging.set(role); return{ base: armed.base, session:{ move: armed.drag.move, end: () =>{ armed.drag.end(); this.dragging.set(null); } , } , } ; } } EpdfSelectionLayer [ClassDeclaration] (from packages/framework/angular/selection/src/selection-layer.ts): @Component({ selector: 'epdf-selection-layer', changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (visible() && polygons().length > 0){ @for (points of polygons(); track $index){ } } `, } ) export class EpdfSelectionLayer{ private readonly page = injectPage(''); private readonly host = injectKernelHost(''); private readonly selection = new CapabilityBinding( this.host, () => SelectionHostToken, () => this.page.documentId, ); private readonly segments = this.selection.select( (selection) => selection.listSegments(this.page.ref), NO_SEGMENTS, ); protected readonly visible = this.selection.select( (selection) => selection.isHighlightVisible(), true, ); private readonly color = this.selection.select( (selection) => selection.getSettings().color, null, ); protected readonly polygons = computed(() =>{ const transform = this.page.transform(); return this.segments().map((segment) => svgPoints(quadInPixels(segment.quad, transform))); } ); protected readonly fill = computed(() => paint( 'text-selection', this.color() ?? mixAccent('text-selection', this.host.viewerSettings().accent), ), ); constructor(){ effect(() =>{ const selection = this.selection.capability(); const page = this.page.ref; if (selection) untracked(() => void selection.ensureLoaded(page)); } ); } } EpdfSelectionMenu [ClassDeclaration] (from packages/framework/angular/selection/src/selection-menu.ts): @Component({ selector: 'epdf-selection-menu', imports: [EpdfAnchored], changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, } ) export class EpdfSelectionMenu{ readonly placement = input('top'); readonly gap = input(8); private readonly selection = new CapabilityBinding( injectKernelHost(''), () => SelectionToken, injectDocumentScope(), ); private readonly selecting = this.selection.select((selection) => selection.isSelecting(), false); private readonly settled = this.selection.select( (selection) => selection.getAnchor(), null, samePageBounds, ); protected readonly anchor = computed(() => (this.selecting() ? null : this.settled())); } EpdfShell [ClassDeclaration] (from packages/framework/angular/shell/src/shell.ts): @Injectable({ providedIn: 'root'} ) export class EpdfShell extends pluginService({ name: 'EpdfShell', feature: 'withShell()', token: ShellToken, state: shellState, methods: [ 'isOpen', 'getSurface', 'listOpenSurfaces', 'open', 'close', 'toggle', 'updateSurfaceProps', 'closeAll', 'isMenuOpen', 'listOpenMenus', 'openMenu', 'closeMenu', 'toggleMenu', 'closeAllMenus', 'getSnapshot', 'applySnapshot', ], events: ['onSurfaceOpened', 'onSurfaceClosed', 'onMenuOpened', 'onMenuClosed'], } ){ surface(id: string | (() => string)): EpdfSurface{ const idOf = typeof id === 'function' ? id : () => id; const shell = this.binding.capability; const now = () => untracked(shell); return{ isOpen: this.binding.select((shell) => shell.isOpen(idOf()), false, Object.is), props: this.binding.select( (shell) => shell.getSurface(idOf())?.props ?? NO_PROPS, NO_PROPS, Object.is, ), open: (options) => now()?.open(untracked(idOf), options), close: () => now()?.close(untracked(idOf)), toggle: (options) => now()?.toggle(untracked(idOf), options), } ; } } EpdfSignature [ClassDeclaration] (from packages/framework/angular/signature/src/signature.ts): @Injectable({ providedIn: 'root'} ) export class EpdfSignature extends pluginService({ name: 'EpdfSignature', feature: 'withSignature()', token: SignatureToken, state: signatureState, methods: [ 'getSnapshot', 'getStatus', 'listSignatures', 'listUnsignedFields', 'getSignature', 'listVerdicts', 'getVerdict', 'getProtection', 'getPending', 'isBusy', 'getMode', 'getTarget', 'sign', 'prepareSignature', 'completeSignature', 'cancelPending', 'fillField', 'clearField', 'placeMark', 'setTarget', 'requestInspection', 'refresh', 'validate', 'validateField', 'addValidationInfo', 'analyzeChanges', 'readRevision', 'canSign', 'canFill', 'canCertify', 'canReadRevision', 'canAddValidationInfo', ], events: [ 'onSigned', 'onFilled', 'onCleared', 'onValidated', 'onProtectionChanged', 'onInvalidationPredicted', 'onTargetChanged', 'onSignRequested', 'onInspectionRequested', ], } ){ private readonly stamp = new CapabilityBinding( this.binding.host, () => StampToken, injectDocumentScope(), ); private readonly libraries = this.stamp.select( (stamp) => stamp.listLibraries({ kind: SIGNATURES_LIBRARY_KIND} ), NO_LIBRARIES, ); private readonly assets = this.stamp.select((stamp) => stamp.listAssets(), NO_ASSETS); readonly signerRows: Signal = computed(() => signerRowsOf(this.libraries(), this.assets()), ); } EpdfSnapshotLayer [ClassDeclaration] (from packages/framework/angular/render/src/snapshot-layer.ts): @Component({ selector: 'epdf-snapshot-layer', changeDetection: ChangeDetectionStrategy.OnPush, template: ` @if (pixels(); as box){ } `, } ) export class EpdfSnapshotLayer{ private readonly page = injectPage(''); private readonly host = injectKernelHost(''); private readonly render = new CapabilityBinding( this.host, () => RenderToken, () => this.page.documentId, ); private readonly box = this.render.select((render) => render.getSnapshotBox(this.page.ref), null); private readonly colors = this.render.select( (render) => render.getSettings().snapshot.box, RENDER_DEFAULTS.snapshot.box, ); protected readonly dash = SNAPSHOT_BOX_DASH; protected readonly pixels = computed(() =>{ const box = this.box(); return box && rectInPixels(box, this.page.transform()); } ); protected readonly boxStyle = computed(() => snapshotBoxPaint(this.colors(), this.host.viewerSettings().accent), ); } EpdfSnapshotMenu [ClassDeclaration] (from packages/framework/angular/render/src/snapshot-menu.ts): @Component({ selector: 'epdf-snapshot-menu', imports: [EpdfAnchored], changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, } ) export class EpdfSnapshotMenu{ readonly placement = input('bottom'); readonly gap = input(8); private readonly render = new CapabilityBinding( injectKernelHost(''), () => RenderToken, injectDocumentScope(), ); private readonly snapshot = this.render.select((render) => render.getSnapshot(), null); protected readonly anchor = computed(() =>{ const snapshot = this.snapshot(); return snapshot &&{ page: snapshot.page, bounds: snapshot.rect} ; } ); } EpdfStage [ClassDeclaration] (from packages/framework/angular/stage/src/stage.ts): @Component({ selector: 'epdf-stage', exportAs: 'epdfStage', imports: [EpdfPageSurface], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ EPDF_SCOPED_SERVICES, StageDocument, { provide: EPDF_DOCUMENT_SCOPE, useExisting: StageDocument} , { provide: EpdfStageRef, useExisting: forwardRef(() => EpdfStage)} , { provide: EPDF_PROJECTOR, useFactory: () => inject(EpdfStage).projection} , ], host:{ style: 'position: relative; display: block; overflow: hidden; touch-action: none; ', '[style.cursor]': 'cursor()', } , template: ` @if (pageTemplate(); as template){ @for (visiblePage of pages(); track visiblePage.ref.objectNumber){ } } @if (zoomBox(); as box){ } `, } ) export class EpdfStage extends EpdfStageRef{ readonly token = input(undefined); readonly document = input(undefined); readonly page = input(undefined); readonly pageChange = output(); readonly zoom = input(undefined); readonly zoomChange = output(); private readonly ownDocument = inject(StageDocument); readonly documentScope: EpdfDocumentScopeRef = this.ownDocument; protected readonly hostCapability = this.binding.capability; protected override view(): StageTokenProp{ return this.token() ?? StageToken; } protected override usedAs(): string{ return ''; } protected readonly pages = this.binding.select( (stage) => stage.listVisiblePages(), NO_PAGES, Object.is, ); protected readonly frame = this.binding.select( (stage) => stage.getSettings().pageFrame, NO_FRAME, frameEqual, ); protected readonly documentId = this.host.read( (kernel) => this.documentScope.id() ?? kernel.documents.getActiveId(), () => null, ); protected readonly look = computed(() => this.host.viewerSettings().page, { equal: shallowEqual, } ); protected readonly zoomBox = this.binding.select((stage) => stage.getZoomBox(), null, Object.is); private readonly zoomBoxColors = this.binding.select( (stage) => stage.getSettings().zoomBox, FOLLOW_ACCENT, Object.is, ); protected readonly zoomBoxStyle = computed(() => zoomBoxPaint(this.zoomBoxColors(), this.host.viewerSettings().accent), ); protected readonly zoomBoxDash = ZOOM_BOX_DASH; private readonly pageTemplateDirective = contentChild(EpdfPageTemplate); private readonly chromeTemplateDirective = contentChild(EpdfPageChrome); protected readonly pageTemplate: Signal | null> = computed( () => this.pageTemplateDirective()?.template ?? null, ); protected readonly chromeTemplate: Signal | null> = computed( () => this.chromeTemplateDirective()?.template ?? null, ); private readonly interaction = this.binding.select( (stage) => stage.getSettings().interaction, true, ); private readonly panFallback = this.binding.select( (stage) => stage.getSettings().panFallback, true, ); private readonly zoomGestures = this.binding.select( (stage) => stage.getSettings().zoomGestures, true, ); private readonly hub = new CapabilityBinding( this.host, () => InteractionToken, this.documentScope.id, ).capability; private readonly usesHub = computed(() => this.interaction() && this.hub() !== null); private readonly hubCursor = this.host.read( () => this.hub()?.getCursor() ?? 'default', () => 'default', ); protected readonly cursor = computed(() => (this.usesHub() ? this.hubCursor() : null)); readonly projection: EpdfProjectorBinding ={ projector: computed(() =>{ const stage = this.hostCapability(); return stage ? stageViewProjector(() => stage) : null; } ), revision: this.pages, shownPages: computed( () =>{ const shown = this.pages().map((visible) => visible.ref.objectNumber); return new Set(shown); } , { equal: (left, right) => left.size === right.size && [...left].every((objectNumber) => right.has(objectNumber)), } , ), } ; constructor(){ super(); this.followDocumentInput(); this.followPageAndZoom(); if (isPlatformBrowser(inject(PLATFORM_ID))) this.bindSurface(); } private followDocumentInput(): void{ effect((onCleanup) =>{ const source = this.document(); const kernel = this.host.kernel(); if (!source || !kernel || this.host.status() !== 'ready') return; untracked(() =>{ const cancel = new AbortController(); const opening = kernel.documents.open(source, { signal: cancel.signal} ); let id = kernel.documents.getActiveId(); opening.then( ({ document} ) =>{ id = document.id; if (!cancel.signal.aborted) this.ownDocument.opened.set(document.id); } , () =>{ } , ); onCleanup(() =>{ cancel.abort(); this.ownDocument.opened.set(null); if (id && kernel.documents.has(id)) void kernel.documents.close(id).catch(() =>{ } ); } ); } ); } ); } private followPageAndZoom(): void{ let previous: StageHostCapability | null = null; effect(() =>{ const stage = this.hostCapability(); const page = this.page(); const zoom = this.zoom(); untracked(() =>{ const switched = previous !== null && stage !== null && stage !== previous; previous = stage; if (!stage) return; if (switched){ if (page !== undefined && page !== stage.getCurrentPageIndex()){ this.pageChange.emit(stage.getCurrentPageIndex()); } if (zoom !== undefined && zoom !== stage.getZoomLevel()){ this.zoomChange.emit(stage.getZoomLevel()); } return; } if (page !== undefined && page !== stage.getCurrentPageIndex()) stage.goToPage(page); if (zoom !== undefined && zoom !== stage.getZoomLevel()) stage.zoomTo(zoom); } ); } ); effect((onCleanup) =>{ const stage = this.hostCapability(); if (!stage) return; const offPage = stage.onPageChanged(({ pageIndex} ) => this.pageChange.emit(pageIndex)); const offZoom = stage.onZoomChanged(({ level} ) => this.zoomChange.emit(level)); onCleanup(() =>{ offPage(); offZoom(); } ); } ); } private bindSurface(): void{ const element = inject>(ElementRef).nativeElement; effect((onCleanup) =>{ const stage = this.hostCapability(); const hub = this.hub(); const usesHub = this.usesHub(); const panFallback = this.panFallback(); const zoomGestures = this.zoomGestures(); if (!stage) return; const detachSurface = createStageSurface(element, stage, { hub: usesHub ? hub : null, source: stage.getLensId(), zoomGestures, } ); const offScroll = usesHub && hub ? hub.registerHandler(createScrollHandler(stage, hub, { panFallback} ), { source: stage.getLensId(), } ) : null; const offZoomDrag = usesHub && hub ? hub.registerHandler(createZoomDragHandler(stage, hub), { source: stage.getLensId()} ) : null; onCleanup(() =>{ offZoomDrag?.(); offScroll?.(); detachSurface(); } ); } ); } } EpdfStageRef [ClassDeclaration] (from packages/framework/angular/stage/src/stage-ref.ts): @Injectable({ providedIn: 'root'} ) export class EpdfStageRef{ protected readonly host: EpdfKernelHost = injectKernelHost(this.usedAs()); protected readonly binding = new CapabilityBinding( this.host, () => asHost(this.view()), injectDocumentScope(), ); protected view(): StageTokenProp{ return StageToken; } protected usedAs(): string{ return 'inject(EpdfStageRef)'; } private readonly state = this.binding.select((stage) => stageState.read(stage), stageState.empty); readonly zoomLevel: Signal = computed(() => this.state().zoomLevel); readonly zoomMode = computed(() => this.state().zoomMode); readonly currentPageIndex: Signal = computed(() => this.state().currentPageIndex); readonly currentPage: Signal = computed(() => this.state().currentPage); readonly pageCount: Signal = computed(() => this.state().pageCount); readonly viewRotation = computed(() => this.state().viewRotation); readonly activeRules: Signal = computed(() => this.state().activeRules); readonly settings: Signal = this.binding.select( (stage) => stage.getSettings(), DEFAULT_SETTINGS, ); readonly scrollMetrics: Signal = this.binding.select( (stage) => stage.getScrollMetrics(), NO_SCROLL, Object.is, ); readonly pageChanged$ = this.binding.stream((stage) => stage.onPageChanged); readonly zoomChanged$ = this.binding.stream((stage) => stage.onZoomChanged); readonly cameraChanged$ = this.binding.stream((stage) => stage.onCameraChanged); readonly motionEnded$ = this.binding.stream((stage) => stage.onMotionEnded); readonly viewportChanged$ = this.binding.stream((stage) => stage.onViewportChanged); readonly settingsChanged$ = this.binding.stream((stage) => stage.onSettingsChanged); readonly getCamera = this.binding.method('getCamera'); readonly setCamera = this.binding.method('setCamera'); readonly getViewportSize = this.binding.method('getViewportSize'); readonly getZoomLevel = this.binding.method('getZoomLevel'); readonly getZoomMode = this.binding.method('getZoomMode'); readonly getViewRotation = this.binding.method('getViewRotation'); readonly getCurrentPage = this.binding.method('getCurrentPage'); readonly getCurrentPageIndex = this.binding.method('getCurrentPageIndex'); readonly getPageCount = this.binding.method('getPageCount'); readonly listCurrentItemPages = this.binding.method('listCurrentItemPages'); readonly listCurrentPages = this.binding.method('listCurrentPages'); readonly listVisiblePages = this.binding.method('listVisiblePages'); readonly isPageVisible = this.binding.method('isPageVisible'); readonly getViewpoint = this.binding.method('getViewpoint'); readonly getViewState = this.binding.method('getViewState'); readonly applyViewState = this.binding.method('applyViewState'); readonly isMoving = this.binding.method('isMoving'); readonly stopMotion = this.binding.method('stopMotion'); readonly zoomTo = this.binding.method('zoomTo'); readonly zoomBy = this.binding.method('zoomBy'); readonly zoomIn = this.binding.method('zoomIn'); readonly zoomOut = this.binding.method('zoomOut'); readonly canZoomIn = this.binding.method('canZoomIn'); readonly canZoomOut = this.binding.method('canZoomOut'); readonly fitWidth = this.binding.method('fitWidth'); readonly fitPage = this.binding.method('fitPage'); readonly fitAll = this.binding.method('fitAll'); readonly fitAutomatic = this.binding.method('fitAutomatic'); readonly goToPage = this.binding.method('goToPage'); readonly goToDestination = this.binding.method('goToDestination'); readonly goToFirstPage = this.binding.method('goToFirstPage'); readonly goToLastPage = this.binding.method('goToLastPage'); readonly nextPage = this.binding.method('nextPage'); readonly previousPage = this.binding.method('previousPage'); readonly canGoNext = this.binding.method('canGoNext'); readonly canGoPrevious = this.binding.method('canGoPrevious'); readonly reveal = this.binding.method('reveal'); readonly scrollTo = this.binding.method('scrollTo'); readonly scrollBy = this.binding.method('scrollBy'); readonly panBy = this.binding.method('panBy'); readonly resetView = this.binding.method('resetView'); readonly setViewRotation = this.binding.method('setViewRotation'); readonly rotateViewBy = this.binding.method('rotateViewBy'); readonly getSettings = this.binding.method('getSettings'); readonly updateSettings = this.binding.method('updateSettings'); readonly resetSettings = this.binding.method('resetSettings'); readonly setResponsiveRules = this.binding.method('setResponsiveRules'); readonly listActiveRules = this.binding.method('listActiveRules'); readonly matchesRule = this.binding.method('matchesRule'); readonly getPageAt = this.binding.method('getPageAt'); readonly viewportToPage = this.binding.method('viewportToPage'); readonly pageToViewport = this.binding.method('pageToViewport'); readonly pageRectToViewport = this.binding.method('pageRectToViewport'); readonly getPageBox = this.binding.method('getPageBox'); } EpdfStamp [ClassDeclaration] (from packages/framework/angular/stamp/src/stamp.ts): @Injectable({ providedIn: 'root'} ) export class EpdfStamp extends pluginService({ name: 'EpdfStamp', feature: 'withStamp()', token: StampToken, state: stampState, methods: [ 'listLibraries', 'getLibrary', 'listAssets', 'getAsset', 'getAssetPreview', 'renderAssetPreview', 'getAssetBytes', 'createLibrary', 'updateLibrary', 'deleteLibrary', 'importLibrary', 'exportLibrary', 'createAsset', 'createAssetFromAnnotations', 'updateAsset', 'deleteAsset', 'moveAsset', 'duplicateAsset', 'armAsset', 'disarm', 'getArmedAsset', 'placeAsset', 'placeAssetOnPages', 'canPlace', 'canCreateFromAnnotations', 'canImport', ], events: [ 'onLibraryChanged', 'onLibraryCreated', 'onLibraryUpdated', 'onLibraryDeleted', 'onAssetCreated', 'onAssetUpdated', 'onAssetDeleted', 'onArmChanged', ], } ){ readonly libraries: Signal = this.binding.select( (stamp) => stamp.listLibraries(), NO_LIBRARIES, ); assetsOf( filter?: StampAssetFilter | (() => StampAssetFilter | undefined), ): Signal{ const filterOf = typeof filter === 'function' ? filter : () => filter; return this.binding.select((stamp) => stamp.listAssets(filterOf()), NO_ASSETS); } previewUrlOf(assetId: string | null | (() => string | null)): Signal{ const idOf = typeof assetId === 'function' ? assetId : () => assetId; const preview = this.binding.select( (stamp) =>{ const id = idOf(); return id ? stamp.getAssetPreview(id) : null; } , null, Object.is, ); const url = signal(null); effect((onCleanup) =>{ const picture = preview(); if (!picture){ url.set(null); return; } const objectUrl = objectUrlOf(picture); url.set(objectUrl.url); onCleanup(() => objectUrl.revoke()); } ); return url.asReadonly(); } } EpdfSurface [InterfaceDeclaration] (from packages/framework/angular/shell/src/shell.ts): export interface EpdfSurface{ readonly isOpen: Signal; readonly props: Signal; open(options?: OpenSurfaceOptions): void; close(): void; toggle(options?: OpenSurfaceOptions): void; } EpdfSurfaceFocus [ClassDeclaration] (from packages/framework/angular/shell/src/shell.ts): @Directive({ selector: '[epdfSurfaceFocus]'} ) export class EpdfSurfaceFocus{ readonly id = input.required({ alias: 'epdfSurfaceFocus'} ); readonly select = input(false, { alias: 'epdfSurfaceFocusSelect', transform: booleanAttribute} ); constructor(){ inject(EpdfShell); const element = inject>(ElementRef).nativeElement; const shell = new CapabilityBinding( injectKernelHost('epdfSurfaceFocus'), () => ShellToken, injectDocumentScope(), ); const request = shell.select( (current) => current.getSurface(this.id())?.focusRequest ?? 0, 0, Object.is, ); const follower = createSurfaceFocusFollower(); afterRenderEffect({ write: () =>{ const current = shell.capability(); const value = request(); const select = this.select(); untracked(() => follower.follow(element, current, value, { select} )); } , } ); } } EpdfSvgAttributes [ClassDeclaration] (from packages/framework/angular/runtime/src/svg-shapes.ts): @Directive({ selector: '[epdfSvgAttributes]'} ) export class EpdfSvgAttributes{ readonly attributes = input.required>>({ alias: 'epdfSvgAttributes', } ); constructor(){ const element = inject>(ElementRef).nativeElement; let shown: Readonly> ={ } ; effect(() =>{ const next = this.attributes(); for (const name of Object.keys(shown)){ if (!(name in next)) element.removeAttribute(name); } for (const [name, value] of Object.entries(next)){ if (shown[name] !== value) element.setAttribute(name, String(value)); } shown = next; } ); } } EpdfSvgShapes [ClassDeclaration] (from packages/framework/angular/runtime/src/svg-shapes.ts): @Component({ selector: 'g[epdfSvgShapes]', imports: [EpdfSvgAttributes], changeDetection: ChangeDetectionStrategy.OnPush, template: ` @for (shape of shapes(); track $index){ @switch (shape.tag){ @case ('rect'){ } @case ('ellipse'){ } @case ('line'){ } @case ('path'){ } @case ('polygon'){ } @case ('polyline'){ } @case ('text'){ } @case ('svg'){ } } } `, } ) export class EpdfSvgShapes{ readonly shapes = input.required({ alias: 'epdfSvgShapes'} ); constructor(){ injectFontMounts(() => this.shapes().flatMap((shape) => (shape.program ? [shape.program] : [])), ); } } EpdfTPipe [ClassDeclaration] (from packages/framework/angular/i18n/src/i18n.ts): @Pipe({ name: 'epdfT', pure: false} ) export class EpdfTPipe implements PipeTransform{ private readonly i18n = inject(EpdfI18n); transform(key: string, options?: TranslateOptions): string{ return this.i18n.translator()(key, options); } } EpdfTheme [TypeAliasDeclaration] (from packages/framework/web/src/theme.ts): export type EpdfTheme = Intersection<{ [Name in EpdfSettingVariable]: ThemeBranch< ThemePath, ThemeValue >; } [EpdfSettingVariable] >; EpdfToolbar [ClassDeclaration] (from packages/framework/angular/toolbar/src/toolbar.ts): @Component({ selector: 'epdf-toolbar', imports: [ NgTemplateOutlet, EpdfToolbarLength, EpdfToolbarMoreButton, EpdfToolbarMenu, EpdfToolbarCollapsed, EpdfToolbarGroupTrigger, EpdfToolbarCommandTemplate, EpdfToolbarCollapsedTemplate, EpdfToolbarGroupTriggerTemplate, EpdfToolbarOverflowTriggerTemplate, EpdfToolbarOverflowMenuTemplate, ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: TOOLBAR_LENGTHS, useExisting: forwardRef(() => EpdfToolbar)} ], host:{ role: 'toolbar', '[attr.aria-orientation]': 'orientation()', style: 'position: relative; display: flex; align-items: center; ', '[style.flex-direction]': "orientation() === 'vertical' ? 'column' : 'row'", } , template: `
@for (entry of row().start; track entry.key){ }
@for (entry of row().center; track entry.key){ }
@for (entry of row().end; track entry.key){ } @if (hasOverflow()){ }
@if (entry.kind === 'separator'){ } @else{ } @switch (entry.kind){ @case ('command'){ } @case ('custom'){ } @case ('socket'){ @if (entry.context){ } } @case ('collapsed'){ } @case ('trigger'){ } @case ('separator'){ } } `, } ) export class EpdfToolbar implements ToolbarLengthSink{ readonly bar = input.required(); readonly orientation = input<'horizontal' | 'vertical'>('horizontal'); readonly gap = input(8); readonly separatorWidth = input(1); protected readonly commandTemplate = contentChild(EpdfToolbarCommandTemplate); private readonly customTemplates = contentChildren(EpdfToolbarCustomTemplate); protected readonly collapsedTemplate = contentChild(EpdfToolbarCollapsedTemplate); protected readonly groupTriggerTemplate = contentChild(EpdfToolbarGroupTriggerTemplate); protected readonly separatorTemplate = contentChild(EpdfToolbarSeparatorTemplate); protected readonly overflowTriggerTemplate = contentChild(EpdfToolbarOverflowTriggerTemplate); protected readonly overflowMenuTemplate = contentChild(EpdfToolbarOverflowMenuTemplate); private readonly host = injectKernelHost(''); private readonly commands = inject(EpdfCommands); private readonly registry = new CapabilityBinding( this.host, () => CommandsHostToken, injectDocumentScope(), ).capability; private readonly lengths = createToolbarLengths(); private readonly measureVersion = signal(0); private readonly containerLength = signal(0); private readonly overflowOpen = signal(false); private roving: RovingFocus | null = null; private readonly vertical = computed(() => this.orientation() === 'vertical'); private readonly normalized = computed(() => normalizeBar(this.bar())); private readonly layout = this.host.read( (): ToolbarLayout =>{ this.measureVersion(); const registry = this.registry(); if (!registry) return EMPTY_LAYOUT; return layoutToolbar({ bar: this.normalized(), resolve: (id) => registry.resolveCommand(id), unregistered: unregisteredCommand, execute: (id) => this.execute(id), menuTarget: (id) => registry.getMenuTarget(id), metrics: this.lengths.metrics(this.orientation(), this.gap(), this.separatorWidth()), measureKey: toolbarMeasureKey, containerLength: this.containerLength(), orientation: this.orientation(), } ); } , () => EMPTY_LAYOUT, ); protected readonly hasOverflow = computed(() => this.layout().hasOverflow); protected readonly row = computed((): Row =>{ const [start, center, end] = this.layout().sections; return{ start: this.liveEntries(start), center: this.liveEntries(center), end: this.liveEntries(end), } ; } ); protected readonly measured = computed(() => this.layout().measured.flatMap((part) =>{ const entry = this.entryOf(part, 'measure'); return entry ? [{ key: part.measureKey, entry} ] : []; } ), ); protected readonly overflowTrigger = computed( (): EpdfToolbarOverflowTriggerContext => ({ $implicit: this.overflowOpen(), toggle: () => this.overflowOpen.update((open) => !open), } ), ); protected readonly closedTrigger: EpdfToolbarOverflowTriggerContext ={ $implicit: false, toggle: noop, } ; protected readonly overflowMenu = computed((): EpdfToolbarViewContext =>{ return{ $implicit:{ sections: this.layout().overflow, isOpen: this.overflowOpen(), close: () => this.overflowOpen.set(false), resolve: (id) => this.resolve(id), execute: (id) => this.execute(id), } , } ; } ); protected readonly overflowTriggerKey = toolbarMeasureKey.overflowTrigger; protected readonly paint = TOOLBAR_PAINT; protected readonly sectionStyles = computed(() => this.layout().sections.map((section) =>{ const vertical = this.vertical(); const spacing = section.spacing === 'balance' ? vertical ? ' margin-top: auto; margin-bottom: auto; ' : ' margin-left: auto; margin-right: auto; ' : section.spacing === 'gap' ? vertical ? ` margin-top: ${ this.gap()} px; ` : ` margin-inline-start: ${ this.gap()} px; ` : ''; return ( `display: flex; flex-direction: ${ vertical ? 'column' : 'row'} ; align-items: center; ` + `flex: ${ section.grows ? '1 0 auto' : '0 0 auto'} ; ${ spacing} ` ); } ), ); protected itemStyle(entry: Entry): string{ return (entry.kind === 'custom' || entry.kind === 'socket') && entry.grow ? `display: flex; flex-direction: ${ this.vertical() ? 'column' : 'row'} ; ` + 'align-items: center; flex: 1 0 auto; ' : 'display: contents; '; } protected readonly separatorStyle = computed( () => `${ this.vertical() ? 'height' : 'width'} : 1px; align-self: stretch; ` + 'background: currentColor; opacity: 0.2; ', ); protected readonly measureLayerStyle = computed( () => 'position: absolute; left: 0; top: 0; height: 0; overflow: hidden; visibility: hidden; ' + 'pointer-events: none; display: flex; white-space: nowrap; ' + (this.vertical() ? ' flex-direction: column; align-items: flex-start; ' : ''), ); protected readonly commandStyle = 'display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; ' + `white-space: nowrap; color: inherit; font: inherit; border: 1px solid ${ TOOLBAR_PAINT.border} ; ` + 'border-radius: 4px; '; constructor(){ effect(() =>{ if (!this.hasOverflow()) untracked(() => this.overflowOpen.set(false)); } ); if (!isPlatformBrowser(inject(PLATFORM_ID))) return; const element = inject>(ElementRef).nativeElement; effect((onCleanup) =>{ const orientation = this.orientation(); onCleanup( untracked(() => observeContentLength(element, orientation, (length) => this.containerLength.set(length)), ), ); } ); afterRenderEffect((onCleanup) =>{ const orientation = this.orientation(); const focus = untracked(() => attachToolbarFocus(element, orientation)); this.roving = focus; onCleanup(() =>{ focus.detach(); this.roving = null; } ); } ); afterRenderEffect(() =>{ this.row(); this.hasOverflow(); this.overflowOpen(); untracked(() => this.roving?.refresh()); } ); } reportLength(key: string, length: number): void{ if (this.lengths.report(untracked(this.orientation), key, length)){ this.measureVersion.update((version) => version + 1); } } private resolve(id: string): ResolvedCommand | null{ return untracked(this.registry)?.resolveCommand(id) ?? null; } private execute(id: string): void{ this.commands.execute(id).catch(noop); } private customTemplateFor(slot: string): EpdfToolbarCustomTemplate | undefined{ return this.customTemplates().find((template) => template.slot() === slot); } private liveEntries(section: LiveSection | undefined): Entry[]{ const entries: Entry[] = []; section?.groups.forEach((group, index) =>{ if (index > 0) entries.push({ kind: 'separator', key: `separator:${ group.id} `} ); for (const part of group.parts){ const entry = this.entryOf(part, 'live'); if (entry) entries.push(entry); } } ); return entries; } private entryOf(part: ToolbarPart, layer: 'live' | 'measure'): Entry | null{ const key = part.measureKey; switch (part.kind){ case 'command': return{ kind: 'command', key, context:{ $implicit: part.command, variant: part.variant, run: part.run} , } ; case 'custom':{ const custom = this.customTemplateFor(part.name); if (custom){ return{ kind: 'custom', key, template: custom.template, context:{ $implicit: part.variant, layer, measure: (length) => this.reportLength(key, length), } , grow: part.grow, } ; } if (layer === 'measure') return null; return{ kind: 'socket', key, slot: part.name, context: part.terminal &&{ $implicit: part.terminal, variant: 'icon', run: part.runTerminal, } , grow: part.grow, } ; } case 'collapsed': return{ kind: 'collapsed', key, context:{ $implicit: part.view} } ; case 'disclosure': return{ kind: 'trigger', key, context:{ $implicit: part.view} } ; } } } EpdfToolbarCollapsedTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarCollapsed]'} ) export class EpdfToolbarCollapsedTemplate{ readonly template = inject>>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarCollapsedTemplate, context: unknown, ): context is EpdfToolbarViewContext{ return true; } } EpdfToolbarCommandContext [InterfaceDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export interface EpdfToolbarCommandContext{ $implicit: ResolvedCommand; variant: string; run: () => void; } EpdfToolbarCommandTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarCommand]'} ) export class EpdfToolbarCommandTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarCommandTemplate, context: unknown, ): context is EpdfToolbarCommandContext{ return true; } } EpdfToolbarCustomContext [InterfaceDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export interface EpdfToolbarCustomContext{ $implicit: string; layer: 'live' | 'measure'; measure: (length: number) => void; } EpdfToolbarCustomTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarCustom]'} ) export class EpdfToolbarCustomTemplate{ readonly slot = input.required({ alias: 'epdfToolbarCustom'} ); readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarCustomTemplate, context: unknown, ): context is EpdfToolbarCustomContext{ return true; } } EpdfToolbarGroupTriggerTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarGroupTrigger]'} ) export class EpdfToolbarGroupTriggerTemplate{ readonly template = inject>>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarGroupTriggerTemplate, context: unknown, ): context is EpdfToolbarViewContext{ return true; } } EpdfToolbarOverflowMenuTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarOverflowMenu]'} ) export class EpdfToolbarOverflowMenuTemplate{ readonly template = inject>>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarOverflowMenuTemplate, context: unknown, ): context is EpdfToolbarViewContext{ return true; } } EpdfToolbarOverflowTriggerContext [InterfaceDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export interface EpdfToolbarOverflowTriggerContext{ $implicit: boolean; toggle: () => void; } EpdfToolbarOverflowTriggerTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarOverflowTrigger]'} ) export class EpdfToolbarOverflowTriggerTemplate{ readonly template = inject>(TemplateRef); static ngTemplateContextGuard( _directive: EpdfToolbarOverflowTriggerTemplate, context: unknown, ): context is EpdfToolbarOverflowTriggerContext{ return true; } } EpdfToolbarSeparatorTemplate [ClassDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): @Directive({ selector: 'ng-template[epdfToolbarSeparator]'} ) export class EpdfToolbarSeparatorTemplate{ readonly template = inject>(TemplateRef); } EpdfToolbarViewContext [InterfaceDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export interface EpdfToolbarViewContext{ $implicit: View; } EpdfViewManager [ClassDeclaration] (from packages/framework/angular/view-manager/src/view-manager.ts): @Injectable({ providedIn: 'root'} ) export class EpdfViewManager extends pluginService({ name: 'EpdfViewManager', feature: 'withViewManager()', token: ViewManagerToken, state: viewManagerState, methods: [ 'listPanes', 'getPane', 'getPaneOrder', 'getFocusedPaneId', 'getPaneOfDocument', 'createPane', 'deletePane', 'movePane', 'setFocusedPane', 'splitPane', 'setActiveDocument', 'addDocument', 'removeDocument', 'moveDocumentWithin', 'moveDocumentBetween', ], events: ['onPaneCreated', 'onPaneDeleted', 'onFocusChanged', 'onDocumentMoved'], } ){ } EpdfViewer [ClassDeclaration] (from packages/framework/angular/runtime/src/services.ts): @Injectable({ providedIn: 'root'} ) export class EpdfViewer{ private readonly host = injectKernelHost('inject(EpdfViewer)'); readonly settings: Signal = this.host.viewerSettings; readonly status: Signal = this.host.status; readonly error: Signal = this.host.error; readonly settingsChanged$: Observable> = this.host.stream( (kernel) => kernel.onSettingsChanged, ); updateSettings(changes: DeepPartial): void{ this.host.updateViewerSettings(changes); } resetSettings(): void{ this.host.resetViewerSettings(); } } EpdfViewerStatus [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/config.ts): export type EpdfViewerStatus = 'starting' | 'ready' | 'error'; EventHook [TypeAliasDeclaration] (from packages/core/main/src/event-hook.ts): export type EventHook = ( listener: (event: T) => void, options?:{ signal?: AbortSignal} , ) => Unsubscribe; EventHookSource [InterfaceDeclaration] (from packages/core/main/src/event-hook.ts): export interface EventHookSource{ readonly on: EventHook; emit(event: T): void; destroy(): void; } EventName [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/service.ts): export type EventName ={ [Key in keyof Capability]-?: Key extends `on${ string} ` ? Capability[Key] extends EventHook ? Key : never : never; } [keyof Capability]; EventOrigin [InterfaceDeclaration] (from packages/engine/core/src/events/DocumentEvent.ts): export interface EventOrigin{ kind: 'local' | 'remote'; sessionId: string; subject: string | null; at: string; serverSequence: number | null; transaction?:{ id: string; index: number; count: number} ; undoOf?: string; } ExecuteOptions [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface ExecuteOptions extends OperationOptions{ documentId?: string; args?: unknown; } ExecuteResult [TypeAliasDeclaration] (from packages/plugin/commands/src/contract.ts): export type ExecuteResult = |{ readonly status: 'executed'} |{ readonly status: 'rejected'; readonly reason: 'not-found' | 'disabled' | 'hidden'} ; FORM_DEFAULTS [VariableDeclaration] (from packages/plugin/form/src/contract.ts): FORM_DEFAULTS: FormSettings ={ validation: 'scripts', focus:{ color: null} , fields:{ border: null, background: 'rgb(255 255 255 / 0.92)', color: '#1f2a44'} , fillable: true, } FORM_TOOLS [VariableDeclaration] (from packages/plugin/form/src/tools/definitions.ts): FORM_TOOLS: readonly FormToolDefinition[] = [{ id: 'form-text', fieldKind: 'text', visualKind: 'widget-text', clickCreate:{ width: 160, height: 24} , upright: true, defaults:{ ...FIELD_CHROME, fontSize: 12} , cursor: 'crosshair', } , { id: 'form-checkbox', fieldKind: 'checkbox', visualKind: 'widget-toggle', clickCreate:{ width: 18, height: 18} , upright: true, defaults: FIELD_CHROME, cursor: 'crosshair', } , { id: 'form-radio', fieldKind: 'radio', visualKind: 'widget-radio', clickCreate:{ width: 18, height: 18} , upright: true, defaults: FIELD_CHROME, cursor: 'crosshair', } , { id: 'form-combobox', fieldKind: 'combobox', visualKind: 'widget-choice', clickCreate:{ width: 140, height: 24} , upright: true, defaults:{ ...FIELD_CHROME, fontSize: 12} , cursor: 'crosshair', } , { id: 'form-listbox', fieldKind: 'listbox', visualKind: 'widget-choice', clickCreate:{ width: 140, height: 72} , upright: true, defaults:{ ...FIELD_CHROME, fontSize: 12} , cursor: 'crosshair', } , { id: 'form-button', fieldKind: 'pushbutton', visualKind: 'widget-button', clickCreate:{ width: 100, height: 28} , upright: true, defaults:{ ...FIELD_CHROME, interiorColor: '#e5e7eb', fontSize: 12} , cursor: 'crosshair', } , { id: 'form-signature', fieldKind: 'signature', visualKind: 'widget-box', clickCreate:{ width: 160, height: 48} , upright: true, defaults: FIELD_CHROME, cursor: 'crosshair', } , ] FORM_TOOL_BY_ID [VariableDeclaration] (from packages/plugin/form/src/tools/definitions.ts): FORM_TOOL_BY_ID: ReadonlyMap = new Map( FORM_TOOLS.map((tool) => [tool.id, tool]), ) Face [InterfaceDeclaration] (from packages/plugin/annotation/src/rich-text.ts): export interface Face{ family: string; weight?: number; italic?: boolean; } FailedDocumentInfo [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface FailedDocumentInfo extends DocumentInfo{ readonly status: 'error'; readonly error: PluginErrorInfo; } FeedbackPluginOptions [InterfaceDeclaration] (from packages/plugin/interaction/src/feedback.types.ts): export interface FeedbackPluginOptions{ provider?: PlatformFeedback; } FeedbackToken [VariableDeclaration] (from packages/plugin/interaction/src/feedback.types.ts): FeedbackToken = createCapabilityToken('feedback') FieldLockSpec [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface FieldLockSpec{ action: FieldLockAction; fields: string[]; permission?: DocMdpPermission; } FieldRefSource [TypeAliasDeclaration] (from packages/framework/angular/form/src/form.ts): export type FieldRefSource = FormFieldRef | (() => FormFieldRef); FieldValues [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type FieldValues = Readonly>; FilePickerProvider [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type FilePickerProvider = ( request: FilePromptRequest, ) => Promise; FilePromptRequest [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface FilePromptRequest{ toolId: string; subtype: KindName; accept?: string; page: PageRef; point: Point; } FillableFields [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FillableFields = boolean | readonly FormFieldKind[]; FlagKey [TypeAliasDeclaration] (from packages/core/annotation/src/kinds/define.ts): export type FlagKey = | 'invisible' | 'hidden' | 'print' | 'noZoom' | 'noRotate' | 'noView' | 'readOnly' | 'locked' | 'toggleNoView' | 'lockedContents'; FlowMode [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type FlowMode = 'continuous' | 'paged'; Font [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface Font{ name: FontName; source: FontSource; builtIn: boolean; familyName: string; weight: number; italic: boolean; postScriptName: string | null; canChoose: boolean; restrictions: FontRestriction[]; programs: FontProgram[]; } FontList [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface FontList{ fonts: Font[]; fallbacks: FontName[]; lastResort: FontProgram; } FontName [TypeAliasDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export type FontName = StandardFont | (string &{ } ); FontProgram [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface FontProgram{ displaySha256: string | null; sourceSha256: string | null; embedded: 'whole' | 'subset' | 'none'; format: FontFormat | null; embeddingPermission: FontEmbeddingPermission | null; canDownload: boolean; } FontProgramInfo [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface FontProgramInfo extends FontProgram{ covers: CodePointRange[]; ascent: number; descent: number; } FontResolution [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface FontResolution{ runs: ResolvedFontRun[]; missingCharacters: string[]; } FontResolveRequest [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export interface FontResolveRequest{ annotation?: AnnotationRef; runs: FontResolveRun[]; } FontRestriction [TypeAliasDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export type FontRestriction = | 'subset' | 'not-embedded' | 'preview-and-print' | 'unsupported-format' | 'no-unicode-map' | 'not-served'; FontSource [TypeAliasDeclaration] (from packages/engine/core/src/dto/DocumentFonts.ts): export type FontSource = 'standard' | 'engine' | 'document'; FormBundle [InterfaceDeclaration] (from packages/engine/core/src/transfer/FormBundle.ts): export interface FormBundle{ readonly format: 'embedpdf/form'; readonly version: 1; readonly pages: readonly BundlePage[]; readonly fields: readonly FormBundleField[]; readonly widgets: readonly FormBundleWidget[]; readonly calculationOrder: readonly FormFieldRef[]; readonly resources: Readonly>; } FormCapability [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormCapability extends SettingsApi{ getSnapshot(): FormSnapshot | null; getStatus(): ResourceStatus; getFormKind(): FormKind; list(filter?: FormFilter): readonly FormField[]; get(ref: FormFieldRef): FormField | null; getFieldForWidget(widget: WidgetAddress): FormField | null; getWidget(widget: WidgetAddress): WidgetAnnotation | null; getWidgets(ref: FormFieldRef): readonly WidgetAnnotation[]; getValue(ref: FormFieldRef): FormFieldValue | null; listWidgets(page: PageRef | number): readonly FormWidgetItem[]; getWidgetAt(page: PageRef | number, point:{ x: number; y: number} ): WidgetHit | null; getSelectedField(): FormField | null; getFocusedField(): FormField | null; getFieldSettings(field: FormFieldRef): FormFieldSettings | null; validate(): FormValidation; exportValues(): Readonly>; focus(ref: FormFieldRef, options?: FormFocusOptions): boolean; focusNext(options?: FormFocusNextOptions): boolean; setValue( ref: FormFieldRef, value: FormFieldValue, options?: OperationOptions, ): Promise; setValues( entries: readonly{ readonly ref: FormFieldRef; readonly value: FormFieldValue} [], options?: OperationOptions, ): Promise>; importValues( values: Readonly>, options?: OperationOptions, ): Promise>; reset(refs?: readonly FormFieldRef[], options?: OperationOptions): Promise; activateWidget( widget: AnnotationRef, options?: OperationOptions, ): Promise; export(selection?: FormExportSelection, options?: OperationOptions): Promise; import( bundle: FormBundle, options?: FormImportOptions & OperationOptions & HistoryOptions, ): Promise; refresh(options?: OperationOptions): Promise; create(draft: FormFieldDraft, options?: OperationOptions): Promise; addWidget( ref: FormFieldRef, placement?: Partial, options?: OperationOptions, ): Promise; duplicate( fields: readonly FormFieldRef[], options?: FormDuplicateOptions & OperationOptions, ): Promise; duplicateWidgets( widgets: readonly AnnotationRef[], options?: FormDuplicateOptions & OperationOptions, ): Promise; update( ref: FormFieldRef, patch: FormFieldPatch, options?: OperationOptions, ): Promise; delete(ref: FormFieldRef, options?: OperationOptions): Promise; removeWidget( ref: FormFieldRef, widget: AnnotationRef, options?: OperationOptions, ): Promise; updateWidget( widget: AnnotationRef, patch: WidgetPatch, options?: OperationOptions, ): Promise<{ readonly widget: WidgetAnnotation} >; deleteWidget( widget: AnnotationRef, options?: OperationOptions, ): Promise<{ readonly field: FormField | null} >; reorderCalculations( fields: FormFieldRef[], position: FieldPosition, options?: OperationOptions, ): Promise<{ readonly calculationOrder: readonly FormFieldRef[]} >; repair(options?: FormRepairOptions & OperationOptions): Promise; canRead(): boolean; canFill(field: FormFieldRef): boolean; canDesign(): boolean; canRestoreAttribution(): boolean; canWriteScripts(): boolean; readonly onValueChanged: EventHook; readonly onFieldCreated: EventHook; readonly onFieldUpdated: EventHook; readonly onFieldDeleted: EventHook; readonly onValidationRejected: EventHook; readonly onResynced: EventHook; readonly onFocusChanged: EventHook; } FormCommitResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormCommitResult{ readonly status: FormCommitStatus; readonly scripted: boolean; readonly uiEffects: FormUiEffect[]; readonly diagnostics: ScriptDiagnostic[]; readonly error?: ScriptExecutionError; } FormCommitStatus [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormCommitStatus = 'applied' | 'unchanged' | 'rejected' | 'failed'; FormConfig [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormConfig = DeepPartial; FormDuplicateOptions [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormDuplicateOptions{ readonly page?: PageRef | number; readonly offset?:{ readonly x: number; readonly y: number} ; readonly values?: boolean; } FormDuplicateResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormDuplicateResult{ readonly fields: readonly FormField[]; readonly widgets: readonly WidgetAnnotation[]; readonly dropped: readonly FormImportDrop[]; } FormExportSelection [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormExportSelection{ readonly fields?: readonly FormFieldRef[]; readonly pages?: readonly (PageRef | number)[]; } FormField [TypeAliasDeclaration] (from packages/engine/core/src/forms/field.ts): export type FormField = | TextField | CheckboxField | RadioField | ComboBoxField | ListBoxField | PushButtonField | SignatureField | UnknownField; FormFieldCreatedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFieldCreatedEvent{ readonly field: FormField; readonly origin: EventOrigin; } FormFieldDeletedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFieldDeletedEvent{ readonly ref: FormFieldRef; readonly origin: EventOrigin; } FormFieldDraft [TypeAliasDeclaration] (from packages/engine/core/src/forms/draft.ts): export type FormFieldDraft = | TextFieldDraft | CheckboxFieldDraft | RadioFieldDraft | ComboBoxFieldDraft | ListBoxFieldDraft | PushButtonFieldDraft | SignatureFieldDraft; FormFieldFlagSetting [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormFieldFlagSetting = | 'required' | 'readOnly' | 'noExport' | 'multiline' | 'password' | 'comb' | 'radiosInUnison' | 'noToggleToOff' | 'edit' | 'multiSelect'; FormFieldKind [TypeAliasDeclaration] (from packages/engine/core/src/forms/field.ts): export type FormFieldKind = | 'text' | 'checkbox' | 'radio' | 'combobox' | 'listbox' | 'pushbutton' | 'signature' | 'unknown'; FormFieldPatch [TypeAliasDeclaration] (from packages/engine/core/src/forms/patch.ts): export type FormFieldPatch = | TextFieldPatch | CheckboxFieldPatch | RadioFieldPatch | ComboBoxFieldPatch | ListBoxFieldPatch | PushButtonFieldPatch | SignatureFieldPatch; FormFieldRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/FormFieldRef.ts): export type FormFieldRef = |{ kind: 'objectNumber'; objectNumber: number} |{ kind: 'fqn'; name: string} ; FormFieldResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFieldResult{ readonly field: FormField; } FormFieldSetting [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormFieldSetting = |{ readonly key: 'name' | 'alternateName'; readonly control: 'text'; readonly label: string; readonly labelKey: string; } |{ readonly key: FormFieldFlagSetting; readonly control: 'flag'; readonly label: string; readonly labelKey: string; } |{ readonly key: 'maxLength'; readonly control: 'number'; readonly label: string; readonly labelKey: string; readonly min: number; } |{ readonly key: 'defaultValue'; readonly control: 'text'; readonly label: string; readonly labelKey: string; } |{ readonly key: 'defaultValue'; readonly control: 'choice'; readonly label: string; readonly labelKey: string; readonly options: readonly string[]; readonly free: boolean; } |{ readonly key: 'defaultValue'; readonly control: 'choices'; readonly label: string; readonly labelKey: string; readonly options: readonly string[]; } |{ readonly key: 'options'; readonly control: 'options'; readonly label: string; readonly labelKey: string; } ; FormFieldSettings [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFieldSettings{ readonly properties: readonly FormFieldSetting[]; readonly values: Readonly>; } FormFieldUpdatedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFieldUpdatedEvent{ readonly field: FormField; readonly origin: EventOrigin; } FormFieldValue [TypeAliasDeclaration] (from packages/engine/core/src/forms/value.ts): export type FormFieldValue = |{ value: string | null} |{ checked: boolean} |{ selectedValues: string[]} ; FormFilter [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFilter{ readonly kind?: FormFieldKind; readonly page?: PageRef | number; readonly name?: string; } FormFocusChangedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFocusChangedEvent{ readonly field: FormField | null; readonly widget: AnnotationRef | null; } FormFocusNextOptions [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFocusNextOptions{ from?: FormFieldRef; backward?: boolean; empty?: boolean; wrap?: boolean; } FormFocusOptions [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormFocusOptions{ widget?: WidgetAddress; select?: boolean; } FormImportDrop [InterfaceDeclaration] (from packages/engine/core/src/transfer/formImport.ts): export interface FormImportDrop{ readonly ref: FormFieldRef | null; readonly widget?: AnnotationRef; readonly field?: string; readonly reason: FormImportDropReason; } FormImportDropReason [TypeAliasDeclaration] (from packages/engine/core/src/transfer/formImport.ts): export type FormImportDropReason = | 'name-conflict' | 'no-field' | 'unsupported-kind' | 'script-not-allowed' | 'unsupported-action'; FormImportOptions [InterfaceDeclaration] (from packages/engine/core/src/transfer/formImport.ts): export interface FormImportOptions extends WriteOptions{ readonly pages?: BundleImportPages; readonly attribution?: 'restore' | 'stamp'; readonly values?: boolean; } FormImportResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormImportResult{ readonly fields: readonly FormField[]; readonly refMap: ReadonlyArray<{ readonly from: FormFieldRef; readonly to: FormFieldRef} >; readonly dropped: readonly FormImportDrop[]; } FormKind [TypeAliasDeclaration] (from packages/engine/core/src/forms/snapshot.ts): export type FormKind = 'none' | 'acroform' | 'xfa'; FormPlainValue [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormPlainValue = string | boolean | readonly string[] | null; FormRepairOptions [InterfaceDeclaration] (from packages/engine/core/src/engine/DocumentFormsService.ts): export interface FormRepairOptions extends WriteOptions{ bakeAppearances?: boolean; } FormRepairResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/FormMutationResults.ts): export interface FormRepairResult{ acroformCreated: boolean; fieldsLinked: number; widgetsLinked: number; fieldsUnrepairable: number; appearancesBaked: number; needsAppearancesCleared: boolean; meta: MutationMeta; } FormResetResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormResetResult{ readonly fields: readonly FormField[]; } FormResyncedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormResyncedEvent{ readonly snapshot: FormSnapshot; } FormScriptingController [ClassDeclaration] (from packages/plugin/form/src/scripting/controller.ts): export class FormScriptingController{ private disposed = false; private readonly transactionBudget: ScriptBudget | undefined; constructor(private readonly options: FormScriptingControllerOptions){ this.transactionBudget = options.budget; } destroy(): void{ this.disposed = true; } transaction(body: (scripts: FormScripts) => Promise): Promise{ if (this.disposed) return Promise.reject(new Error('Form scripting controller is disposed')); return this.options.transaction((txn) => body({ commit: (form, ref, value) => this.run(txn, form, ref, value), activate: (form, ref, action) => this.run(txn, form, ref, undefined, action), recalculate: (form) => this.run(txn, form, undefined), } ), ); } async warm(form: FormSnapshot): Promise{ if (this.disposed) return; const budget = this.transactionBudget ?? DEFAULT_SCRIPT_BUDGET; await this.options.transaction((txn) => txn.run( '', { fields: scriptFieldsFromSnapshot(form), event:{ kind: 'name-tree-boot'} } , budget, ), ); } commit(form: FormSnapshot, ref: FormFieldRef, value: FormFieldValue): Promise{ return this.transaction((scripts) => scripts.commit(form, ref, value)); } activate( form: FormSnapshot, ref: FormFieldRef, action: PdfActionTree, ): Promise{ return this.transaction((scripts) => scripts.activate(form, ref, action)); } recalculate(form: FormSnapshot): Promise{ return this.transaction((scripts) => scripts.recalculate(form)); } private async run( txn: ScriptTransaction, snapshot: FormSnapshot, refInput: FormFieldRef | undefined, proposed?: FormFieldValue, activation?: PdfActionTree, ): Promise{ const asked = refInput ?? snapshot.calculationOrder.find( (candidate): candidate is FormFieldRef => candidate !== null && snapshotField(snapshot, candidate) !== undefined, ) ?? snapshot.fields[0]?.ref; if (!asked){ return{ status: 'accepted', effects: [], bootEffects: [], uiEffects: [], diagnostics: []} ; } const target = snapshotField(snapshot, asked); if (!target){ return this.failed([], [], scriptError(`Form field '${ refKey(asked)} ' no longer exists`)); } const ref = target.ref; const original = scriptFieldsFromSnapshot(snapshot); const overlay: Overlay ={ original, fields: cloneFields(original), resetKeys: new Set(), appearances: new Map(), } ; const targetInput = fieldByRef(overlay.fields, ref); if (!targetInput){ return this.failed([], [], scriptError(`Form field '${ refKey(ref)} ' has no script view`)); } const hasProposedValue = proposed !== undefined; let proposedValue: ScriptValue = cloneValue(targetInput.value); if (proposed){ try{ proposedValue = scriptValueFromFormValue(targetInput, proposed); } catch (error){ return this.failed( [], [], scriptError(error instanceof Error ? error.message : String(error)), ); } } const uiEffects: FormUiEffect[] = []; const diagnostics: ScriptDiagnostic[] = []; const meta = this.options.document(); const pageNumber = pageNumberFor(meta, target); const budget = this.transactionBudget ?? DEFAULT_SCRIPT_BUDGET; let executionMs = 0; let aggregateOutputSize = 0; const consume = ( output: ScriptOutput, phase: FormUiEffect['phase'], ): ScriptExecutionError | null =>{ aggregateOutputSize += utf8Length(JSON.stringify(output)); uiEffects.push(...output.uiEffects.map((effect) => ({ ...effect, phase} ))); diagnostics.push(...output.diagnostics); if (aggregateOutputSize > budget.maxOutputBytes){ return{ kind: 'budget', message: `Form script transaction output exceeded ${ budget.maxOutputBytes} bytes`, } ; } return output.error ?? null; } ; const remainingBudget = (): ScriptBudget | null =>{ const remaining = budget.maxExecutionMs - executionMs; return remaining <= 0 ? null :{ ...budget, maxExecutionMs: remaining} ; } ; const world = ( fields: ScriptFieldInput[], event: ScriptWorldInput['event'], ): ScriptWorldInput => ({ fields, pageNumber, event, } ); const run = async ( source: string, input: ScriptWorldInput, ): Promise<{ output?: ScriptOutput; error?: ScriptExecutionError} > =>{ const remaining = remainingBudget(); if (!remaining){ return{ error:{ kind: 'budget', message: 'Form script transaction timed out'} } ; } let output: ScriptOutput; try{ const startedAt = Date.now(); output = await txn.run(source, input, remaining); executionMs += Date.now() - startedAt; } catch (error){ return{ error: scriptError(error instanceof Error ? error.message : String(error)), } ; } const error = consume(output, 'user'); return error ?{ error} :{ output} ; } ; { let boot: ScriptOutput | null = null; try{ boot = await txn.boot(world(overlay.fields, { kind: 'name-tree-boot'} ), budget); } catch (error){ diagnostics.push({ code: 'script-error', message: `Document boot script failed (continuing without it): ${ error instanceof Error ? error.message : String(error)} `, } ); } if (boot){ const bootError = consume(boot, 'boot'); if (!bootError) applyEffects(overlay, boot.formEffects); else{ diagnostics.push({ code: 'script-error', message: `Document boot script failed (continuing without it): ${ bootError.message} `, } ); } } } const bootEffects = canonicalEffects(overlay); if (activation){ let program: string; try{ program = javaScriptProgramFromActionTree(activation); } catch (error){ return this.failed( uiEffects, diagnostics, scriptError(error instanceof Error ? error.message : String(error)), ); } if (program){ const activated = await run( program, world(overlay.fields, { kind: 'widget-activate', target: ref, source: ref, value: targetInput.value, } ), ); if (activated.error) return this.failed(uiEffects, diagnostics, activated.error); applyEffects(overlay, activated.output!.formEffects); } } if (!activation && hasProposedValue && target.actions?.keystroke && target.kind === 'text'){ let program: string; try{ program = javaScriptProgramFromActionTree(target.actions.keystroke); } catch (error){ return this.failed( uiEffects, diagnostics, scriptError(error instanceof Error ? error.message : String(error)), ); } if (program){ const oldValue = String(targetInput.value ?? ''); const typing = await run( program, world(overlay.fields, { kind: 'field-keystroke', target: ref, source: ref, value: oldValue, change: String(proposedValue ?? ''), selStart: 0, selEnd: oldValue.length, willCommit: false, } ), ); if (typing.error && typing.error.kind !== 'exception'){ return this.failed(uiEffects, diagnostics, typing.error); } if (typing.error){ diagnostics.push({ code: 'script-error', message: `Keystroke script failed (kept the typed value): ${ typing.error.message} `, } ); } else{ if (!typing.output!.event.rc){ return this.rejected(bootEffects, uiEffects, diagnostics); } applyEffects(overlay, typing.output!.formEffects); const event = typing.output!.event; const base = String(event.value ?? ''); proposedValue = base.slice(0, event.selStart) + event.change + base.slice(Math.max(event.selStart, event.selEnd)); } const commit = await run( program, world(overlay.fields, { kind: 'field-keystroke', target: ref, source: ref, value: proposedValue, change: '', selStart: 0, selEnd: 0, willCommit: true, } ), ); if (commit.error && commit.error.kind !== 'exception'){ return this.failed(uiEffects, diagnostics, commit.error); } if (commit.error){ diagnostics.push({ code: 'script-error', message: `Keystroke commit script failed (kept the typed value): ${ commit.error.message} `, } ); } else{ if (!commit.output!.event.rc){ return this.rejected(bootEffects, uiEffects, diagnostics); } applyEffects(overlay, commit.output!.formEffects); proposedValue = cloneValue(commit.output!.event.value); } } } if (!activation && hasProposedValue){ targetInput.value = cloneValue(proposedValue); overlay.resetKeys.delete(refKey(ref)); } if (!activation && hasProposedValue && target.actions?.validate){ let program: string; try{ program = javaScriptProgramFromActionTree(target.actions.validate); } catch (error){ return this.failed( uiEffects, diagnostics, scriptError(error instanceof Error ? error.message : String(error)), ); } if (program){ const validation = await run( program, world(overlay.fields, { kind: 'field-validate', target: ref, source: ref, value: proposedValue, willCommit: true, } ), ); if (validation.error && validation.error.kind !== 'exception'){ return this.failed(uiEffects, diagnostics, validation.error); } if (validation.error){ diagnostics.push({ code: 'script-error', message: `Validate script failed (accepted the value): ${ validation.error.message} `, } ); } else{ if (!validation.output!.event.rc){ return this.rejected(bootEffects, uiEffects, diagnostics); } targetInput.value = cloneValue(validation.output!.event.value); applyEffects(overlay, validation.output!.formEffects); } } } const formatRefs: FormFieldRef[] = !activation && hasProposedValue ? [ref] : []; for (const calculationRef of activation ? [] : snapshot.calculationOrder){ if (!calculationRef) continue; const calculated = snapshotField(snapshot, calculationRef); const tree = calculated?.actions?.calculate; if (!calculated || !tree) continue; let program: string; try{ program = javaScriptProgramFromActionTree(tree); } catch (error){ return this.failed( uiEffects, diagnostics, scriptError(error instanceof Error ? error.message : String(error)), ); } const calculatedInput = fieldByRef(overlay.fields, calculationRef); if (program && calculatedInput){ const calculation = await run( program, world(overlay.fields, { kind: 'field-calculate', target: calculationRef, ...(hasProposedValue ?{ source: ref} :{ } ), value: calculatedInput.value, } ), ); if (calculation.error && calculation.error.kind !== 'exception'){ return this.failed(uiEffects, diagnostics, calculation.error); } if (calculation.error){ diagnostics.push({ code: 'script-error', message: `Calculate script failed (field left unchanged): ${ calculation.error.message} `, } ); } else{ applyEffects(overlay, calculation.output!.formEffects); } } if (!formatRefs.some((candidate) => sameRef(candidate, calculationRef))){ formatRefs.push(calculationRef); } } for (const formatRef of formatRefs){ const field = snapshotField(snapshot, formatRef); const tree = field?.actions?.format; const overlayField = fieldByRef(overlay.fields, formatRef); if (!field || !tree || !overlayField) continue; let program: string; try{ program = javaScriptProgramFromActionTree(tree); } catch (error){ return this.failed( uiEffects, diagnostics, scriptError(error instanceof Error ? error.message : String(error)), ); } if (!program) continue; const format = await run( program, world(overlay.fields, { kind: 'field-format', target: formatRef, ...(hasProposedValue ?{ source: ref} :{ } ), value: overlayField.value, } ), ); if (format.error && format.error.kind !== 'exception'){ return this.failed(uiEffects, diagnostics, format.error); } if (format.error){ diagnostics.push({ code: 'script-error', message: `Format script failed (kept the raw value): ${ format.error.message} `, } ); continue; } applyEffects(overlay, format.output!.formEffects); } const effects = canonicalEffects(overlay); if (effects.length + uiEffects.length > budget.maxEffects){ return this.failed(uiEffects, diagnostics, { kind: 'budget', message: `Form script transaction exceeded ${ budget.maxEffects} effects`, } ); } return{ status: 'accepted', effects, bootEffects, uiEffects, diagnostics} ; } private failed( uiEffects: FormUiEffect[], diagnostics: ScriptDiagnostic[], error: ScriptExecutionError, ): FormScriptResult{ return{ status: 'failed', effects: [], bootEffects: [], uiEffects, diagnostics, error} ; } private rejected( bootEffects: FormEffect[], uiEffects: FormUiEffect[], diagnostics: ScriptDiagnostic[], ): FormScriptResult{ return{ status: 'rejected', effects: [], bootEffects, uiEffects, diagnostics} ; } } FormSetValueResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormSetValueResult{ readonly field: FormField; readonly status: FormSetValueStatus; } FormSetValueStatus [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormSetValueStatus = 'applied' | 'unchanged' | 'rejected'; FormSettings [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormSettings{ readonly validation: 'scripts' | 'none'; readonly focus:{ readonly color: string | null; } ; readonly fields:{ readonly border: string | null; readonly background: string; readonly color: string; } ; readonly fillable: FillableFields; } FormSnapshot [InterfaceDeclaration] (from packages/engine/core/src/forms/snapshot.ts): export interface FormSnapshot{ formKind: FormKind; needsAppearances: boolean; fields: FormField[]; widgets: WidgetAnnotation[]; calculationOrder: Array; } FormState [InterfaceDeclaration] (from packages/plugin/form/src/state.ts): export interface FormState{ readonly fields: readonly FormField[]; readonly status: ResourceStatus; readonly formKind: FormKind; readonly selectedField: FormField | null; readonly focusedField: FormField | null; } FormToken [VariableDeclaration] (from packages/plugin/form/src/token.ts): FormToken = createCapabilityToken('form', { hint: `add formPlugin() from '@embedpdf/plugin-form' to your plugins list`, promises:{ setValue: true, setValues: true, importValues: true, reset: true, activateWidget: true, export: true, import: true, refresh: true, create: true, addWidget: true, duplicate: true, duplicateWidgets: true, update: true, delete: true, removeWidget: true, updateWidget: true, deleteWidget: true, reorderCalculations: true, repair: true, } , } ) FormToolDefinition [InterfaceDeclaration] (from packages/plugin/form/src/tools/definitions.ts): export interface FormToolDefinition{ id: string; fieldKind: AuthorableFormKind; visualKind: | 'widget-text' | 'widget-choice' | 'widget-button' | 'widget-toggle' | 'widget-radio' | 'widget-box'; clickCreate: Extract; upright: boolean; defaults: WidgetAppearance; cursor: string; } FormTransfer [VariableDeclaration] (from packages/engine/core/src/transfer/FormTransfer.ts): FormTransfer = bundleCodec({ kind: 'form', keys: FORM_BUNDLE_KEYS, assertManifest: assertFormBundleManifest, } ) FormUiEffect [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type FormUiEffect = ScriptUiEffect &{ phase: 'boot' | 'user'; origin?: ActionOrigin; } ; FormValidation [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormValidation{ readonly valid: boolean; readonly missing: readonly FormField[]; } FormValidationRejectedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormValidationRejectedEvent{ readonly field: FormField; readonly issues: readonly ScriptDiagnostic[]; } FormValueChangedEvent [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormValueChangedEvent{ readonly field: FormField; readonly origin: EventOrigin; } FormWidgetAddResult [InterfaceDeclaration] (from packages/plugin/form/src/contract.ts): export interface FormWidgetAddResult{ readonly field: FormField; readonly widget: WidgetAnnotation; } FormWidgetItem [TypeAliasDeclaration] (from packages/plugin/form/src/read/fill-items.ts): export type FormWidgetItem = FormWidgetItemBase & ( |{ control: 'text'; value: string; multiline: boolean; password: boolean; maxLength: number | null; comb: boolean; } |{ control: 'toggle'; kind: 'checkbox'; checked: boolean; exportValue: string; } |{ control: 'toggle'; kind: 'radio'; checked: boolean; exportValue: string; inGroup: GroupPosition | null; } |{ control: 'choice'; kind: 'combo' | 'list'; edit: boolean; multi: boolean; options: FormFieldOption[]; selected: string[]; } |{ control: 'button'} |{ control: 'signature'; signed: boolean} ); FormWidgetLook [InterfaceDeclaration] (from packages/plugin/form/src/model.ts): export interface FormWidgetLook{ readonly border: string | null; readonly borderWidth: number; readonly borderStyle: 'solid' | 'dashed' | 'beveled' | 'inset' | 'underline'; readonly background: string | null; readonly color: string | null; readonly fontFamily: string | null; readonly fontSize: number | null; readonly textAlign: 'left' | 'center' | 'right'; } FullPageSettings [InterfaceDeclaration] (from packages/plugin/render/src/paint-plan.ts): export interface FullPageSettings{ maxWidth?: number; quantize?: 'exact' | readonly number[]; } Gap [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type Gap = number |{ px: number} ; GestureCancelledEvent [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface GestureCancelledEvent{ readonly toolId: ToolId; readonly page: PageRef | null; readonly pointerType: PointerKind; } GestureEndedEvent [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface GestureEndedEvent{ readonly toolId: ToolId; readonly page: PageRef | null; readonly pointerType: PointerKind; } GestureStartedEvent [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface GestureStartedEvent{ readonly toolId: ToolId; readonly page: PageRef | null; readonly pointerType: PointerKind; } GhostPolicy [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type GhostPolicy = boolean |{ opacity: number} ; GlobalState [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface GlobalState{ readonly core: CoreState; readonly plugins: Readonly>; } GoToDestinationOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface GoToDestinationOptions{ behavior?: ScrollBehaviorKind; } GoToOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface GoToOptions{ behavior?: ScrollBehaviorKind; viewpoint?: Viewpoint; arrivalAlign?: Partial; } GrantOpenRequest [TypeAliasDeclaration] (from packages/engine/core/src/dto/GrantVisitor.ts): export type GrantOpenRequest = |{ readonly kind: 'passphrase'; readonly passphraseProvided: boolean} |{ readonly kind: 'identity'; readonly request: VisitorIdentityRequest} ; GridColumns [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type GridColumns = 'square' | 'auto' | number; GroupDisclosureView [TypeAliasDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export type GroupDisclosureView = GroupDisclosureViewOf; GroupPosition [InterfaceDeclaration] (from packages/plugin/form/src/read/fill-items.ts): export interface GroupPosition{ readonly position: number; readonly size: number; } HANDLE_BAR [VariableDeclaration] (from packages/plugin/selection/src/handles.ts): HANDLE_BAR = 2 HANDLE_HEAD [VariableDeclaration] (from packages/plugin/selection/src/handles.ts): HANDLE_HEAD = 12 HANDLE_PAD [VariableDeclaration] (from packages/plugin/selection/src/handles.ts): HANDLE_PAD = 14 HISTORY_DEFAULTS [VariableDeclaration] (from packages/plugin/history/src/contract.ts): HISTORY_DEFAULTS: HistorySettings ={ limit: 100} HandleProps [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface HandleProps{ readonly at: Point; readonly size: number; readonly rotation: number; readonly kind: HandleRole; readonly active: boolean; } HandleRole [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type HandleRole = 'corner' | 'side' | 'point'; HeldChange [InterfaceDeclaration] (from packages/core/main/src/changes.ts): export interface HeldChange{ readonly open: boolean; readonly change: PendingChange | null; set(ops: readonly ChangeOp[], undo?: readonly PredictedOp[]): void; send(): PendingChange | null; cancel(): void; } HistoryCapability [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryCapability extends SettingsApi{ undo(): void; redo(): void; canUndo(): boolean; canRedo(): boolean; getUndoLabel(): ChangeLabel | null; getRedoLabel(): ChangeLabel | null; clear(): void; readonly onUndone: EventHook; readonly onUndoFailed: EventHook; } HistoryConfig [TypeAliasDeclaration] (from packages/plugin/history/src/contract.ts): export type HistoryConfig = DeepPartial; HistoryOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface HistoryOptions{ readonly history?: false; } HistorySettings [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistorySettings{ readonly limit: number; } HistoryState [InterfaceDeclaration] (from packages/plugin/history/src/state.ts): export interface HistoryState{ readonly canUndo: boolean; readonly canRedo: boolean; readonly undoLabel: ChangeLabel | null; readonly redoLabel: ChangeLabel | null; } HistoryToken [VariableDeclaration] (from packages/plugin/history/src/token.ts): HistoryToken = createCapabilityToken('history', { hint: "add historyPlugin() from '@embedpdf/plugin-history' to your plugins list", } ) HistoryUndoFailedEvent [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryUndoFailedEvent{ readonly label: ChangeLabel; readonly redo: boolean; readonly reason: 'unavailable' | 'refused'; readonly error: PluginError; } HistoryUndoneEvent [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryUndoneEvent{ readonly label: ChangeLabel; readonly redo: boolean; readonly skipped: number; } HoldOptions [InterfaceDeclaration] (from packages/core/main/src/changes.ts): export interface HoldOptions{ readonly merge?: string; } HostClock [InterfaceDeclaration] (from packages/core/main/src/clock.ts): export interface HostClock{ now(): number; after(ms: number, run: () => void): Cancel; nextFrame?(run: (timeMs: number) => void): Cancel; } HostFetch [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type HostFetch = ( url: string, init:{ readonly signal: AbortSignal} , ) => Promise<{ readonly ok: boolean; readonly status: number; arrayBuffer(): Promise; } >; HostFontProgram [InterfaceDeclaration] (from packages/core/main/src/measurer.ts): export interface HostFontProgram{ readonly family: string; readonly weight: number; readonly style: 'normal' | 'italic'; load(): Promise; } HostPrinter [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface HostPrinter{ readonly needsTap?: boolean; stage( sheets: readonly PrintSheet[], options:{ readonly name: string; readonly signal?: AbortSignal} , ): Promise; stagePdf?( pdf: Uint8Array, options:{ readonly name: string; readonly signal?: AbortSignal} , ): Promise; } HostTextMeasurer [InterfaceDeclaration] (from packages/core/main/src/measurer.ts): export interface HostTextMeasurer{ ready(program: HostFontProgram): boolean; refused(program: HostFontProgram): boolean; width(program: HostFontProgram, text: string, rtl: boolean): number; onChange(listener: () => void): () => void; } HoverPump [InterfaceDeclaration] (from packages/plugin/actions/src/hover-pump.ts): export interface HoverPump{ hover(target: HoverTarget | null): void; reset(): void; } HoverTarget [InterfaceDeclaration] (from packages/plugin/actions/src/hover-pump.ts): export interface HoverTarget{ ref: AnnotationRef; page: PageRef; source?: ActionSource; events?:{ enter?: boolean; exit?: boolean} ; } HttpRevocationSourceOptions [InterfaceDeclaration] (from packages/core/signature/src/revocation/http-source.ts): export interface HttpRevocationSourceOptions{ url: string; headers?: Record; fetch?: typeof globalThis.fetch; timeoutMs?: number; retries?: number; } HttpTimestampAuthorityOptions [InterfaceDeclaration] (from packages/core/signature/src/signers/timestamp-http.ts): export interface HttpTimestampAuthorityOptions{ url: string; hash?: Exclude; policy?: string; headers?: Record; fetch?: typeof globalThis.fetch; timeoutMs?: number; retries?: number; } I18N_DEFAULTS [VariableDeclaration] (from packages/plugin/i18n/src/contract.ts): I18N_DEFAULTS: I18nSettings ={ locale: null, fallbackLocale: 'en', locales: NO_LOCALES, loaders: NO_LOADERS, } I18nCapability [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface I18nCapability extends SettingsApi{ t(key: string, options?: TranslateOptions): string; getTranslator(): (key: string, options?: TranslateOptions) => string; hasKey(key: string): boolean; getLocale(): string; getDirection(): TextDirection; listLocales(): readonly LocaleInfo[]; getLoadingLocale(): string | null; setLocale(code: string, options?: OperationOptions): Promise; registerLocale(locale: Locale): Unsubscribe; addTranslations(code: string, translations: TranslationDictionary): void; readonly onLocaleChanged: EventHook; readonly onLocaleLoadFailed: EventHook; } I18nConfig [TypeAliasDeclaration] (from packages/plugin/i18n/src/contract.ts): export type I18nConfig = DeepPartial; I18nSettings [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface I18nSettings{ readonly locale: string | null; readonly fallbackLocale: string; readonly locales: readonly Locale[]; readonly loaders: Readonly>; } I18nState [InterfaceDeclaration] (from packages/plugin/i18n/src/state.ts): export interface I18nState{ readonly locale: string; readonly direction: TextDirection; readonly locales: readonly LocaleInfo[]; readonly loading: string | null; } I18nToken [VariableDeclaration] (from packages/plugin/i18n/src/token.ts): I18nToken = createCapabilityToken('i18n', { hint: `add i18nPlugin() from '@embedpdf/plugin-i18n' to your plugins list`, } ) INITIALS_MARK_NAME [VariableDeclaration] (from packages/plugin/signature/src/contract.ts): INITIALS_MARK_NAME = 'initials' INTERACTION_DEFAULTS [VariableDeclaration] (from packages/plugin/interaction/src/contract.ts): INTERACTION_DEFAULTS: InteractionSettings ={ defaultTool: 'pointer', tools: []} IconAccent [InterfaceDeclaration] (from packages/core/main/src/command-types.ts): export interface IconAccent{ readonly primary?: string; readonly secondary?: string; } Identity [InterfaceDeclaration] (from packages/engine/core/src/auth/scope/types.ts): export interface Identity{ readonly userId?: string; readonly displayName?: string; readonly email?: string; readonly title?: string; readonly organization?: string; readonly organizationalUnit?: string; readonly groupId?: string; } ImageGhost [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ImageGhost{ readonly page: PageRef; readonly box: Rect; readonly rot: number; readonly opacity: number; } ImportLibraryOptions [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface ImportLibraryOptions extends OperationOptions{ id?: string; name?: string; categories?: string[]; assetKind?: StampAssetKind; libraryKind?: StampLibraryKind; assetName?: (pageIndex: number) => string; } Importance [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type Importance = 1 | 2 | 3 | 4 | 5; InitialDocument [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type InitialDocument ={ source: OpenSource; active?: boolean} & Omit< OpenDocumentOptions, 'activate' | 'signal' >; InkAuthoringOptions [InterfaceDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export interface InkAuthoringOptions{ groupStrokesMs?: number; straighten?: InkStraightenOptions; } InteractionCapability [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface InteractionCapability extends SettingsApi{ getActiveTool(): Tool; getActiveToolId(): ToolId; getDefaultToolId(): ToolId; listTools(): readonly Tool[]; getTool(id: ToolId): Tool | null; hasTool(id: ToolId): boolean; canUseTool(id: ToolId): boolean; activateTool(id: ToolId): void; activateDefaultTool(): void; pushTool(id: ToolId): void; popTool(): void; setToolCursor(id: ToolId, cursors: ToolCursors | null): void; registerTool(tool: Tool, options?: RegisterToolOptions): Unsubscribe; readonly onToolChanged: EventHook; readonly onGestureStarted: EventHook; readonly onGestureEnded: EventHook; readonly onGestureCancelled: EventHook; } InteractionConfig [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type InteractionConfig = DeepPartial; InteractionSettings [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface InteractionSettings{ readonly defaultTool: ToolId; readonly tools: readonly Tool[]; } InteractionState [InterfaceDeclaration] (from packages/plugin/interaction/src/state.ts): export interface InteractionState{ readonly activeToolId: ToolId | null; readonly tools: readonly Tool[]; } InteractionToken [VariableDeclaration] (from packages/plugin/interaction/src/token.ts): InteractionToken = createCapabilityToken('interaction', { hint: `add interactionPlugin() from '@embedpdf/plugin-interaction' to your plugins list`, } ) InvalidateOptions [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface InvalidateOptions{ pages?: readonly (PageRef | number)[]; scope?: InvalidateScope; } InvalidateScope [TypeAliasDeclaration] (from packages/plugin/render/src/contract.ts): export type InvalidateScope = 'content' | 'annotations' | 'fields'; Kernel [InterfaceDeclaration] (from packages/core/main/src/kernel.ts): export interface Kernel extends SettingsApi{ readonly engine: Engine; readonly documents: DocumentsCapability; capability(token: CapabilityToken, documentId?: string): T; tryCapability(token: CapabilityToken, documentId?: string): T | null; scopeOf(token: CapabilityToken): PluginScope; settingsOf(token: CapabilityToken): SettingsApi>; subscribe(listener: () => void): Unsubscribe; getState(): GlobalState; getStatus(): KernelStatus; start(): Promise; destroy(): Promise; } KernelStatus [TypeAliasDeclaration] (from packages/core/main/src/kernel.ts): export type KernelStatus = | 'created' | 'starting' | 'started' | 'failed' | 'destroying' | 'destroyed'; LatestCancellation [InterfaceDeclaration] (from packages/core/main/src/lanes.ts): export interface LatestCancellation{ readonly runId: string; readonly reason: string; } LatestLane [InterfaceDeclaration] (from packages/core/main/src/lanes.ts): export interface LatestLane{ readonly running: boolean; run(fn: (run: LatestRun) => Promise, options?: OperationOptions): Promise; cancel(reason?: unknown): void; } LatestRun [InterfaceDeclaration] (from packages/core/main/src/lanes.ts): export interface LatestRun{ readonly id: string; readonly signal: AbortSignal; readonly superseded: boolean; commit(fn: () => void): boolean; } LayoutKind [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type LayoutKind = 'vertical' | 'horizontal' | 'grid'; LengthUnit [TypeAliasDeclaration] (from packages/engine/core/src/measure/units.ts): export type LengthUnit = keyof typeof METRES; LineEnding [TypeAliasDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export type LineEnding = | 'none' | 'square' | 'circle' | 'diamond' | 'open-arrow' | 'closed-arrow' | 'butt' | 'r-open-arrow' | 'r-closed-arrow' | 'slash'; LineEndings [InterfaceDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export interface LineEndings{ start: LineEnding; end: LineEnding; } LineStyle [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type LineStyle = 'solid' | 'dashed'; Link [TypeAliasDeclaration] (from packages/plugin/link/src/contract.ts): export type Link = LinkNavItem; LinkActivateContext [InterfaceDeclaration] (from packages/plugin/link/src/contract.ts): export interface LinkActivateContext{ readonly activate?: PdfActionTree; readonly ref?: AnnotationRef; readonly page?: PageRef; readonly stage?: StageCapability; } LinkActivatedEvent [InterfaceDeclaration] (from packages/plugin/link/src/contract.ts): export interface LinkActivatedEvent{ readonly target: PdfLinkTarget; readonly activation: LinkActivation; } LinkActivation [TypeAliasDeclaration] (from packages/plugin/link/src/contract.ts): export type LinkActivation = |{ status: 'revealed'} |{ status: 'destination'; destination: PageDestination} |{ status: 'uri'; uri: string} |{ status: 'named'; name: string} |{ status: 'reported'; target: PdfLinkTarget} |{ status: 'dispatched'; dispatch: Promise} |{ status: 'none'} ; LinkCapability [InterfaceDeclaration] (from packages/plugin/link/src/contract.ts): export interface LinkCapability{ listLinks(page: PageRef | number): readonly Link[]; getLink(page: PageRef | number, linkId: string): Link | null; getLinkAt(page: PageRef | number, point: Point): Link | null; readAllLinks(options?: OperationOptions): Promise; ensureLoaded(page: PageRef | number, options?: OperationOptions): Promise; isLoaded(page: PageRef | number): boolean; getStatus(page: PageRef | number): ResourceStatus; resolve(target: PdfLinkTarget): LinkResolution; activate(target: PdfLinkTarget | Link, context?: LinkActivateContext): LinkActivation; activateAt( page: PageRef | number, point: Point, context?: LinkActivateContext, ): LinkActivation | null; getLabel(link: Link | PdfLinkTarget): string; readonly onActivated: EventHook; readonly onLoaded: EventHook; } LinkLoadedEvent [InterfaceDeclaration] (from packages/plugin/link/src/contract.ts): export interface LinkLoadedEvent{ readonly page: PageRef; } LinkNavItem [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface LinkNavItem{ readonly id: string; readonly bounds: Rect; readonly target: PdfLinkTarget; readonly attached: boolean; readonly activate?: PdfActionTree; readonly ref?: AnnotationRef; readonly hoverEvents?:{ enter: boolean; exit: boolean} ; } LinkResolution [TypeAliasDeclaration] (from packages/plugin/link/src/contract.ts): export type LinkResolution = |{ kind: 'destination'; destination: PageDestination} |{ kind: 'uri'; uri: string} |{ kind: 'named'; name: string} |{ kind: 'reported'; target: PdfLinkTarget} ; LinkToken [VariableDeclaration] (from packages/plugin/link/src/token.ts): LinkToken = createCapabilityToken('link', { hint: `add linkPlugin() from '@embedpdf/plugin-link' to your plugins list`, promises:{ readAllLinks: true, ensureLoaded: true, } , } ) Locale [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface Locale{ readonly code: string; readonly name: string; readonly direction?: TextDirection; readonly translations: TranslationDictionary; } LocaleChangedEvent [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface LocaleChangedEvent{ readonly locale: string; readonly previousLocale: string; } LocaleInfo [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface LocaleInfo{ readonly code: string; readonly name: string; readonly direction: TextDirection; readonly loaded: boolean; } LocaleLoadFailedEvent [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface LocaleLoadFailedEvent{ readonly locale: string; readonly error: PluginErrorInfo; } LocaleLoader [TypeAliasDeclaration] (from packages/plugin/i18n/src/contract.ts): export type LocaleLoader = () => Promise; LockedDocumentInfo [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface LockedDocumentInfo extends DocumentInfo{ readonly status: 'locked'; readonly passwordProvided: boolean; } LongTermGap [InterfaceDeclaration] (from packages/core/signature/src/long-term.ts): export interface LongTermGap{ certificate: string | null; reason: LongTermGapReason; } LongTermGapReason [TypeAliasDeclaration] (from packages/core/signature/src/long-term.ts): export type LongTermGapReason = 'no-timestamp' | 'untrusted' | 'no-answer' | 'revoked'; LongTermVerdict [InterfaceDeclaration] (from packages/core/signature/src/long-term.ts): export interface LongTermVerdict{ enabled: boolean; provenAt: string | null; expiresAt: string | null; documentTimestampedAt: string | null; missing: LongTermGap[]; } MEASUREMENT_DEFAULTS [VariableDeclaration] (from packages/plugin/measurement/src/contract.ts): MEASUREMENT_DEFAULTS: MeasurementSettings ={ defaultScale: 'metric', presets: DEFAULT_PRESETS, } MIN_DRAG [VariableDeclaration] (from packages/core/annotation/src/placement.ts): MIN_DRAG = 3 Mark [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type Mark ={ assetId: string} |{ source: BinarySource} ; MarkRole [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type MarkRole = 'signature' | 'initials'; MarkSource [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type MarkSource = |{ kind: 'ink'; strokes: ReadonlyArray>; color?: string; strokeWidth?: number; } |{ kind: 'text'; text: string; fontFamily: string; color?: string; fontSize?: number} |{ kind: 'image'; source: BinarySource} |{ kind: 'pdf'; source: BinarySource; pageIndex?: number} ; MarkupSubtype [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type MarkupSubtype = 'highlight' | 'underline' | 'strikeout' | 'squiggly'; MeasurementCapability [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface MeasurementCapability extends SettingsApi{ canCalibrate(): boolean; canMeasure(page: PageRef | number): boolean; getPageScale(page: PageRef | number): PageScale; ensureLoaded(page: PageRef | number, options?: OperationOptions): Promise; isBusy(): boolean; listLastReports(): readonly ScaleChangeReport[]; listPresets(): readonly ScalePreset[]; listUnits(): readonly LengthUnit[]; listAreaUnits(): readonly AreaUnit[]; getReadout(ref: AnnotationRef): MeasurementReadout | MeasurementUnavailable; measureDistance( page: PageRef | number, from: Point, to: Point, ): MeasurementReadout | MeasurementUnavailable; measureArea( page: PageRef | number, vertices: readonly Point[], ): MeasurementReadout | MeasurementUnavailable; getCalibrationRequest(): CalibrationRequest | null; setScale( pages: PageTarget, measure: PdfMeasure, options?: ScaleChangeOptions, ): Promise; calibrate( input: CalibrateInput, options?: ScaleChangeOptions &{ applyTo?: PageTarget} , ): Promise; setUnit( pages: PageTarget, unit: LengthUnit, options?: ScaleChangeOptions, ): Promise; setAreaUnit( pages: PageTarget, unit: AreaUnit, options?: ScaleChangeOptions, ): Promise; setPrecision( pages: PageTarget, precision: number, options?: ScaleChangeOptions, ): Promise; setPreset( pages: PageTarget, presetId: string, options?: ScaleChangeOptions, ): Promise; clearScale( pages: PageTarget, options?: ScaleChangeOptions, ): Promise; createMeasurement( input: CreateMeasurementInput, options?: OperationOptions, ): Promise<{ annotation: Annotation} >; startCalibration(): void; dismissCalibration(): void; readonly onScaleChanged: EventHook; readonly onCalibrationRequested: EventHook; readonly onCalibrationCompleted: EventHook; readonly onCalibrationDismissed: EventHook; } MeasurementConfig [TypeAliasDeclaration] (from packages/plugin/measurement/src/contract.ts): export type MeasurementConfig = Partial; MeasurementIntent [TypeAliasDeclaration] (from packages/core/annotation/src/editable.ts): export type MeasurementIntent = 'line-dimension' | 'polyline-dimension' | 'polygon-dimension'; MeasurementKind [TypeAliasDeclaration] (from packages/plugin/measurement/src/contract.ts): export type MeasurementKind = 'distance' | 'perimeter' | 'area'; MeasurementReadout [InterfaceDeclaration] (from packages/engine/core/src/measure/derive.ts): export interface MeasurementReadout{ kind: 'distance' | 'perimeter' | 'area'; label: string; value: number; perimeter?: string; } MeasurementScaleChangedEvent [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface MeasurementScaleChangedEvent{ readonly page: PageRef; readonly report: ScaleChangeReport; } MeasurementSettings [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface MeasurementSettings{ readonly defaultScale: 'metric' | 'imperial' | PdfMeasure; readonly presets: readonly ScalePreset[]; } MeasurementState [InterfaceDeclaration] (from packages/plugin/measurement/src/state.ts): export interface MeasurementState{ readonly busy: boolean; readonly calibrationRequest: CalibrationRequest | null; readonly lastReports: readonly ScaleChangeReport[]; } MeasurementToken [VariableDeclaration] (from packages/plugin/measurement/src/token.ts): MeasurementToken = createCapabilityToken('measurement', { hint: `add measurementPlugin() from '@embedpdf/plugin-measurement' to your plugins list`, promises:{ ensureLoaded: true, setScale: true, calibrate: true, setUnit: true, setAreaUnit: true, setPrecision: true, setPreset: true, clearScale: true, createMeasurement: true, } , } ) MeasurementUnavailable [InterfaceDeclaration] (from packages/engine/core/src/measure/derive.ts): export interface MeasurementUnavailable{ unavailable: | 'not-dimension' | 'no-measure' | 'foreign-measure' | 'no-scale' | 'no-distance-format' | 'no-area-format' | 'invalid-format' | 'invalid-geometry'; } MenuClosedEvent [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface MenuClosedEvent{ readonly id: string; } MenuOpenedEvent [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface MenuOpenedEvent{ readonly id: string; } MetadataCapability [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface MetadataCapability{ getSnapshot(): DocumentMetadata | null; getStatus(): ResourceStatus; ensureLoaded(options?: OperationOptions): Promise; canUpdate(): boolean; update( patch: MetadataPatch, options?: OperationOptions, ): Promise<{ readonly metadata: DocumentMetadata} >; refresh(options?: OperationOptions): Promise; readonly onUpdated: EventHook; readonly onResynced: EventHook; readonly custom: CustomMetadataCapability; } MetadataPatch [InterfaceDeclaration] (from packages/engine/core/src/dto/MetadataPatch.ts): export interface MetadataPatch{ title?: string | null; author?: string | null; subject?: string | null; keywords?: string | null; producer?: string | null; creator?: string | null; createdAt?: DateInput | null; modifiedAt?: DateInput | null; trapped?: DocumentMetadataTrapped; } MetadataResyncedEvent [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface MetadataResyncedEvent{ readonly metadata: DocumentMetadata; } MetadataState [InterfaceDeclaration] (from packages/plugin/metadata/src/state.ts): export interface MetadataState{ readonly metadata: DocumentMetadata | null; readonly custom: CustomMetadata | null; readonly status: ResourceStatus; } MetadataToken [VariableDeclaration] (from packages/plugin/metadata/src/token.ts): MetadataToken = createCapabilityToken('metadata', { hint: "add metadataPlugin() from '@embedpdf/plugin-metadata' to your plugins list", promises:{ update: true, refresh: true, ensureLoaded: true, 'custom.update': true, 'custom.refresh': true, } , } ) MetadataUpdateResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/MetadataUpdateResult.ts): export interface MetadataUpdateResult{ metadata: DocumentMetadata; meta: MutationMeta; } MetadataUpdatedEvent [InterfaceDeclaration] (from packages/plugin/metadata/src/contract.ts): export interface MetadataUpdatedEvent{ readonly metadata: DocumentMetadata; readonly previous: DocumentMetadata | null; readonly changedKeys: readonly (keyof DocumentMetadata)[]; readonly origin: EventOrigin; } Mirror [InterfaceDeclaration] (from packages/core/main/src/mirror.ts): export interface Mirror{ get(): V; view(): V; getStatus(): ResourceStatus; ensureLoaded(): Promise; refresh(): Promise; settled(): Promise; } MirrorChange [InterfaceDeclaration] (from packages/core/main/src/mirror.ts): export interface MirrorChange{ readonly cause: 'load' | 'event'; readonly event: DocumentEvent | null; readonly pages: 'all' | readonly PageRef[] | null; readonly previous: V; readonly next: V; } MirrorReload [InterfaceDeclaration] (from packages/core/main/src/mirror.ts): export interface MirrorReload{ readonly [RELOAD]: 'all' | readonly PageRef[]; } MirrorSpec [InterfaceDeclaration] (from packages/core/main/src/mirror.ts): export interface MirrorSpec{ readonly name: string; readonly initial: () => V; readonly readable?: () => boolean; readonly onDemand?: true; load(doc: DocumentHandle, signal: AbortSignal): Promise<{ value: V; cursor?: number} >; fold(value: V, event: DocumentEvent): V | MirrorReload; predict?(value: V, op: PredictedOp): V; loadPages?( doc: DocumentHandle, pages: readonly PageRef[], signal: AbortSignal, ): Promise<(value: V) => V>; readonly onChanged?: (change: MirrorChange) => void; } Modifiers [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface Modifiers{ readonly shift: boolean; readonly alt: boolean; readonly ctrl: boolean; readonly meta: boolean; } NO_PAGE_SCALE [VariableDeclaration] (from packages/plugin/measurement/src/contract.ts): NO_PAGE_SCALE: PageScale = Object.freeze({ measure: null, source: 'default', ready: false, persistent: false, } ) NO_READOUT [VariableDeclaration] (from packages/plugin/measurement/src/contract.ts): NO_READOUT: MeasurementUnavailable = Object.freeze({ unavailable: 'not-dimension'} ) NoSettings [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface NoSettings{ readonly [noSettings]: true; } NotAllowedMode [TypeAliasDeclaration] (from packages/plugin/commands/src/contract.ts): export type NotAllowedMode = 'hide' | 'disable'; OpenDocumentOptions [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type OpenDocumentOptions = OpenOptions &{ readonly activate?: boolean; readonly name?: string; readonly signal?: AbortSignal; } ; OpenDocumentResult [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface OpenDocumentResult{ readonly document: DocumentInfo; } OpenInput [TypeAliasDeclaration] (from packages/engine/core/src/dto/OpenInput.ts): export type OpenInput = | OpenInputBytes | OpenInputLayerBytes | OpenInputLayerFile | OpenInputById | OpenInputToken | OpenInputGrant; OpenOptions [InterfaceDeclaration] (from packages/engine/core/src/dto/OpenInput.ts): export interface OpenOptions{ password?: string; scope?: ReadonlyArray; identity?: Identity; } OpenSequenceCompletedEvent [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface OpenSequenceCompletedEvent{ readonly result: ActionTriggerResult; } OpenSource [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type OpenSource = | OpenInput | UrlSource | ((signal: AbortSignal) => OpenInput | UrlSource | Promise); OpenSurfaceOptions [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface OpenSurfaceOptions{ readonly exclusive?: string; readonly props?: SurfaceProps; readonly focus?: boolean; } OperationOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface OperationOptions{ readonly signal?: AbortSignal; } OutlineCapability [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineCapability{ list(): readonly OutlineItem[]; get(ref: OutlineItemRef): OutlineItem | null; getChildren(parent: OutlineItemRef | null): readonly OutlineItem[]; listRows(): readonly OutlineRow[]; getCurrentItem(): OutlineItemRef | null; isIncomplete(): boolean; getStatus(): ResourceStatus; ensureLoaded(options?: OperationOptions): Promise; refresh(options?: OperationOptions): Promise; isExpanded(ref: OutlineItemRef): boolean; expand(ref: OutlineItemRef): void; collapse(ref: OutlineItemRef): void; toggle(ref: OutlineItemRef): void; expandAll(): void; collapseAll(): void; reveal(ref: OutlineItemRef): void; getSelected(): readonly OutlineItemRef[]; select(refs: readonly OutlineItemRef[]): void; activate(ref: OutlineItemRef): LinkActivation; canEdit(): boolean; getCurrentViewTarget(): PdfLinkTargetWritable | null; create( input?: OutlineItemInput, options?: OutlineCreateOptions, ): Promise<{ readonly item: OutlineItem} >; update( ref: OutlineItemRef, patch: OutlineItemPatch, options?: OperationOptions, ): Promise<{ readonly item: OutlineItem} >; move( refs: readonly OutlineItemRef[], parent: OutlineItemRef | null, position: OutlinePosition, options?: OperationOptions, ): Promise; delete(refs: readonly OutlineItemRef[], options?: OperationOptions): Promise; readonly onChanged: EventHook; readonly onResynced: EventHook; } OutlineChangedEvent [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineChangedEvent{ readonly type: 'created' | 'updated' | 'moved' | 'deleted' | 'restored'; readonly items: readonly OutlineItemRef[]; readonly origin: EventOrigin; } OutlineCreateOptions [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineCreateOptions extends OperationOptions{ readonly select?: boolean; } OutlineItem [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentOutline.ts): export interface OutlineItem{ ref: OutlineItemRef; parent: OutlineItemRef | null; title: string; target: PdfLinkTarget | null; action: PdfActionTree | null; open: boolean; color: string | null; bold: boolean; italic: boolean; } OutlineItemDraft [InterfaceDeclaration] (from packages/engine/core/src/dto/DocumentOutline.ts): export interface OutlineItemDraft{ title: string; target?: PdfLinkTargetWritable | null; color?: string | null; bold?: boolean; italic?: boolean; } OutlineItemInput [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineItemInput extends Partial{ readonly parent?: OutlineItemRef | null; readonly position?: OutlinePosition; } OutlineItemPatch [TypeAliasDeclaration] (from packages/engine/core/src/dto/DocumentOutline.ts): export type OutlineItemPatch = Partial> &{ open?: boolean; } ; OutlineItemRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/OutlineItemRef.ts): export type OutlineItemRef ={ kind: 'objectNumber'; objectNumber: number} ; OutlinePosition [TypeAliasDeclaration] (from packages/engine/core/src/mutation/ListPosition.ts): export type OutlinePosition = ListPosition; OutlineResyncedEvent [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineResyncedEvent{ readonly outline: DocumentOutline; } OutlineRow [InterfaceDeclaration] (from packages/plugin/outline/src/contract.ts): export interface OutlineRow{ readonly item: OutlineItem; readonly depth: number; readonly hasChildren: boolean; readonly expanded: boolean; } OutlineState [InterfaceDeclaration] (from packages/plugin/outline/src/state.ts): export interface OutlineState{ readonly items: readonly OutlineItem[]; readonly rows: readonly OutlineRow[]; readonly current: OutlineItemRef | null; readonly selected: readonly OutlineItemRef[]; readonly status: ResourceStatus; readonly incomplete: boolean; readonly canEdit: boolean; } OutlineToken [VariableDeclaration] (from packages/plugin/outline/src/token.ts): OutlineToken = createCapabilityToken('outline', { hint: "add outlinePlugin() from '@embedpdf/plugin-outline' to your plugins list", promises:{ ensureLoaded: true, refresh: true, create: true, update: true, move: true, delete: true, } , } ) OverflowMenuView [TypeAliasDeclaration] (from packages/framework/angular/toolbar/src/templates.ts): export type OverflowMenuView = OverflowMenuViewOf; OverflowRow [TypeAliasDeclaration] (from packages/core/ui/src/projection.ts): export type OverflowRow = |{ readonly kind: 'command'; readonly command: string} |{ readonly kind: 'submenu'; readonly command: string; readonly menu: string} ; OverflowSection [InterfaceDeclaration] (from packages/core/ui/src/projection.ts): export interface OverflowSection{ readonly labelKey?: string; readonly role?: 'radio'; readonly rows: readonly OverflowRow[]; } PINNED [VariableDeclaration] (from packages/core/ui/src/schema.ts): PINNED: Importance = 5 Padding [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type Padding = number | PaddingSides; PaddingSides [InterfaceDeclaration] (from packages/core/stage/src/index.ts): export interface PaddingSides{ top: number; right: number; bottom: number; left: number; } PageDeleteResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/PageDeleteResult.ts): export interface PageDeleteResult{ layout: PageListSnapshot; meta: MutationMeta; } PageDestination [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfDestination.ts): export type PageDestination = |{ kind: 'xyz'; page: PageRef; x: number | null; y: number | null; zoom: number | null} |{ kind: 'fit'; page: PageRef} |{ kind: 'fitH'; page: PageRef; y: number | null} |{ kind: 'fitV'; page: PageRef; x: number | null} |{ kind: 'fitR'; page: PageRef; x: number; y: number; width: number; height: number} |{ kind: 'fitB'; page: PageRef} |{ kind: 'fitBH'; page: PageRef; y: number | null} |{ kind: 'fitBV'; page: PageRef; x: number | null} ; PageEditCapability [InterfaceDeclaration] (from packages/plugin/page-edit/src/contract.ts): export interface PageEditCapability{ canEdit(): boolean; canExtract(): boolean; getSelected(): readonly PageRef[]; select(pages: readonly (PageRef | number)[]): void; rotateBy( pages: readonly (PageRef | number)[], delta: 90 | -90 | 180, options?: OperationOptions, ): Promise; setRotation( pages: readonly (PageRef | number)[], rotation: PdfRotation, options?: OperationOptions, ): Promise; reorder( pages: readonly (PageRef | number)[], position: PagePosition, options?: OperationOptions, ): Promise; delete(pages: readonly (PageRef | number)[], options?: OperationOptions): Promise; insertBlank(options?: PageInsertBlankOptions): Promise; insertFromBytes( bytes: Uint8Array | ArrayBuffer, options?: PageInsertFromBytesOptions, ): Promise; insertFromDocument( documentId: string, pages: readonly (PageRef | number)[], options?: PagePositionOptions, ): Promise; duplicate( pages: readonly (PageRef | number)[], options?: PagePositionOptions, ): Promise; extract(pages: readonly (PageRef | number)[], options?: OperationOptions): Promise; } PageEditInsertResult [InterfaceDeclaration] (from packages/plugin/page-edit/src/contract.ts): export interface PageEditInsertResult{ readonly pages: readonly PageRef[]; } PageEditState [InterfaceDeclaration] (from packages/plugin/page-edit/src/state.ts): export interface PageEditState{ readonly selected: readonly PageRef[]; readonly canEdit: boolean; readonly canExtract: boolean; } PageEditToken [VariableDeclaration] (from packages/plugin/page-edit/src/token.ts): PageEditToken = createCapabilityToken('page-edit', { hint: `add pageEditPlugin() from '@embedpdf/plugin-page-edit' to your plugins list`, promises:{ rotateBy: true, setRotation: true, reorder: true, delete: true, insertBlank: true, insertFromBytes: true, insertFromDocument: true, duplicate: true, extract: true, } , } ) PageFrame [InterfaceDeclaration] (from packages/core/geometry/src/index.ts): export interface PageFrame{ top: number; right: number; bottom: number; left: number; } PageHandle [InterfaceDeclaration] (from packages/engine/core/src/engine/PageHandle.ts): export interface PageHandle{ readonly ref: PageRef; readonly annotations: PageAnnotationsService; readonly forms: PageFormsService; readonly text: PageTextService; readonly render: PageRenderService; readonly measure: PageMeasureService; } PageImage [TypeAliasDeclaration] (from packages/plugin/render/src/contract.ts): export type PageImage = PageImageHandle; PageImageHandle [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageImageHandle extends PageImageResult, ImageSource{ } PageImageObjectUrl [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageImageObjectUrl{ url: string; revoke(): void; } PageImageOptions [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageImageOptions< C extends Coordinates = PageCoordinates, > extends PageRenderOptions{ format?: PageRenderEncodedFormat; quality?: number; } PageInfo [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PageInfo = PageLayout; PageInsertBlankOptions [InterfaceDeclaration] (from packages/plugin/page-edit/src/contract.ts): export interface PageInsertBlankOptions extends OperationOptions{ readonly position?: PagePosition; readonly size?: PdfSize; readonly count?: number; } PageInsertBlankSpec [InterfaceDeclaration] (from packages/engine/core/src/mutation/PageInsertBlankInput.ts): export interface PageInsertBlankSpec{ size: PdfSize; count?: number; } PageInsertFromBytesOptions [InterfaceDeclaration] (from packages/plugin/page-edit/src/contract.ts): export interface PageInsertFromBytesOptions extends OperationOptions{ readonly pageIndexes?: readonly number[]; readonly position?: PagePosition; } PageInsertResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/PageInsertResult.ts): export interface PageInsertResult{ insertedPages: PageRef[]; layout: PageListSnapshot; meta: MutationMeta; } PageLayerOptions [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PageLayerOptions{ includeAnnotations?: boolean; includeFormFields?: boolean; } PageLayerRights [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageLayerRights{ readonly annotations: boolean; readonly formFields: boolean; } PageLayout [InterfaceDeclaration] (from packages/engine/core/src/dto/PageLayout.ts): export interface PageLayout{ index: number; ref: PageRef; label: string | null; size: PdfSize; rotation: PdfRotation; userUnit: number; tabOrder: PageTabOrder | null; boxes: PageBoxes; pdfCropBox: PdfRect; actions?: PdfPageActions; viewports?: PageMeasurementViewport[]; } PageMirror [InterfaceDeclaration] (from packages/core/main/src/page-mirror.ts): export interface PageMirror{ get(page: PageRef): V | undefined; view(page: PageRef): V | undefined; getStatus(page: PageRef): ResourceStatus; ensureLoaded(page: PageRef, options?: OperationOptions): Promise; refresh(page?: PageRef): Promise; } PageMirrorChange [InterfaceDeclaration] (from packages/core/main/src/page-mirror.ts): export interface PageMirrorChange{ readonly page: PageRef; readonly cause: 'load' | 'event' | 'drop'; readonly event: DocumentEvent | null; readonly previous: V | undefined; readonly next: V | undefined; } PageMirrorSpec [InterfaceDeclaration] (from packages/core/main/src/page-mirror.ts): export interface PageMirrorSpec{ readonly name: string; load(doc: DocumentHandle, page: PageRef, signal: AbortSignal): Promise; affected(event: DocumentEvent): readonly PageRef[] | 'all' | null; fold?(value: V, event: DocumentEvent, page: PageRef): V | 'reload'; predict?(value: V, op: PredictedOp, page: PageRef): V; readonly onChanged?: (change: PageMirrorChange) => void; } PageObjectNumber [TypeAliasDeclaration] (from packages/engine/core/src/identity/PageObjectNumber.ts): export type PageObjectNumber = number; PagePosition [TypeAliasDeclaration] (from packages/engine/core/src/mutation/ListPosition.ts): export type PagePosition = ListPosition; PagePositionOptions [InterfaceDeclaration] (from packages/plugin/page-edit/src/contract.ts): export interface PagePositionOptions extends OperationOptions{ readonly position?: PagePosition; } PageRaster [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageRaster{ width: number; height: number; stride: number; color: 'rgba8'; premultipliedAlpha: false; data: ArrayBuffer; } PageRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/PageRef.ts): export type PageRef ={ kind: 'objectNumber'; objectNumber: PageObjectNumber} ; PageRender [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PageRender{ readonly page: PageRef; readonly image: PageImage; } PageRenderLayers [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageRenderLayers{ readonly includeAnnotations: boolean; readonly includeFormFields: boolean; } PageRenderOptions [InterfaceDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export interface PageRenderOptions{ target?: PageRenderTarget; viewport?: PageRenderViewport; rotation?: PdfRotation; background?: PageRenderBackground; includeAnnotations?: boolean; includeFormFields?: boolean; usage?: PageFlattenUsage; maxOutputPixels?: number; } PageRenderTarget [TypeAliasDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export type PageRenderTarget = |{ kind: 'page'} |{ kind: 'rect'; rect: C['box']; } ; PageRenderViewport [TypeAliasDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export type PageRenderViewport = | PageScreenViewport |{ kind: 'thumbnail'; } |{ kind: 'dpi'; dpi: PrintDpi; } ; PageReorderResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/PageReorderResult.ts): export interface PageReorderResult{ pages: PageRef[]; layout: PageListSnapshot; meta: MutationMeta; } PageRotateResult [InterfaceDeclaration] (from packages/engine/core/src/mutation/PageRotateResult.ts): export interface PageRotateResult{ layout: PageListSnapshot; meta: MutationMeta; } PageScale [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface PageScale{ readonly measure: PdfMeasurement | null; readonly source: 'owned' | 'foreign' | 'default'; readonly ready: boolean; readonly persistent: boolean; readonly error?: SerializedEngineError; } PageTarget [TypeAliasDeclaration] (from packages/plugin/measurement/src/contract.ts): export type PageTarget = PageRef | number | readonly (PageRef | number)[] | 'all'; PageViewDemand [InterfaceDeclaration] (from packages/plugin/render/src/paint-plan.ts): export interface PageViewDemand{ desiredDeviceWidth: number; visibleRect?: Rect; velocity?:{ dx: number; dy: number} ; } PageViewEnv [InterfaceDeclaration] (from packages/framework/web/src/anchored-position.ts): export interface PageViewEnv{ scale: number; rotation: 0 | 90 | 180 | 270; zoom: number; } PaintedPicture [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PaintedPicture{ update(page: PicturePage): void; destroy(): void; } PaneCreatedEvent [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface PaneCreatedEvent{ readonly paneId: PaneId; } PaneDeletedEvent [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface PaneDeletedEvent{ readonly paneId: PaneId; } PaneFocusChangedEvent [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface PaneFocusChangedEvent{ readonly paneId: PaneId | null; } PaneId [TypeAliasDeclaration] (from packages/plugin/view-manager/src/contract.ts): export type PaneId = string; PaneInfo [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface PaneInfo{ readonly id: PaneId; readonly documentIds: readonly string[]; readonly activeDocumentId: string | null; } PdfActionNode [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfAction.ts): export type PdfActionNode = PdfActionNodeCommon & ( |{ type: 'javascript'; script: string} |{ type: 'goto'; destination: Destination} |{ type: 'uri'; uri: string; isMap: boolean} |{ type: 'named'; name: string} |{ type: 'hide'; targets: PdfActionTargetRef[]; hide: boolean} |{ type: 'reset-form'; fields: PdfActionTargetRef[] | null; exclude: boolean; } |{ type: 'goto-remote'; filePath: string} |{ type: 'goto-embedded'; filePath: string} |{ type: 'launch'; filePath: string} |{ type: 'rendition'; script?: string} |{ type: 'submit-form'; payload?: SubmitFormPayload} |{ type: 'thread'} |{ type: 'sound'} |{ type: 'movie'} |{ type: 'import-data'} |{ type: 'set-ocg-state'} |{ type: 'transition'} |{ type: 'goto-3d-view'} |{ type: 'unknown'} ); PdfActionTree [InterfaceDeclaration] (from packages/engine/core/src/dto/PdfAction.ts): export interface PdfActionTree{ root: PdfActionNode | null; incomplete: boolean; warnings: PdfActionWarning[]; } PdfActionType [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfAction.ts): export type PdfActionType = PdfActionNode['type']; PdfAnnotationEventKind [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type PdfAnnotationEventKind = | 'cursorEnter' | 'cursorExit' | 'mouseDown' | 'mouseUp' | 'focus' | 'blur'; PdfDestination [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfDestination.ts): export type PdfDestination = |{ kind: 'xyz'; page: PageRef; left: number | null; top: number | null; zoom: number | null; } |{ kind: 'fit'; page: PageRef} |{ kind: 'fitH'; page: PageRef; top: number | null} |{ kind: 'fitV'; page: PageRef; left: number | null} |{ kind: 'fitR'; page: PageRef; left: number; bottom: number; right: number; top: number; } |{ kind: 'fitB'; page: PageRef} |{ kind: 'fitBH'; page: PageRef; top: number | null} |{ kind: 'fitBV'; page: PageRef; left: number | null} ; PdfFieldEventKind [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type PdfFieldEventKind = 'keystroke' | 'format' | 'validate' | 'calculate'; PdfLinkTarget [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfLinkTarget.ts): export type PdfLinkTarget = |{ kind: 'goto'; destination: Destination} |{ kind: 'uri'; uri: string} |{ kind: 'goto-remote'; file: string} |{ kind: 'launch'; path: string} |{ kind: 'javascript'} |{ kind: 'named'; name: string} |{ kind: 'unsupported'} ; PdfMeasure [InterfaceDeclaration] (from packages/engine/core/src/dto/Measure.ts): export interface PdfMeasure{ subtype: 'rectilinear'; ratio?: string; x: PdfNumberFormat[]; y?: PdfNumberFormat[]; distance: PdfNumberFormat[]; area: PdfNumberFormat[]; angle?: PdfNumberFormat[]; slope?: PdfNumberFormat[]; origin?: PdfPoint; cyx?: number; } PdfNamedAction [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type PdfNamedAction = | 'NextPage' | 'PrevPage' | 'FirstPage' | 'LastPage' | 'Print' | (string &{ } ); PdfRect [InterfaceDeclaration] (from packages/engine/core/src/geometry/primitives.ts): export interface PdfRect{ left: number; bottom: number; right: number; top: number; } PdfRotation [TypeAliasDeclaration] (from packages/engine/core/src/geometry/primitives.ts): export type PdfRotation = 0 | 90 | 180 | 270; PdfSaveMode [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfSaveMode.ts): export type PdfSaveMode = 'incremental' | 'rewrite'; PdfSize [InterfaceDeclaration] (from packages/engine/core/src/geometry/primitives.ts): export interface PdfSize{ width: number; height: number; } PendingChange [InterfaceDeclaration] (from packages/core/main/src/changes.ts): export interface PendingChange{ readonly opId: string; readonly label: ChangeLabel; readonly undoOf: string | null; readonly merge: string | null; readonly shows: readonly PredictedOp[]; readonly undo: readonly PredictedOp[]; readonly history: boolean; readonly held: boolean; readonly result: Promise; } PendingMeta [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PendingMeta{ readonly id: string; readonly name?: string; readonly status: 'loading' | 'locked' | 'error'; readonly passwordProvided?: boolean; readonly error?: unknown; readonly openRequest?: GrantOpenRequest; } PendingPage [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PendingPage = |{ readonly kind: 'blank'} |{ readonly kind: 'own'} |{ readonly kind: 'copy'; readonly of: PageRef} ; Permission [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type Permission = DocCapability | 'annotations:create' | PluginPermission; PermissionDenied [ClassDeclaration] (from packages/engine/core/src/auth/scope/errors.ts): export class PermissionDenied extends EngineError{ override readonly name: string = 'PermissionDenied'; constructor( public readonly required: string, public readonly context?: string, public readonly anyOf?: readonly string[], public readonly refs?: readonly AnnotationRef[], ){ super( EngineErrorCode.Forbidden, `permission denied${ context ? ` (${ context} )` : ''} : ${ anyOf ? `one of ${ anyOf.join(', ')} ` : required} ${ refs ? ` for ${ refs.length} annotation${ refs.length === 1 ? '' : 's'} ` : ''} `, { details:{ required, ...(context === undefined ?{ } :{ context} ), ...(anyOf === undefined ?{ } :{ anyOf: [...anyOf]} ), ...(refs === undefined ?{ } :{ refs: [...refs]} ), } , } , ); } } PersistStampLibrariesOptions [TypeAliasDeclaration] (from packages/framework/angular/stamp/src/stamp.ts): export type PersistStampLibrariesOptions = NonNullable[2]>; PersonalKeyStore [InterfaceDeclaration] (from packages/core/signature/src/signers/personal.ts): export interface PersonalKeyStore{ load(subject: string): Promise; save(subject: string, record: PersonalKeyRecord): Promise; remove(subject: string): Promise; } PersonalSigner [InterfaceDeclaration] (from packages/core/signature/src/signers/personal.ts): export interface PersonalSigner extends RawSigner{ readonly certificate: Uint8Array; readonly subject: string; } PicturePage [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PicturePage{ readonly ref: PageRef; readonly pageIndex: number; readonly view: string; readonly transform: PageTransform; readonly getViewDemand?: () => PageViewDemand; } PicturePainter [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PicturePainter{ paints(view: string): boolean; paint(host: Host, page: PicturePage, report: PictureReport): PaintedPicture; } PictureReport [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PictureReport{ shown(): void; failed(error: unknown): void; } PictureState [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PictureState{ readonly status: ResourceStatus; readonly slow: boolean; } PictureStateChangedEvent [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface PictureStateChangedEvent extends PictureState{ readonly page: PageRef; readonly view: string; } PlaceMarkResult [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type PlaceMarkResult = |{ status: 'signed'; field: FormFieldRef; result: SignFieldResult} |{ status: 'filled'; field: FormFieldRef} |{ status: 'requested'; field: FormFieldRef} |{ status: 'placed'; annotation: AnnotationRef} ; Placement [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type Placement = |{ kind: 'box'; rect: Rect; rot: number} |{ kind: 'segment'; a: Point; b: Point} ; PlatformFeedback [InterfaceDeclaration] (from packages/plugin/interaction/src/feedback.types.ts): export interface PlatformFeedback{ selection(): void; impact(weight?: 'light' | 'medium' | 'heavy'): void; notify(kind: 'success' | 'warning' | 'error'): void; } PluginClock [InterfaceDeclaration] (from packages/core/main/src/clock.ts): export interface PluginClock{ after(ms: number, run: () => void): Cancel; nextFrame(run: (timeMs: number) => void): Cancel; readonly hasFrames: boolean; } PluginContext [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PluginContext{ readonly id: string; readonly instanceId: string; readonly documentId?: string; readonly engine: Engine; readonly doc: DocumentHandle; documentHandle(documentId?: string): DocumentHandle | null; document(): DocumentMeta | null; getPage(page: PageRef | number): PageInfo | null; pageOf(page: PageRef | number): PageInfo; assertPageRef(ref: PageRef): void; allows(permission: Permission): boolean; assertAllowed(permission: Permission, operation: string): void; allowsField(action: 'fill' | 'sign', field:{ readonly groupId: string | null} ): boolean; assertAllowedField( action: 'fill' | 'sign', field:{ readonly groupId: string | null} , operation: string, ): void; get(token: CapabilityToken): T; tryGet(token: CapabilityToken): T | null; forDocument(token: CapabilityToken, documentId: string): T; tryForDocument(token: CapabilityToken, documentId: string): T | null; readonly state: StateCell; readonly settings: () => Settings; notify(): void; storeChangeCount(): number; watch( select: () => R, handler: (value: R, previous: R) => void, isEqual?: (left: R, right: R) => boolean, ): Unsubscribe; waitFor(predicate: () => boolean, options?: OperationOptions): Promise; mirror(spec: MirrorSpec): Mirror; pageMirror(spec: PageMirrorSpec): PageMirror; readonly changes: ChangeQueue; readonly events:{ source():{ readonly on: EventHook; emit(event: T): void; destroy(): void} ; } ; listen(source: Subscribable, listener: (event: T) => void): void; cleanup(fn: () => void | Promise): void; readonly clock: PluginClock; readonly measurer: HostTextMeasurer | null; onSettle(flush: (signal: AbortSignal) => Promise | void): void; aroundDownload(wrap: (read: () => Promise) => Promise): void; aroundPrint(wrap: (print: () => Promise) => Promise): void; acquire( get: (lifetime: AbortSignal) => Promise, release: (resource: R) => void | Promise, ): Promise; cancellable(signal: AbortSignal | undefined, task: Promise): Promise; latest(key: string): import('./lanes').LatestLane; serialQueue(key?: string): SerialQueue; } PluginDefinition [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PluginDefinition< State = unknown, Capability = unknown, PluginSettings extends object = NoSettings, >{ readonly id: string; readonly token?: CapabilityToken; readonly scope?: PluginScope; readonly requires?: ReadonlyArray>; readonly optional?: ReadonlyArray>; readonly resolvesAnyCapability?: true; readonly state?: () => State; readonly settings?: SettingsDeclaration; readonly create: NoInfer< (ctx: PluginContext) =>{ api: Capability; connect?: () => void} >; readonly inScope?: NoInfer<(api: Capability, documentId: string) => Capability>; } PluginError [ClassDeclaration] (from packages/core/main/src/errors.ts): export class PluginError extends Error{ override readonly name = 'PluginError'; readonly code: PluginErrorCode; readonly capability: string; readonly permission: string | null; readonly details: unknown; constructor( code: PluginErrorCode, capability: string, message: string, options:{ cause?: unknown; details?: unknown; permission?: string | null} ={ } , ){ super(message); if (options.cause !== undefined) (this as{ cause?: unknown} ).cause = options.cause; this.code = code; this.capability = capability; this.permission = options.permission ?? null; this.details = options.details; } } PluginErrorCode [TypeAliasDeclaration] (from packages/core/main/src/errors.ts): export type PluginErrorCode = | 'permission-denied' | 'unsupported' | 'not-found' | 'not-ready' | 'invalid-input' | 'conflict' | 'instance-closed' | 'operation-cancelled' | 'operation-failed'; PluginErrorInfo [InterfaceDeclaration] (from packages/core/main/src/errors.ts): export interface PluginErrorInfo{ readonly code: PluginErrorCode; readonly message: string; readonly capability: string; readonly permission: string | null; } PluginPermission [TypeAliasDeclaration] (from packages/engine/core/src/auth/scope/types.ts): export type PluginPermission = keyof PluginPermissions & string; PluginPermissions [InterfaceDeclaration] (from packages/engine/core/src/auth/scope/types.ts): export interface PluginPermissions{ } PluginScope [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PluginScope = 'workspace' | 'document'; PluginServiceClass [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/service.ts): export type PluginServiceClass< Capability, State extends object, Method extends keyof Capability, Event extends EventName, > = abstract new () => EpdfPluginService & PluginServiceMembers; PluginServiceMembers [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/service.ts): export type PluginServiceMembers< Capability, State extends object, Method extends keyof Capability, Event extends EventName, > ={ readonly [Key in Method]-?: Capability[Key]} &{ readonly [Key in keyof State]-?: Signal; } &{ readonly [Key in Event as StreamName]: Observable>; } & SettingsMembers; PluginServiceSpec [InterfaceDeclaration] (from packages/framework/angular/runtime/src/service.ts): export interface PluginServiceSpec< Capability, State extends object, Method extends keyof Capability, Event extends EventName, >{ readonly name: string; readonly feature?: string; readonly token: CapabilityToken; readonly state?: StateDeclaration; readonly ensure?: (capability: Capability) => Promise; readonly methods: readonly Method[]; readonly events?: readonly Event[]; } PluginSettingsBinding [InterfaceDeclaration] (from packages/framework/angular/runtime/src/kernel-host.ts): export interface PluginSettingsBinding{ readonly current: Signal; update(change: DeepPartial): void; reset(): void; } Point [InterfaceDeclaration] (from packages/core/geometry/src/index.ts): export interface Point{ x: number; y: number; } PointerKind [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type PointerKind = 'mouse' | 'pen' | 'touch'; PredictedOp [TypeAliasDeclaration] (from packages/core/main/src/changes.ts): export type PredictedOp = | ChangeOp |{ readonly type: 'annotations.restore'; readonly annotation: Annotation; readonly index: number; } |{ readonly type: 'forms.restore'; readonly field: FormField; readonly widgets: readonly WidgetAnnotation[]; } |{ readonly type: 'forms.restoreWidget'; readonly widget: WidgetAnnotation; readonly field: FormField | null; } |{ readonly type: 'outline.restore'; readonly items: readonly OutlineItem[]; readonly index: number; } |{ readonly type: 'attachments.restore'; readonly attachment: Attachment; } |{ readonly type: 'pages.restore'; readonly pages: readonly RestoredPage[]; } |{ readonly type: 'pages.relabel'; readonly labels: readonly PageLabelSection[]; } ; PrepareSignatureInput [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface PrepareSignatureInput{ field: FormFieldRef; mark?: Mark; appearance?: BinarySource; signer?: SignatureSignerInput; certify?:{ permission: DocMdpPermission} ; lock?: FieldLockSpec; subFilter?: SignatureSubFilter; digest?: Exclude; timestampAuthority?: CmsSigner | null; } PreparedPrint [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PreparedPrint{ readonly quality: PrintQuality; readonly pageCount: number; readonly needsTap: boolean; print(options?: OperationOptions): Promise; destroy(): void; } PrintDpi [TypeAliasDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export type PrintDpi = 150 | 300; PrintOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PrintOptions extends OperationOptions{ readonly pages?: readonly PageRef[]; readonly includeAnnotations?: boolean; readonly onProgress?: (progress: PrintProgress) => void; } PrintProgress [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PrintProgress{ readonly pagesRendered: number; readonly pageCount: number; } PrintQuality [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PrintQuality = |{ readonly kind: 'pdf'} |{ readonly kind: 'images'; readonly dpi: PrintDpi} ; PrintSheet [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface PrintSheet{ readonly image: Blob; readonly widthPt: number; readonly heightPt: number; } PromiseMemberOf [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PromiseMemberOf = | PromiseMethodOf |{ [Key in keyof Capability & string]-?: Capability[Key] extends (...args: never[]) => unknown ? never : Capability[Key] extends object ? `${ Key} .${ PromiseMethodOf} ` : never; } [keyof Capability & string]; PromiseMembers [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type PromiseMembers ={ readonly [Path in PromiseMemberOf]: true} ; PromptSourceSpec [InterfaceDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export interface PromptSourceSpec{ kind: 'prompt'; accept?: string; } REDACTION_DEFAULTS [VariableDeclaration] (from packages/plugin/redaction/src/contract.ts): REDACTION_DEFAULTS: RedactionSettings ={ overlay:{ fill: '#000000', text:{ color: '#ffffff', fontFamily: 'helvetica', fontSize: 0} , } , } RENDER_DEFAULTS [VariableDeclaration] (from packages/plugin/render/src/contract.ts): RENDER_DEFAULTS: RenderSettings ={ fullPage:{ maxWidth: 640, quantize: 'exact'} , tiles:{ size: 512, quantize: 'exact', maxScale: 128, bleedPx: 1, prefetch:{ margin: 0.5, velocityBias: true} , settleMs: 150, } , format: null, quality: null, slowAfterMs: 400, debug: false, snapshot:{ scale: 2, box:{ fill: null, stroke: null} } , } RecalibrationReport [InterfaceDeclaration] (from packages/plugin/annotation/src/host-contract.ts): export interface RecalibrationReport{ page: PageRef; scale: PdfMeasure; error?: SerializedEngineError; updated: AnnotationRef[]; skipped:{ ref: AnnotationRef; reason: 'no-authority' | 'locked' | 'foreign-measure' | 'unavailable'; } []; failed:{ ref: AnnotationRef; error: SerializedEngineError} []; } 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, } , } ) RefusedShortcut [InterfaceDeclaration] (from packages/framework/angular/commands/src/commands.ts): export interface RefusedShortcut{ readonly commandId: CommandId; readonly refusal: CommandRefusal; } RegisterCommandOptions [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface RegisterCommandOptions{ replace?: boolean; } RegisterToolOptions [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface RegisterToolOptions{ readonly replace?: boolean; } RenderCapability [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderCapability extends SettingsApi{ canRender(): boolean; canRenderThumbnail(): boolean; renderPage(page: PageRef | number, options?: RenderPageOptions): Promise; renderThumbnail(page: PageRef | number, options?: RenderThumbnailOptions): Promise; renderPages( pages: readonly (PageRef | number)[], options?: RenderPagesOptions, ): Promise>; getRenderPolicy(): EngineRenderPolicy; getRenderEpoch(page: PageRef | number, layers?: PageLayerOptions): number; invalidate(options?: InvalidateOptions): void; readonly onInvalidated: EventHook; getPictureState(page: PageRef | number, view: string): PictureState; readonly onPictureStateChanged: EventHook; handOverPictures(painter: PicturePainter): () => void; getPicturePainter(): PicturePainter | null; canSnapshot(): boolean; getSnapshot(): Snapshot | null; clearSnapshot(): void; readonly onSnapshotChanged: EventHook; } RenderConfig [TypeAliasDeclaration] (from packages/plugin/render/src/contract.ts): export type RenderConfig = DeepPartial; RenderFormat [TypeAliasDeclaration] (from packages/plugin/render/src/contract.ts): export type RenderFormat = NonNullable; RenderInvalidatedEvent [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderInvalidatedEvent{ readonly pages: readonly PageRef[]; readonly scope: InvalidateScope; readonly origin: EventOrigin | null; } RenderItem [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface RenderItem{ id: Id; ref: AnnotationRef | null; annotation?: Annotation; subtype: KindName; geometry: Shape; box: Rect; apBox?: Rect; apRot?: number; style: Style; text?: TextStyle; source: 'baked' | 'vector' | 'draft' | 'ghost'; pictureVersion?: number; lentScene?: () => readonly SceneNode[]; ghostOpacity?: number; selected: boolean; hovered?: boolean; label?:{ text: string; repeat: boolean; fonts?: PaintFonts} ; frame:{ box: Rect; rotation: number; scale: number} ; raster:{ box: Rect; rotation: number} | null; icon?: NoteIcon | FileAttachmentIcon; measure?: MeasurementAppearance; rot?: number; blend?: Exclude; } RenderPageOptions [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderPageOptions extends OperationOptions, PageLayerOptions{ width?: number; scale?: number; rect?: Rect; rotation?: Rotation; format?: RenderFormat; quality?: number; } RenderPagesOptions [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderPagesOptions extends Omit{ concurrency?: number; } RenderSettings [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderSettings{ readonly fullPage: FullPageSettings; readonly tiles: TilesSettings | false; readonly format: RenderFormat | null; readonly quality: number | null; readonly slowAfterMs: number; readonly debug: boolean; readonly snapshot: SnapshotSettings; } RenderThumbnailOptions [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface RenderThumbnailOptions extends OperationOptions, PageLayerOptions{ format?: RenderFormat; quality?: number; } RenderToken [VariableDeclaration] (from packages/plugin/render/src/token.ts): RenderToken = createCapabilityToken('render', { hint: `add renderPlugin() from '@embedpdf/plugin-render' to your plugins list`, promises:{ renderPage: true, renderThumbnail: true, renderPages: true, } , } ) ResolvedCommand [InterfaceDeclaration] (from packages/plugin/commands/src/contract.ts): export interface ResolvedCommand{ readonly id: string; readonly label: string; readonly icon?: string; readonly iconAccent?: IconAccent; readonly shortcuts: readonly string[]; readonly menu?: string; readonly enabled: boolean; readonly active: boolean; readonly pressable: boolean; readonly visible: boolean; readonly categories: readonly string[]; readonly disabledReason?: string; } ResolvedGhost [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type ResolvedGhost = false |{ opacity: number} ; ResolvedTool [InterfaceDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export interface ResolvedTool{ id: string; subtype: KindName; preset: string; fieldsKind: string; cursor: string; enables: ReadonlySet; defaults?: FieldValues; flags?: Partial; source?: StampSourceSpec; selection?: SelectionAuthoring; ink?: InkAuthoringOptions; upright: boolean; clickCreate: ClickCreate | false; ghost: ResolvedGhost; afterCreate?: Partial; capture: boolean; meta?: Record; } ResourceStatus [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type ResourceStatus = 'idle' | 'loading' | 'ready' | 'forbidden' | 'error'; ResponsiveRule [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface ResponsiveRule{ readonly name?: string; readonly when: BoxQuery | ((box: StageBox) => boolean); readonly settings?: StageSettingsPatch; } RestoredPage [InterfaceDeclaration] (from packages/engine/core/src/pages/predict.ts): export interface RestoredPage{ readonly page: PageLayout; readonly after: PageRef | null; } RetryOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface RetryOptions extends OperationOptions{ readonly passphrase?: string; readonly visitorIdentity?: VisitorAnswers; } RevealAlignment [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface RevealAlignment{ readonly x?: ArrivalAlignValue; readonly y?: ArrivalAlignValue; } RevealOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface RevealOptions{ behavior?: ScrollBehaviorKind; rect?: Rect; zoom?: RevealZoom; align?: RevealAlignment; } RevealZoom [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type RevealZoom = 'keep' | 'fit' | 'fit-width' | 'fit-height' |{ level: number} ; ReviewStatus [InterfaceDeclaration] (from packages/engine/core/src/annotation/comments.ts): export interface ReviewStatus{ state: string; stateModel: string; by: string | null; at: IsoDateTime | null; ref: AnnotationRef; } RevocationSource [InterfaceDeclaration] (from packages/core/signature/src/revocation/source.ts): export interface RevocationSource{ fetch(request: RevocationRequest): Promise; } RevocationVerdict [TypeAliasDeclaration] (from packages/core/signature/src/long-term.ts): export type RevocationVerdict = 'good' | 'revoked' | 'unknown'; RotationHandleProps [InterfaceDeclaration] (from packages/framework/angular/annotation/src/templates.ts): export interface RotationHandleProps extends Omit{ readonly from: Point; } SEARCH_DEFAULTS [VariableDeclaration] (from packages/plugin/search/src/contract.ts): SEARCH_DEFAULTS: SearchSettings ={ reveal:{ align:{ y: 0.35} , behavior: 'smooth'} , highlight:{ color: '#ffd500', activeColor: '#ff9632', blendMode: 'multiply'} , } SELECTION_DEFAULTS [VariableDeclaration] (from packages/plugin/selection/src/contract.ts): SELECTION_DEFAULTS: SelectionSettings ={ dragThresholdPx: 4, color: null, handles:{ color: null, shadow: '0 1px 4px rgb(0 0 0 / 0.35)'} , } SIGNATURES_LIBRARY_KIND [VariableDeclaration] (from packages/plugin/signature/src/contract.ts): SIGNATURES_LIBRARY_KIND = 'signatures' SIGNATURE_DEFAULTS [VariableDeclaration] (from packages/plugin/signature/src/contract.ts): SIGNATURE_DEFAULTS: SignatureSettings ={ signingKey: null, mode: null, timestampAuthority: null, revocation: null, documentTimestamp: false, trust: null, allowCertify: false, } SIGNATURE_MARK_NAME [VariableDeclaration] (from packages/plugin/signature/src/contract.ts): SIGNATURE_MARK_NAME = 'signature' SNAPSHOT_MAX_PIXELS [VariableDeclaration] (from packages/plugin/render/src/contract.ts): SNAPSHOT_MAX_PIXELS = 16_000_000 SNAPSHOT_TOOL [VariableDeclaration] (from packages/plugin/render/src/contract.ts): SNAPSHOT_TOOL = 'snapshot' STAMP_DEFAULTS [VariableDeclaration] (from packages/plugin/stamp/src/contract.ts): STAMP_DEFAULTS: StampSettings ={ assetEngine: null, fonts: [], previewWidth: 256, dynamic: true, } ScaleChangeOptions [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface ScaleChangeOptions extends OperationOptions{ recalculate?: boolean; } ScaleChangeReport [TypeAliasDeclaration] (from packages/plugin/measurement/src/contract.ts): export type ScaleChangeReport = | (RecalibrationReport &{ scaleError?: never} ) |{ page: PageRef; scale?: never; error?: never; updated: []; skipped: []; failed: []; scaleError: SerializedEngineError; } ; ScalePreset [InterfaceDeclaration] (from packages/plugin/measurement/src/contract.ts): export interface ScalePreset{ readonly id: string; readonly label: string; readonly paper: number; readonly real: number; readonly unit: LengthUnit; } ScriptDiagnosticReportedEvent [TypeAliasDeclaration] (from packages/plugin/actions/src/contract.ts): export type ScriptDiagnosticReportedEvent = Readonly; ScriptFailedEvent [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface ScriptFailedEvent{ readonly error: ScriptExecutionError; readonly source: ActionSource | null; } ScrollBehaviorKind [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type ScrollBehaviorKind = 'smooth' | 'instant'; ScrollHandlerOptions [InterfaceDeclaration] (from packages/plugin/stage/src/scroll-handler.ts): export interface ScrollHandlerOptions{ panFallback?: boolean; } ScrollMetrics [InterfaceDeclaration] (from packages/core/stage/src/index.ts): export interface ScrollMetrics{ scrollLeft: number; scrollTop: number; scrollWidth: number; scrollHeight: number; clientWidth: number; clientHeight: number; scrollableX: boolean; scrollableY: boolean; } ScrollbarAxis [TypeAliasDeclaration] (from packages/framework/angular/stage/src/scrollbar.ts): export type ScrollbarAxis = 'x' | 'y'; SearchActiveHitChangedEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchActiveHitChangedEvent{ readonly index: number; readonly hit: SearchHit | null; } SearchCancelledEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchCancelledEvent{ readonly reason: 'superseded' | 'cancelled' | 'cleared'; } SearchCapability [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchCapability extends SettingsApi{ canSearch(options?:{ readonly snippets?: boolean} ): boolean; search(query: SearchQuery, options?: SearchOptions): Promise; refresh(options?: OperationOptions): Promise; cancel(): void; clear(): void; nextHit(options?: SearchRevealOptions): SearchHit | null; previousHit(options?: SearchRevealOptions): SearchHit | null; goToHit(hit: SearchHit | number, options?: SearchRevealOptions): SearchHit | null; revealActiveHit(options?: SearchRevealOptions): void; getQuery(): SearchQuery | null; getStatus(): SearchStatus; listHits(filter?: SearchHitFilter): readonly SearchHit[]; getHitCount(page?: PageRef | number): number; listPagesWithHits(): readonly PageRef[]; getActiveHitIndex(): number; getActiveHit(): SearchHit | null; getProgress(): SearchProgress; getError(): PluginErrorInfo | null; findAll(query: SearchQuery, options?: SearchFindAllOptions): Promise; readonly onStarted: EventHook; readonly onProgressChanged: EventHook; readonly onCompleted: EventHook; readonly onCancelled: EventHook; readonly onFailed: EventHook; readonly onActiveHitChanged: EventHook; readonly onCleared: EventHook; } SearchClearedEvent [TypeAliasDeclaration] (from packages/plugin/search/src/contract.ts): export type SearchClearedEvent = Record; SearchCompletedEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchCompletedEvent{ readonly hitCount: number; } SearchConfig [TypeAliasDeclaration] (from packages/plugin/search/src/contract.ts): export type SearchConfig = DeepPartial; SearchFailedEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchFailedEvent{ readonly error: PluginErrorInfo; } SearchFindAllOptions [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchFindAllOptions extends OperationOptions{ readonly snippets?: boolean; } SearchHit [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchHit{ readonly page: PageRef; readonly pageIndex: number; readonly start: number; readonly count: number; readonly segments: readonly TextSegment[]; readonly bounds?: Rect; readonly snippet?: SearchSnippet; } SearchHitFilter [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchHitFilter{ readonly page?: PageRef | number; } SearchOptions [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchOptions extends OperationOptions{ readonly from?: PageRef | number; } SearchProgress [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchProgress{ readonly pagesSearched: number; readonly pageCount: number; } SearchProgressChangedEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchProgressChangedEvent extends SearchProgress{ readonly hitCount: number; } SearchQuery [InterfaceDeclaration] (from packages/engine/core/src/search/types.ts): export interface SearchQuery{ text: string; regex?: boolean; matchCase?: boolean; wholeWord?: boolean; matchDiacritics?: boolean; ignoreWhitespace?: boolean; } SearchQueryIssue [TypeAliasDeclaration] (from packages/engine/core/src/search/regex.ts): export type SearchQueryIssue = | SearchRegexIssue | 'diacritics-with-regex' | 'ignore-whitespace-with-regex'; SearchQueryValidation [TypeAliasDeclaration] (from packages/engine/core/src/search/regex.ts): export type SearchQueryValidation = |{ ok: true} |{ ok: false; issue: SearchQueryIssue; message: string} ; SearchRegexValidation [TypeAliasDeclaration] (from packages/engine/core/src/search/regex.ts): export type SearchRegexValidation = |{ ok: true} |{ ok: false; issue: SearchRegexIssue; message: string} ; SearchResult [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchResult{ readonly status: 'complete' | 'superseded' | 'cancelled'; readonly hitCount: number; } SearchReveal [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchReveal{ readonly align: RevealAlignment; readonly behavior: ScrollBehaviorKind; } SearchRevealOptions [TypeAliasDeclaration] (from packages/plugin/search/src/contract.ts): export type SearchRevealOptions = Partial; SearchSettings [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchSettings{ readonly reveal: SearchReveal; readonly highlight:{ readonly color: string; readonly activeColor: string; readonly blendMode: BlendMode; } ; } SearchSnippet [InterfaceDeclaration] (from packages/engine/core/src/search/types.ts): export interface SearchSnippet{ before: string; match: string; after: string; } SearchStartedEvent [InterfaceDeclaration] (from packages/plugin/search/src/contract.ts): export interface SearchStartedEvent{ readonly query: SearchQuery; } SearchState [InterfaceDeclaration] (from packages/plugin/search/src/state.ts): export interface SearchState{ readonly query: SearchQuery | null; readonly status: SearchStatus; readonly hitCount: number; readonly activeHitIndex: number; readonly activeHit: SearchHit | null; readonly progress: SearchProgress; readonly error: PluginErrorInfo | null; } SearchStatus [TypeAliasDeclaration] (from packages/plugin/search/src/contract.ts): export type SearchStatus = 'idle' | 'searching' | 'complete' | 'cancelled' | 'error'; SearchToken [VariableDeclaration] (from packages/plugin/search/src/token.ts): SearchToken = createCapabilityToken('search', { hint: "add searchPlugin() from '@embedpdf/plugin-search' to your plugins list", promises:{ search: true, refresh: true, findAll: true, } , } ) SelectionAnchor [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionAnchor{ readonly page: PageRef; readonly bounds: Rect; } SelectionAuthoring [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type SelectionAuthoring = |{ kind: 'markup'} |{ kind: 'text-edit'; operation: 'insert' | 'replace'} ; SelectionCapability [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionCapability extends SettingsApi{ canSelect(): boolean; canCopy(): boolean; select(range: SelectionRangeInput): void; selectAll(): void; selectPage(page: PageRef | number): void; selectWordAt(page: PageRef | number, point: Point): boolean; selectLineAt(page: PageRef | number, point: Point): boolean; extendTo(page: PageRef | number, point: Point): void; clear(): void; hasSelection(): boolean; isSelecting(): boolean; getSnapshot(): SelectionSnapshot; getRange(): TextRange | null; listSelectedPages(): readonly PageRef[]; listSegments(page: PageRef | number): readonly SelectionSegment[]; listRects(page: PageRef | number): readonly Rect[]; getAnchor(): SelectionAnchor | null; readText(options?: OperationOptions): Promise; readTextInRange(range: TextRange, options?: OperationOptions): Promise; readonly onChanged: EventHook; readonly onCommitted: EventHook; readonly onCleared: EventHook; } SelectionChangedEvent [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionChangedEvent{ readonly range: TextRange | null; readonly pages: readonly PageRef[]; } SelectionClearedEvent [TypeAliasDeclaration] (from packages/plugin/selection/src/contract.ts): export type SelectionClearedEvent = Record; SelectionCommittedEvent [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionCommittedEvent{ readonly range: TextRange; } SelectionConfig [TypeAliasDeclaration] (from packages/plugin/selection/src/contract.ts): export type SelectionConfig = DeepPartial; SelectionEndpoint [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionEndpoint{ readonly page: PageRef; readonly glyphQuad: Quad; readonly advance: 1 | -1; readonly rect: Rect; } SelectionHandleDragSession [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleDragSession{ move(overlay: Point): void; end(): void; } SelectionHandleEndpoint [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleEndpoint{ page: PageRef; glyphQuad: Quad; advance: 1 | -1; } SelectionHandleEndpoints [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleEndpoints{ start: SelectionHandleEndpoint; end: SelectionHandleEndpoint; } SelectionHandleGeometry [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleGeometry{ bar:{ from: Point; to: Point} ; length: number; rotation: number; upright: boolean; head: Point; } SelectionHandleStage [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleStage{ pageToViewport(page: PageRef, point: Point): Point | null; getPageAt(point: Point):{ ref: PageRef; point: Point} | null; viewportToPage(page: PageRef, point: Point): Point | null; } SelectionHandleTarget [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleTarget{ beginGestureAt(page: PageRef, point: Point): boolean; extendTo(page: PageRef, point: Point): void; endGesture(): void; } SelectionHandleView [InterfaceDeclaration] (from packages/plugin/selection/src/handles.ts): export interface SelectionHandleView{ toOverlay(page: PageRef, point: Point): Point | null; pageAt(overlay: Point):{ ref: PageRef; point: Point} | null; pointOnPage(page: PageRef, overlay: Point): Point | null; } SelectionRangeInput [TypeAliasDeclaration] (from packages/plugin/selection/src/contract.ts): export type SelectionRangeInput = TextRange |{ page: PageRef; start: number; count: number} ; SelectionSegment [TypeAliasDeclaration] (from packages/plugin/selection/src/geometry.ts): export type SelectionSegment = PdfTextSegment; SelectionSettings [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionSettings{ readonly dragThresholdPx: number; readonly color: string | null; readonly handles:{ readonly color: string | null; readonly shadow: string; } ; } SelectionSnapshot [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface SelectionSnapshot{ readonly pages: readonly{ page: PageRef; segments: readonly SelectionSegment[]} []; readonly start: SelectionEndpoint | null; readonly end: SelectionEndpoint | null; readonly direction: 'forward' | 'backward'; readonly range: TextRange | null; } SelectionState [InterfaceDeclaration] (from packages/plugin/selection/src/state.ts): export interface SelectionState{ readonly hasSelection: boolean; readonly isSelecting: boolean; readonly range: TextRange | null; readonly pages: readonly PageRef[]; } SelectionToken [VariableDeclaration] (from packages/plugin/selection/src/token.ts): SelectionToken = createCapabilityToken('selection', { hint: `add selectionPlugin() from '@embedpdf/plugin-selection' to your plugins list`, promises:{ readText: true, readTextInRange: true, } , } ) SendChange [TypeAliasDeclaration] (from packages/core/main/src/changes.ts): export type SendChange = ( doc: DocumentHandle, write:{ readonly opId: string} , ) => PromiseLike; SerialQueue [InterfaceDeclaration] (from packages/core/main/src/serial-queue.ts): export interface SerialQueue{ (operation: () => Promise, options?: OperationOptions): Promise; idle(): Promise; } SettingLock [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface SettingLock{ readonly by: string; readonly reasonKey?: string; } Settings [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface Settings{ get(): T; readonly api: SettingsApi; } SettingsApi [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface SettingsApi{ getSettings(): T; updateSettings(changes: DeepPartial): void; resetSettings(): void; readonly onSettingsChanged: EventHook>; } SettingsChangedEvent [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface SettingsChangedEvent{ readonly settings: T; readonly changedKeys: readonly (keyof T)[]; } SettingsDeclaration [InterfaceDeclaration] (from packages/core/main/src/settings.ts): export interface SettingsDeclaration{ readonly defaults: T; readonly registered?: DeepPartial | undefined; readonly whole?: readonly SettingPath[]; } SettingsOf [TypeAliasDeclaration] (from packages/core/main/src/settings.ts): export type SettingsOf = Capability extends{ getSettings(): infer T} ? T : never; SettledChange [TypeAliasDeclaration] (from packages/core/main/src/changes.ts): export type SettledChange = |{ readonly change: PendingChange; readonly status: 'applied'; readonly result: ChangeResult} |{ readonly change: PendingChange; readonly status: 'refused'; readonly error: PluginError} ; ShellCapability [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface ShellCapability{ isOpen(id: string): boolean; getSurface(id: string): SurfaceState | null; listOpenSurfaces(): readonly SurfaceState[]; open(id: string, options?: OpenSurfaceOptions): void; close(id: string): void; toggle(id: string, options?: OpenSurfaceOptions): void; updateSurfaceProps(id: string, props: SurfaceProps): void; closeAll(): void; isMenuOpen(id: string): boolean; listOpenMenus(): readonly string[]; openMenu(id: string): void; closeMenu(id: string): void; toggleMenu(id: string): void; closeAllMenus(): void; getSnapshot(): ShellSnapshot; applySnapshot(snapshot: ShellSnapshot): void; readonly onSurfaceOpened: EventHook; readonly onSurfaceClosed: EventHook; readonly onMenuOpened: EventHook; readonly onMenuClosed: EventHook; } ShellSnapshot [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface ShellSnapshot{ readonly surfaces: Readonly>>; readonly openMenus: readonly string[]; } ShellState [InterfaceDeclaration] (from packages/plugin/shell/src/state.ts): export interface ShellState{ readonly openSurfaces: readonly SurfaceState[]; readonly openMenus: readonly string[]; } ShellToken [VariableDeclaration] (from packages/plugin/shell/src/token.ts): ShellToken = createCapabilityToken('shell', { hint: `add shellPlugin() from '@embedpdf/plugin-shell' to your plugins list`, } ) SignFieldInput [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignFieldInput{ field: FormFieldRef; mark: Mark; signingKey?: SigningKey; timestampAuthority?: CmsSigner | null; signer?: SignatureSignerInput; appearance?: BinarySource; certify?:{ permission: DocMdpPermission} ; lock?: FieldLockSpec; } SignFieldResult [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignFieldResult extends SignatureCompleteResult{ readonly validationInfo: ValidationInfoAdded | null; readonly validationInfoError: PluginError | null; } Signature [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface Signature{ index: number; field: FormFieldRef; fieldName: string; widget: FormFieldWidget | null; signed: boolean; kind: SignatureKind; filter: string | null; subFilter: string | null; byteRange: [number, number, number, number] | null; contentsSizeBytes: number; coverage: SignatureCoverage | null; revisionIndex: number | null; signer: SignatureSigner; docMdp: DocMdpPermission | null; catalogCertification: boolean; fieldMdp: FieldLockSpec | null; lock: FieldLockSpec | null; seedValue: SignatureSeedValue | null; } SignatureCapability [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureCapability extends SettingsApi{ getSnapshot(): SignatureSnapshot | null; getStatus(): ResourceStatus; listSignatures(): readonly SignatureInfo[]; listUnsignedFields(): readonly FormFieldRef[]; getSignature(field: SignatureFieldAddress): SignatureInfo | null; listVerdicts(): readonly SignatureVerdict[] | null; getVerdict(field: SignatureFieldAddress): SignatureVerdict | null; getProtection(): DocumentProtection | null; getPending(): SignaturePending | null; isBusy(): boolean; getMode(): SignatureMode; getTarget(): FormFieldRef | null; sign(input: SignFieldInput, options?: OperationOptions): Promise; prepareSignature( input: PrepareSignatureInput, options?: OperationOptions, ): Promise; completeSignature( signingId: string, cms: Uint8Array, options?: OperationOptions, ): Promise; cancelPending(options?: OperationOptions): Promise; fillField(field: FormFieldRef, mark: Mark, options?: OperationOptions): Promise; clearField(field: FormFieldRef, options?: OperationOptions): Promise; placeMark( mark: Mark, target:{ field: FormFieldRef} | StampPlacement, options?: OperationOptions, ): Promise; setTarget(field: FormFieldRef | null): void; requestInspection(field: FormFieldRef): void; refresh(options?: OperationOptions): Promise; validate(options?: SignatureValidateOptions): Promise; validateField( field: SignatureFieldAddress, options?: SignatureValidateOptions, ): Promise; addValidationInfo( field?: SignatureFieldAddress, options?: OperationOptions, ): Promise; analyzeChanges(input: AnalyzeInput, options?: OperationOptions): Promise; readRevision( target: SignatureFieldAddress |{ revisionIndex: number} , options?: OperationOptions, ): Promise; canSign(field: FormFieldRef): boolean; canFill(field: FormFieldRef): boolean; canCertify(): boolean; canReadRevision(): boolean; canAddValidationInfo(): boolean; readonly onSigned: EventHook; readonly onFilled: EventHook; readonly onCleared: EventHook; readonly onValidated: EventHook; readonly onProtectionChanged: EventHook; readonly onInvalidationPredicted: EventHook; readonly onTargetChanged: EventHook; readonly onSignRequested: EventHook; readonly onInspectionRequested: EventHook; } SignatureClearedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureClearedEvent{ readonly field: FormFieldRef; } SignatureCompleteResult [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface SignatureCompleteResult{ status: 'completed' | 'already-completed'; signature: Signature; version: BaseVersionInfo; previous: DocumentVersionRef; protection: DocumentProtection; meta: MutationMeta; } SignatureConfig [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type SignatureConfig = Partial; SignatureFieldAddress [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type SignatureFieldAddress = FormFieldRef | AnnotationRef | FormWidget; SignatureFilledEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureFilledEvent{ readonly field: FormFieldRef; } SignatureInfo [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureInfo extends Signature{ readonly verdict: SignatureVerdict | null; } SignatureInspectionRequestedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureInspectionRequestedEvent{ readonly field: FormFieldRef; } SignatureInvalidationPredictedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureInvalidationPredictedEvent{ readonly field: FormFieldRef; readonly detail: string; } SignatureMode [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type SignatureMode = 'sign' | 'visual' | 'ask'; SignaturePending [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignaturePending{ readonly signingId: string; readonly field: FormFieldRef; } SignaturePrepared [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface SignaturePrepared{ signingId: string; digest: Uint8Array; algorithm: Exclude; byteRange: [number, number, number, number]; contentsSizeBytes: number; subFilter: SignatureSubFilter | 'ETSI.RFC3161'; expectedVersion: DocumentVersionRef; expiresAt: string | null; field?: FormFieldRef; } SignatureProtectionChangedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureProtectionChangedEvent{ readonly protection: DocumentProtection; } SignatureSettings [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureSettings{ readonly signingKey: SigningKey | null; readonly mode: SignatureMode | null; readonly timestampAuthority: CmsSigner | null; readonly revocation: RevocationSource | null; readonly documentTimestamp: boolean; readonly trust: TrustPort | null; readonly allowCertify: boolean; } SignatureSignRequestedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureSignRequestedEvent{ readonly field: FormFieldRef; readonly mark: Mark; } SignatureSignedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureSignedEvent{ readonly field: FormFieldRef; readonly result: SignatureCompleteResult; readonly origin: EventOrigin; } SignatureSnapshot [InterfaceDeclaration] (from packages/engine/core/src/signature/types.ts): export interface SignatureSnapshot{ chainValid: boolean; revisions: PdfRevision[]; signatures: Signature[]; protection: DocumentProtection; } SignatureState [InterfaceDeclaration] (from packages/plugin/signature/src/state.ts): export interface SignatureState{ readonly signatures: readonly SignatureInfo[]; readonly protection: DocumentProtection | null; readonly target: FormFieldRef | null; readonly busy: boolean; readonly pending: SignaturePending | null; readonly status: ResourceStatus; } SignatureTargetChangedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureTargetChangedEvent{ readonly field: FormFieldRef | null; } SignatureToken [VariableDeclaration] (from packages/plugin/signature/src/token.ts): SignatureToken = createCapabilityToken('signature', { hint: `add signaturePlugin() from '@embedpdf/plugin-signature' to your plugins list`, promises:{ sign: true, prepareSignature: true, completeSignature: true, cancelPending: true, fillField: true, clearField: true, placeMark: true, refresh: true, validate: true, validateField: true, addValidationInfo: true, analyzeChanges: true, readRevision: true, } , } ) SignatureValidateOptions [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureValidateOptions extends OperationOptions{ readonly validationTime?: ValidationTime |{ readonly kind: 'earliest-timestamp'} ; readonly until?: 'persisted' | 'working-copy'; } SignatureValidatedEvent [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignatureValidatedEvent{ readonly verdicts: readonly SignatureVerdict[]; } SignatureVerdict [InterfaceDeclaration] (from packages/core/signature/src/verdict.ts): export interface SignatureVerdict{ signature: Signature; integrity: IntegrityVerdict; cryptography: CryptographyVerdict; trust: TrustStatus; trustReason?: string; validationTime: AppliedValidationTime; revocation: RevocationVerdict; revocationReason?: string; modifications:{ verdict: ModificationsVerdict; detail?: string; basis: 'persisted' | 'working-copy'; laterRevisions?: number; undone?: boolean; } ; summary: 'valid' | 'valid-untrusted' | 'invalid' | 'indeterminate'; cms: ParsedCms | null; timestamp: TimestampVerdict | null; longTerm: LongTermVerdict; } SignerPort [TypeAliasDeclaration] (from packages/core/signature/src/sign.ts): export type SignerPort = CmsSigner | RawSigner; SignerRow [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface SignerRow{ readonly libraryId: string; readonly name: string; readonly library: StampLibrary; readonly signatures: StampAsset[]; readonly initials: StampAsset | null; } SigningKey [TypeAliasDeclaration] (from packages/plugin/signature/src/contract.ts): export type SigningKey = SignerPort | (() => SignerPort | Promise); Size [InterfaceDeclaration] (from packages/core/geometry/src/index.ts): export interface Size{ width: number; height: number; } SizingMode [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type SizingMode = 'intrinsic' | 'uniform'; SliceChange [InterfaceDeclaration] (from packages/core/main/src/store.ts): export interface SliceChange{ readonly next: S; readonly previous: S; } SliceLease [InterfaceDeclaration] (from packages/core/main/src/store.ts): export interface SliceLease{ readonly key: string; readonly instanceId: string; readonly live: boolean; read(): S; write(next: S): boolean; readonly onChange: EventHook>; revoke(): void; } SnapSettings [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface SnapSettings{ readonly alignment: boolean; readonly alignmentThresholdPx: number; readonly rotation: boolean; readonly rotationAngles: readonly number[]; readonly rotationThresholdDeg: number; } Snapshot [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface Snapshot{ readonly page: PageRef; readonly rect: Rect; readonly image: Promise; } SnapshotBoxLook [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface SnapshotBoxLook{ readonly fill: string | null; readonly stroke: string | null; } SnapshotChangedEvent [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface SnapshotChangedEvent{ readonly snapshot: Snapshot | null; } SnapshotSettings [InterfaceDeclaration] (from packages/plugin/render/src/contract.ts): export interface SnapshotSettings{ readonly scale: number; readonly box: SnapshotBoxLook; } SplitPaneOptions [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface SplitPaneOptions{ readonly from?: PaneId; } SpreadMode [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type SpreadMode = 'none' | 'odd' | 'even'; StageBox [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageBox{ readonly width: number; readonly height: number; readonly orientation: 'portrait' | 'landscape'; } StageCameraChangedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageCameraChangedEvent{ readonly camera: Camera; } StageCapability [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageCapability{ getCamera(): Camera; setCamera(camera: Camera): void; getViewportSize(): Size; getZoomLevel(): number; getZoomMode(): ZoomModeValue | 'custom'; getViewRotation(): Rotation; getCurrentPage(): PageRef | null; getCurrentPageIndex(): number; getPageCount(): number; listCurrentItemPages(): readonly PageInfo[]; listCurrentPages(): readonly PageInfo[]; listVisiblePages(): readonly VisiblePage[]; isPageVisible(page: PageRef | number): boolean; getViewpoint(): Viewpoint; getCurrentDestination(): PageDestination | null; getViewState(): StageViewState; applyViewState(view: StageViewState): void; isMoving(): boolean; stopMotion(): void; zoomTo(zoom: number | ZoomSpec, options?: ZoomToOptions): void; zoomBy(factor: number, options?: ZoomToOptions): void; zoomIn(options?: ZoomToOptions): void; zoomOut(options?: ZoomToOptions): void; canZoomIn(): boolean; canZoomOut(): boolean; fitWidth(): void; fitPage(): void; fitAll(): void; fitAutomatic(): void; goToPage(page: PageRef | number, options?: GoToOptions): void; goToDestination(destination: PageDestination, options?: GoToDestinationOptions): void; goToFirstPage(options?: GoToOptions): void; goToLastPage(options?: GoToOptions): void; nextPage(options?: GoToOptions): void; previousPage(options?: GoToOptions): void; canGoNext(): boolean; canGoPrevious(): boolean; reveal(page: PageRef | number, options?: RevealOptions): void; scrollTo(options: StageScrollToOptions): void; scrollBy(options: StageScrollToOptions): void; panBy(dxViewport: number, dyViewport: number): void; resetView(): void; setViewRotation(rotation: Rotation): void; rotateViewBy(delta: 90 | -90): void; getSettings(): StageSettings; updateSettings(changes: StageSettingsPatch): void; resetSettings(): void; setResponsiveRules(rules: readonly ResponsiveRule[]): void; lockSettings(lock: StageSettingsLock): () => void; getLock(setting: keyof StageSettings): SettingLock | null; listActiveRules(): readonly string[]; matchesRule(name: string): boolean; getPageAt(point: ViewportPoint):{ ref: PageRef; point: Point; scale: number; rotation: Rotation; zoom: number; } | null; viewportToPage(page: PageRef | number, point: ViewportPoint): Point | null; pageToViewport(page: PageRef | number, point: Point): ViewportPoint | null; pageRectToViewport(page: PageRef | number, rect: Rect): ViewportRect | null; getPageBox(page: PageRef | number): VisiblePage | null; readonly onPageChanged: EventHook; readonly onZoomChanged: EventHook; readonly onCameraChanged: EventHook; readonly onMotionEnded: EventHook; readonly onSettingsChanged: EventHook; readonly onViewportChanged: EventHook; } StageConfig [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageConfig extends StageSettingsPatch{ responsive?: readonly ResponsiveRule[]; } StageMotionEndedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageMotionEndedEvent{ readonly camera: Camera; } StagePageChangedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StagePageChangedEvent{ readonly page: PageRef | null; readonly pageIndex: number; readonly previousPageIndex: number; } StagePluginOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StagePluginOptions extends StageConfig{ id?: string; token?: CapabilityToken; } StageScrollToOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageScrollToOptions{ left?: number; top?: number; behavior?: ScrollBehaviorKind; } StageSettings [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageSettings{ readonly flow: FlowMode; readonly layout: LayoutKind; readonly spread: SpreadMode; readonly sizing: SizingMode; readonly columns: GridColumns; readonly bounded: boolean; readonly padding: Padding; readonly gap: Gap; readonly pageFrame: PageFrame; readonly direction: Direction; readonly fitAlign: Alignment; readonly arrivalAlign: ArrivalAlignment; readonly zoomAlign: AlignmentValue; readonly anchorAlign: AlignmentValue; readonly viewRotation: Rotation; readonly zoom: ZoomSpec; readonly minZoom: number; readonly maxZoom: number; readonly scrollBehavior: ScrollBehaviorKind; readonly interaction: boolean; readonly panFallback: boolean; readonly zoomGestures: boolean; readonly turnGestures: boolean; readonly scrollChaining: boolean; readonly zoomBox: ZoomBoxLook; readonly viewUnitsPerPoint: number; } StageSettingsChangedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageSettingsChangedEvent{ readonly settings: StageSettings; readonly changedKeys: readonly (keyof StageSettings)[]; } StageSettingsLock [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageSettingsLock extends SettingLock{ readonly settings: Omit; } StageSettingsPatch [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageSettingsPatch extends Partial< Omit >{ padding?: number | Partial; pageFrame?: Partial; zoomBox?: Partial; } StageState [InterfaceDeclaration] (from packages/plugin/stage/src/state.ts): export interface StageState{ readonly zoomLevel: number; readonly zoomMode: ZoomModeValue | 'custom'; readonly currentPageIndex: number; readonly currentPage: PageRef | null; readonly pageCount: number; readonly viewRotation: Rotation; readonly activeRules: readonly string[]; } StageToken [VariableDeclaration] (from packages/plugin/stage/src/token.ts): StageToken = createCapabilityToken('stage', { hint: `add stagePlugin() from '@embedpdf/plugin-stage' to your plugins list`, } ) StageTokenProp [TypeAliasDeclaration] (from packages/framework/angular/stage/src/stage-ref.ts): export type StageTokenProp = CapabilityToken; StageViewState [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageViewState extends StageSettings{ readonly pageIndex: number; readonly anchor: Anchor; } StageViewportChangedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageViewportChangedEvent{ readonly size: Size; } StageZoomChangedEvent [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface StageZoomChangedEvent{ readonly level: number; readonly previousLevel: number; readonly mode: ZoomModeValue | 'custom'; } StagedChange [TypeAliasDeclaration] (from packages/core/main/src/changes.ts): export type StagedChange = |{ readonly label: ChangeLabel; readonly ops: readonly ChangeOp[]; readonly undo?: readonly PredictedOp[]; readonly history?: false; } |{ readonly label: ChangeLabel; readonly undoOf: string; readonly shows: readonly PredictedOp[]; } |{ readonly label: ChangeLabel; readonly send: SendChange; readonly opId?: string; readonly history?: false; } ; StagedPrint [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface StagedPrint{ print(): Promise; destroy(): void; } StampArmChangedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampArmChangedEvent{ readonly documentId: string; readonly asset: StampAsset | null; } StampArmOptions [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampArmOptions extends StampDocumentOptions{ readonly targetWidth?: number; } StampAsset [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAsset{ readonly id: string; readonly libraryId: string; readonly kind: StampAssetKind; readonly name: string; readonly label: string; readonly size:{ width: number; height: number} ; readonly page: PageRef; readonly subject?: string; readonly categories?: string[]; } StampAssetCreatedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetCreatedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: StampAsset; } StampAssetDeletedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetDeletedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: null; } StampAssetEngine [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type StampAssetEngine = LocalEngine | (() => LocalEngine | Promise); StampAssetFilter [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetFilter{ readonly libraryId?: string; readonly kind?: StampAssetKind; readonly category?: string; } StampAssetKind [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type StampAssetKind = 'stamp' | 'signature' | 'initials'; StampAssetPatch [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetPatch{ readonly label?: string; readonly subject?: string | null; readonly categories?: string[]; } StampAssetPreview [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetPreview{ readonly bytes: Uint8Array; readonly mimeType: string; } StampAssetUpdatedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampAssetUpdatedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: StampAsset; } StampCapability [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampCapability extends SettingsApi{ listLibraries(filter?: StampLibraryFilter): readonly StampLibrary[]; getLibrary(libraryId: string): StampLibrary | null; listAssets(filter?: StampAssetFilter): readonly StampAsset[]; getAsset(assetId: string): StampAsset | null; getAssetPreview(assetId: string): StampAssetPreview | null; renderAssetPreview( assetId: string, options:{ width: number} & OperationOptions, ): Promise; getAssetBytes(assetId: string): Uint8Array | null; createLibrary(name: string, options?: CreateLibraryOptions): Promise<{ library: StampLibrary} >; updateLibrary( libraryId: string, changes: StampLibraryPatch, options?: OperationOptions, ): Promise<{ library: StampLibrary} >; deleteLibrary(libraryId: string, options?: OperationOptions): Promise; importLibrary( source: BinarySource, options?: ImportLibraryOptions, ): Promise<{ library: StampLibrary} >; exportLibrary(libraryId: string, options?: OperationOptions): Promise; createAsset(input: CreateAssetInput, options?: OperationOptions): Promise<{ asset: StampAsset} >; createAssetFromAnnotations( page: PageRef | number, refs: readonly AnnotationRef[], input: AssetFromAnnotationsInput, options?: StampDocumentOptions, ): Promise<{ asset: StampAsset} >; updateAsset( assetId: string, changes: StampAssetPatch, options?: OperationOptions, ): Promise<{ asset: StampAsset} >; deleteAsset(assetId: string, options?: OperationOptions): Promise; moveAsset( assetId: string, to:{ libraryId: string} , options?: OperationOptions, ): Promise<{ asset: StampAsset} >; duplicateAsset( assetId: string, options?:{ label?: string} & OperationOptions, ): Promise<{ asset: StampAsset} >; armAsset(assetId: string, options?: StampArmOptions): Promise; disarm(documentId?: string): void; getArmedAsset(documentId?: string): StampAsset | null; placeAsset( assetId: string, placement: StampPlacement, options?: StampDocumentOptions, ): Promise<{ annotation: Annotation} >; placeAssetOnPages( assetId: string, pages: readonly (PageRef | number)[] | 'all', placement: Omit, options?: StampDocumentOptions, ): Promise>; canPlace(documentId?: string): boolean; canCreateFromAnnotations(documentId?: string): boolean; canImport(): boolean; readonly onLibraryCreated: EventHook; readonly onLibraryUpdated: EventHook; readonly onLibraryDeleted: EventHook; readonly onAssetCreated: EventHook; readonly onAssetUpdated: EventHook; readonly onAssetDeleted: EventHook; readonly onArmChanged: EventHook; readonly onLibraryChanged: EventHook; } StampConfig [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type StampConfig = DeepPartial; StampDocumentOptions [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampDocumentOptions extends OperationOptions{ readonly documentId?: string; } StampFont [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampFont{ readonly key: string; readonly load: () => Promise; } StampInput [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface StampInput{ source: BinarySource; targetWidth?: number; name?: string; subject?: string; preview?: BinarySource | StampPreviewProvider; intrinsicSize?:{ width: number; height: number} ; } StampLibrary [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibrary{ readonly id: string; readonly name: string; readonly kind: StampLibraryKind; readonly locale?: string; readonly categories?: string[]; readonly assetIds: string[]; } StampLibraryChangedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryChangedEvent{ readonly libraryId: string; readonly type: | 'created' | 'imported' | 'updated' | 'asset-created' | 'asset-updated' | 'asset-deleted' | 'deleted'; } StampLibraryCreatedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryCreatedEvent{ readonly libraryId: string; readonly library: StampLibrary; } StampLibraryDeletedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryDeletedEvent{ readonly libraryId: string; readonly library: null; } StampLibraryFilter [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryFilter{ readonly kind?: StampLibraryKind | readonly StampLibraryKind[]; } StampLibraryKind [TypeAliasDeclaration] (from packages/plugin/stamp/src/contract.ts): export type StampLibraryKind = string; StampLibraryPatch [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryPatch{ readonly name?: string; readonly categories?: string[]; } StampLibraryStore [InterfaceDeclaration] (from packages/plugin/stamp/src/persistence.ts): export interface StampLibraryStore{ list(): Promise>; put(id: string, bytes: Uint8Array): Promise; delete(id: string): Promise; } StampLibraryUpdatedEvent [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampLibraryUpdatedEvent{ readonly libraryId: string; readonly library: StampLibrary; } StampPlacement [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface StampPlacement{ readonly page: PageRef | number; readonly center: Point; readonly targetWidth?: number; readonly rotation?: number; readonly select?: boolean; } StampPreviewProvider [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type StampPreviewProvider = (devicePixelWidth: number) => Promise; StampSettings [InterfaceDeclaration] (from packages/plugin/stamp/src/contract.ts): export interface StampSettings{ readonly assetEngine: StampAssetEngine | null; readonly fonts: readonly StampFont[]; readonly previewWidth: number; readonly dynamic: boolean; } StampSourceSpec [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type StampSourceSpec ={ kind: 'bytes'; source: BinarySource} | PromptSourceSpec; StampState [InterfaceDeclaration] (from packages/plugin/stamp/src/state.ts): export interface StampState{ readonly armedAsset: StampAsset | null; } StampToken [VariableDeclaration] (from packages/plugin/stamp/src/token.ts): StampToken = createCapabilityToken('stamp', { hint: `add stampPlugin() from '@embedpdf/plugin-stamp' to your plugins list`, } ) StateCell [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface StateCell{ get(): State; update( transition: (state: State, ...args: Args) => State, ...args: Args ): void; readonly onChange: EventHook>; } StateChange [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface StateChange{ readonly next: S; readonly previous: S; } StateDeclaration [InterfaceDeclaration] (from packages/core/main/src/state.ts): export interface StateDeclaration{ readonly token: CapabilityToken; readonly read: (capability: Capability) => State; readonly empty: State; readonly ensure?: (capability: Capability) => Promise; } StreamName [TypeAliasDeclaration] (from packages/framework/angular/runtime/src/service.ts): export type StreamName = Event extends `on${ infer Name} ` ? `${ Uncapitalize} $` : never; Style [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface Style{ color: Color | null; interiorColor: Color | null; strokeWidth: number; opacity: number; blendMode: BlendMode; borderStyle: AnnotationBorderStyle; dashArray: number[] | null; cloudyIntensity: number | null; } SubmitIntent [InterfaceDeclaration] (from packages/plugin/actions/src/contract.ts): export interface SubmitIntent{ readonly url: string | null; readonly fields: PdfActionTargetRef[] | null; readonly exclude: boolean; readonly includeNoValueFields: boolean; readonly format: 'fdf' | 'html' | 'xfdf' | 'pdf'; readonly method: 'post' | 'get'; readonly charSet?: string; } Subscribable [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type Subscribable = | ((listener: (event: T) => void) => Unsubscribe) |{ subscribe(listener: (event: T) => void): Unsubscribe} ; SurfaceClosedEvent [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface SurfaceClosedEvent{ readonly id: string; } SurfaceOpenedEvent [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface SurfaceOpenedEvent{ readonly id: string; readonly props?: SurfaceProps; } SurfaceProps [TypeAliasDeclaration] (from packages/plugin/shell/src/contract.ts): export type SurfaceProps = Readonly>; SurfaceState [InterfaceDeclaration] (from packages/plugin/shell/src/contract.ts): export interface SurfaceState{ readonly id: string; readonly open: boolean; readonly exclusive?: string; readonly props?: SurfaceProps; readonly focusRequest: number; } SvgCursorOptions [InterfaceDeclaration] (from packages/framework/web/src/cursor.ts): export interface SvgCursorOptions{ svg: string; hotspot?:{ x: number; y: number} ; fallback?: string; } TestCertificateAuthority [InterfaceDeclaration] (from packages/core/signature/src/signers/test-authority.ts): export interface TestCertificateAuthority{ readonly certificate: Uint8Array; issueSigner(options?:{ commonName?: string; algorithm?: 'RSA-PKCS1-v1_5' | 'RSA-PSS' | 'ECDSA'; hash?: 'sha256' | 'sha384' | 'sha512'; unrevocable?: Unrevocable; } ): Promise; readonly revocation: RevocationSource; revoke( signer: Pick | Uint8Array, options?:{ at?: Date; reason?: RevocationReason} , ): void; } TestSigner [InterfaceDeclaration] (from packages/core/signature/src/signers/webcrypto.ts): export interface TestSigner extends RawSigner{ readonly certificate: Uint8Array; readonly privateKey: CryptoKey; } TestTimestampAuthority [InterfaceDeclaration] (from packages/core/signature/src/signers/webcrypto.ts): export interface TestTimestampAuthority extends CmsSigner{ readonly certificate: Uint8Array; } TextAlign [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type TextAlign = 'left' | 'center' | 'right'; TextDirection [TypeAliasDeclaration] (from packages/plugin/i18n/src/contract.ts): export type TextDirection = 'ltr' | 'rtl'; TextFormat [TypeAliasDeclaration] (from packages/plugin/annotation/src/rich-text.ts): export type TextFormat = 'bold' | 'italic' | 'underline'; TextItem [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface TextItem{ readonly id: string; readonly ref: AnnotationRef | null; readonly box: Rect; readonly contents: string; readonly richText:{ paragraphs: RichTextParagraph[]} ; readonly face:{ family: string; weight: number; italic: boolean} ; readonly programs: readonly MountableFontProgram[]; readonly editing: boolean; readonly rot?: number; readonly css:{ fontFamily: string; fontSize: number; color: string; fontWeight: number; fontStyle: 'normal' | 'italic'; textDecoration: 'none' | 'underline'; align: 'left' | 'center' | 'right'; padding: number; } ; } TextPosition [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface TextPosition{ readonly page: PageRef; readonly index: number; } TextRange [InterfaceDeclaration] (from packages/plugin/selection/src/contract.ts): export interface TextRange{ readonly start: TextPosition; readonly end: TextPosition; } TextSegment [TypeAliasDeclaration] (from packages/plugin/search/src/contract.ts): export type TextSegment = PdfTextSegment; TextSelection [InterfaceDeclaration] (from packages/plugin/annotation/src/rich-text.ts): export interface TextSelection extends RichTextRange{ id: string; } TextStyle [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface TextStyle{ fontFamily: string; fontSize: number; fontColor: Color; textAlign: TextAlign; bold?: boolean; italic?: boolean; underline?: boolean; } ThreadDeleteResult [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ThreadDeleteResult{ readonly deleted: AnnotationRef[]; readonly failed: Array<{ ref: AnnotationRef; error: unknown} >; } TilesSettings [InterfaceDeclaration] (from packages/plugin/render/src/paint-plan.ts): export interface TilesSettings{ size?: number; quantize?: 'exact' | readonly number[]; maxScale?: number; bleedPx?: number; engageRatio?: number; prefetch?:{ margin?: number; velocityBias?: boolean; } ; settleMs?: number; } TimestampVerdict [TypeAliasDeclaration] (from packages/core/signature/src/verdict.ts): export type TimestampVerdict = TimestampFacts & ( |{ readonly summary: 'valid' | 'valid-untrusted'; readonly stampedAt: string; readonly authorityCertificate: Uint8Array; } |{ readonly summary: 'invalid' | 'indeterminate'; readonly stampedAt: string | null; readonly authorityCertificate: Uint8Array | null; } ); Tool [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface Tool{ readonly id: ToolId; readonly cursor: Cursor; readonly touch?: ToolTouch; canUse?(): boolean; onPointerDown?(event: ToolPointerEvent): boolean | void; onPointerMove?(event: ToolPointerEvent): void; onPointerUp?(event: ToolPointerEvent): void; onHover?(event: ToolPointerEvent): void; } ToolAuthoringKind [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type ToolAuthoringKind = keyof typeof TOOL_DEFAULT_FIELDS; ToolChangedEvent [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface ToolChangedEvent{ readonly toolId: ToolId; readonly previousToolId: ToolId; } ToolCursorImage [TypeAliasDeclaration] (from packages/framework/web/src/cursor.ts): export type ToolCursorImage = SvgCursorOptions | string; ToolCursorSpec [InterfaceDeclaration] (from packages/framework/web/src/cursor.ts): export interface ToolCursorSpec{ toolId: string; cursors: Record; } ToolCursors [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type ToolCursors = Readonly>; ToolDefaults [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ToolDefaults{ readonly color?: string | null; readonly interiorColor?: string | null; readonly opacity?: number; readonly strokeWidth?: number; readonly fontFamily?: string; readonly fontSize?: number; readonly fontColor?: string; readonly textAlign?: 'left' | 'center' | 'right'; readonly icon?: string; readonly contents?: string | null; readonly [field: string]: unknown; } ToolDefaultsChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ToolDefaultsChangedEvent{ readonly toolId: string; readonly defaults: ToolDefaults; } ToolDefaultsFor [TypeAliasDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export type ToolDefaultsFor = ToolDraftOf & (K extends 'free-text' | 'free-text-callout' ? ToolRichText : unknown); ToolId [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type ToolId = string; ToolPointerEvent [InterfaceDeclaration] (from packages/plugin/interaction/src/contract.ts): export interface ToolPointerEvent{ readonly page: PageRef; readonly point: Point; readonly modifiers: Modifiers; readonly pointerType: PointerKind; } ToolTouch [TypeAliasDeclaration] (from packages/plugin/interaction/src/contract.ts): export type ToolTouch = 'draw' | 'tap'; Translate [TypeAliasDeclaration] (from packages/framework/angular/i18n/src/i18n.ts): export type Translate = (key: string, options?: TranslateOptions) => string; TranslateOptions [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface TranslateOptions{ params?: Readonly>; fallbackKey?: string; fallback?: string; } TranslationDictionary [InterfaceDeclaration] (from packages/plugin/i18n/src/contract.ts): export interface TranslationDictionary{ readonly [key: string]: string | TranslationDictionary; } TrustPort [InterfaceDeclaration] (from packages/core/signature/src/trust.ts): export interface TrustPort{ anchors(): Promise; timestampAnchors?(): Promise; } UnlockOptions [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface UnlockOptions extends OperationOptions{ readonly password: string; } Unsubscribe [TypeAliasDeclaration] (from packages/core/main/src/types.ts): export type Unsubscribe = () => void; UrlSource [InterfaceDeclaration] (from packages/core/main/src/types.ts): export interface UrlSource{ readonly kind: 'url'; readonly url: string; readonly id?: string; } VIEWER_DEFAULTS [VariableDeclaration] (from packages/core/main/src/viewer-settings.ts): VIEWER_DEFAULTS: ViewerSettings = Object.freeze({ identity: null, scope: null, accent: '#3858e9', page: Object.freeze({ background: '#ffffff', shadow: '0 6px 18px rgb(0 0 0 / 0.18)'} ), } ) VIEWER_WHOLE_SETTINGS [VariableDeclaration] (from packages/core/main/src/viewer-settings.ts): VIEWER_WHOLE_SETTINGS = ['identity'] as const ValidationInfoAdded [InterfaceDeclaration] (from packages/plugin/signature/src/contract.ts): export interface ValidationInfoAdded{ readonly added: ValidationInfoCounts; readonly documentTimestamp: FormFieldRef | null; } ValidationInfoCounts [TypeAliasDeclaration] (from packages/engine/core/src/signature/types.ts): export type ValidationInfoCounts = Record; ValidationTime [TypeAliasDeclaration] (from packages/core/signature/src/trust.ts): export type ValidationTime = |{ kind: 'now'} |{ kind: 'timestamp'; stampedAt: string; tokenVerified: true; genTime?: string; } |{ kind: 'timestamp'; genTime: string; tokenVerified: true; stampedAt?: undefined; } ; Variant [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type Variant = 'icon+label' | 'icon' | 'label'; ViewDemandInput [InterfaceDeclaration] (from packages/plugin/render/src/paint-plan.ts): export interface PageViewDemand{ desiredDeviceWidth: number; visibleRect?: Rect; velocity?:{ dx: number; dy: number} ; } ViewManagerCapability [InterfaceDeclaration] (from packages/plugin/view-manager/src/contract.ts): export interface ViewManagerCapability{ listPanes(): readonly PaneInfo[]; getPane(id: PaneId): PaneInfo | null; getPaneOrder(): readonly PaneId[]; getFocusedPaneId(): PaneId | null; getPaneOfDocument(documentId: string): PaneId | null; createPane(options?: CreatePaneOptions): PaneId; deletePane(id: PaneId, options?: DeletePaneOptions): void; movePane(id: PaneId, toIndex: number): void; setFocusedPane(id: PaneId | null): void; splitPane(documentId: string, options?: SplitPaneOptions): PaneId; setActiveDocument(paneId: PaneId, documentId: string | null): void; addDocument(paneId: PaneId, documentId: string, index?: number): void; removeDocument(paneId: PaneId, documentId: string): void; moveDocumentWithin(paneId: PaneId, documentId: string, toIndex: number): void; moveDocumentBetween( fromPaneId: PaneId, toPaneId: PaneId, documentId: string, toIndex?: number, ): void; readonly onPaneCreated: EventHook; readonly onPaneDeleted: EventHook; readonly onFocusChanged: EventHook; readonly onDocumentMoved: EventHook; } ViewManagerState [InterfaceDeclaration] (from packages/plugin/view-manager/src/state.ts): export interface ViewManagerState{ readonly panes: readonly PaneInfo[]; readonly focusedPaneId: PaneId | null; } ViewManagerToken [VariableDeclaration] (from packages/plugin/view-manager/src/token.ts): ViewManagerToken = createCapabilityToken('view-manager', { hint: `add viewManagerPlugin() from '@embedpdf/plugin-view-manager' to your plugins list`, } ) ViewProjector [InterfaceDeclaration] (from packages/framework/web/src/anchored-position.ts): export interface ViewProjector{ space: 'overlay' | 'client'; toScreen(page: PageRef, rect: AnchoredRect): AnchoredRect | null; toScreenPoint(page: PageRef, at: AnchoredPoint): AnchoredPoint | null; viewEnv(page: PageRef): PageViewEnv | null; view(): AnchoredRect | null; } ViewerPageSettings [InterfaceDeclaration] (from packages/core/main/src/viewer-settings.ts): export interface ViewerPageSettings{ readonly background: string; readonly shadow: string; } ViewerSettings [InterfaceDeclaration] (from packages/core/main/src/viewer-settings.ts): export interface ViewerSettings{ readonly identity: Identity | null; readonly scope: readonly string[] | null; readonly accent: string; readonly page: ViewerPageSettings; } ViewerSettingsInput [InterfaceDeclaration] (from packages/core/main/src/viewer-settings.ts): export interface ViewerSettingsInput{ readonly identity?: Identity | null; readonly scope?: readonly string[] | null; readonly accent?: string; readonly page?: Partial; } Viewpoint [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface Viewpoint{ readonly anchor: Anchor; readonly zoom: ZoomSpec; } ViewportPoint [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type ViewportPoint = Point; ViewportRect [TypeAliasDeclaration] (from packages/plugin/stage/src/contract.ts): export type ViewportRect = Rect; VisiblePage [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface VisiblePage extends PageBox{ readonly ref: PageRef; readonly screenX: number; readonly screenY: number; readonly transform: PageTransform; readonly visibleRect: Rect; } VisitorAnswers [TypeAliasDeclaration] (from packages/engine/core/src/dto/GrantVisitor.ts): export type VisitorAnswers = Partial>; VisitorIdentityRequest [InterfaceDeclaration] (from packages/engine/core/src/dto/GrantVisitor.ts): export interface VisitorIdentityRequest{ readonly fields: Partial>; readonly missing: readonly VisitorIdentityField[]; readonly invalid: readonly VisitorIdentityField[]; readonly purpose?: string; readonly privacyUrl?: string; } WidgetActivationResult [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type WidgetActivationResult = |{ status: 'form'; result: FormCommitResult} |{ status: 'dispatched'; result: ActionTriggerResult} ; WidgetAddress [TypeAliasDeclaration] (from packages/plugin/form/src/contract.ts): export type WidgetAddress = AnnotationRef | FormWidget; WidgetAnnotation [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/widget/index.ts): export type WidgetAnnotation = ReadOf< typeof WidgetDeclaration, C >; WidgetHit [InterfaceDeclaration] (from packages/plugin/form/src/model.ts): export interface WidgetHit extends WidgetPlace{ readonly annotObjectNumber: number; readonly field: FormField; } WidgetPlace [InterfaceDeclaration] (from packages/plugin/form/src/model.ts): export interface WidgetPlace{ readonly box: Box; readonly rotation: 0 | 90 | 180 | 270; readonly rect: Box; } WorkingSetPage [InterfaceDeclaration] (from packages/engine/core/src/scheduling/facts.ts): export interface WorkingSetPage{ readonly page: PageRef; readonly role: 'visible' | 'near'; readonly visible?: PageBox; readonly pixels: number; } ZoomBoxLook [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface ZoomBoxLook{ readonly fill: string | null; readonly stroke: string | null; } ZoomMode [VariableDeclaration] (from packages/core/stage/src/index.ts): ZoomMode ={ Automatic: 'automatic', FitPage: 'fit-page', FitWidth: 'fit-width', FitAll: 'fit-all', } as const ZoomModeValue [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type ZoomModeValue = (typeof ZoomMode)[keyof typeof ZoomMode]; ZoomSpec [TypeAliasDeclaration] (from packages/core/stage/src/index.ts): export type ZoomSpec = |{ mode: ZoomModeValue} |{ level: number} |{ pageWidth: number} |{ pageHeight: number} ; ZoomToOptions [InterfaceDeclaration] (from packages/plugin/stage/src/contract.ts): export interface ZoomToOptions{ readonly around?: ViewportPoint; } actionsPlugin [VariableDeclaration] (from packages/plugin/actions/src/actions.plugin.ts): actionsPlugin = (config?: ActionsConfig) => definePlugin({ id: 'actions', token: ActionsToken, scope: 'document', settings:{ defaults: ACTIONS_DEFAULTS, registered: registeredSettings(config)} , create: (ctx) => createActionsController(ctx, config), } ) annotationCommands [VariableDeclaration] (from packages/framework/angular/annotation/src/commands.ts): annotationCommands = createAnnotationCommands() annotationKey [FunctionDeclaration] (from packages/engine/core/src/identity/annotationKey.ts): export function annotationKey(ref: AnnotationRef): string{ switch (ref.kind){ case 'objectNumber': return `obj:${ ref.objectNumber} `; case 'baseIndex': return `base:${ ref.page.objectNumber} :${ ref.baseIndex} `; } } annotationPlugin [VariableDeclaration] (from packages/plugin/annotation/src/annotation.plugin.ts): annotationPlugin = (config?: AnnotationConfig) => definePlugin({ id: 'annotation', token: AnnotationToken, scope: 'document', requires: [InteractionToken], optional: [SelectionToken, PublicActionsToken, RenderToken, FontsToken], state: initialAnnotationModel, settings:{ defaults: ANNOTATION_DEFAULTS, registered: config, whole: ['chrome.marquee']} , create: createAnnotationController, } ) annotationState [VariableDeclaration] (from packages/plugin/annotation/src/state.ts): annotationState = defineState(AnnotationToken, { read: (annotation): AnnotationState => ({ status: annotation.getStatus(), selected: annotation.selection.getSelected(), hovered: annotation.getHovered(), editing: annotation.text.getEditing(), } ), empty:{ status: 'loading', selected: [], hovered: null, editing: null} , } ) armSelectionHandle [FunctionDeclaration] (from packages/plugin/selection/src/handles.ts): export function armSelectionHandle( selection: SelectionHandleTarget, view: SelectionHandleView, endpoints: SelectionHandleEndpoints, role: 'start' | 'end', ): ArmedSelectionHandle | null{ const geometry = selectionHandleGeometry(view, endpoints[role], role); if (!geometry) return null; const opposite = endpoints[role === 'start' ? 'end' : 'start']; return{ base: midpoint(geometry.bar.from, geometry.bar.to), drag: createSelectionHandleDrag(selection, view, opposite, endpoints[role].page), } ; } attachmentPlugin [VariableDeclaration] (from packages/plugin/attachment/src/attachment.plugin.ts): attachmentPlugin = () => definePlugin({ id: 'attachment', token: AttachmentToken, scope: 'document', optional: [AnnotationToken, StageToken], state: initialAttachmentModel, create: createAttachmentController, } ) attachmentState [VariableDeclaration] (from packages/plugin/attachment/src/state.ts): attachmentState = defineState(AttachmentToken, { read: (attachment): AttachmentState => ({ files: attachment.list(), selected: attachment.getSelected(), status: attachment.getStatus(), canCreate: attachment.canCreate(), canDownload: attachment.canDownload(), } ), empty:{ files: [], selected: [], status: 'idle', canCreate: false, canDownload: false, } , ensure: (attachment) => attachment.ensureLoaded(), } ) boundCommandOf [FunctionDeclaration] (from packages/plugin/commands/src/contract.ts): export function boundCommandOf( command: ResolvedCommand, execute: (id: CommandId) => Promise, options:{ readonly isMac: boolean} , ): BoundCommand{ const [first] = command.shortcuts; return{ ...command, run: () => execute(command.id), shortcutLabel: first === undefined ? null : formatShortcut(first, { isMac: options.isMac} ), } ; } boxOf [VariableDeclaration] (from packages/plugin/stage/src/responsive.ts): boxOf = (size: Size): StageBox => ({ width: size.width, height: size.height, orientation: size.height >= size.width ? 'portrait' : 'landscape', } ) commandsPlugin [VariableDeclaration] (from packages/plugin/commands/src/commands.plugin.ts): commandsPlugin = (config?: CommandsConfig) => definePlugin({ id: 'commands', scope: 'workspace', token: CommandsToken, optional: [I18nToken, ShellToken], resolvesAnyCapability: true, settings:{ defaults: COMMANDS_DEFAULTS, registered: config as CommandsConfig | undefined, whole: ['appState'], } , create: createCommandsController, inScope: (commands, documentId) => ({ ...commands, resolveCommand: (id, target = documentId) => commands.resolveCommand(id, target), listCommands: (target = documentId) => commands.listCommands(target), searchCommands: (query, target = documentId) => commands.searchCommands(query, target), execute: (id, options) => commands.execute(id, { ...options, documentId: options?.documentId ?? documentId} ), canExecute: (id, target = documentId) => commands.canExecute(id, target), getRefusal: (id, target = documentId) => commands.getRefusal(id, target), } ), } ) composeApi [FunctionDeclaration] (from packages/core/main/src/compose.ts): export function composeApi( capability: string, slices: T, ): UnionToIntersection{ const seen = new Set(); const api: Record ={ } ; for (const slice of slices){ for (const key of Object.keys(slice)){ if (seen.has(key)){ throw new Error(`[${ capability} ] api member '${ key} ' is defined twice`); } seen.add(key); api[key] = (slice as Record)[key]; } } return api as UnionToIntersection; } copyImage [FunctionDeclaration] (from packages/framework/web/src/clipboard.ts): export async function copyImage( image: ClipboardImageSource | PromiseLike, ): Promise{ const blob = Promise.resolve(image).then((picture) => picture.blob()); await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob} )]); } copySelection [FunctionDeclaration] (from packages/framework/web/src/clipboard.ts): export async function copySelection( selection: Pick, ): Promise{ const text = await selection.readText(); if (text !== '') await navigator.clipboard.writeText(text); return text; } createCapabilityToken [FunctionDeclaration] (from packages/core/main/src/index.ts): export function createCapabilityToken( name: string, options?:{ hint?: string; promises?: PromiseMembers} , ): CapabilityToken{ return{ name, hint: options?.hint, ...(options?.promises ?{ promises: options.promises as Readonly>} :{ } ), } ; } createEventHook [FunctionDeclaration] (from packages/core/main/src/event-hook.ts): export function createEventHook( onListenerError?: (error: unknown) => void, ): EventHookSource{ let listeners: Set<(event: T) => void> | null = new Set(); return{ on(listener, options){ if (!listeners || options?.signal?.aborted) return () =>{ } ; listeners.add(listener); const off = () => void listeners?.delete(listener); options?.signal?.addEventListener('abort', off, { once: true} ); return off; } , emit(event){ if (!listeners) return; for (const listener of [...listeners]){ try{ listener(event); } catch (error){ onListenerError?.(error); } } } , destroy(){ listeners = null; } , } ; } createFormScriptingController [FunctionDeclaration] (from packages/plugin/form/src/scripting/controller.ts): export function createFormScriptingController( options: FormScriptingControllerOptions, ): FormScriptingController{ return new FormScriptingController(options); } createHostToken [FunctionDeclaration] (from packages/core/main/src/index.ts): export function createHostToken(token: CapabilityToken): CapabilityToken{ return token as CapabilityToken; } createHoverPump [FunctionDeclaration] (from packages/plugin/actions/src/hover-pump.ts): export function createHoverPump( dispatch: (trigger: ActionTrigger) => Promise, ): HoverPump{ let delivered: HoverTarget | null = null; let desired: HoverTarget | null = null; let inFlight = false; const pump = (): void =>{ if (inFlight || sameTarget(delivered, desired)) return; inFlight = true; const from = delivered; const to = desired; delivered = to; const submissions: Array> = []; if (from && from.events?.exit !== false){ submissions.push( dispatch({ type: 'annotation', event: 'cursorExit', annotation: from.ref, page: from.page, ...(from.source ?{ source: from.source} :{ } ), } ), ); } if (to && to.events?.enter !== false){ submissions.push( dispatch({ type: 'annotation', event: 'cursorEnter', annotation: to.ref, page: to.page, ...(to.source ?{ source: to.source} :{ } ), } ), ); } void Promise.allSettled(submissions).then(() =>{ inFlight = false; pump(); } ); } ; return{ hover(target){ desired = target; pump(); } , reset(){ delivered = null; desired = null; } , } ; } createKernel [FunctionDeclaration] (from packages/core/main/src/kernel.ts): export function createKernel(config:{ engine: Engine; plugins: AnyPlugin[]; settings?: DeepPartial; report?: (error: unknown) => void; clock?: HostClock; printer?: HostPrinter; measurer?: HostTextMeasurer; fetch?: HostFetch; } ): Kernel{ const{ engine, plugins} = config; const report = config.report ?? ((error: unknown) => console.error('[kernel]', error)); const store = createStore(report); const plan = planPlugins(plugins); const documentScopedPlugins = plan.ordered.filter(isDocumentScoped); const workspaceCapabilities = new Map, unknown>(); const workspaceLeases = new Map>(); const workspaceConnectors = new Map void>(); const workspaceCancel = new AbortController(); const workspaceScope = createScope(report); const inScopeByToken = new Map, NonNullable>([ [DocumentsToken, documentsInScope], ]); for (const plugin of plan.ordered){ if (plugin.token && plugin.inScope && !isDocumentScoped(plugin)){ inScopeByToken.set(plugin.token, plugin.inScope); } } const opened = createEventHook(report); const openFailed = createEventHook(report); const locked = createEventHook(report); const closed = createEventHook(report); const activeChanged = createEventHook(report); const pagesChanged = createEventHook(report); const unsavedChangesChanged = createEventHook(report); workspaceScope.defer(() =>{ for (const hook of [ opened, openFailed, locked, closed, activeChanged, pagesChanged, unsavedChangesChanged, ]) hook.destroy(); } ); const setCore = (patch: Partial): void =>{ const before = store.getCore().activeId; store.setCore(patch); const after = store.getCore().activeId; if (before !== after) activeChanged.emit({ documentId: after, previousDocumentId: before} ); } ; const sessions = new Map(); let status: KernelStatus = 'created'; let startPromise: Promise | null = null; let destroyPromise: Promise | null = null; const guardUsable = (what: string) =>{ if (status === 'failed' || status === 'destroying' || status === 'destroyed'){ throw new Error(`[kernel] ${ what} on a ${ status} kernel`); } } ; const checkpoint = (session: DocumentSession) =>{ if (session.cancel.signal.aborted){ throw new CancelledError(`closed while opening: ${ session.id} `); } } ; async function engineCall( session: DocumentSession, call: Promise, onLateResult?: (value: T) => void | Promise, ): Promise{ const abortable = call as Promise &{ abort?: (reason?: unknown) => void} ; session.engineOp = typeof abortable.abort === 'function' ? (abortable as never) : null; const signal = session.cancel.signal; let onAbort: (() => void) | undefined; const cancellation = new Promise((_, reject) =>{ onAbort = () => reject(new CancelledError(`closed while opening: ${ session.id} `)); if (signal.aborted) onAbort(); else signal.addEventListener('abort', onAbort, { once: true} ); } ); try{ return await Promise.race([call, cancellation]); } catch (error){ if (isCancelled(error)){ void call.then( (value) =>{ if (onLateResult) session.scope.defer(() => onLateResult(value)); } , () =>{ } , ); } throw error; } finally{ if (onAbort) signal.removeEventListener('abort', onAbort); session.engineOp = null; } } function createSession(id: string, name: string | undefined): DocumentSession{ const cancel = new AbortController(); const changes = createDocumentChanges({ handle: () => session.handle, notify: () =>{ refreshPages(session); store.notify(); } , report, } ); const session: DocumentSession ={ id, instanceId: `${ id} #${ ++instanceCounter} `, name, source: null, grantInput: null, openOptions: undefined, phase: 'opening', handle: null, stagedMeta: null, scope: createScope(report), operation: null, engineOp: null, cancel, signal: cancel.signal, capabilities: new Map(), building: new Set(), views: new Map(), connectors: new Map(), leases: new Map(), settleFlushes: new Set(), downloadWraps: [], printWraps: [], changes, pageView: createPageView({ changes, report} ), changeCount: 0, changesSeen: 0, close: () => closeSession(session), } ; session.settleFlushes.add(() => session.changes.settle()); session.scope.defer(() => session.changes.close()); return session; } function beginOperation(session: DocumentSession, run: () => Promise): Promise{ if (session.operation){ throw new Error(`[documents] "${ session.id} " already has an active transition`); } const operation = run().finally(() =>{ if (session.operation === operation) session.operation = null; } ); session.operation = operation; return operation; } function rekeySession(session: DocumentSession, nextId: string): void{ const previousId = session.id; if (previousId === nextId) return; const core = store.getCore(); if (sessions.has(nextId) || core.documents[nextId] || core.pending[nextId]){ throw new PluginError('conflict', 'documents', `duplicate document id: ${ nextId} `); } sessions.delete(previousId); session.id = nextId; sessions.set(nextId, session); session.views.clear(); const slot = core.pending[previousId]; if (slot){ const{ [previousId]: _moved, ...pending} = core.pending; setCore({ pending:{ ...pending, [nextId]:{ ...slot, id: nextId} } , order: core.order.map((id) => (id === previousId ? nextId : id)), activeId: core.activeId === previousId ? nextId : core.activeId, } ); } } const closingSessions = new WeakMap>(); function closeSession(session: DocumentSession): Promise{ const inFlight = closingSessions.get(session); if (inFlight) return inFlight; const closing = (async () =>{ session.phase = 'closing'; unpublishSlot(session.id); for (const lease of session.leases.values()) lease.revoke(); const reason = new CancelledError(`closed while opening: ${ session.id} `); session.cancel.abort(reason); session.engineOp?.abort(reason); await session.operation?.catch((error) =>{ if (!isCancelled(error) && !isAbortLike(error)) report(error); } ); await session.scope.destroy(); if (sessions.get(session.id) === session) sessions.delete(session.id); session.views.clear(); closed.emit({ documentId: session.id} ); } )(); closingSessions.set(session, closing); return closing; } function nextActiveDocument(core: CoreState, removedId: string): string | null{ if (core.activeId !== removedId) return core.activeId; const index = core.order.indexOf(removedId); const remaining = core.order.filter((id) => id !== removedId); return remaining.length === 0 ? null : (remaining[Math.max(0, index - 1)] ?? remaining[0]); } function publishPendingSlot(session: DocumentSession, activate: boolean): void{ const core = store.getCore(); setCore({ pending:{ ...core.pending, [session.id]:{ id: session.id, name: session.name, status: 'loading'} , } , order: core.order.includes(session.id) ? core.order : [...core.order, session.id], activeId: activate || core.activeId === null ? session.id : core.activeId, } ); } function publishLocked(session: DocumentSession, passwordProvided: boolean): void{ const core = store.getCore(); setCore({ pending:{ ...core.pending, [session.id]:{ id: session.id, name: session.name, status: 'locked', passwordProvided} , } , } ); locked.emit({ documentId: session.id, passwordProvided} ); } function publishError(session: DocumentSession, error: unknown): void{ const core = store.getCore(); const openRequest = openRequestOf(error, session.grantInput); setCore({ pending:{ ...core.pending, [session.id]:{ id: session.id, name: session.name, status: 'error', error, ...(openRequest ?{ openRequest} :{ } ), } , } , } ); openFailed.emit({ documentId: session.id, error: toPluginErrorInfo(toPluginError('documents', error)), } ); } function unpublishSlot(id: string): void{ const core = store.getCore(); if (!core.pending[id] && !core.documents[id]) return; const{ [id]: _pending, ...pending} = core.pending; const{ [id]: _document, ...documents} = core.documents; setCore({ pending, documents, order: core.order.filter((other) => other !== id), activeId: nextActiveDocument(core, id), } ); } function commitReady(session: DocumentSession): void{ session.phase = 'ready'; session.pageView.refresh(); const meta = pageMetaOf(session.stagedMeta!, session.pageView.current()); const core = store.getCore(); const{ [session.id]: _resolved, ...pending} = core.pending; setCore({ documents:{ ...core.documents, [session.id]: meta} , pending} ); const grant = session.handle?.grant; if (grant){ session.scope.defer( grant.onIdentityRequested((request) => setIdentityRequest(session, request)), ); session.scope.defer(grant.onOpenRequested((request) => setOpenRequest(session, request))); } opened.emit({ documentId: session.id, info: documentInfoOf(meta)} ); } function pageMetaOf(meta: DocumentMeta, view: PageView): DocumentMeta{ const{ pages, labels, pending} = view; if (meta.pages === pages && meta.pageLabels === labels && meta.pendingPages === pending){ return meta; } return{ ...meta, pageCount: pages.length, pages, pageLabels: labels, pendingPages: pending, pagesSequence: meta.pages === pages ? meta.pagesSequence : meta.pagesSequence + 1, } ; } function refreshPages(session: DocumentSession): void{ const view = session.pageView.refresh(); if (!view) return; const now = store.getCore(); const existing = now.documents[session.id]; if (!existing) return; const updated = pageMetaOf(existing, view); if (updated === existing) return; setCore({ documents:{ ...now.documents, [session.id]: updated} } ); if (updated.pages === existing.pages) return; pagesChanged.emit({ documentId: session.id, pagesSequence: updated.pagesSequence, pages: updated.pages, } ); } function setOpenRequest(session: DocumentSession, request: GrantOpenRequest | null): void{ const core = store.getCore(); const published = core.documents[session.id]; if (!published || (published.openRequest ?? null) === request) return; const{ openRequest: _shown, ...rest} = published; setCore({ documents:{ ...core.documents, [session.id]: request ?{ ...rest, openRequest: request} : rest, } , } ); } async function resumeGrant(session: DocumentSession, options: RetryOptions | undefined){ const grant = session.handle!.grant!; const{ passphrase, visitorIdentity} = options ??{ } ; try{ await grant.resume({ ...(passphrase !== undefined ?{ passphrase} :{ } ), ...(visitorIdentity !== undefined ?{ visitorIdentity} :{ } ), } ); } catch (error){ setOpenRequest(session, grant.openRequest); throw toPluginError('documents', error); } setOpenRequest(session, grant.openRequest); return{ document: getDocument(session.id)!} ; } function setIdentityRequest( session: DocumentSession, request: VisitorIdentityRequest | null, ): void{ const core = store.getCore(); const published = core.documents[session.id]; if (!published || (published.identityRequest ?? null) === request) return; const{ identityRequest: _shown, ...rest} = published; setCore({ documents:{ ...core.documents, [session.id]: request ?{ ...rest, identityRequest: request} : rest, } , } ); } async function identify(id: string, answers: VisitorAnswers): Promise{ const session = readySession(id, 'identify'); const grant = session.handle!.grant; if (!grant){ throw new PluginError('invalid-input', 'documents', `${ id} isn't from a grant`); } try{ await grant.identify(answers); } catch (error){ const request = visitorIdentityRequestOf(error); if (request) setIdentityRequest(session, request); throw toPluginError('documents', error); } setIdentityRequest(session, grant.identityRequest); } function declineIdentity(id: string): void{ const session = readySession(id, 'decline'); session.handle!.grant?.decline(); setIdentityRequest(session, null); } function setUnsavedChanges(session: DocumentSession, hasUnsavedChanges: boolean): void{ const core = store.getCore(); const published = core.documents[session.id]; if (!published){ if (session.stagedMeta && session.stagedMeta.hasUnsavedChanges !== hasUnsavedChanges){ session.stagedMeta ={ ...session.stagedMeta, hasUnsavedChanges} ; } return; } if (published.hasUnsavedChanges === hasUnsavedChanges) return; setCore({ documents:{ ...core.documents, [session.id]:{ ...published, hasUnsavedChanges} } , } ); unsavedChangesChanged.emit({ documentId: session.id, hasUnsavedChanges} ); } const sessionOf = (documentId?: string): DocumentSession | null =>{ const id = documentId ?? store.getCore().activeId; return id ? (sessions.get(id) ?? null) : null; } ; const documentHandle = (documentId?: string): DocumentHandle | null =>{ const session = sessionOf(documentId); if (!session) return null; return session.phase === 'bringup' || session.phase === 'ready' ? session.handle : null; } ; function readySession(documentId: string | undefined, verb: string): DocumentSession{ const session = sessionOf(documentId); if (!session || !documentHandle(session.id)){ throw new PluginError('not-ready', 'documents', `no open document to ${ verb} `); } return session; } const allowsOn = (documentId: string | undefined, permission: Permission): boolean =>{ const handle = documentHandle(documentId); return handle ? sessionAllows(handle.security, permission) : false; } ; async function downloadFile( documentId: string | undefined, signal: AbortSignal | undefined, verb: string, read: (handle: DocumentHandle) => Promise, refuse?: (handle: DocumentHandle) => PluginError | null, ): Promise{ const session = readySession(documentId, verb); if (!allowsOn(session.id, 'doc.download')){ throw permissionDenied('documents', 'doc.download', `documents.${ verb} `); } const refusal = refuse?.(session.handle!); if (refusal) throw refusal; try{ await settle(session.settleFlushes, [signal, session.signal], report); const handle = documentHandle(session.id); if (!handle) throw new PluginError('not-ready', 'documents', `no open document to ${ verb} `); let readAt = -1; const readFile = () =>{ readAt = session.changeCount; return cancellable('documents', signal, read(handle)); } ; const bytes = await runWrapped(session.downloadWraps, readFile); if (readAt === session.changeCount) setUnsavedChanges(session, false); return bytes; } catch (error){ throw toPluginError('documents', error); } } const printer = config.printer ?? null; const canPrintOn = (documentId: string | undefined): boolean => printer !== null && allowsOn(documentId, 'doc.print'); const printQualityOf = (documentId: string | undefined): PrintQuality | null =>{ if (!canPrintOn(documentId)) return null; if (!allowsOn(documentId, 'doc.print.high')) return PRINT_STANDARD; const mayKeepCopy = allowsOn(documentId, 'doc.download') || allowsOn(documentId, 'doc.download.flattened'); return mayKeepCopy && printer?.stagePdf ? PRINT_PDF : PRINT_HIGH; } ; function printPagesOf( session: DocumentSession, pages: readonly PageRef[] | undefined, ): readonly PageInfo[]{ const all = metaOf(session.id)?.pages ?? EMPTY_PAGES; if (pages === undefined) return all; if (pages.length === 0){ throw new PluginError('invalid-input', 'documents', 'a print needs at least one page'); } const found = pages.map((ref) =>{ const page = findPage(all, ref); if (!page){ throw new PluginError( 'not-found', 'documents', `page ${ ref.objectNumber} is not in this document`, ); } return page; } ); if (new Set(found).size !== found.length){ throw new PluginError('invalid-input', 'documents', 'a print names a page twice'); } return found; } const printLayersOf = (documentId: string, options: PrintOptions) => ({ includeAnnotations: options.includeAnnotations ?? allowsOn(documentId, 'doc.annotate.read'), includeFormFields: allowsOn(documentId, 'doc.forms.read'), } ); async function stagePrint( session: DocumentSession, activePrinter: HostPrinter, quality: PrintQuality, options: PrintOptions, ): Promise<{ staged: StagedPrint; quality: PrintQuality; changesSeen: number} >{ const{ signal} = options; await settle(session.settleFlushes, [signal, session.signal], report); const handle = documentHandle(session.id); if (!handle) throw new PluginError('not-ready', 'documents', 'no open document to print'); const changesSeen = session.changesSeen; const job: PrintJob ={ handle, pages: printPagesOf(session, options.pages), layers: printLayersOf(session.id, options), name: session.name ?? 'document', options, } ; options.onProgress?.({ pagesRendered: 0, pageCount: job.pages.length} ); if (quality.kind === 'images'){ return{ staged: await stagePictures(job, activePrinter, quality.dpi), quality, changesSeen} ; } try{ return{ staged: await stagePdfCopy(job, activePrinter), quality, changesSeen} ; } catch (error){ if (signal?.aborted) throw error; const staged = await stagePictures(job, activePrinter, PRINT_HIGH.dpi); return{ staged, quality: PRINT_HIGH, changesSeen} ; } } async function stagePdfCopy(job: PrintJob, activePrinter: HostPrinter): Promise{ const{ handle, pages, layers, name, options} = job; const{ signal} = options; if (!activePrinter.stagePdf){ throw new PluginError('unsupported', 'documents', 'this printer prints no PDF'); } const pdf = await cancellable( 'documents', signal, handle.pages.extract( pages.map((page) => page.ref), { flatten:{ usage: 'print'} , ...layers} , ), ); const staged = await activePrinter.stagePdf(pdf, { name, ...(signal ?{ signal} :{ } )} ); options.onProgress?.({ pagesRendered: pages.length, pageCount: pages.length} ); return staged; } async function stagePictures( job: PrintJob, activePrinter: HostPrinter, dpi: PrintDpi, ): Promise{ const{ handle, pages, layers, name, options} = job; const{ signal} = options; const sheets: PrintSheet[] = []; for (const page of pages){ const image = await cancellable( 'documents', signal, handle.page(page.ref).render.image({ usage: 'print', viewport:{ kind: 'dpi', dpi} , format: 'png', ...layers, } ), ); const blob = await cancellable('documents', signal, image.blob()); sheets.push({ image: blob, widthPt: page.size.width, heightPt: page.size.height} ); options.onProgress?.({ pagesRendered: sheets.length, pageCount: pages.length} ); } return activePrinter.stage(sheets, { name, ...(signal ?{ signal} :{ } )} ); } async function preparePrint( documentId: string | undefined, options: PrintOptions ={ } , ): Promise{ const session = readySession(documentId, 'preparePrint'); if (!allowsOn(session.id, 'doc.print')){ throw permissionDenied('documents', 'doc.print', 'documents.preparePrint'); } const quality = printQualityOf(session.id); if (!printer || !quality){ throw new PluginError( 'unsupported', 'documents', 'no printer: pass one to createKernel({ printer} ), such as browserPrinter() from @embedpdf/web', ); } const pageCount = printPagesOf(session, options.pages).length; try{ let{ staged, changesSeen, quality: printed, } = await stagePrint(session, printer, quality, options); let disposed = false; const destroy = () =>{ if (disposed) return; disposed = true; staged.destroy(); } ; session.scope.defer(destroy); const restage = async (as: PrintQuality, signal: AbortSignal | undefined) =>{ const fresh = await stagePrint(session, printer, as, { ...(options.pages ?{ pages: options.pages} :{ } ), ...(options.includeAnnotations !== undefined ?{ includeAnnotations: options.includeAnnotations} :{ } ), ...(signal ?{ signal} :{ } ), } ); staged.destroy(); ({ staged, changesSeen, quality: printed} = fresh); } ; return{ get quality(){ return printed; } , pageCount, needsTap: printer.needsTap === true, async print(printOptions){ if (disposed){ throw new PluginError('invalid-input', 'documents', 'this print was disposed'); } const signal = printOptions?.signal; const run = async () =>{ if (session.changesSeen !== changesSeen) await restage(quality, signal); if (signal?.aborted){ throw new PluginError('operation-cancelled', 'documents', 'print cancelled', { cause: signal.reason, } ); } try{ await staged.print(); } catch (error){ if (printed.kind !== 'pdf') throw error; await restage(PRINT_HIGH, signal); await staged.print(); } } ; try{ await runWrapped(session.printWraps, run); } catch (error){ throw toPluginError('documents', error); } } , destroy, } ; } catch (error){ throw toPluginError('documents', error); } } const isBuilding = (plugin: AnyPlugin, session: DocumentSession): boolean => session.building.has(plugin) && !session.capabilities.has(plugin); function buildDocumentCapability(plugin: AnyPlugin, session: DocumentSession): unknown{ let capability = session.capabilities.get(plugin); if (!capability){ if (session.building.has(plugin)){ throw new PluginError( 'not-ready', plugin.id, `"${ plugin.id} " was asked for while it is being created`, ); } const ctx = createPluginContext(services, plugin, session, session.signal, session.scope); session.building.add(plugin); let created: ReturnType; try{ created = plugin.create(ctx); } finally{ session.building.delete(plugin); } const{ api, connect} = created; capability = api; session.connectors.set(plugin, () =>{ connect?.(); markConnected(ctx); } ); session.capabilities.set(plugin, capability); } return capability; } function workspaceViewOf( token: CapabilityToken, capability: T, documentId: string | undefined, ): T{ const inScope = inScopeByToken.get(token); const session = documentId === undefined ? undefined : sessions.get(documentId); if (!inScope || !session) return capability; let view = session.views.get(token); if (view === undefined){ view = inScope(capability, session.id); session.views.set(token, view); } return view as T; } function resolveCapability(token: CapabilityToken, documentId?: string): T{ guardUsable(`capability("${ token.name} ")`); const workspaceCapability = workspaceCapabilities.get(token); if (workspaceCapability) return workspaceViewOf(token, workspaceCapability as T, documentId); const provider = plan.providerOf(token); if (!provider) throw new Error(`No capability "${ token.name} ".`); const id = documentId ?? store.getCore().activeId; if (!id) throw new Error(`Capability "${ token.name} " requires an active document.`); const session = sessions.get(id); if (!session) throw new Error(`Capability "${ token.name} " unavailable: no document "${ id} ".`); if (session.phase === 'bringup' || session.phase === 'ready'){ return buildDocumentCapability(provider, session) as T; } const shown = session.phase === 'opening' ? 'loading' : session.phase; throw new Error(`Capability "${ token.name} " unavailable: document "${ id} " is ${ shown} .`); } function tryResolveInternal(token: CapabilityToken, documentId?: string): T | null{ if (status === 'destroying' || status === 'destroyed') return null; const workspaceCapability = workspaceCapabilities.get(token); if (workspaceCapability) return workspaceViewOf(token, workspaceCapability as T, documentId); const provider = plan.providerOf(token); if (!provider) return null; const session = sessionOf(documentId); if (!session || (session.phase !== 'bringup' && session.phase !== 'ready')) return null; if (isBuilding(provider, session)) return null; return buildDocumentCapability(provider, session) as T; } function tryResolveCapability(token: CapabilityToken, documentId?: string): T | null{ if (status === 'destroying' || status === 'destroyed') return null; const workspaceCapability = workspaceCapabilities.get(token); if (workspaceCapability) return workspaceViewOf(token, workspaceCapability as T, documentId); const provider = plan.providerOf(token); if (!provider) return null; const session = sessionOf(documentId); if (!session || session.phase !== 'ready') return null; if (isBuilding(provider, session)) return null; return buildDocumentCapability(provider, session) as T; } const viewerSettings = createSettingsStore({ defaults: VIEWER_DEFAULTS, registered: config.settings, whole: VIEWER_WHOLE_SETTINGS} , store.notify, report, ); workspaceScope.defer(() => viewerSettings.destroy()); const settingsStores = new Map>(); for (const plugin of plan.ordered){ if (plugin.settings){ settingsStores.set(plugin, createSettingsStore(plugin.settings, store.notify, report)); } } workspaceScope.defer(() =>{ for (const settings of settingsStores.values()) settings.destroy(); } ); function settingsOf(token: CapabilityToken): SettingsApi>{ const provider = plan.providerOf(token); if (!provider) throw new Error(`No capability "${ token.name} ".`); const settings = settingsStores.get(provider); if (!settings) throw new Error(`Plugin "${ provider.id} " has no settings.`); return settings.api as unknown as SettingsApi>; } const services: ContextServices ={ engine, store, workspaceScope, workspaceSignal: workspaceCancel.signal, workspaceLeases, report, clock: config.clock ?? timerClock, measurer: config.measurer ?? null, resolveCapability, tryResolveCapability: tryResolveInternal, documentHandle, settingsStoreOf: (plugin) => settingsStores.get(plugin), } ; let ticketCounter = 0; const nextTicket = () => `pending:${ ++ticketCounter} `; async function bringUp( session: DocumentSession, snapshot:{ pageCount: number; pages: DocumentMeta['pages']; labels: DocumentMeta['pageLabels']; } , ): Promise{ session.phase = 'bringup'; let renderPolicy: EngineRenderPolicy = CONTINUOUS_RENDER_POLICY; try{ renderPolicy = (await session.handle!.render?.getPolicy()) ?? CONTINUOUS_RENDER_POLICY; } catch{ } checkpoint(session); session.pageView.setEnginePages(snapshot); session.pageView.refresh(); session.stagedMeta ={ id: session.id, instanceId: session.instanceId, name: session.name, pageCount: snapshot.pageCount, pages: session.pageView.current().pages, pageLabels: session.pageView.current().labels, pendingPages: NO_PENDING_PAGES, pagesSequence: 0, renderPolicy, hasUnsavedChanges: false, } ; const tracksChanges = isLocalDocument(session.handle!); const bursts = createBurstGate(store); session.scope.defer(bursts.close); let layoutsSeen = 0; let pageReads = 0; const readPagesAgain = (): void =>{ const seen = layoutsSeen; const read = ++pageReads; session.handle!.pages.list().then( (snapshot) =>{ if (session.cancel.signal.aborted || layoutsSeen !== seen || pageReads !== read) return; session.pageView.setEnginePages(snapshot); refreshPages(session); } , (error: unknown) =>{ if (!session.cancel.signal.aborted) report(error); } , ); } ; const unsubscribeEvents = session.handle!.events.subscribe((event) =>{ bursts.first(event); if (changesDocument(event)){ session.changesSeen += 1; if (tracksChanges){ session.changeCount += 1; setUnsavedChanges(session, true); } } const layout = layoutFromEvent(event); if (layout){ layoutsSeen += 1; session.pageView.setEnginePages(layout); } if (event.type === 'stream.desynced') readPagesAgain(); session.pageView.fold(event); refreshPages(session); } ); session.scope.defer(unsubscribeEvents); for (const plugin of documentScopedPlugins){ const lease = store.lease( sliceKey(plugin.id, session.id), initialStateOf(plugin), session.instanceId, ); session.leases.set(plugin, lease); session.scope.defer(() => lease.revoke()); } const release = store.hold(); try{ for (const plugin of documentScopedPlugins){ buildDocumentCapability(plugin, session); session.connectors.get(plugin)?.(); } } finally{ release(); } session.scope.defer(session.handle!.events.subscribe((event) => bursts.last(event))); checkpoint(session); } function openedResult(session: DocumentSession): OpenDocumentResult{ const core = store.getCore(); const entry = core.documents[session.id] ?? core.pending[session.id]; if (!entry) throw new PluginError('instance-closed', 'documents', `${ session.id} was closed`); return{ document: documentInfoOf(entry)} ; } async function openDocument( input: OpenSource, options?: OpenDocumentOptions, slotId?: string, ): Promise{ const signal = options?.signal; if (signal?.aborted){ throw new PluginError('operation-cancelled', 'documents', 'the open was cancelled'); } try{ const{ session, done} = reserveAndOpen(input, options, slotId); const cancel = () => void session.close(); signal?.addEventListener('abort', cancel, { once: true} ); try{ return openedResult(await done); } finally{ signal?.removeEventListener('abort', cancel); } } catch (error){ throw toPluginError('documents', error); } } function engineOptionsOf(options: OpenDocumentOptions | undefined){ const{ activate: _activate, name: _name, signal: _signal, ...own} = options ??{ } ; const viewer = viewerSettings.api.getSettings(); const scope = own.scope ?? viewer.scope ?? undefined; const identity = own.identity ?? viewer.identity ?? undefined; return{ ...own, ...(scope !== undefined ?{ scope} :{ } ), ...(identity !== undefined ?{ identity} :{ } ), } ; } function reserveAndOpen( input: OpenSource, options?: OpenDocumentOptions, slotId?: string, ):{ session: DocumentSession; done: Promise} { guardUsable('documents.open()'); const engineOptions = engineOptionsOf(options); const requestedId = slotId ?? (typeof input === 'function' ? nextTicket() : (idOfInput(input) ?? nextTicket())); if (sessions.has(requestedId)){ throw new PluginError('conflict', 'documents', `document already open: ${ requestedId} `); } const session = createSession(requestedId, options?.name); session.source = input; session.openOptions = options; sessions.set(session.id, session); publishPendingSlot(session, options?.activate ?? true); const done = beginOperation(session, async () =>{ try{ const given = typeof input === 'function' ? await engineCall(session, Promise.resolve(input(session.cancel.signal))) : input; checkpoint(session); const source = isUrlSource(given) ? await engineCall(session, fetchUrlSource(given, session.cancel.signal, config.fetch)) : given; checkpoint(session); session.grantInput = source.kind === 'grant' ? source : null; const sourceId = idOfInput(source); if (sourceId) rekeySession(session, sourceId); const handle = await engineCall(session, engine.open(source, engineOptions), (late) => late.close(), ); session.handle = handle; session.scope.defer(() => handle.close()); checkpoint(session); if (handle.id !== session.id) rekeySession(session, handle.id); const prompt = handle.security?.passwordPrompt; if (prompt?.state === 'required'){ session.phase = 'locked'; publishLocked(session, prompt.incorrect); return session; } const snapshot = await engineCall(session, handle.pages.list()); checkpoint(session); await bringUp(session, snapshot); commitReady(session); return session; } catch (error){ if (isCancelled(error)) throw error; if (session.phase === 'closing' || isAbortLike(error)){ throw new CancelledError(`closed while opening: ${ session.id} `); } await session.scope.destroy(); session.phase = 'error'; publishError(session, error); throw error; } } ); return{ session, done} ; } async function unlockDocument(id: string, options: UnlockOptions): Promise{ guardUsable('documents.unlock()'); const session = sessions.get(id); if (!session || session.phase !== 'locked' || !session.handle){ throw new PluginError('invalid-input', 'documents', `document is not locked: ${ id} `); } const handle = session.handle; return beginOperation(session, async () =>{ try{ await cancellable( 'documents', options.signal, engineCall(session, handle.security.unlock({ password: options.password} )), ); } catch (error){ if (session.phase === 'closing' || isAbortLike(error)){ throw new CancelledError(`closed while opening: ${ session.id} `); } throw error; } checkpoint(session); try{ const snapshot = await engineCall(session, handle.pages.list()); checkpoint(session); await bringUp(session, snapshot); commitReady(session); } catch (error){ if (isCancelled(error)) throw error; if (session.phase === 'closing' || isAbortLike(error)){ throw new CancelledError(`closed while opening: ${ session.id} `); } await session.scope.destroy(); session.phase = 'error'; publishError(session, error); throw error; } } ).catch((error: unknown) =>{ throw toPluginError('documents', error); } ); } async function closeDocument(documentId: string): Promise{ const session = sessions.get(documentId); if (!session) return; await session.close(); } function reorder(next: string[]){ setCore({ order: next} ); } const metaOf = (documentId?: string): DocumentMeta | null =>{ const core = store.getCore(); const id = documentId ?? core.activeId; return id ? (core.documents[id] ?? null) : null; } ; let listMemo:{ core: CoreState; value: readonly DocumentInfo[]} | null = null; const listDocuments = (): readonly DocumentInfo[] =>{ const core = store.getCore(); if (listMemo?.core === core) return listMemo.value; const next = core.order.map((id) => documentInfoOf(core.documents[id] ?? core.pending[id])); const previous = listMemo?.value; const same = previous !== undefined && previous.length === next.length && previous.every((info, i) => info === next[i]); const value = same ? previous : Object.freeze(next); listMemo ={ core, value} ; return value; } ; const getDocument = (documentId?: string): DocumentInfo | null =>{ const core = store.getCore(); const id = documentId ?? core.activeId; const entry = id ? (core.documents[id] ?? core.pending[id]) : undefined; return entry ? documentInfoOf(entry) : null; } ; const documents: DocumentsCapability ={ open: openDocument, canOpenFiles: () => engine.canOpenFiles, retry: async (id, options) =>{ const session = sessions.get(id); if (session?.phase === 'ready' && session.handle?.grant?.openRequest){ return resumeGrant(session, options); } if (!session || session.phase !== 'error' || session.source === null){ throw new PluginError( 'invalid-input', 'documents', `${ id} didn't fail to open; nothing to retry`, ); } const{ source, grantInput, openOptions} = session; const given = retrySourceOf(source, grantInput, options); const identity = options?.visitorIdentity !== undefined ?{ ...engineOptionsOf(openOptions).identity, ...options.visitorIdentity} : undefined; sessions.delete(id); return openDocument( given, { ...openOptions, ...(identity !== undefined ?{ identity} :{ } ), activate: false, signal: options?.signal, } , id, ); } , identify, declineIdentity, rename: (id, name) =>{ const core = store.getCore(); if (core.documents[id]){ setCore({ documents:{ ...core.documents, [id]:{ ...core.documents[id], name} } } ); } else if (core.pending[id]){ setCore({ pending:{ ...core.pending, [id]:{ ...core.pending[id], name} } } ); } const session = sessions.get(id); if (session) session.name = name; } , openAll: (initialDocuments) =>{ guardUsable('documents.openAll()'); const activeIndex = Math.max( 0, initialDocuments.findIndex((initialDocument) => initialDocument.active), ); return initialDocuments.map(({ source, active: _active, ...options} , index) =>{ try{ const{ session, done} = reserveAndOpen(source, { ...options, activate: index === activeIndex, } ); void done.catch(() =>{ } ); return session.id; } catch{ return typeof source === 'function' ? '' : (idOfInput(source) ?? ''); } } ); } , unlock: unlockDocument, close: closeDocument, closeAll: async () =>{ for (const id of [...store.getCore().order]) await closeDocument(id); } , setActive: (id) =>{ const core = store.getCore(); if (core.documents[id] || core.pending[id]) setCore({ activeId: id} ); } , getActiveId: () => store.getCore().activeId, getActive: () => getDocument(), list: listDocuments, get: getDocument, has: (id) =>{ const core = store.getCore(); return core.documents[id] !== undefined || core.pending[id] !== undefined; } , getCount: () => store.getCore().order.length, getOrder: () => store.getCore().order, setOrder: (ids) =>{ const current = store.getCore().order; const same = ids.length === current.length && [...ids].sort().join('\0') === [...current].sort().join('\0'); if (!same){ throw new PluginError( 'invalid-input', 'documents', 'setOrder() needs a permutation of the current order', ); } reorder([...ids]); } , move: (id, toIndex) =>{ const core = store.getCore(); if (!core.documents[id] && !core.pending[id]) return; const without = core.order.filter((documentId) => documentId !== id); const clamped = Math.max(0, Math.min(toIndex, without.length)); without.splice(clamped, 0, id); reorder(without); } , swap: (id, otherId) =>{ const core = store.getCore(); const index = core.order.indexOf(id); const otherIndex = core.order.indexOf(otherId); if (index < 0 || otherIndex < 0) return; const next = [...core.order]; next[index] = otherId; next[otherIndex] = id; reorder(next); } , download: (id, options) => downloadFile(id, options?.signal, 'download', (handle) => handle.download(options?.mode !== undefined ?{ mode: options.mode} : undefined), ), downloadLayer: (id, options) => downloadFile( id, options?.signal, 'downloadLayer', (handle) => (isLocalDocument(handle) ? handle.downloadLayer() : Promise.reject(noLayer())), (handle) => (isLocalDocument(handle) ? null : noLayer()), ), preparePrint: (id, options) => preparePrint(id, options), async print(id, options ={ } ){ const prepared = await preparePrint(id, options); try{ await prepared.print(options.signal ?{ signal: options.signal} : undefined); } finally{ prepared.destroy(); } } , getPrintQuality: (id) => printQualityOf(id), canDownload: (id) => allowsOn(id, 'doc.download'), canPrint: (id) => canPrintOn(id), listPages: (id) => metaOf(id)?.pages ?? EMPTY_PAGES, getPage: (page, id) => findPage(metaOf(id)?.pages ?? EMPTY_PAGES, page), getPageIndex: (ref, id) => metaOf(id)?.pages.findIndex((pageInfo) => pageRefsEqual(pageInfo.ref, ref)) ?? -1, getRevision: (id) => metaOf(id)?.pagesSequence ?? -1, onOpened: opened.on, onOpenFailed: openFailed.on, onLocked: locked.on, onClosed: closed.on, onActiveChanged: activeChanged.on, onPagesChanged: pagesChanged.on, onUnsavedChangesChanged: unsavedChangesChanged.on, } ; workspaceCapabilities.set(DocumentsToken, documents); for (const plugin of plan.ordered){ if (!isDocumentScoped(plugin)){ workspaceLeases.set(plugin, store.lease(plugin.id, initialStateOf(plugin))); } } for (const plugin of plan.ordered){ if (isDocumentScoped(plugin)) continue; const ctx = createPluginContext( services, plugin, undefined, workspaceCancel.signal, workspaceScope, ); const{ api, connect} = plugin.create(ctx); if (plugin.token) workspaceCapabilities.set(plugin.token, api); workspaceConnectors.set(plugin, () =>{ connect?.(); markConnected(ctx); } ); } return{ ...viewerSettings.api, engine, documents, capability: resolveCapability, tryCapability: tryResolveCapability, scopeOf: plan.scopeOf, settingsOf, subscribe: store.subscribe, getState: store.getState, getStatus: () => status, start: () =>{ if (status === 'destroying' || status === 'destroyed' || status === 'failed'){ return Promise.reject(new Error(`[kernel] start() on a ${ status} kernel`)); } return (startPromise ??= (async () =>{ status = 'starting'; try{ for (const plugin of plan.ordered){ if (status !== 'starting') return; if (!isDocumentScoped(plugin)) workspaceConnectors.get(plugin)?.(); } status = 'started'; } catch (error){ status = 'failed'; await workspaceScope.destroy(); workspaceCapabilities.clear(); throw error; } } )()); } , destroy: () =>{ return (destroyPromise ??= (async () =>{ const wasFailed = status === 'failed'; status = 'destroying'; workspaceCancel.abort(new CancelledError('kernel destroyed')); await startPromise?.catch((error) =>{ if (!isCancelled(error) && !wasFailed) report(error); } ); await Promise.allSettled([...sessions.values()].map((session) => session.close())); sessions.clear(); await workspaceScope.destroy(); workspaceCapabilities.clear(); store.destroy(); status = 'destroyed'; } )()); } , } ; } createLatestLane [FunctionDeclaration] (from packages/core/main/src/lanes.ts): export function createLatestLane( lifetime: AbortSignal, capability: string, name: string, ): LatestLane{ let generation = 0; let active: AbortController | null = null; const closed = () => new PluginError('instance-closed', capability, `${ name} : instance closed`); const cancelled = (id: string, why: string) => new PluginError('operation-cancelled', capability, `${ name} : ${ why} `, { details:{ runId: id, reason: why} , } ); return{ get running(){ return active !== null; } , cancel(reason){ active?.abort(reason ?? 'cancelled'); active = null; } , async run(fn, options){ if (lifetime.aborted) throw closed(); if (options?.signal?.aborted) throw cancelled(`${ name} #${ generation + 1} `, 'cancelled before start'); const mine = ++generation; const id = `${ name} #${ mine} `; const controller = new AbortController(); const previous = active; active = controller; const onLifetime = () => controller.abort('instance-closed'); const onCaller = () => controller.abort('cancelled'); lifetime.addEventListener('abort', onLifetime, { once: true} ); options?.signal?.addEventListener('abort', onCaller, { once: true} ); const current = () => mine === generation && !controller.signal.aborted; const run: LatestRun ={ id, signal: controller.signal, get superseded(){ return mine !== generation; } , commit(commitFn){ if (!current()) return false; commitFn(); return true; } , } ; try{ previous?.abort('superseded'); if (!current()) throw cancelled(id, 'superseded'); const value = await fn(run); if (!current()) throw cancelled(id, String(controller.signal.reason ?? 'superseded')); return value; } catch (error){ if (lifetime.aborted) throw closed(); if (!current()) throw cancelled(id, String(controller.signal.reason ?? 'superseded')); throw toPluginError(capability, error); } finally{ lifetime.removeEventListener('abort', onLifetime); options?.signal?.removeEventListener('abort', onCaller); if (active === controller) active = null; } } , } ; } createPageContext [FunctionDeclaration] (from packages/framework/angular/runtime/src/page-context.ts): export function createPageContext(parts:{ documentId: () => string; ref: () => PageRef; view: () => string; pageIndex: Signal; frame: Signal; transform: Signal; getRect: () => DOMRect; getViewDemand?: () => PageViewDemand; } ): EpdfPageContext{ const{ transform, getRect} = parts; return{ get documentId(){ return parts.documentId(); } , get ref(){ return parts.ref(); } , get view(){ return parts.view(); } , pageIndex: parts.pageIndex, frame: parts.frame, transform, ...(parts.getViewDemand ?{ getViewDemand: parts.getViewDemand} :{ } ), ...pageClientSpace(transform, getRect), } ; } createScrollHandler [FunctionDeclaration] (from packages/plugin/stage/src/scroll-handler.ts): export function createScrollHandler( stage: StageCapability, interaction: InteractionHostCapability, options: ScrollHandlerOptions ={ } , ): InteractionHandler{ const panFallback = options.panFallback ?? true; let last ={ x: 0, y: 0} ; const isPanTool = (): boolean => interaction.getActiveTool().enables.has('scroll'); return{ id: 'stage-scroll', priority: 10, enabledFor: (tool) => tool.enables.has('scroll') || (panFallback && tool.gapCursor === undefined), onPointerDown: (sample) =>{ if (!isPanTool() && sample.page) return false; last = sample.viewport; interaction.claimCursor('stage-grab', 'grabbing', 40); return true; } , onPointerMove: (sample) =>{ stage.panBy(sample.viewport.x - last.x, sample.viewport.y - last.y); last = sample.viewport; } , onPointerUp: () => interaction.claimCursor('stage-grab', null), onHover: (sample) =>{ if (panFallback && !isPanTool()){ interaction.claimCursor('stage-pan-fallback', sample.page ? null : 'grab', 5); } } , } ; } createSelectionHandleDrag [FunctionDeclaration] (from packages/plugin/selection/src/handles.ts): export function createSelectionHandleDrag( selection: SelectionHandleTarget, view: SelectionHandleView, opposite: SelectionHandleEndpoint, draggedPage: PageRef, ): SelectionHandleDragSession{ const quad = opposite.glyphQuad; const anchorPoint = midpoint( midpoint(quad.upperLeft, quad.lowerRight), midpoint(quad.upperRight, quad.lowerLeft), ); let begun = false; let lastPage = draggedPage; return{ move: (overlay) =>{ if (!begun){ if (!selection.beginGestureAt(opposite.page, anchorPoint)) return; begun = true; } const hit = view.pageAt(overlay); if (hit){ lastPage = hit.ref; selection.extendTo(hit.ref, hit.point); } else{ const point = view.pointOnPage(lastPage, overlay); if (point) selection.extendTo(lastPage, point); } } , end: () =>{ if (begun) selection.endGesture(); } , } ; } createSerialQueue [FunctionDeclaration] (from packages/core/main/src/serial-queue.ts): export function createSerialQueue(capability: string): SerialQueue{ let tail: Promise = Promise.resolve(); const queue = (operation: () => Promise, options?: OperationOptions): Promise =>{ const start = (): Promise => options?.signal?.aborted ? Promise.reject( new PluginError('operation-cancelled', capability, 'cancelled before it started', { cause: options.signal.reason, } ), ) : operation(); const result = tail.then(start, start); tail = result.then( () => undefined, () => undefined, ); return result; } ; return Object.assign(queue, { idle: () => tail} ); } createTestCertificateAuthority [FunctionDeclaration] (from packages/core/signature/src/signers/test-authority.ts): export async function createTestCertificateAuthority( options:{ commonName?: string; url?: string; now?: () => Date} ={ } , ): Promise{ ensureEngine(); const now = options.now ?? (() => new Date()); const url = (options.url ?? 'http://test-authority.example').replace(/\/$/, ''); const addresses ={ ocsp: `${ url} /ocsp`, crl: `${ url} /crl`, issuer: `${ url} /issuer`} ; const commonName = options.commonName ?? 'EmbedPDF test certificate authority'; const dates = () => ({ notBefore: new Date(now().getTime() - DAY), notAfter: new Date(now().getTime() + 365 * DAY), } ); const rootKeys = await generateSigningKeyPair('RSA-PKCS1-v1_5', 'sha256', true); const root: Issuer ={ certificate: await issueCertificate({ kind: 'authority', commonName, publicKey: rootKeys.publicKey, privateKey: rootKeys.privateKey, ...dates(), } ), privateKey: rootKeys.privateKey, } ; const responderKeys = await generateSigningKeyPair('RSA-PKCS1-v1_5', 'sha256', true); const responder: Issuer ={ certificate: await issueCertificate({ kind: 'responder', commonName: `${ commonName} (OCSP responder)`, publicKey: responderKeys.publicKey, issuer: root, ...dates(), } ), privateKey: responderKeys.privateKey, } ; const der = (certificate: pkijs.Certificate) => new Uint8Array(certificate.toSchema(true).toBER(false)); const rootDer = der(root.certificate); const issued: pkijs.Certificate[] = []; const unrevocableOnes = new Set(); const revoked = new Map(); const serialOf = (certificate: pkijs.Certificate) => new Uint8Array(certificate.serialNumber.valueBlock.valueHexView); const bySerial = (serial: Uint8Array) => issued.find((certificate) => bytesEqual(serialOf(certificate), serial)) ?? null; const answer = async (request: RevocationRequest): Promise =>{ if (!request.url.startsWith(url)){ throw new Error(`the test certificate authority does not answer at ${ request.url} `); } if (request.kind === 'issuer') return rootDer; if (request.kind === 'crl'){ return buildCrl({ issuer: root, thisUpdate: now(), nextUpdate: new Date(now().getTime() + 7 * DAY), revoked: [...revoked].map(([certificate, entry]) => ({ serialNumber: certificate.serialNumber, at: entry.at, reason: entry.reason, } )), } ); } const parsed = asn1js.fromBER(toArrayBuffer(request.body)); if (parsed.offset === -1) throw new Error('the OCSP request is not valid DER'); const asked = new pkijs.OCSPRequest({ schema: parsed.result} ).tbsRequest.requestList[0]; if (!asked) throw new Error('the OCSP request asks about no certificate'); const certificate = bySerial( new Uint8Array(asked.reqCert.serialNumber.valueBlock.valueHexView), ); const entry = certificate ? revoked.get(certificate) : undefined; return buildOcspResponse({ certificate: certificate ?? root.certificate, issuer: root.certificate, asked: asked.reqCert, signer: responder, status: !certificate ? 'unknown' : entry ?{ revokedAt: entry.at, reason: entry.reason} : 'good', producedAt: now(), thisUpdate: now(), nextUpdate: new Date(now().getTime() + HOUR), } ); } ; return{ certificate: rootDer, async issueSigner(signerOptions ={ } ){ const hash = signerOptions.hash ?? 'sha256'; const keys = await generateSigningKeyPair( signerOptions.algorithm ?? 'RSA-PKCS1-v1_5', hash, true, ); const{ unrevocable} = signerOptions; const certificate = await issueCertificate({ kind: 'signer', commonName: signerOptions.commonName ?? 'EmbedPDF test signer', publicKey: keys.publicKey, issuer: root, addresses: unrevocable ?{ issuer: addresses.issuer} : addresses, ...(unrevocable ?{ unrevocable} :{ } ), ...dates(), } ); issued.push(certificate); if (unrevocable) unrevocableOnes.add(certificate); const leaf = der(certificate); const signer = webCryptoSigner({ privateKey: keys.privateKey, certificateChain: [leaf, rootDer], hash, } ); return{ ...signer, certificate: leaf, privateKey: keys.privateKey} ; } , revocation:{ fetch: answer} , revoke(signer, revokeOptions ={ } ){ const bytes = signer instanceof Uint8Array ? signer : signer.certificate; const certificate = issued.find((candidate) => bytesEqual(der(candidate), bytes)); if (!certificate){ throw new Error('the test certificate authority did not issue this certificate'); } if (unrevocableOnes.has(certificate)){ throw new Error('this certificate was issued as one that cannot be withdrawn'); } revoked.set(certificate, { at: revokeOptions.at ?? now(), reason: revokeOptions.reason ?? null, } ); } , } ; } createTestSigner [FunctionDeclaration] (from packages/core/signature/src/signers/webcrypto.ts): export async function createTestSigner( options:{ commonName?: string; algorithm?: 'RSA-PKCS1-v1_5' | 'RSA-PSS' | 'ECDSA'; hash?: 'sha256' | 'sha384' | 'sha512'; } ={ } , ): Promise{ const{ selfSignedCertificate} = await import('./self-signed'); const hash = options.hash ?? 'sha256'; const keys = await generateSigningKeyPair(options.algorithm ?? 'RSA-PKCS1-v1_5', hash, true); const certificate = await selfSignedCertificate({ publicKey: keys.publicKey, privateKey: keys.privateKey, commonName: options.commonName ?? 'EmbedPDF test signer', hash, } ); const signer = webCryptoSigner({ privateKey: keys.privateKey, certificateChain: [certificate], hash, } ); return{ ...signer, certificate, privateKey: keys.privateKey} ; } createTestTimestampAuthority [FunctionDeclaration] (from packages/core/signature/src/signers/webcrypto.ts): export async function createTestTimestampAuthority( options:{ commonName?: string} ={ } , ): Promise{ const{ timestampAuthorityCertificate} = await import('./self-signed'); const keys = await generateSigningKeyPair('RSA-PKCS1-v1_5', 'sha256', true); const certificate = await timestampAuthorityCertificate({ publicKey: keys.publicKey, privateKey: keys.privateKey, commonName: options.commonName ?? 'EmbedPDF test timestamp authority', hash: 'sha256', } ); const authority = webCryptoSigner({ privateKey: keys.privateKey, certificateChain: [certificate], } ); const{ buildTimestampToken} = await import('../cms/timestamp'); return{ kind: 'cms', certificate, sign: ({ digest, algorithm} ) => buildTimestampToken({ digest, hash: algorithm, authority} ), } ; } createZoomDragHandler [FunctionDeclaration] (from packages/plugin/stage/src/zoom-drag-handler.ts): export function createZoomDragHandler( stage: StageHostCapability, interaction: InteractionHostCapability, ): InteractionHandler{ return{ id: 'stage-zoom-drag', priority: 10, enabledFor: (tool) => tool.enables.has('zoom-box'), onPointerDown: (sample) =>{ if (sample.source !== stage.getLensId()) return false; stage.beginZoomDrag(sample.viewport); return true; } , onPointerMove: (sample) => stage.moveZoomDrag(sample.viewport), onPointerUp: (sample) => stage.endZoomDrag({ zoomOut: sample.modifiers.alt} ), onPointerCancel: () => stage.cancelZoomDrag(), onHover: (sample) => interaction.claimCursor('stage-zoom-out', sample.modifiers.alt ? 'zoom-out' : null), } ; } custom [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function custom( slot: string, terminal?: string, options?: Omit, ): CustomItem{ return terminal === undefined ?{ slot, ...options} :{ slot, terminal, ...options} ; } decodePageKey [FunctionDeclaration] (from packages/engine/core/src/identity/PageRef.ts): export function decodePageKey(key: string): PageRef | null{ if (!key.startsWith('obj:')) return null; const rest = key.slice('obj:'.length); const n = Number.parseInt(rest, 10); if (!Number.isInteger(n) || n <= 0 || String(n) !== rest) return null; return{ kind: 'objectNumber', objectNumber: n} ; } definePlugin [FunctionDeclaration] (from packages/core/main/src/index.ts): export function definePlugin< State = void, Capability = unknown, Settings extends object = NoSettings, >( definition: PluginDefinition, ): PluginDefinition{ return definition; } defineState [FunctionDeclaration] (from packages/core/main/src/state.ts): export function defineState( token: CapabilityToken, declaration:{ readonly read: (capability: Capability) => State; readonly empty: NoInfer; readonly ensure?: (capability: NoInfer) => Promise; } , ): StateDeclaration{ return{ token, read: declaration.read, empty: Object.freeze(declaration.empty), ...(declaration.ensure ?{ ensure: declaration.ensure} :{ } ), } ; } devWarn [FunctionDeclaration] (from packages/framework/angular/runtime/src/dev.ts): export function devWarn(key: string, message: string): void{ if (!isDevMode() || warned.has(key)) return; warned.add(key); console.warn(`[embedpdf] ${ message} `); } displayNameOf [FunctionDeclaration] (from packages/plugin/attachment/src/names.ts): export function displayNameOf(file:{ readonly name: string} ): string{ return file.name.replace(HIDDEN, '').trim() || 'attachment'; } documentCommands [VariableDeclaration] (from packages/framework/angular/runtime/src/commands.ts): documentCommands = createDocumentCommands(standardCommandsBrowser) documentState [VariableDeclaration] (from packages/core/main/src/documents-state.ts): documentState = defineState(DocumentsToken, { read: (documents): DocumentInfo => documents.get() ?? NO_DOCUMENT, empty: NO_DOCUMENT, } ) documentsState [VariableDeclaration] (from packages/core/main/src/documents-state.ts): documentsState = defineState(DocumentsToken, { read: (documents): DocumentsState => ({ documents: documents.list(), activeId: documents.getActiveId(), } ), empty:{ documents: [], activeId: null} , } ) encodePageKey [FunctionDeclaration] (from packages/engine/core/src/identity/PageRef.ts): export function encodePageKey(ref: PageRef): string{ if (!isValidPageObjectNumber(ref.objectNumber)){ throw new RangeError( `encodePageKey: objectNumber must be a positive integer, got ${ ref.objectNumber} `, ); } return `obj:${ ref.objectNumber} `; } epdfTheme [FunctionDeclaration] (from packages/framework/angular/runtime/src/theme.ts): export function epdfTheme(theme: EpdfTheme): Record{ return epdfThemeVariables(theme) as Record; } eventOf [VariableDeclaration] (from packages/plugin/actions/src/contract.ts): eventOf = (trigger: ActionTrigger): ActionTriggerEvent =>{ switch (trigger.type){ case 'activate': return{ type: 'activate'} ; case 'annotation': return{ type: 'annotation', event: trigger.event} ; case 'page': return{ type: 'page', event: trigger.event} ; case 'document': return{ type: 'document', event: trigger.event} ; } } feedbackPlugin [VariableDeclaration] (from packages/plugin/interaction/src/feedback.ts): feedbackPlugin = (options: FeedbackPluginOptions ={ } ) => definePlugin({ id: 'feedback', scope: 'workspace', token: FeedbackToken, create: () => ({ api: options.provider ?? NOOP} ), } ) filePickerProvider [VariableDeclaration] (from packages/framework/angular/annotation/src/file-picker.ts): filePickerProvider: FilePickerProvider = pickRequestedFile formPlugin [VariableDeclaration] (from packages/plugin/form/src/form.plugin.ts): formPlugin = (config?: FormConfig) => definePlugin({ id: 'form', token: FormToken, scope: 'document', requires: [InteractionToken], optional: [AnnotationToken, ActionsToken, RenderToken, FontsToken], state: initialFormModel, settings:{ defaults: FORM_DEFAULTS, registered: config} , create: createFormController, } ) formState [VariableDeclaration] (from packages/plugin/form/src/state.ts): formState = defineState(FormToken, { read: (form): FormState => ({ fields: form.list(), status: form.getStatus(), formKind: form.getFormKind(), selectedField: form.getSelectedField(), focusedField: form.getFocusedField(), } ), empty:{ fields: NO_FIELDS, status: 'idle', formKind: 'none', selectedField: null, focusedField: null, } , } ) formatShortcut [FunctionDeclaration] (from packages/framework/angular/commands/src/commands.ts): export function formatShortcut(shortcut: string, options:{ isMac?: boolean} ={ } ): string{ return formatKeys(shortcut, { isMac: options.isMac ?? isMacPlatform()} ); } gesturePlacement [FunctionDeclaration] (from packages/core/annotation/src/placement.ts): export function gesturePlacement( form: GestureForm, from: Point, to: Point, clickCreate: ClickCreate | false | undefined, frame: PlacementFrame ={ } , ): Placement | null{ if (!isDrag(form, from, to)){ return clickCreate ? resolveClickPlacement(from, clickCreate, frame) : null; } const a = frame.pageBox ? clampPointToBox(from, frame.pageBox) : from; const b = frame.pageBox ? clampPointToBox(to, frame.pageBox) : to; if (form === 'segment') return{ kind: 'segment', a, b} ; const rot = uprightTurn(frame); const dragged = rectFromPoints(a, b); return{ kind: 'box', rect: rot % 180 ? transposedAboutCenter(dragged) : dragged, rot} ; } group [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function group( id: string, items: readonly BarChild[], options?: Omit, ): BarGroup{ return{ id, ...options, items} ; } guardHandle [FunctionDeclaration] (from packages/core/main/src/guarded-handle.ts): export function guardHandle( handle: DocumentHandle, lifetime: GuardedLifetime, capability: string, ): DocumentHandle{ const cache = new WeakMap(); const closedError = () => new PluginError( 'instance-closed', capability, `document instance ${ lifetime.instanceId} was closed`, ); const guardPromise = (pending: PromiseLike): Promise =>{ const abortable = pending as PromiseLike &{ abort?: (reason?: unknown) => void} ; const guarded = new Promise((resolve, reject) =>{ const onAbort = () =>{ abortable.abort?.(lifetime.signal.reason); reject(closedError()); } ; if (lifetime.signal.aborted){ onAbort(); } else{ lifetime.signal.addEventListener('abort', onAbort, { once: true} ); } Promise.resolve(pending).then( (value) =>{ lifetime.signal.removeEventListener('abort', onAbort); if (!lifetime.signal.aborted) resolve(value); } , (error) =>{ lifetime.signal.removeEventListener('abort', onAbort); if (!lifetime.signal.aborted) reject(toPluginError(capability, error)); } , ); } ); if (typeof abortable.abort === 'function'){ Object.defineProperty(guarded, 'abort', { value: (reason?: unknown) => abortable.abort!(reason), enumerable: false, } ); } return guarded; } ; const wrapFunction = (fn: (...args: unknown[]) => unknown, target: object) => function guardedCall(...args: unknown[]): unknown{ let result: unknown; try{ result = fn.apply(target, args); } catch (error){ throw toPluginError(capability, error); } if (isPromiseLike(result)) return guardPromise(result); return wrapValue(result, target); } ; const wrapValue = (value: unknown, target: object): unknown =>{ if (typeof value === 'function') return wrapFunction(value as (...args: unknown[]) => unknown, target); if (isPlainWrappable(value)) return wrapObject(value); return value; } ; const wrapObject = (target: object): object =>{ let proxy = cache.get(target); if (!proxy){ proxy = new Proxy(target, { get(proxyTarget, property){ return wrapValue(Reflect.get(proxyTarget, property, proxyTarget), proxyTarget); } , } ); cache.set(target, proxy); } return proxy; } ; return wrapObject(handle) as DocumentHandle; } historyCommands [VariableDeclaration] (from packages/framework/angular/history/src/commands.ts): historyCommands = createHistoryCommands() historyPlugin [VariableDeclaration] (from packages/plugin/history/src/history.plugin.ts): historyPlugin = (config?: HistoryConfig) => definePlugin({ id: 'history', token: HistoryToken, scope: 'document', state: emptyHistory, settings:{ defaults: HISTORY_DEFAULTS, registered: config} , create: createHistoryController, } ) historyState [VariableDeclaration] (from packages/plugin/history/src/state.ts): historyState = defineState(HistoryToken, { read: (history): HistoryState => ({ canUndo: history.canUndo(), canRedo: history.canRedo(), undoLabel: history.getUndoLabel(), redoLabel: history.getRedoLabel(), } ), empty:{ canUndo: false, canRedo: false, undoLabel: null, redoLabel: null, } , } ) httpRevocationSource [FunctionDeclaration] (from packages/core/signature/src/revocation/http-source.ts): export function httpRevocationSource(options: HttpRevocationSourceOptions): RevocationSource{ const{ url: route, timeoutMs = 10_000, retries = 1} = options; async function ask(request: RevocationRequest): Promise{ const send = options.fetch ?? globalThis.fetch; const details = (more: Record ={ } ) => ({ source: request.url, route, ...more, } ); const noAnswer = (why: string, cause?: unknown) => new EngineError( EngineErrorCode.Network, `${ request.url} did not answer through ${ route} : ${ why} `, { details: details(), cause} , ); const payload: RevocationRouteRequest ={ kind: request.kind, url: request.url, ...(request.kind === 'ocsp' ?{ body: toBase64(request.body)} :{ } ), } ; const timeout = new AbortController(); const timer = setTimeout(() => timeout.abort(), timeoutMs); try{ let response: Response; try{ response = await send(route, { method: 'POST', headers:{ 'content-type': 'application/json', ...options.headers} , body: JSON.stringify(payload), signal: timeout.signal, } ); } catch (error){ if (timeout.signal.aborted) throw noAnswer(`no reply within ${ timeoutMs} ms`, error); throw noAnswer((error as Error).message, error); } if (response.status >= 500 || response.status === 429){ throw noAnswer(`HTTP ${ response.status} ${ await said(response)} `); } if (!response.ok){ const refusal = await refusalOf(response); throw new EngineError( EngineErrorCode.SignatureRefused, `the route at ${ route} refused to ask ${ request.url} : ${ refusal.message ?? `HTTP ${ response.status} `} `, { details: details({ httpStatus: response.status, reason: refusal.reason} )} , ); } try{ return new Uint8Array(await response.arrayBuffer()); } catch (error){ throw noAnswer( timeout.signal.aborted ? `no reply within ${ timeoutMs} ms` : `the reply broke off: ${ (error as Error).message} `, error, ); } } finally{ clearTimeout(timer); } } return{ async fetch(request){ for (let attempt = 0; ; attempt++){ try{ return await ask(request); } catch (error){ const noAnswer = EngineError.is(error, EngineErrorCode.Network); if (!noAnswer || attempt >= retries) throw error; await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS)); } } } , } ; } httpTimestampAuthority [FunctionDeclaration] (from packages/core/signature/src/signers/timestamp-http.ts): export function httpTimestampAuthority(options: HttpTimestampAuthorityOptions): CmsSigner{ const{ url, policy, timeoutMs = 10_000, retries = 1} = options; const details = (more: Record ={ } ) => ({ authority: url, ...more} ); const refused = (message: string, more: Record, cause?: unknown) => new EngineError(EngineErrorCode.SignatureRefused, message, { details: details(more), cause} ); const wrongAnswer = (reason: CompletionRefusal, what: string) => refused(`the timestamp authority at ${ url} ${ what} `, { reason} ); async function ask(query: Uint8Array): Promise{ const send = options.fetch ?? globalThis.fetch; const noAnswer = (why: string, cause?: unknown) => new EngineError( EngineErrorCode.Network, `the timestamp authority at ${ url} did not answer: ${ why} `, { details: details(), cause} , ); const timeout = new AbortController(); const timer = setTimeout(() => timeout.abort(), timeoutMs); try{ let response: Response; try{ response = await send(url, { method: 'POST', headers:{ 'content-type': 'application/timestamp-query', ...options.headers} , body: new Uint8Array(query), signal: timeout.signal, } ); } catch (error){ if (timeout.signal.aborted) throw noAnswer(`no reply within ${ timeoutMs} ms`, error); const hint = 'document' in globalThis ? '. In a browser most authorities cannot be called directly: call yours through a route on your own server' : ''; throw noAnswer(`${ (error as Error).message} ${ hint} `, error); } if (response.status >= 500 || response.status === 429){ throw noAnswer(`HTTP ${ response.status} `); } if (!response.ok){ throw refused( `the timestamp authority at ${ url} refused the request: HTTP ${ response.status} `, { httpStatus: response.status} , ); } try{ return new Uint8Array(await response.arrayBuffer()); } catch (error){ throw noAnswer( timeout.signal.aborted ? `no reply within ${ timeoutMs} ms` : `the reply broke off: ${ (error as Error).message} `, error, ); } } finally{ clearTimeout(timer); } } return{ kind: 'cms', hash: options.hash ?? 'sha256', async sign({ digest, algorithm, subFilter} ){ if (subFilter !== 'ETSI.RFC3161'){ throw new EngineError( EngineErrorCode.InvalidArg, "a timestamp authority can't sign a document: pass it as `timestampAuthority`, or sign with `kind: 'timestamp'`", { details: details()} , ); } const [protocol, parse, timestamp, engine] = await Promise.all([ import('../cms/timestamp-protocol'), import('../cms/parse'), import('../cms/timestamp'), import('../cms/engine'), ]); const nonce = engine.randomPositiveInteger(); const query = protocol.buildTimestampRequest({ digest, algorithm, policy, nonce} ); let reply: Uint8Array; for (let attempt = 0; ; attempt++){ try{ reply = await ask(query); break; } catch (error){ const noAnswer = EngineError.is(error, EngineErrorCode.Network); if (!noAnswer || attempt >= retries) throw error; await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS)); } } let response; try{ response = protocol.readTimestampResponse(reply); } catch (error){ throw refused( `the timestamp authority at ${ url} sent a reply that can't be read: ${ (error as Error).message} `, { reason: 'malformed'} , error, ); } if (!response.granted){ const said = [response.failInfo, response.statusText].filter(Boolean).join(': '); throw refused( `the timestamp authority at ${ url} refused the request${ said ? ` (${ said} )` : ''} `, { failInfo: response.failInfo} , ); } if (!response.token) throw wrongAnswer('malformed', 'granted the request but sent no token'); let info; try{ info = timestamp.readTimestampInfo( parse.readCmsParts(response.token, 'tst-info').eContent!, ); } catch (error){ throw refused( `the timestamp authority at ${ url} sent a token that can't be read: ${ (error as Error).message} `, { reason: 'malformed'} , error, ); } if (info.imprintAlgorithm !== algorithm){ throw wrongAnswer( 'algorithm-mismatch', `stamped a ${ info.imprintAlgorithm} digest where ${ algorithm} was asked for`, ); } if (!engine.bytesEqual(info.imprint, digest)){ throw wrongAnswer('digest-mismatch', 'stamped another digest than the one it was sent'); } if (!info.nonce || !engine.bytesEqual(info.nonce, timestamp.withoutLeadingZeros(nonce))){ throw wrongAnswer( 'profile-violation', "sent a token that doesn't answer this request: its nonce is not the one sent", ); } if (policy && info.policy !== policy){ throw wrongAnswer( 'profile-violation', `issued the token under policy ${ info.policy} where ${ policy} was asked for`, ); } return response.token; } , } ; } i18nPlugin [VariableDeclaration] (from packages/plugin/i18n/src/i18n.plugin.ts): i18nPlugin = (config?: I18nConfig) => definePlugin({ id: 'i18n', scope: 'workspace', token: I18nToken, state: initialI18nModel, settings:{ defaults: I18N_DEFAULTS, registered: config} , create: createI18nController, } ) i18nState [VariableDeclaration] (from packages/plugin/i18n/src/state.ts): i18nState = defineState(I18nToken, { read: (i18n): I18nState => ({ locale: i18n.getLocale(), direction: i18n.getDirection(), locales: i18n.listLocales(), loading: i18n.getLoadingLocale(), } ), empty:{ locale: 'en', direction: 'ltr', locales: [], loading: null} , } ) indexedDbByteStore [FunctionDeclaration] (from packages/framework/web/src/byte-store.ts): export function indexedDbByteStore( dbName: string, options: IndexedDbByteStoreOptions ={ } , ): ByteStore{ const storeName = options.storeName ?? 'bytes'; const open = (): Promise => new Promise((resolve, reject) =>{ const request = indexedDB.open(dbName, 1); request.onupgradeneeded = () =>{ if (!request.result.objectStoreNames.contains(storeName)){ request.result.createObjectStore(storeName); } } ; request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error ?? new Error('indexedDB.open failed')); } ); const run = async ( mode: IDBTransactionMode, body: (store: IDBObjectStore) => IDBRequest, ): Promise =>{ const db = await open(); try{ return await new Promise((resolve, reject) =>{ const request = body(db.transaction(storeName, mode).objectStore(storeName)); request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error ?? new Error('indexedDB request failed')); } ); } finally{ db.close(); } } ; return{ list: async () =>{ const keys = await run('readonly', (store) => store.getAllKeys()); const values = await run('readonly', (store) => store.getAll()); return keys.map((key, i) => ({ id: String(key), bytes: new Uint8Array(values[i])} )); } , put: (id, bytes) => run('readwrite', (store) => store.put(new Uint8Array(bytes), id)).then(() => undefined), delete: (id) => run('readwrite', (store) => store.delete(id)).then(() => undefined), } ; } indexedDbKeyStore [FunctionDeclaration] (from packages/core/signature/src/signers/personal.ts): export function indexedDbKeyStore( dbName: string, options:{ storeName?: string} ={ } , ): PersonalKeyStore{ const storeName = options.storeName ?? 'keys'; let opening: Promise | null = null; const open = (): Promise =>{ opening ??= new Promise((resolve, reject) =>{ const request = indexedDB.open(dbName, 1); request.onupgradeneeded = () =>{ if (!request.result.objectStoreNames.contains(storeName)){ request.result.createObjectStore(storeName); } } ; request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error ?? new Error('indexedDB open failed')); } ); return opening; } ; const run = async ( mode: IDBTransactionMode, op: (store: IDBObjectStore) => IDBRequest, ): Promise =>{ const db = await open(); return new Promise((resolve, reject) =>{ const tx = db.transaction(storeName, mode); const request = op(tx.objectStore(storeName)); request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error ?? new Error('indexedDB request failed')); } ); } ; return{ load: async (subject) => ((await run('readonly', (store) => store.get(subject))) as PersonalKeyRecord | undefined) ?? null, save: (subject, record) => run('readwrite', (store) => store.put(record, subject)).then(() => undefined), remove: (subject) => run('readwrite', (store) => store.delete(subject)).then(() => undefined), } ; } injectCapability [FunctionDeclaration] (from packages/framework/angular/runtime/src/capability.ts): export function injectCapability( token: CapabilityToken, ): Signal{ const binding = new CapabilityBinding( injectKernelHost(`injectCapability(${ token.name} )`), () => token, injectDocumentScope(), ); return binding.capability; } injectDocumentScope [FunctionDeclaration] (from packages/framework/angular/runtime/src/capability.ts): export function injectDocumentScope(): Signal{ return inject(EPDF_DOCUMENT_SCOPE, { optional: true} )?.id ?? FOLLOW_ACTIVE; } injectFontMounts [FunctionDeclaration] (from packages/framework/angular/runtime/src/font-mounts.ts): export function injectFontMounts(programs: () => readonly MountableFontProgram[]): void{ if (!isPlatformBrowser(inject(PLATFORM_ID))) return; const mounts = createFontMounts(); inject(DestroyRef).onDestroy(() => mounts.release()); effect(() => mounts.mount(programs())); } injectKernelHost [FunctionDeclaration] (from packages/framework/angular/runtime/src/capability.ts): export function injectKernelHost(what: string): EpdfKernelHost{ const host = inject(EpdfKernelHost, { optional: true} ); if (!host) throw noViewerError(what); return host; } injectPage [FunctionDeclaration] (from packages/framework/angular/runtime/src/page-context.ts): export function injectPage(what = 'This component'): EpdfPageContext{ const page = inject(EPDF_PAGE, { optional: true} ); if (!page) throw outsidePageError(what); return page; } injectPaintedParts [FunctionDeclaration] (from packages/framework/angular/runtime/src/page-layers.ts): export function injectPaintedParts(pageRef: () => object): Signal{ const painted = signal(null); const injector = inject(Injector); afterNextRender(() =>{ effect( (onCleanup) =>{ const layers = pageLayersOf(pageRef()); untracked(() => painted.set(layers.painted())); onCleanup(layers.subscribe(() => painted.set(layers.painted()))); } , { injector} , ); } ); return painted.asReadonly(); } injectPictureState [FunctionDeclaration] (from packages/framework/angular/render/src/render.ts): export function injectPictureState(): Signal{ const page = injectPage('A component that calls injectPictureState()'); return new CapabilityBinding( injectKernelHost('injectPictureState()'), () => RenderToken, () => page.documentId, ).select((render) => render.getPictureState(page.ref, page.view), NO_PICTURE, Object.is); } interactionCommands [VariableDeclaration] (from packages/framework/angular/interaction/src/commands.ts): interactionCommands = createInteractionCommands() interactionPlugin [VariableDeclaration] (from packages/plugin/interaction/src/interaction.plugin.ts): interactionPlugin = (config?: InteractionConfig) => definePlugin({ id: 'interaction', token: InteractionToken, scope: 'document', state: initialInteractionModel, settings:{ defaults: INTERACTION_DEFAULTS, registered: config} , create: (ctx) => createInteractionController(ctx, builtinTools()), } ) interactionState [VariableDeclaration] (from packages/plugin/interaction/src/state.ts): interactionState = defineState(InteractionToken, { read: (interaction): InteractionState => ({ activeToolId: interaction.getActiveToolId(), tools: interaction.listTools(), } ), empty:{ activeToolId: null, tools: []} , } ) interpolate [FunctionDeclaration] (from packages/plugin/i18n/src/contract.ts): export function interpolate( text: string, params?: Readonly>, ): string{ if (!params) return text; return text.replace(/\{ (\w+)\} /g, (match, slot: string) => params[slot] !== undefined ? String(params[slot]) : match, ); } isCancelled [VariableDeclaration] (from packages/core/main/src/scope.ts): isCancelled = (error: unknown): error is CancelledError => error instanceof CancelledError isLocalEngine [FunctionDeclaration] (from packages/engine/core/src/engine/LocalEngine.ts): export function isLocalEngine(engine: Engine): engine is LocalEngine{ return hasLocalEngineBrand(engine); } isPdf [FunctionDeclaration] (from packages/core/main/src/pdf-header.ts): export function isPdf(bytes: Uint8Array): boolean{ const end = Math.min(bytes.length - PDF_HEADER.length, 1024); for (let start = 0; start <= end; start++){ if (PDF_HEADER.every((byte, index) => bytes[start + index] === byte)) return true; } return false; } isPluginError [FunctionDeclaration] (from packages/core/main/src/errors.ts): export function isPluginError(value: unknown, code?: PluginErrorCode): value is PluginError{ if (!(value instanceof PluginError)) return false; return code === undefined || value.code === code; } isReadMember [FunctionDeclaration] (from packages/core/main/src/capability-handle.ts): export function isReadMember(name: string): boolean{ return READ.test(name); } item [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function item(command: string, options?: Omit): BarItem{ return{ command, ...options} ; } kindNamed [FunctionDeclaration] (from packages/core/annotation/src/kinds/index.ts): export function kindNamed(name: string): AnnotationKind{ const kind = KINDS[name]; if (kind) return kind; let shown = shownOnly.get(name); if (!shown){ shown ={ name, family: boxFamily, style: plainStyle, caps:{ ...NO_CAPS, rasterOnly: true} , properties: [], } ; shownOnly.set(name, shown); } return shown; } linkPlugin [VariableDeclaration] (from packages/plugin/link/src/link.plugin.ts): linkPlugin = () => definePlugin({ id: 'link', token: LinkToken, scope: 'document', requires: [InteractionToken], optional: [StageToken, AnnotationToken, ActionsToken], create: createLinkController, } ) markRoleOf [VariableDeclaration] (from packages/plugin/signature/src/contract.ts): markRoleOf = (asset: Pick): MarkRole => asset.name === INITIALS_MARK_NAME ? 'initials' : 'signature' matchesQuery [VariableDeclaration] (from packages/plugin/stage/src/responsive.ts): matchesQuery = (query: BoxQuery, box: StageBox): boolean => (query.minWidth === undefined || box.width >= query.minWidth) && (query.maxWidth === undefined || box.width <= query.maxWidth) && (query.minHeight === undefined || box.height >= query.minHeight) && (query.maxHeight === undefined || box.height <= query.maxHeight) && (query.orientation === undefined || box.orientation === query.orientation) measurementPlugin [VariableDeclaration] (from packages/plugin/measurement/src/measurement.plugin.ts): measurementPlugin = (config?: MeasurementConfig) => definePlugin({ id: 'measurement', scope: 'document', token: MeasurementToken, requires: [AnnotationToken, InteractionToken], state: initialMeasurementModel, settings:{ defaults: MEASUREMENT_DEFAULTS, registered: config, whole: ['defaultScale']} , create: createMeasurementController, } ) measurementState [VariableDeclaration] (from packages/plugin/measurement/src/state.ts): measurementState = defineState(MeasurementToken, { read: (measurement): MeasurementState => ({ busy: measurement.isBusy(), calibrationRequest: measurement.getCalibrationRequest(), lastReports: measurement.listLastReports(), } ), empty:{ busy: false, calibrationRequest: null, lastReports: NO_REPORTS, } , } ) memo [FunctionDeclaration] (from packages/core/main/src/memo.ts): export function memo( inputs: () => Inputs, compute: (...inputs: Computed) => Result, ): () => Result{ let last:{ inputs: Inputs; result: Result} | null = null; return () =>{ const next = inputs(); if (last && sameInputs(last.inputs, next)) return last.result; const result = compute(...(next as unknown as Computed)); last ={ inputs: next, result} ; return result; } ; } memoByKey [FunctionDeclaration] (from packages/core/main/src/memo.ts): export function memoByKey( inputs: (key: Key) => Inputs, compute: (key: Key, ...inputs: Computed) => Result, options:{ maxEntries?: number} ={ } , ): (key: Key) => Result{ const cache = new Map(); return (key) =>{ const next = inputs(key); const cached = cache.get(key); if (cached && sameInputs(cached.inputs, next)) return cached.result; const result = compute(key, ...(next as unknown as Computed)); if (cached) cache.delete(key); else if (options.maxEntries !== undefined && cache.size >= options.maxEntries){ const oldest = cache.keys().next(); if (!oldest.done) cache.delete(oldest.value); } cache.set(key, { inputs: next, result} ); return result; } ; } memoryKeyStore [FunctionDeclaration] (from packages/core/signature/src/signers/personal.ts): export function memoryKeyStore(): PersonalKeyStore{ const records = new Map(); return{ load: async (subject) => records.get(subject) ?? null, save: async (subject, record) =>{ records.set(subject, record); } , remove: async (subject) =>{ records.delete(subject); } , } ; } memoryStampStore [FunctionDeclaration] (from packages/plugin/stamp/src/persistence.ts): export function memoryStampStore(): StampLibraryStore{ const rows = new Map(); return{ list: async () => [...rows.entries()].map(([id, bytes]) => ({ id, bytes} )), put: async (id, bytes) =>{ rows.set(id, new Uint8Array(bytes)); } , delete: async (id) =>{ rows.delete(id); } , } ; } mergeSettings [FunctionDeclaration] (from packages/core/main/src/settings.ts): export function mergeSettings( settings: T, changes: DeepPartial | undefined, declaration?: Pick, 'defaults' | 'whole'>, ): T{ const whole = declaration?.whole ?? []; if (whole.length === 0 || !isPlainObject(changes)) return mergeValue(settings, changes) as T; const paths = whole.map((path) => path.split('.')); let merged = mergeValue(settings, withoutPaths(changes, paths)); for (const path of paths){ const change = valueAt(changes, path); if (change === undefined) continue; const value = filledFrom(valueAt(declaration?.defaults, path), change); if (!sameValue(valueAt(merged, path), value)) merged = withValueAt(merged, path, value); } return merged as T; } metadataPlugin [VariableDeclaration] (from packages/plugin/metadata/src/metadata.plugin.ts): metadataPlugin = () => definePlugin({ id: 'metadata', token: MetadataToken, scope: 'document', create: createMetadataController, } ) metadataState [VariableDeclaration] (from packages/plugin/metadata/src/state.ts): metadataState = defineState(MetadataToken, { read: (metadata): MetadataState => ({ metadata: metadata.getSnapshot(), custom: metadata.custom.getSnapshot(), status: metadata.getStatus(), } ), empty:{ metadata: null, custom: null, status: 'idle', } , ensure: (metadata) => metadata.ensureLoaded(), } ) negotiateLocale [FunctionDeclaration] (from packages/plugin/i18n/src/negotiate.ts): export function negotiateLocale( available: readonly string[], requested: readonly string[], ): string | null{ const byCanonical = new Map(); for (const code of available){ const canonical = code.toLowerCase(); if (!byCanonical.has(canonical)) byCanonical.set(canonical, code); } const languageOf = (code: string) => code.toLowerCase().split('-')[0]; for (const wanted of requested){ const exact = byCanonical.get(wanted.toLowerCase()); if (exact !== undefined) return exact; } for (const wanted of requested){ const narrowed = byCanonical.get(languageOf(wanted)); if (narrowed !== undefined && sameScript(wanted, narrowed)) return narrowed; } for (const wanted of requested){ const language = languageOf(wanted); for (const [canonical, original] of byCanonical){ if (languageOf(canonical) === language && sameScript(wanted, original)) return original; } } return null; } noPluginError [VariableDeclaration] (from packages/framework/angular/runtime/src/errors.ts): noPluginError = (service: string, feature: string): EpdfError => new EpdfError( 'EPDF-102', `inject(${ service} ) found no viewer with its plugin. Add ${ feature} to provideEmbedPdf() ` + `in this component's providers, or in your app config.`, ) noViewerError [VariableDeclaration] (from packages/framework/angular/runtime/src/errors.ts): noViewerError = (what: string): EpdfError => new EpdfError( 'EPDF-101', `${ what} found no viewer. Add provideEmbedPdf() to this component's providers, or to your app config.`, ) onServerError [VariableDeclaration] (from packages/framework/angular/runtime/src/errors.ts): onServerError = (what: string): EpdfError => new EpdfError( 'EPDF-105', `${ what} needs the engine, which runs in the browser only. Call it from an event or ` + `afterNextRender(), or put the viewer in a @defer block.`, ) orientationPatch [FunctionDeclaration] (from packages/core/annotation/src/record/shape.ts): export function orientationPatch( annotation: Annotation, rotation: Rotation, ):{ box: Rect; rotation: Rotation | null} | Record{ if (!kindOf(annotation).caps.quarterTurns) return{ } ; const shape = shapeOf(annotation); if (shape.kind !== 'box') return{ } ; const stands = standingRect(shape.box, shape.rotation); return{ box: standingRect(stands, rotation), rotation: rotation || null} ; } outlinePlugin [VariableDeclaration] (from packages/plugin/outline/src/outline.plugin.ts): outlinePlugin = () => definePlugin({ id: 'outline', token: OutlineToken, scope: 'document', optional: [StageToken, ActionsToken, LinkToken, SelectionToken, I18nToken], state: initialOutlineModel, create: createOutlineController, } ) outlineState [VariableDeclaration] (from packages/plugin/outline/src/state.ts): outlineState = defineState(OutlineToken, { read: (outline): OutlineState => ({ items: outline.list(), rows: outline.listRows(), current: outline.getCurrentItem(), selected: outline.getSelected(), status: outline.getStatus(), incomplete: outline.isIncomplete(), canEdit: outline.canEdit(), } ), empty:{ items: [], rows: [], current: null, selected: [], status: 'idle', incomplete: false, canEdit: false, } , ensure: (outline) => outline.ensureLoaded(), } ) outsidePageError [VariableDeclaration] (from packages/framework/angular/runtime/src/errors.ts): outsidePageError = (what: string): EpdfError => new EpdfError( 'EPDF-103', `${ what} draws on a page. Put it inside in an .`, ) outsideStageError [VariableDeclaration] (from packages/framework/angular/runtime/src/errors.ts): outsideStageError = (what: string): EpdfError => new EpdfError('EPDF-104', `${ what} belongs to a Stage. Put it inside .`) pageEditPlugin [VariableDeclaration] (from packages/plugin/page-edit/src/page-edit.plugin.ts): pageEditPlugin = () => definePlugin({ id: 'page-edit', scope: 'document', token: PageEditToken, state: initialPageEditModel, create: createPageEditController, } ) pageEditState [VariableDeclaration] (from packages/plugin/page-edit/src/state.ts): pageEditState = defineState(PageEditToken, { read: (pageEdit): PageEditState => ({ selected: pageEdit.getSelected(), canEdit: pageEdit.canEdit(), canExtract: pageEdit.canExtract(), } ), empty:{ selected: [], canEdit: false, canExtract: false, } , } ) pageRefsEqual [FunctionDeclaration] (from packages/engine/core/src/identity/PageRef.ts): export function pageRefsEqual(a: PageRef, b: PageRef): boolean{ return a.kind === b.kind && a.objectNumber === b.objectNumber; } paintsPagePart [FunctionDeclaration] (from packages/framework/angular/runtime/src/page-layers.ts): export function paintsPagePart(pageRef: () => object | null, part: PagePart): void{ effect((onCleanup) =>{ const ref = pageRef(); if (ref) onCleanup(untracked(() => pageLayersOf(ref).paint(part))); } ); } persistStampLibraries [FunctionDeclaration] (from packages/framework/angular/stamp/src/stamp.ts): export function persistStampLibraries( stamp: Pick, store: StampLibraryStore, options?: PersistStampLibrariesOptions, ): () => void{ return persistLibraries({ exportLibrary: stamp.exportLibrary, onLibraryChanged: eventHookOf(stamp.libraryChanged$)} , store, options, ); } personalSigner [FunctionDeclaration] (from packages/core/signature/src/signers/personal.ts): export async function personalSigner(input:{ subject: string; store: PersonalKeyStore; algorithm?: 'RSA-PKCS1-v1_5' | 'RSA-PSS' | 'ECDSA'; hash?: 'sha256' | 'sha384' | 'sha512'; } ): Promise{ const{ ensureEngine} = await import('../cms/engine'); ensureEngine(); const hash = input.hash ?? 'sha256'; let record = await input.store.load(input.subject); if (!record){ const{ selfSignedCertificate} = await import('./self-signed'); const keys = await generateSigningKeyPair(input.algorithm ?? 'RSA-PKCS1-v1_5', hash, false); const certificate = await selfSignedCertificate({ publicKey: keys.publicKey, privateKey: keys.privateKey, commonName: input.subject, hash, } ); record ={ privateKey: keys.privateKey, certificate} ; await input.store.save(input.subject, record); } const signer = webCryptoSigner({ privateKey: record.privateKey, certificateChain: [record.certificate], hash, } ); return{ ...signer, certificate: record.certificate, subject: input.subject} ; } pluginService [FunctionDeclaration] (from packages/framework/angular/runtime/src/service.ts): export function pluginService< Capability, State extends object = Record, Method extends keyof Capability = never, Event extends EventName = never, >( spec: PluginServiceSpec, ): PluginServiceClass{ abstract class PluginService extends EpdfPluginService{ constructor(){ super(spec); const members = this as unknown as Record; const binding = this.binding; if (spec.state){ const state = spec.state; const whole = binding.select((capability) => state.read(capability), state.empty); for (const field of Object.keys(state.empty) as (keyof State & string)[]){ members[field] = computed(() => whole()[field]); } } const ensure = spec.ensure ?? spec.state?.ensure; if (ensure){ effect(() =>{ const capability = binding.capability(); if (capability) untracked(() => ensure(capability).catch(() =>{ } )); } ); } for (const name of spec.methods) members[name as string] = binding.method(name); for (const event of spec.events ?? []){ const stream = `${ event.charAt(2).toLowerCase()} ${ event.slice(3)} $`; members[stream] = binding.stream( (capability) => capability[event] as unknown as EventHook, ); } const host = binding.host; if (host.hasSettings(spec.token)){ const settings = host.settingsOf(spec.token); members['settings'] = settings.current; members['getSettings'] = () => settings.current(); members['updateSettings'] = settings.update; members['resetSettings'] = settings.reset; members['settingsChanged$'] = host.stream( (kernel) => kernel.settingsOf(spec.token).onSettingsChanged, ); } } } return PluginService as unknown as PluginServiceClass; } propertiesOf [FunctionDeclaration] (from packages/core/annotation/src/props.ts): export function propertiesOf(kind: AnnotationKind): readonly AnnotationProperty[]{ let properties = withFlags.get(kind); if (!properties){ properties = [...kind.properties, ...FLAG_PROPERTIES]; withFlags.set(kind, properties); } return properties; } provideEmbedPdf [FunctionDeclaration] (from packages/framework/angular/runtime/src/provide.ts): export function provideEmbedPdf( config: EmbedPdfConfig | EmbedPdfKernelConfig, ...features: EmbedPdfFeature[] ): Provider[]{ for (const feature of features){ for (const service of feature.services ?? []){ if (!scopedServices.includes(service)) scopedServices.push(service); } } const setup: EmbedPdfSetup ={ config, features} ; return [{ provide: EPDF_SETUP, useValue: setup} , EpdfKernelHost, EpdfViewer, EpdfDocuments, EpdfDocument, ...features.flatMap((feature) => [...(feature.services ?? []), ...(feature.providers ?? [])]), ]; } 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, } , } ) reload [FunctionDeclaration] (from packages/core/main/src/mirror.ts): export function reload(options?:{ pages?: readonly PageRef[]} ): MirrorReload{ return{ [RELOAD]: options?.pages ?? 'all'} ; } remoteSigner [FunctionDeclaration] (from packages/core/signature/src/signers/remote.ts): export function remoteSigner(input:{ sign: (request:{ digest: Uint8Array; algorithm: 'sha256' | 'sha384' | 'sha512'; subFilter: 'adbe.pkcs7.detached' | 'ETSI.CAdES.detached' | 'ETSI.RFC3161'; } ) => Promise; } ): CmsSigner{ return{ kind: 'cms', sign: (request) => input.sign(request), } ; } renderCommands [VariableDeclaration] (from packages/framework/angular/render/src/commands.ts): renderCommands = createRenderCommands(standardCommandsBrowser) renderPlugin [VariableDeclaration] (from packages/plugin/render/src/render.plugin.ts): renderPlugin = (config?: RenderConfig) => definePlugin({ id: 'render', scope: 'document', token: RenderToken, optional: [InteractionToken], state: initialRenderState, settings:{ defaults: RENDER_DEFAULTS, registered: config, whole: ['snapshot.box']} , create: createRenderController, } ) reorderBackOf [FunctionDeclaration] (from packages/engine/core/src/pages/predict.ts): export function reorderBackOf( pages: readonly PageLayout[], refs: readonly PageRef[], ): PageOp<'pages.reorder'>[]{ return restoredPagesOf(pages, refs).map(({ page, after} ) => ({ type: 'pages.reorder', pages: [page.ref], position: after ?{ after} : 'start', } )); } resetDevWarnings [FunctionDeclaration] (from packages/framework/angular/runtime/src/dev.ts): export function resetDevWarnings(): void{ warned.clear(); } resolveClickPlacement [FunctionDeclaration] (from packages/core/annotation/src/placement.ts): export function resolveClickPlacement( point: Point, policy: ClickCreate, frame: PlacementFrame ={ } , ): Placement{ const seen = frame.upright ? (frame.displayRotation ?? 0) : 0; if ('length' in policy){ const turn = ((policy.rotation ?? 0) * Math.PI) / 180; const span = rotatePoint({ x: Math.cos(turn) * policy.length, y: Math.sin(turn) * policy.length} , { x: 0, y: 0} , -seen, ); const before = policy.anchor === 'start' ? 0 : policy.anchor === 'end' ? 1 : 0.5; const a ={ x: point.x - span.x * before, y: point.y - span.y * before} ; const b ={ x: a.x + span.x, y: a.y + span.y} ; const bounds = rectFromPoints(a, b); const placed = clampRectToBox(bounds, frame.pageBox); const dx = placed.x - bounds.x; const dy = placed.y - bounds.y; return{ kind: 'segment', a:{ x: a.x + dx, y: a.y + dy} , b:{ x: b.x + dx, y: b.y + dy} } ; } const{ width, height} = policy; const rot = uprightTurn(frame); const rect = policy.anchor === 'top-left' ? uprightAnchoredRect(point, width, height, seen) :{ x: point.x - width / 2, y: point.y - height / 2, width, height} ; const shown = rot % 180 ? transposedAboutCenter(rect) : rect; const placed = clampRectToBox(shown, frame.pageBox); return{ kind: 'box', rect:{ ...rect, x: rect.x + placed.x - shown.x, y: rect.y + placed.y - shown.y} , rot, } ; } resolveLinkTarget [FunctionDeclaration] (from packages/plugin/link/src/contract.ts): export function resolveLinkTarget( target: PdfLinkTarget, hasPage: (page: PageRef) => boolean, ): LinkResolution{ switch (target.kind){ case 'goto': return hasPage(target.destination.page) ?{ kind: 'destination', destination: target.destination} :{ kind: 'reported', target} ; case 'uri': return{ kind: 'uri', uri: target.uri} ; case 'named': return{ kind: 'named', name: target.name} ; default: return{ kind: 'reported', target} ; } } resolvePageLayers [FunctionDeclaration] (from packages/engine/core/src/dto/PageRender.ts): export function resolvePageLayers( options:{ includeAnnotations?: boolean; includeFormFields?: boolean} | undefined, may: PageLayerRights, ): PageRenderLayers{ const{ includeAnnotations, includeFormFields} = options ??{ } ; if (includeAnnotations === true && !may.annotations){ throw new PermissionDenied('doc.annotate.read', 'includeAnnotations'); } if (includeFormFields === true && !may.formFields){ throw new PermissionDenied('doc.forms.read', 'includeFormFields'); } return{ includeAnnotations: includeAnnotations ?? may.annotations, includeFormFields: includeFormFields ?? (includeAnnotations === false ? false : may.formFields), } ; } resolveResponsive [VariableDeclaration] (from packages/plugin/stage/src/responsive.ts): resolveResponsive = ( base: StageSettings, rules: readonly ResponsiveRule[], box: StageBox, ): ResolvedResponsive =>{ let effective = base; const active: string[] = []; for (const rule of rules){ if (!ruleMatches(rule, box)) continue; if (rule.name !== undefined) active.push(rule.name); if (rule.settings) effective = mergeSettings(effective, rule.settings); } return{ effective, active} ; } resolvedCommandsEqual [VariableDeclaration] (from packages/plugin/commands/src/contract.ts): resolvedCommandsEqual = ( left: ResolvedCommand | null, right: ResolvedCommand | null, ): boolean =>{ if (left === right) return true; if (!left || !right) return false; return ( left.id === right.id && left.label === right.label && left.icon === right.icon && left.iconAccent?.primary === right.iconAccent?.primary && left.iconAccent?.secondary === right.iconAccent?.secondary && left.menu === right.menu && left.enabled === right.enabled && left.active === right.active && left.pressable === right.pressable && left.visible === right.visible && left.disabledReason === right.disabledReason && left.shortcuts.length === right.shortcuts.length && left.shortcuts.every((shortcut, index) => shortcut === right.shortcuts[index]) ); } restoreStampLibraries [FunctionDeclaration] (from packages/plugin/stamp/src/persistence.ts): export async function restoreStampLibraries( stamp: Pick, store: StampLibraryStore, ): Promise{ const restored: string[] = []; for (const{ id, bytes} of await store.list()){ try{ restored.push((await stamp.importLibrary(bytes)).library.id); } catch (error){ globalThis.console?.warn(`[stamp] stored library '${ id} ' could not be restored:`, error); } } return restored; } restoredPagesOf [FunctionDeclaration] (from packages/engine/core/src/pages/predict.ts): export function restoredPagesOf( pages: readonly PageLayout[], refs: readonly PageRef[], ): RestoredPage[]{ const deleting = new Set(refs.map(encodePageKey)); return pages.flatMap((page, index) => deleting.has(keyOf(page)) ? [{ page, after: index > 0 ? pages[index - 1]!.ref : null} ] : [], ); } returnsPromise [FunctionDeclaration] (from packages/core/main/src/capability-handle.ts): export function returnsPromise(token: CapabilityToken, path: string): boolean{ return token.promises?.[path] === true; } rotateBackOf [FunctionDeclaration] (from packages/engine/core/src/pages/predict.ts): export function rotateBackOf( pages: readonly PageLayout[], refs: readonly PageRef[], ): PageOp<'pages.rotate'>[]{ const rotations = new Map(pages.map((page) => [keyOf(page), page.rotation])); const groups = new Map(); for (const ref of refs){ const rotation = rotations.get(encodePageKey(ref)); if (rotation === undefined) continue; groups.set(rotation, [...(groups.get(rotation) ?? []), ref]); } return [...groups].map(([rotation, group]) => ({ type: 'pages.rotate', pages: group, rotation, } )); } samePageViewDemand [FunctionDeclaration] (from packages/plugin/render/src/paint-plan.ts): export function samePageViewDemand(left: PageViewDemand, right: PageViewDemand): boolean{ return ( left.desiredDeviceWidth === right.desiredDeviceWidth && left.velocity?.dx === right.velocity?.dx && left.velocity?.dy === right.velocity?.dy && (left.visibleRect === right.visibleRect || (left.visibleRect !== undefined && right.visibleRect !== undefined && left.visibleRect.x === right.visibleRect.x && left.visibleRect.y === right.visibleRect.y && left.visibleRect.width === right.visibleRect.width && left.visibleRect.height === right.visibleRect.height)) ); } saveFile [FunctionDeclaration] (from packages/framework/web/src/file-picker.ts): export function saveFile(bytes: Uint8Array | Blob, name: string, mimeType?: string): void{ const blob = bytes instanceof Blob ? bytes : new Blob([bytes as BlobPart], { type: mimeType ?? 'application/octet-stream'} ); const url = URL.createObjectURL(blob); const anchor = document.createElement('a'); anchor.href = url; anchor.download = name; anchor.style.display = 'none'; document.body.appendChild(anchor); anchor.click(); anchor.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); } searchPlugin [VariableDeclaration] (from packages/plugin/search/src/search.plugin.ts): searchPlugin = (config?: SearchConfig) => definePlugin({ id: 'search', token: SearchToken, scope: 'document', optional: [StageToken], state: initialSearchModel, settings:{ defaults: SEARCH_DEFAULTS, registered: config} , create: createSearchController, } ) searchState [VariableDeclaration] (from packages/plugin/search/src/state.ts): searchState = defineState(SearchToken, { read: (search): SearchState => ({ query: search.getQuery(), status: search.getStatus(), hitCount: search.getHitCount(), activeHitIndex: search.getActiveHitIndex(), activeHit: search.getActiveHit(), progress: search.getProgress(), error: search.getError(), } ), empty:{ query: null, status: 'idle', hitCount: 0, activeHitIndex: -1, activeHit: null, progress: NO_PROGRESS, error: null, } , } ) selectionCommands [VariableDeclaration] (from packages/framework/angular/selection/src/commands.ts): selectionCommands = createSelectionCommands(standardCommandsBrowser) selectionHandleEndpointsOf [FunctionDeclaration] (from packages/plugin/selection/src/handles.ts): export function selectionHandleEndpointsOf( snapshot: Pick, ): SelectionHandleEndpoints | null{ const{ start, end} = snapshot; if (!start || !end) return null; return{ start:{ page: start.page, glyphQuad: start.glyphQuad, advance: start.advance} , end:{ page: end.page, glyphQuad: end.glyphQuad, advance: end.advance} , } ; } selectionHandleGeometry [FunctionDeclaration] (from packages/plugin/selection/src/handles.ts): export function selectionHandleGeometry( view: SelectionHandleView, endpoint: SelectionHandleEndpoint, role: 'start' | 'end', ): SelectionHandleGeometry | null{ const leading = role === 'start' ? endpoint.advance > 0 : endpoint.advance < 0; const [upperPage, lowerPage] = quadEdge(endpoint.glyphQuad, leading ? 'left' : 'right'); const upper = view.toOverlay(endpoint.page, upperPage); const lower = view.toOverlay(endpoint.page, lowerPage); if (!upper || !lower) return null; const dx = lower.x - upper.x; const dy = lower.y - upper.y; const length = Math.hypot(dx, dy); if (length === 0) return null; const rotation = (Math.atan2(dy, dx) * 180) / Math.PI - 90; const upright = Math.abs(rotation) < HANDLE_ROT_EPSILON; const ux = dx / length; const uy = dy / length; const head = role === 'start' ?{ x: upper.x - (ux * HANDLE_HEAD) / 2, y: upper.y - (uy * HANDLE_HEAD) / 2} :{ x: lower.x + (ux * HANDLE_HEAD) / 2, y: lower.y + (uy * HANDLE_HEAD) / 2} ; return{ bar:{ from: upper, to: lower} , length, rotation, upright, head} ; } selectionHandleViewOf [FunctionDeclaration] (from packages/plugin/selection/src/handles.ts): export function selectionHandleViewOf(stage: SelectionHandleStage): SelectionHandleView{ return{ toOverlay: (page, point) => stage.pageToViewport(page, point), pageAt: (overlay) => stage.getPageAt(overlay), pointOnPage: (page, overlay) => stage.viewportToPage(page, overlay), } ; } selectionPlugin [VariableDeclaration] (from packages/plugin/selection/src/selection.plugin.ts): selectionPlugin = (config?: SelectionConfig) => definePlugin({ id: 'selection', token: SelectionToken, scope: 'document', requires: [InteractionToken], optional: [FeedbackToken], state: initialSelectionModel, settings:{ defaults: SELECTION_DEFAULTS, registered: config} , create: createSelectionController, } ) selectionState [VariableDeclaration] (from packages/plugin/selection/src/state.ts): selectionState = defineState(SelectionToken, { read: (selection): SelectionState => ({ hasSelection: selection.hasSelection(), isSelecting: selection.isSelecting(), range: selection.getRange(), pages: selection.listSelectedPages(), } ), empty:{ hasSelection: false, isSelecting: false, range: null, pages: [], } , } ) settingsEqual [VariableDeclaration] (from packages/plugin/stage/src/settings.ts): settingsEqual = (left: StageSettings, right: StageSettings): boolean => SETTING_KEYS.every((key) => eqSetting(left[key], right[key])) shallowEqual [FunctionDeclaration] (from packages/core/main/src/state.ts): export function shallowEqual(left: unknown, right: unknown): boolean{ if (Object.is(left, right)) return true; if (typeof left !== 'object' || typeof right !== 'object' || left === null || right === null){ return false; } if (Array.isArray(left) !== Array.isArray(right)) return false; const leftFields = left as Record; const rightFields = right as Record; const keys = Object.keys(leftFields); return ( keys.length === Object.keys(rightFields).length && keys.every((key) => key in rightFields && Object.is(leftFields[key], rightFields[key])) ); } shellPlugin [VariableDeclaration] (from packages/plugin/shell/src/shell.plugin.ts): shellPlugin = () => definePlugin({ id: 'shell', scope: 'document', token: ShellToken, state: initialShellModel, create: createShellController, } ) shellState [VariableDeclaration] (from packages/plugin/shell/src/state.ts): shellState = defineState(ShellToken, { read: (shell): ShellState => ({ openSurfaces: shell.listOpenSurfaces(), openMenus: shell.listOpenMenus(), } ), empty:{ openSurfaces: [], openMenus: []} , } ) signaturePlugin [VariableDeclaration] (from packages/plugin/signature/src/signature.plugin.ts): signaturePlugin = (config?: SignatureConfig) => definePlugin({ id: 'signature', token: SignatureToken, scope: 'document', requires: [FormToken], optional: [InteractionToken, StampToken, AnnotationToken], state: initialSignatureModel, settings:{ defaults: SIGNATURE_DEFAULTS, registered: config, whole: ['signingKey', 'timestampAuthority', 'revocation', 'trust'], } , create: createSignatureController, } ) signatureState [VariableDeclaration] (from packages/plugin/signature/src/state.ts): signatureState = defineState(SignatureToken, { read: (signature): SignatureState => ({ signatures: signature.listSignatures(), protection: signature.getProtection(), target: signature.getTarget(), busy: signature.isBusy(), pending: signature.getPending(), status: signature.getStatus(), } ), empty:{ signatures: NO_SIGNATURES, protection: null, target: null, busy: false, pending: null, status: 'idle', } , } ) signerRowsOf [FunctionDeclaration] (from packages/plugin/signature/src/contract.ts): export function signerRowsOf( libraries: readonly StampLibrary[], assets: readonly StampAsset[], ): SignerRow[]{ return libraries .filter((library) => library.kind === SIGNATURES_LIBRARY_KIND) .map((library) =>{ const own = assets.filter((asset) => asset.libraryId === library.id); return{ libraryId: library.id, name: library.name, library, signatures: own.filter((asset) => markRoleOf(asset) === 'signature'), initials: own.find((asset) => markRoleOf(asset) === 'initials') ?? null, } ; } ); } snapAppearanceScale [FunctionDeclaration] (from packages/engine/core/src/engine/DocumentRenderService.ts): export function snapAppearanceScale(policy: EngineRenderPolicy, scale: number): number{ if (policy.kind === 'continuous' || policy.appearances === undefined) return scale; if (policy.appearances.scales.length === 0){ throw new EngineError( EngineErrorCode.InvalidArg, 'render policy has an empty appearance-scale lattice', ); } const scales = [...policy.appearances.scales].sort((a, b) => a - b); return scales.find((s) => s >= scale) ?? scales[scales.length - 1]!; } snapFullPageViewport [FunctionDeclaration] (from packages/engine/core/src/engine/DocumentRenderService.ts): export function snapFullPageViewport( policy: EngineRenderPolicy, viewport: PageRenderViewport, options?:{ pageWidth?: number} , ): PageRenderViewport{ if (policy.kind === 'continuous') return viewport; if (viewport.kind === 'dpi' || viewport.kind === 'thumbnail') return viewport; if (policy.fullPage.widths.length === 0){ throw new EngineError(EngineErrorCode.InvalidArg, 'render policy has an empty width ladder'); } const widths = [...policy.fullPage.widths].sort((a, b) => a - b); let requested: number; if (viewport.kind === 'width'){ requested = viewport.width; } else{ const pageWidth = options?.pageWidth; if (pageWidth === undefined || pageWidth <= 0){ throw new EngineError( EngineErrorCode.InvalidArg, 'snapping a scale viewport to a width lattice requires opts.pageWidth', ); } requested = (viewport.scale ?? 1) * pageWidth; } const snapped = widths.find((width) => width >= requested) ?? widths[widths.length - 1]!; return{ kind: 'width', width: snapped} ; } snapTileScale [FunctionDeclaration] (from packages/engine/core/src/engine/DocumentRenderService.ts): export function snapTileScale(policy: EngineRenderPolicy, scale: number): number{ if (policy.kind === 'continuous' || policy.tiles === undefined) return scale; if (policy.tiles.scales.length === 0){ throw new EngineError( EngineErrorCode.InvalidArg, 'render policy has an empty tile-scale lattice', ); } const scales = [...policy.tiles.scales].sort((a, b) => a - b); return scales.find((s) => s >= scale) ?? scales[scales.length - 1]!; } stageCommands [VariableDeclaration] (from packages/framework/angular/stage/src/commands.ts): stageCommands = createStageCommands() stagePlugin [VariableDeclaration] (from packages/plugin/stage/src/stage.plugin.ts): stagePlugin = (options: StagePluginOptions ={ } ) =>{ const{ id = DEFAULT_LENS_ID, token = StageToken, ...config} = options; return definePlugin({ id, token: createHostToken(token), scope: 'document', optional: [ActionsToken], state: () => initialStageModel(config), create: (ctx) => createStageController(ctx, config), } ); } stageState [VariableDeclaration] (from packages/plugin/stage/src/state.ts): stageState = defineState(StageToken, { read: (stage): StageState => ({ zoomLevel: stage.getZoomLevel(), zoomMode: stage.getZoomMode(), currentPageIndex: stage.getCurrentPageIndex(), currentPage: stage.getCurrentPage(), pageCount: stage.getPageCount(), viewRotation: stage.getViewRotation(), activeRules: stage.listActiveRules(), } ), empty:{ zoomLevel: 1, zoomMode: ZoomMode.Automatic, currentPageIndex: 0, currentPage: null, pageCount: 0, viewRotation: 0, activeRules: [], } , } ) stampPlugin [VariableDeclaration] (from packages/plugin/stamp/src/stamp.plugin.ts): stampPlugin = (config?: StampConfig) => definePlugin({ id: 'stamp', token: StampToken, scope: 'workspace', optional: [AnnotationToken, ActionsToken], state: initialStampModel, settings:{ defaults: STAMP_DEFAULTS, registered: config, whole: ['assetEngine', 'fonts']} , create: createStampController, inScope: (stamp, documentId) =>{ const scoped = (options?: Options) => ({ ...options, documentId: options?.documentId ?? documentId, } ); return{ ...stamp, createAssetFromAnnotations: (page, refs, input, options) => stamp.createAssetFromAnnotations(page, refs, input, scoped(options)), armAsset: (assetId, options) => stamp.armAsset(assetId, scoped(options)), disarm: (target = documentId) => stamp.disarm(target), getArmedAsset: (target = documentId) => stamp.getArmedAsset(target), placeAsset: (assetId, placement, options) => stamp.placeAsset(assetId, placement, scoped(options)), placeAssetOnPages: (assetId, pages, placement, options) => stamp.placeAssetOnPages(assetId, pages, placement, scoped(options)), canPlace: (target = documentId) => stamp.canPlace(target), canCreateFromAnnotations: (target = documentId) => stamp.canCreateFromAnnotations(target), } ; } , } ) stampState [VariableDeclaration] (from packages/plugin/stamp/src/state.ts): stampState = defineState(StampToken, { read: (stamp): StampState => ({ armedAsset: stamp.getArmedAsset(), } ), empty:{ armedAsset: null, } , } ) standInFor [FunctionDeclaration] (from packages/core/main/src/capability-handle.ts): export function standInFor(kernel: Kernel, token: CapabilityToken): T{ let byToken = standIns.get(kernel); if (!byToken){ byToken = new WeakMap(); standIns.set(kernel, byToken); } let standIn = byToken.get(token); if (!standIn){ standIn = createStandIn(token, () => kernel.settingsOf(token)); byToken.set(token, standIn); } return standIn as T; } standardCommands [VariableDeclaration] (from packages/framework/angular/commands/src/standard.ts): standardCommands = join( createStageCommands(), createInteractionCommands(), createSelectionCommands(standardCommandsBrowser), createAnnotationCommands(), createHistoryCommands(), createRenderCommands(standardCommandsBrowser), createDocumentCommands(standardCommandsBrowser), ) submitEntriesToUrlEncoded [VariableDeclaration] (from packages/plugin/actions/src/submit-encoding.ts): submitEntriesToUrlEncoded = (entries: FormSubmissionEntry[]): string => entries .flatMap(({ name, value} ) => value === null ? [encodeURIComponent(name)] : Array.isArray(value) ? value.map((item) => `${ encodeURIComponent(name)} =${ encodeURIComponent(item)} `) : [`${ encodeURIComponent(name)} =${ encodeURIComponent(value)} `], ) .join('&') svgCursor [FunctionDeclaration] (from packages/framework/web/src/cursor.ts): export function svgCursor({ svg, hotspot, fallback = 'crosshair'} : SvgCursorOptions): string{ const tagStart = svg.indexOf('= 0 ? svg.indexOf('>', tagStart) : -1; const openTag = tagEnd >= 0 ? svg.slice(tagStart, tagEnd + 1) : ''; if (!/\swidth\s*=/.test(openTag) || !/\sheight\s*=/.test(openTag)){ throw new Error( '[web] svgCursor: the needs explicit width/height attributes — ' + 'browsers ignore cursor images without an intrinsic size', ); } const uri = `data:image/svg+xml, ${ encodeURIComponent(svg)} `; const spot = hotspot ? ` ${ Math.round(hotspot.x)} ${ Math.round(hotspot.y)} ` : ''; return `url("${ uri} ")${ spot} , ${ fallback} `; } timerClock [VariableDeclaration] (from packages/core/main/src/clock.ts): timerClock: HostClock ={ now: () => performance.now(), after(ms, run){ const timer = setTimeout(run, ms); return () => clearTimeout(timer); } , } toFieldRef [FunctionDeclaration] (from packages/engine/core/src/identity/FormFieldRef.ts): export function toFieldRef(name: string): FormFieldRef{ return{ kind: 'fqn', name} ; } toPageRef [FunctionDeclaration] (from packages/engine/core/src/identity/PageRef.ts): export function toPageRef(pageObjectNumber: PageObjectNumber): PageRef{ return{ kind: 'objectNumber', objectNumber: pageObjectNumber} ; } toPluginError [FunctionDeclaration] (from packages/core/main/src/errors.ts): export function toPluginError(capability: string, error: unknown): PluginError{ if (error instanceof PluginError) return error; if (isCancelled(error) || (error instanceof Error && error.name === 'AbortError')){ return new PluginError('operation-cancelled', capability, 'operation cancelled', { cause: error, } ); } if (EngineError.is(error)){ const code = ENGINE_CODE_MAP[String(error.code)] ?? 'operation-failed'; return new PluginError(code, capability, error.message, { cause: error, details: error.details, permission: code === 'permission-denied' ? requiredPermissionOf(error) : null, } ); } const message = error instanceof Error ? error.message : String(error); return new PluginError('operation-failed', capability, message, { cause: error} ); } toPluginErrorInfo [FunctionDeclaration] (from packages/core/main/src/errors.ts): export function toPluginErrorInfo(error: PluginError): PluginErrorInfo{ return{ code: error.code, message: error.message, capability: error.capability, permission: error.permission, } ; } toolCommand [VariableDeclaration] (from packages/plugin/interaction/src/commands.ts): toolCommand = (toolId: string): Omit => ({ labelKey: `commands.tool.${ toolId} `, label: toolId, icon: toolId, categories: ['tool'], run: (context) => interactionOf(context)?.activateTool(toolId), active: (context) => interactionOf(context)?.getActiveToolId() === toolId, visible: (context) => interactionOf(context)?.hasTool(toolId) ?? false, enabled: (context) => interactionOf(context)?.canUseTool(toolId) ?? true, } ) triggerOriginOf [VariableDeclaration] (from packages/plugin/actions/src/contract.ts): triggerOriginOf = (trigger: ActionTrigger): ActionOrigin =>{ switch (trigger.type){ case 'activate': return 'user'; case 'annotation': return trigger.event === 'cursorEnter' || trigger.event === 'cursorExit' ? 'hover' : 'user'; case 'page': case 'document': return 'lifecycle'; } } unknownCommandWarning [VariableDeclaration] (from packages/plugin/commands/src/contract.ts): unknownCommandWarning = (id: CommandId, known: Iterable): string => `no command "${ id} "${ didYouMean(id, known)} : it shows as neither visible nor enabled` unregisteredCommand [VariableDeclaration] (from packages/plugin/commands/src/contract.ts): unregisteredCommand = (id: CommandId): ResolvedCommand => ({ id, label: id, shortcuts: [], enabled: false, active: false, pressable: false, visible: false, categories: [], } ) validateSearchQuery [FunctionDeclaration] (from packages/engine/core/src/search/regex.ts): export function validateSearchQuery(query: SearchQuery): SearchQueryValidation{ if (!query.regex) return{ ok: true} ; if (query.matchDiacritics){ return{ ok: false, issue: 'diacritics-with-regex', message: 'Diacritic-sensitive matching is not available for regex patterns (regex runs on the raw text plane).', } ; } if (query.ignoreWhitespace){ return{ ok: false, issue: 'ignore-whitespace-with-regex', message: 'Whitespace-insensitive matching is not available for regex patterns (regex runs on the raw text plane; use \\s* in the pattern).', } ; } return validateSearchRegex(query.text); } validateSearchRegex [FunctionDeclaration] (from packages/engine/core/src/search/regex.ts): export function validateSearchRegex(pattern: string): SearchRegexValidation{ if (pattern.length === 0){ return{ ok: false, issue: 'empty', message: 'Pattern is empty.'} ; } if (pattern.length > SEARCH_REGEX_MAX_LENGTH){ return{ ok: false, issue: 'too-long', message: `Pattern exceeds ${ SEARCH_REGEX_MAX_LENGTH} characters.`, } ; } let inClass = false; for (let i = 0; i < pattern.length; i++){ const ch = pattern[i]; if (ch === '\\'){ const next = pattern[i + 1] ?? ''; if (!inClass && next >= '1' && next <= '9'){ return{ ok: false, issue: 'backreference', message: `Backreference \\${ next} is not supported.`, } ; } if (!inClass && next === 'k' && pattern[i + 2] === '<'){ return{ ok: false, issue: 'backreference', message: 'Named backreferences (\\k<…>) are not supported.', } ; } i++; continue; } if (inClass){ if (ch === ']') inClass = false; continue; } if (ch === '['){ inClass = true; continue; } if (ch === '(' && pattern[i + 1] === '?'){ const tag = pattern[i + 2] ?? ''; if (tag === '=' || tag === '!'){ return{ ok: false, issue: 'lookaround', message: 'Lookahead ((?=…), (?!…)) is not supported.', } ; } if (tag === '<' && (pattern[i + 3] === '=' || pattern[i + 3] === '!')){ return{ ok: false, issue: 'lookaround', message: 'Lookbehind ((?<=…), (? vibrate(8), impact: (weight = 'light') => vibrate(weight === 'heavy' ? 30 : weight === 'medium' ? 20 : 10), notify: (kind) => vibrate( kind === 'error' ? [12, 60, 12, 60, 12] : kind === 'warning' ? [15, 70, 15] : [10, 50, 10], ), } viewManagerPlugin [VariableDeclaration] (from packages/plugin/view-manager/src/view-manager.plugin.ts): viewManagerPlugin = () => definePlugin({ id: 'view-manager', scope: 'workspace', token: ViewManagerToken, requires: [DocumentsToken], state: initialViewManagerModel, create: createViewManagerController, } ) viewManagerState [VariableDeclaration] (from packages/plugin/view-manager/src/state.ts): viewManagerState = defineState(ViewManagerToken, { read: (viewManager): ViewManagerState => ({ panes: viewManager.listPanes(), focusedPaneId: viewManager.getFocusedPaneId(), } ), empty:{ panes: [], focusedPaneId: null} , } ) viewerSettingsOf [FunctionDeclaration] (from packages/core/main/src/viewer-settings.ts): export function viewerSettingsOf({ identity, scope, accent, page, } : ViewerSettingsInput): ViewerSettings{ return{ identity: identity ?? null, scope: scope ?? null, accent: accent ?? VIEWER_DEFAULTS.accent, page:{ ...VIEWER_DEFAULTS.page, ...page} , } ; } webCryptoSigner [FunctionDeclaration] (from packages/core/signature/src/signers/webcrypto.ts): export function webCryptoSigner(input:{ privateKey: CryptoKey; certificateChain: Uint8Array[]; hash?: Exclude; } ): RawSigner{ const keyAlgorithm = input.privateKey.algorithm as RsaHashedKeyAlgorithm | EcKeyAlgorithm; let algorithm: RawSignatureAlgorithm; let hash: Exclude; switch (keyAlgorithm.name){ case 'RSASSA-PKCS1-v1_5': algorithm = 'RSA-PKCS1-v1_5'; hash = hashFromWebCrypto((keyAlgorithm as RsaHashedKeyAlgorithm).hash.name); break; case 'RSA-PSS': algorithm = 'RSA-PSS'; hash = hashFromWebCrypto((keyAlgorithm as RsaHashedKeyAlgorithm).hash.name); break; case 'ECDSA': algorithm = 'ECDSA'; hash = input.hash ?? 'sha256'; break; default: throw new Error(`unsupported WebCrypto key algorithm ${ keyAlgorithm.name} `); } return{ kind: 'raw', certificateChain: input.certificateChain, algorithm, hash, async sign(data){ const params: AlgorithmIdentifier | RsaPssParams | EcdsaParams = algorithm === 'RSA-PSS' ?{ name: 'RSA-PSS', saltLength:{ sha256: 32, sha384: 48, sha512: 64} [hash]} : algorithm === 'ECDSA' ?{ name: 'ECDSA', hash: WEBCRYPTO_HASH[hash]} :{ name: 'RSASSA-PKCS1-v1_5'} ; const copy = new Uint8Array(data.byteLength); copy.set(data); const signature = await globalThis.crypto.subtle.sign(params, input.privateKey, copy); return new Uint8Array(signature); } , } ; } widgetAppearanceOf [FunctionDeclaration] (from packages/core/annotation/src/record/defaults.ts): export function widgetAppearanceOf(defaults: FieldValues): WidgetAppearance{ return Object.fromEntries( WIDGET_APPEARANCE_FIELDS.filter((name) => defaults[name] !== undefined).map((name) => [ name, defaults[name], ]), ) as WidgetAppearance; } withActions [FunctionDeclaration] (from packages/framework/angular/actions/src/actions.ts): export function withActions(config?: ActionsConfig): EmbedPdfFeature{ return{ plugins: [actionsPlugin(config)], services: [EpdfActions]} ; } withActionsUi [FunctionDeclaration] (from packages/framework/angular/actions/src/actions.ts): export function withActionsUi( handlers?: ActionsUiHandlers | (() => ActionsUiHandlers), ): EmbedPdfFeature{ return{ plugins: [], setup: () => installActionsUi(handlers)} ; } withAnnotation [FunctionDeclaration] (from packages/framework/angular/annotation/src/annotation.ts): export function withAnnotation(options?: AnnotationConfig): EmbedPdfFeature{ return{ plugins: [annotationPlugin(options)], services: [EpdfAnnotation, EpdfComments]} ; } withAttachment [FunctionDeclaration] (from packages/framework/angular/attachment/src/attachment.ts): export function withAttachment(): EmbedPdfFeature{ return{ plugins: [attachmentPlugin()], services: [EpdfAttachment]} ; } withCommandShortcuts [FunctionDeclaration] (from packages/framework/angular/commands/src/commands.ts): export function withCommandShortcuts(options?:{ isMac?: boolean; onRefused?: (commandId: CommandId, refusal: CommandRefusal) => void; } ): EmbedPdfFeature{ return{ plugins: [], setup: () =>{ const commands = shortcutCommands(inject(EpdfKernelHost)); effect((onCleanup) =>{ const current = commands(); if (current){ onCleanup( bindCommandShortcuts(current, { isMac: options?.isMac, onRefused: options?.onRefused, } ), ); } } ); } , } ; } withCommands [FunctionDeclaration] (from packages/framework/angular/commands/src/commands.ts): export function withCommands(options?: CommandsConfig): EmbedPdfFeature{ return{ plugins: [commandsPlugin(options)], services: [EpdfCommands]} ; } withFeedback [FunctionDeclaration] (from packages/framework/angular/interaction/src/interaction.ts): export function withFeedback(options?: FeedbackPluginOptions): EmbedPdfFeature{ return{ plugins: [feedbackPlugin(options)]} ; } withFilePicker [FunctionDeclaration] (from packages/framework/angular/annotation/src/file-picker.ts): export function withFilePicker( provider: FilePickerProvider | null = filePickerProvider, ): EmbedPdfFeature{ return{ plugins: [], setup: () => installFilePicker(provider)} ; } withForm [FunctionDeclaration] (from packages/framework/angular/form/src/form.ts): export function withForm(config?: FormConfig): EmbedPdfFeature{ return{ plugins: [formPlugin(config)], services: [EpdfForm]} ; } withHistory [FunctionDeclaration] (from packages/framework/angular/history/src/history.ts): export function withHistory(options?: HistoryConfig): EmbedPdfFeature{ return{ plugins: [historyPlugin(options)], services: [EpdfHistory]} ; } withI18n [FunctionDeclaration] (from packages/framework/angular/i18n/src/i18n.ts): export function withI18n(options?: I18nConfig): EmbedPdfFeature{ return{ plugins: [i18nPlugin(options)], services: [EpdfI18n]} ; } withInteraction [FunctionDeclaration] (from packages/framework/angular/interaction/src/interaction.ts): export function withInteraction(options?: InteractionConfig): EmbedPdfFeature{ return{ plugins: [interactionPlugin(options)], services: [EpdfInteraction]} ; } withLink [FunctionDeclaration] (from packages/framework/angular/link/src/link.ts): export function withLink(): EmbedPdfFeature{ return{ plugins: [linkPlugin()], services: [EpdfLink]} ; } withMeasurement [FunctionDeclaration] (from packages/framework/angular/measurement/src/measurement.ts): export function withMeasurement(options?: MeasurementConfig): EmbedPdfFeature{ return{ plugins: [measurementPlugin(options)], services: [EpdfMeasurement]} ; } withMetadata [FunctionDeclaration] (from packages/framework/angular/metadata/src/metadata.ts): export function withMetadata(): EmbedPdfFeature{ return{ plugins: [metadataPlugin()], services: [EpdfMetadata]} ; } withOutline [FunctionDeclaration] (from packages/framework/angular/outline/src/outline.ts): export function withOutline(): EmbedPdfFeature{ return{ plugins: [outlinePlugin()], services: [EpdfOutline]} ; } withPageEdit [FunctionDeclaration] (from packages/framework/angular/page-edit/src/page-edit.ts): export function withPageEdit(): EmbedPdfFeature{ return{ plugins: [pageEditPlugin()], services: [EpdfPageEdit]} ; } withRedaction [FunctionDeclaration] (from packages/framework/angular/redaction/src/redaction.ts): export function withRedaction(options?: RedactionConfig): EmbedPdfFeature{ return{ plugins: [redactionPlugin(options)], services: [EpdfRedaction]} ; } withRender [FunctionDeclaration] (from packages/framework/angular/render/src/render.ts): export function withRender(options?: RenderConfig): EmbedPdfFeature{ return{ plugins: [renderPlugin(options)], services: [EpdfRender]} ; } withSearch [FunctionDeclaration] (from packages/framework/angular/search/src/search.ts): export function withSearch(options?: SearchConfig): EmbedPdfFeature{ return{ plugins: [searchPlugin(options)], services: [EpdfSearch]} ; } withSelection [FunctionDeclaration] (from packages/framework/angular/selection/src/selection.ts): export function withSelection(options?: SelectionConfig): EmbedPdfFeature{ return{ plugins: [selectionPlugin(options)], services: [EpdfSelection]} ; } withShell [FunctionDeclaration] (from packages/framework/angular/shell/src/shell.ts): export function withShell(): EmbedPdfFeature{ return{ plugins: [shellPlugin()], services: [EpdfShell]} ; } withSignature [FunctionDeclaration] (from packages/framework/angular/signature/src/signature.ts): export function withSignature(config?: SignatureConfig): EmbedPdfFeature{ return{ plugins: [signaturePlugin(config)], services: [EpdfSignature]} ; } withStage [FunctionDeclaration] (from packages/framework/angular/stage/src/feature.ts): export function withStage(options?: StagePluginOptions): EmbedPdfFeature{ return{ plugins: [stagePlugin(options)], services: [EpdfStageRef]} ; } withStamp [FunctionDeclaration] (from packages/framework/angular/stamp/src/stamp.ts): export function withStamp(options?: StampConfig): EmbedPdfFeature{ return{ plugins: [stampPlugin(options)], services: [EpdfStamp]} ; } withViewManager [FunctionDeclaration] (from packages/framework/angular/view-manager/src/view-manager.ts): export function withViewManager(): EmbedPdfFeature{ return{ plugins: [viewManagerPlugin()], services: [EpdfViewManager]} ; } wkFeedback [VariableDeclaration] (from packages/framework/web/src/feedback.ts): wkFeedback = ( handlerName: string, fallback: WebPlatformFeedback = vibrationFeedback, ): WebPlatformFeedback =>{ const handler = (): WKMessageHandler | undefined =>{ if (typeof window === 'undefined') return undefined; const webkitWindow = window as Window &{ webkit?:{ messageHandlers?: Record} ; } ; return webkitWindow.webkit?.messageHandlers?.[handlerName]; } ; return{ selection: () =>{ const messageHandler = handler(); if (messageHandler) messageHandler.postMessage({ family: 'selection'} ); else fallback.selection(); } , impact: (weight = 'light') =>{ const messageHandler = handler(); if (messageHandler) messageHandler.postMessage({ family: 'impact', weight} ); else fallback.impact(weight); } , notify: (kind) =>{ const messageHandler = handler(); if (messageHandler) messageHandler.postMessage({ family: 'notify', kind} ); else fallback.notify(kind); } , } ; }