# @embedpdf/plugin-annotation — ./internal ANNOTATION_DRAW_PRIORITY [VariableDeclaration] (from packages/plugin/annotation/src/priorities.ts): ANNOTATION_DRAW_PRIORITY = 55 ANNOTATION_EDIT_PRIORITY [VariableDeclaration] (from packages/plugin/annotation/src/priorities.ts): ANNOTATION_EDIT_PRIORITY = 100 ANNOTATION_GHOST_PRIORITY [VariableDeclaration] (from packages/plugin/annotation/src/priorities.ts): ANNOTATION_GHOST_PRIORITY = 1000 ANNOTATION_MARQUEE_PRIORITY [VariableDeclaration] (from packages/plugin/annotation/src/priorities.ts): ANNOTATION_MARQUEE_PRIORITY = 50 ANNOTATION_PLACE_PRIORITY [VariableDeclaration] (from packages/plugin/annotation/src/priorities.ts): ANNOTATION_PLACE_PRIORITY = 95 ARMED_STAMP_TOOL_ID [VariableDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): ARMED_STAMP_TOOL_ID = 'stamp' Annotation [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface Annotation{ readonly ref: AnnotationRef; readonly page: PageRef; readonly subtype: Subtype; readonly bounds: Rect; readonly geometry: AnnotationGeometry; readonly props: Partial; readonly flags: AnnotationFlags; readonly contents: string; readonly author: string | null; readonly createdAt: string | null; readonly modifiedAt: string | null; readonly group: AnnotationRef | null; readonly inReplyTo: AnnotationRef | null; readonly authority:{ readonly update: boolean; readonly delete: boolean} ; readonly raw: AnnotationDTO | null; } AnnotationAction [TypeAliasDeclaration] (from packages/plugin/annotation/src/model.ts): export type AnnotationAction = |{ type: 'SET_MODEL'; model: Model} |{ type: 'SET_HYDRATION'; hydration: AnnotationHydration} |{ type: 'SET_CHROME'; patch: ChromeSettingsPatch} |{ type: 'SET_TOOL_GHOST'; ghost: ToolGhost | null} |{ type: 'SET_TEXT_SELECTION'; selection: TextSelection | null} |{ type: 'STAMP_ARM_CHANGED'} ; AnnotationCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationCapability{ get(ref: AnnotationRef): Annotation | null; list(filter?: AnnotationFilter): readonly Annotation[]; getRaw(ref: AnnotationRef): AnnotationDTO | null; listRaw(filter?: AnnotationFilter): readonly AnnotationDTO[]; hitTestAt(page: PageRef, point: Point): AnnotationRef | null; getStatus(): ResourceStatus; refresh(options?: OperationOptions): Promise; create(input: CreateAnnotationInput, options?: OperationOptions): Promise; createMany( inputs: readonly CreateAnnotationInput[], options?: OperationOptions, ): Promise>; createRaw( page: PageRef, draft: AnnotationDraft, options?: OperationOptions, ): Promise; createFromSelection( subtype: MarkupSubtype | 'insert-text' | 'replace-text' | 'redact', options?:{ preset?: string; clear?: boolean} & OperationOptions, ): Promise; createAttachment( page: PageRef, at: Point, file: AttachmentFileSource, options?: OperationOptions, ): Promise; placeStamp(input: StampToolInput, placement: StampPlacement): Promise; update(ref: AnnotationRef, patch: AnnotationPatch, options?: OperationOptions): Promise; updateMany( refs: readonly AnnotationRef[], patch: AnnotationPatch, options?: OperationOptions, ): Promise>; updateRaw( ref: AnnotationRef, patch: AnnotationPatchRaw, options?: OperationOptions, ): Promise; setRotation(ref: AnnotationRef, degrees: number, options?: OperationOptions): Promise; rotateBy(ref: AnnotationRef, delta: number, options?: OperationOptions): Promise; setContents(ref: AnnotationRef, text: string, options?: OperationOptions): Promise; setRichText( ref: AnnotationRef, document:{ paragraphs: RichTextParagraph[]} , options?: OperationOptions, ): Promise; delete(ref: AnnotationRef, options?: OperationOptions): Promise; deleteMany( refs: readonly AnnotationRef[], options?: OperationOptions, ): Promise>; links:{ get(ref: AnnotationRef): PdfLinkTarget | null; set(ref: AnnotationRef, target: PdfLinkTarget, options?: OperationOptions): Promise; clear(ref: AnnotationRef, options?: OperationOptions): Promise; } ; readAttachment(ref: AnnotationRef, options?: OperationOptions): Promise; select(refs: AnnotationRef | readonly AnnotationRef[], options?:{ add?: boolean} ): void; selectAll(page?: PageRef): void; selectInRect(page: PageRef, rect: Rect, options?:{ add?: boolean} ): void; clearSelection(): void; getSelection(): readonly AnnotationRef[]; listSelected(): readonly Annotation[]; getSelectionProps(): SelectionProps; getSelectionFlags(): SelectionFlags | null; getSelectionAnchor(view?:{ scale?: number; rotation?: PageRotation; zoom?: number; } ): AnnotationSelectionAnchor | null; updateSelection( patch: AnnotationPropsPatch, options?: OperationOptions, ): Promise>; updateSelectionFlags( patch: Partial, options?: OperationOptions, ): Promise>; deleteSelection(options?: OperationOptions): Promise>; rotateSelectionBy(delta: 90 | -90, options?: OperationOptions): Promise; resetSelectionRotation(options?: OperationOptions): Promise; toggleTextFormat(format: TextFormat, options?: OperationOptions): Promise; group(options?: OperationOptions): Promise; ungroup(options?: OperationOptions): Promise; canGroup(): boolean; canUngroup(): boolean; getCreationDraft(): CreationDraft | null; hasCreationDraft(): boolean; finishCreationDraft(options?: OperationOptions): Promise; cancelCreationDraft(): void; beginTextEdit(ref: AnnotationRef): void; endTextEdit(options?: OperationOptions): Promise; getEditingRef(): AnnotationRef | null; armStamp(input: StampToolInput): Promise; disarmStamp(): void; hasArmedStamp(): boolean; listTools(): readonly AnnotationTool[]; getTool(id: string): AnnotationTool | null; registerTool(def: AnnotationToolInput): Unsubscribe; getToolDefaults(toolId: string): AnnotationProps; setToolDefaults(toolId: string, patch: AnnotationPropsPatch): void; listPropSpecs(toolId: string): readonly PropSpec[]; getSnapSettings(): SnapSettings; updateSnapSettings(patch: Partial): void; getChromeSettings(): ChromeSettings; updateChromeSettings(patch: ChromeSettingsPatch): void; setFilePickerProvider(provider: FilePickerProvider | null): Unsubscribe; canRead(): boolean; canCreate(): boolean; canEdit(ref: AnnotationRef): boolean; canDelete(ref: AnnotationRef): boolean; cancel(): void; comments: CommentsApi; readonly onCreated: EventHook; readonly onUpdated: EventHook; readonly onDeleted: EventHook; readonly onResynced: EventHook; readonly onSelectionChanged: EventHook; readonly onDraftChanged: EventHook; readonly onEditingChanged: EventHook; } AnnotationChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationChangedEvent{ readonly ref: AnnotationRef; readonly page: PageRef; readonly subtype: AnnotationDTO['subtype']; readonly annotation: Annotation | null; readonly raw: AnnotationDTO; readonly origin: ChangeOrigin; } AnnotationConfig [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationConfig{ snap?:{ guides?: boolean; guideThreshold?: number; rotation?: boolean; rotationAngles?: number[]; rotationThreshold?: number; } ; chrome?: ChromeSettingsPatch; tools?: AnnotationToolInput[]; } AnnotationCreatedEvent [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationCreatedEvent = AnnotationChangedEvent; AnnotationDTO [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/index.ts): export type AnnotationDTO = DTOFromKind; AnnotationDeletedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDeletedEvent{ readonly ref: AnnotationRef; readonly page: PageRef; readonly origin: ChangeOrigin; } AnnotationDraft [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/index.ts): export type AnnotationDraft = | Exclude | StampDraft | FileAttachmentDraft; AnnotationDraftChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationDraftChangedEvent{ readonly draft: CreationDraft | null; } AnnotationEditingChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationEditingChangedEvent{ readonly ref: AnnotationRef | null; } AnnotationFilter [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationFilter{ readonly page?: PageRef; readonly subtype?: Subtype; readonly author?: string; readonly group?: AnnotationRef; } 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; } AnnotationGeometry [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationGeometry = |{ readonly kind: 'rect'; readonly bounds: Rect; readonly rotation: number} |{ readonly kind: 'line'; readonly from: Point; readonly to: Point} |{ readonly kind: 'polygon' | 'polyline'; readonly vertices: readonly Point[]} |{ readonly kind: 'ink'; readonly strokes: readonly (readonly Point[])[]} |{ readonly kind: 'markup'; readonly quads: readonly TextQuad[]} |{ readonly kind: 'caret'; readonly bounds: Rect} |{ readonly kind: 'text'; readonly bounds: Rect; readonly rotation: number; readonly callout: Callout | null; } ; AnnotationGeometryPatch [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationGeometryPatch = |{ readonly kind: 'rect'; readonly bounds: Rect; readonly rotation?: number} |{ readonly kind: 'line'; readonly from: Point; readonly to: Point} |{ readonly kind: 'polygon' | 'polyline'; readonly vertices: readonly Point[]} |{ readonly kind: 'ink'; readonly strokes: readonly (readonly Point[])[]} |{ readonly kind: 'markup'; readonly quads: readonly TextQuad[]} |{ readonly kind: 'text'; readonly bounds: Rect; readonly rotation?: number; readonly callout?: Callout | null; } ; AnnotationHostCapability [InterfaceDeclaration] (from packages/plugin/annotation/src/host-contract.ts): export interface AnnotationHostCapability extends AnnotationCapability{ setPageViewports( page: PageRef, viewports: PageMeasurementViewport[] | undefined, fallback: PdfMeasure, ): void; remeasurePage(page: PageRef, scale: PdfMeasure): Promise; readonly onDraftCaptured: EventHook; distanceCreationPage(): PageRef | null; listPageItems(page: PageRef, view?: ViewEnv): RenderItem[]; listTextItems(page: PageRef, view?: ViewEnv): TextItem[]; listChromeNodes( page: PageRef, scale?: number, rotation?: PageRotation, zoom?: number, ): ChromeNode[]; listLinkItems(page: PageRef): LinkNavItem[]; getAppearanceEpoch(page: PageRef): string; getBakeScale(renderScale: number): number; renderAppearances( page: PageRef, scale: number, signal?: AbortSignal, ): Promise; pdfToPageRect(page: PageRef, rect: PdfRect): Rect | null; getHydration(): AnnotationHydration; ensureHydrated(): void; reloadPage(page: PageRef): Promise; deliverRemoteEvent(event: DocumentEvent): void; getEditingId(): Id | null; beginTextEditAt( page: PageRef, point: Vec, scale?: number, rotation?: PageRotation, zoom?: number, ): boolean; draftContents(ref: AnnotationRef, text: string): void; draftRichText(ref: AnnotationRef, doc:{ paragraphs: RichTextParagraph[]} ): void; setTextSelection(ref: AnnotationRef, range:{ start: number; end: number} | null): void; getCssFontFamily(family: string): string; getHitKind( page: PageRef, point: Vec, scale?: number, rotation?: PageRotation, zoom?: number, touch?: boolean, ): 'handle' | 'rotate' | 'group-handle' | 'annot' | 'empty'; claimsTouchAt( page: PageRef, point: Vec, scale?: number, rotation?: PageRotation, zoom?: number, ): boolean; getCursorAt( page: PageRef, point: Vec, scale?: number, rotation?: PageRotation, zoom?: number, ): string | null; hoverAt( at:{ page: PageRef; point: Vec; scale?: number; rotation?: PageRotation; zoom?: number; } | null, ): void; editPointer( phase: 'down' | 'move' | 'up', page: PageRef, point: Vec, shift: boolean, scale?: number, rotation?: PageRotation, zoom?: number, touch?: boolean, ): void; marqueePointer( phase: 'down' | 'move' | 'up', page: PageRef, point: Vec, shift: boolean, scale?: number, rotation?: PageRotation, zoom?: number, ): void; createPointer( tool: string, phase: 'down' | 'move' | 'up', page: PageRef, point: Vec, finish?: boolean, displayRotation?: PageRotation, ): void; finishInkDraft(): void; placeAt(page: PageRef, point: Vec, displayRotation?: PageRotation): boolean; placeArmedStamp(page: PageRef, point: Vec, displayRotation?: PageRotation): boolean; requestStampAt(page: PageRef, point: Vec, displayRotation?: PageRotation): boolean; createMarkup(subtype: Subtype, page: PageRef, quads: TextQuad[], preset?: string): void; createCaret(page: PageRef, anchor: TextEndAnchor): void; createReplaceText(page: PageRef, quads: TextQuad[], anchor: TextEndAnchor, preset?: string): void; previewMarkup(subtype: Subtype, quadsByPage: Record, preset?: string): void; clearMarkupPreview(): void; hoverGhostAt(toolId: string, page: PageRef, point: Vec, displayRotation?: PageRotation): void; clearGhost(): void; setPlacementPreview(toolId: string, page: PageRef, box: Rect): void; clearPlacementPreview(): void; getToolGhost(page: PageRef): ToolGhost | null; getArmedStampPreview(devicePixelWidth?: number): Promise; getStampArmEpoch(): number; listResolvedTools(): ResolvedTool[]; getResolvedTool(id: string): ResolvedTool | null; getToolSubtype(id: string): Subtype; registerBehavior(b: Behavior): Unsubscribe; getBehaviorFor(a:{ subtype: Subtype; ref: AnnotationRef | null} ): Behavior | null; pruneEngagedSelection(): void; commitScriptEffects(entries: AnnotCommitEntry[]): Promise; } AnnotationHydration [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationHydration = |{ status: 'loading'} |{ status: 'complete'} |{ status: 'error'; error: unknown} |{ status: 'forbidden'} ; AnnotationPatch [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationPatch{ readonly bounds?: Rect; readonly geometry?: AnnotationGeometryPatch; readonly props?: AnnotationPropsPatch; readonly flags?: Partial; readonly contents?: string; readonly richText?:{ paragraphs: RichTextParagraph[]} ; } AnnotationPatchRaw [TypeAliasDeclaration] (from packages/engine/core/src/annotation/kinds/index.ts): export type AnnotationPatch = Exclude | StampPatch; AnnotationProps [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface AnnotationProps extends Style, TextStyle{ lineEndings: LineEndings; icon?: string; link?: PdfLinkTarget | null; } AnnotationPropsPatch [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type AnnotationPropsPatch ={ [K in PropKey]?: K extends 'lineEndings' ? Partial : AnnotationProps[K]; } ; AnnotationRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/AnnotationRef.ts): export type AnnotationRef = |{ kind: 'objectNumber'; page: PageRef; annotObjectNumber: number; } |{ kind: 'nm'; page: PageRef; nm: string; } |{ kind: 'index'; page: PageRef; index: number; revision: RevisionToken; } ; AnnotationResyncedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationResyncedEvent{ readonly pages: readonly PageRef[] | 'all'; } AnnotationSelectionAnchor [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSelectionAnchor{ page: PageRef; bounds: Rect; knob?: Vec; } AnnotationSelectionChangedEvent [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationSelectionChangedEvent{ readonly refs: readonly AnnotationRef[]; readonly previousRefs: readonly AnnotationRef[]; } AnnotationState [InterfaceDeclaration] (from packages/plugin/annotation/src/model.ts): export interface AnnotationState{ model: Model; hydration: AnnotationHydration; chrome: ChromeSettings; toolGhost: ToolGhost | null; stampArmEpoch: number; textSelection: TextSelection | null; } AnnotationSubtype [TypeAliasDeclaration] (from packages/engine/core/src/annotation/subtype.ts): export type AnnotationSubtype = (typeof ANNOTATION_SUBTYPES)[number]; AnnotationToken [VariableDeclaration] (from packages/plugin/annotation/src/host-contract.ts): AnnotationToken = PublicAnnotationToken as unknown as CapabilityToken AnnotationTool [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface AnnotationTool{ readonly id: string; readonly subtype: Subtype; readonly preset: string; readonly cursor: string; readonly enables: readonly string[]; readonly defaults?: AnnotationPropsPatch; readonly flags?: Partial; readonly upright: boolean; } AnnotationUpdatedEvent [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type AnnotationUpdatedEvent = AnnotationChangedEvent; ArmedStampPreview [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ArmedStampPreview{ bytes: Uint8Array; mimeType?: string; } AttachmentContent [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentContent{ bytes: Uint8Array; name: string; mimeType?: string; } AttachmentFileSource [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentFileSource{ data: Uint8Array | Blob; name?: string; mimeType?: string; description?: string; } Behavior [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface Behavior{ id: string; matches(a:{ subtype: Subtype; ref: AnnotationRef | null} ): boolean; engaged(): 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'; Border [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type Border = |{ kind: 'solid'} |{ kind: 'dashed'; dash: number[]} |{ kind: 'cloudy'; intensity: number} ; CapturedAnnotationDraft [InterfaceDeclaration] (from packages/plugin/annotation/src/host-contract.ts): export interface CapturedAnnotationDraft{ tool: string; page: PageRef; from: PdfPoint; to: PdfPoint; } ChromeSettings [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ChromeSettings{ accent: string; outline:{ style: 'solid' | 'dashed'; width: number; color?: string; } ; handles:{ size: number; hitSize: number; fill: string; stroke?: string; } ; knob:{ size: number; hitSize: number; offset: number; stalk: boolean; fill: string; stroke?: string; } ; guides:{ enabled: boolean; style: 'solid' | 'dashed'; width: number; axisColor?: string; axisOpacity: number; indicatorColor?: string; indicatorOpacity: number; } ; } ChromeSettingsPatch [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ChromeSettingsPatch{ accent?: string; outline?: Partial; handles?: Partial; knob?: Partial; guides?: Partial; } ClickCreate [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type ClickCreate = |{ width: number; height: number; anchor?: 'center' | 'top-left'} |{ length: number; angleDeg?: number} ; Color [InterfaceDeclaration] (from packages/engine/core/src/annotation/primitives.ts): export interface Color{ r: number; g: number; b: number; } CommentPermissions [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface CommentPermissions{ canReply: boolean; canEditText: boolean; canDelete: boolean; canSetStatus: boolean; canDeleteThread: boolean; } 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 change: '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; } CommentsApi [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface CommentsApi{ listThreads(): readonly CommentThread[]; getThread(ref: AnnotationRef): CommentThread | null; reply(ref: AnnotationRef, text: string, options?: OperationOptions): Promise; 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; getPermissions(ref: AnnotationRef): CommentPermissions; readonly onThreadChanged: EventHook; } CreateAnnotationGeometry [TypeAliasDeclaration] (from packages/plugin/annotation/src/create-input.ts): export type CreateAnnotationGeometry = |{ readonly subtype: 'square' | 'circle'; readonly bounds: Rect; readonly rotation?: number} |{ readonly subtype: 'line'; readonly from: Point; readonly to: Point} |{ readonly subtype: 'polygon' | 'polyline'; readonly vertices: readonly Point[]} |{ readonly subtype: 'ink'; readonly strokes: readonly (readonly Point[])[]} |{ readonly subtype: 'highlight' | 'underline' | 'strikeout' | 'squiggly' | 'redact'; readonly quads: readonly TextQuad[]; } |{ readonly subtype: 'redact'; readonly bounds: Rect} |{ readonly subtype: 'free-text'; readonly bounds: Rect; readonly callout?: Callout} ; CreateAnnotationInput [TypeAliasDeclaration] (from packages/plugin/annotation/src/create-input.ts): export type CreateAnnotationInput ={ readonly page: PageRef; readonly tool?: string; readonly props?: AnnotationPropsPatch; readonly flags?: Partial; readonly select?: boolean; } & CreateAnnotationGeometry; CreationDraft [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type CreationDraft = CreationDraftAnchor; Face [InterfaceDeclaration] (from packages/plugin/annotation/src/rich-text.ts): export interface Face{ family: string; weight?: number; italic?: boolean; } FilePickerProvider [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type FilePickerProvider = (req: FilePromptRequest) => Promise; FilePromptRequest [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface FilePromptRequest{ toolId: string; subtype: Subtype; accept?: string; page: PageRef; point: Vec; } 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; } LinkNavItem [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface LinkNavItem{ id: string; bounds: Rect; target: PdfLinkTarget; attached: boolean; activate?: PdfActionTree; ref?: AnnotationRef; hoverEvents?:{ enter: boolean; exit: boolean} ; } MarkupSubtype [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type MarkupSubtype = 'highlight' | 'underline' | 'strikeout' | 'squiggly'; PdfLinkTarget [TypeAliasDeclaration] (from packages/engine/core/src/dto/PdfLinkTarget.ts): export type PdfLinkTarget = |{ kind: 'goto'; destination: PdfDestination} |{ kind: 'uri'; uri: string} |{ kind: 'goto-remote'; file: string} |{ kind: 'launch'; path: string} |{ kind: 'javascript'} |{ kind: 'named'; name: string} |{ kind: 'unsupported'} ; PropKey [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type PropKey = keyof AnnotationProps; PropSpec [TypeAliasDeclaration] (from packages/core/annotation/src/kinds.ts): export type PropSpec = |{ key: 'color'; label: string} |{ key: 'interiorColor'; label: string} |{ key: 'fontColor'; label: string} |{ key: 'opacity'; label: string; min: number; max: number; step: number} |{ key: 'strokeWidth'; label: string; min: number; max: number; step: number} |{ key: 'fontSize'; label: string; min: number; max: number; step: number} |{ key: 'border'; label: string; cloudy: boolean} |{ key: 'lineEndings'; label: string} |{ key: 'fontFamily'; label: string} |{ key: 'textAlign'; label: string} |{ key: 'bold'; label: string} |{ key: 'italic'; label: string} |{ key: 'underline'; label: string} |{ key: 'blendMode'; label: string} |{ key: 'icon'; label: string; options: readonly string[]} |{ key: 'link'; label: string} ; 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} []; } ResolvedTool [InterfaceDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export interface ResolvedTool{ id: string; subtype: Subtype; preset: string; propsKind: string; cursor: string; enables: ReadonlySet; defaults?: AnnotationPropsPatch; flags?: Partial; source?: StampSourceSpec; selection?: SelectionAuthoring; intent?: InkIntent | 'LineDimension' | 'PolyLineDimension' | 'PolygonDimension'; measurement?:{ caption: LineDimensionCaption | ShapeDimensionCaption; leader?: LineLeader} ; ink?: InkAuthoringOptions; upright: boolean; clickCreate: ClickCreate | false; ghost: GhostPolicy; meta?: Record; } ReviewStatus [InterfaceDeclaration] (from packages/engine/core/src/annotation/comments.ts): export interface ReviewStatus{ state: string; stateModel: string; by: string | null; at: string | null; ref: AnnotationRef; } SelectionFlags [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type SelectionFlags ={ [K in keyof AnnotationFlags]: boolean | null} ; SelectionProps [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface SelectionProps{ specs: PropSpec[]; values: Partial; mixed: PropKey[]; } SnapSettings [InterfaceDeclaration] (from packages/core/annotation/src/types.ts): export interface SnapSettings{ guides: boolean; guideThreshold: number; rotation: boolean; rotationAngles: number[]; rotationThreshold: number; } StampPlacement [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface StampPlacement{ page: PageRef; at: Vec; targetWidth?: number; rotation?: number; } StampPreviewProvider [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type StampPreviewProvider = (devicePixelWidth: number) => Promise; StampToolInput [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface StampToolInput{ source: BinarySource; targetWidth?: number; name?: string; subject?: string; preview?: BinarySource | StampPreviewProvider; intrinsicSize?:{ width: number; height: number} ; } TextAlign [TypeAliasDeclaration] (from packages/core/annotation/src/types.ts): export type TextAlign = 'left' | 'center' | 'right'; 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{ id: Id; ref: AnnotationRef | null; box: Rect; contents: string; richText:{ paragraphs: RichTextParagraph[]} ; editing: boolean; rot?: number; css:{ fontFamily: string; fontSize: number; color: string; fontWeight: number; fontStyle: 'normal' | 'italic'; textDecoration: 'none' | 'underline'; align: 'left' | 'center' | 'right'; padding: number; } ; } TextSelection [InterfaceDeclaration] (from packages/plugin/annotation/src/rich-text.ts): export interface TextSelection extends RichTextRange{ id: string; } ThreadDeleteResult [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface ThreadDeleteResult{ deleted: AnnotationRef[]; failed: Array<{ ref: AnnotationRef; error: unknown} >; } ToolGhost [TypeAliasDeclaration] (from packages/plugin/annotation/src/contract.ts): export type ToolGhost ={ page: PageRef; box: Rect; rot: number; } & ( |{ kind: 'image'} |{ kind: 'vector'; toolId: string; geom: Geom} ); buildToolRegistry [FunctionDeclaration] (from packages/plugin/annotation/src/tools/definitions.ts): export function buildToolRegistry( overrides: AnnotationToolInput[] = [], ): Map{ const defs = new Map(); for (const d of DEFAULT_TOOLS) defs.set(d.id, d); for (const o of overrides){ const prev = defs.get(o.id); defs.set(o.id, prev ? mergeDef(prev, o) : o); } const out = new Map(); const resolving = new Set(); const resolve = (id: string): ResolvedTool =>{ const cached = out.get(id); if (cached) return cached; const def = defs.get(id); if (!def) throw new Error(`[annotation] tool '${ id} ' extends an unknown tool`); let base: ResolvedTool | undefined; if (def.extends && def.extends !== id && !resolving.has(def.extends)){ resolving.add(id); base = resolve(def.extends); resolving.delete(id); } const subtype = (def.subtype ?? base?.subtype ?? def.id) as Subtype; const resolved: ResolvedTool ={ id: def.id, subtype, preset: def.preset ?? def.id, propsKind: def.propsKind ?? base?.propsKind ?? subtype, cursor: def.cursor ?? base?.cursor ?? 'crosshair', enables: new Set(def.enables ?? (base ? [...base.enables] : [])), defaults: mergeDefaults(base?.defaults, def.defaults), flags: base?.flags || def.flags ?{ ...base?.flags, ...def.flags} : undefined, source: def.source ?? base?.source, selection: def.selection ?? base?.selection, intent: def.intent ?? base?.intent, measurement: def.measurement ?? base?.measurement, ink: base?.ink || def.ink ?{ ...base?.ink, ...def.ink} : undefined, upright: def.upright ?? base?.upright ?? false, clickCreate: def.clickCreate ?? base?.clickCreate ?? false, ghost: def.ghost ?? base?.ghost ?? false, meta: base?.meta || def.meta ?{ ...base?.meta, ...def.meta} : undefined, } ; validateDefaults(resolved); out.set(id, resolved); return resolved; } ; for (const id of defs.keys()) resolve(id); return out; } createAnnotationController [FunctionDeclaration] (from packages/plugin/annotation/src/controller.ts): export function createAnnotationController( ctx: AnnotationContext, config: AnnotationConfig ={ } , ): AnnotationHostCapability{ const services = createServices(ctx, config); const{ events, authority, tools, behaviors} = services; const annotations = createAnnotationReads(services); const chrome = createChromeReads(ctx, services); const render = createRenderReads(ctx, services); const selectionProps = createSelectionPropsReads(ctx, services); const announce = createAnnouncer(events, annotations.projectRef); const remote = createRemoteSync(services, announce); const hydration = createHydration(ctx, services, remote); const text = createTextEditing(ctx, services, annotations, chrome); const links = createLinkWrites(ctx, services); const crud = createCrud(ctx, services, annotations, announce, text, links); const stamps = createStamps(ctx, services); const ghost = createGhost(ctx, services, stamps); const icons = createIcons(ctx, services, announce, stamps); const selection = createSelectionWrites(services, annotations, selectionProps, text, links, crud); const measurement = createMeasurement(ctx, services, crud, hydration); const pointer = createPointer(ctx, services, chrome, measurement); const drafts = createDrafts(ctx, services); const markup = createMarkupWrites(ctx, services); const scripts = createScriptEffects(ctx, services, hydration); const settings = createSettings(ctx, services); const threads = createThreadIndex(ctx, services); const comments = createComments(ctx, services, threads, crud); const api = composeApi('annotation', [ annotations.api, chrome.api, render.api, selectionProps.api, tools.api, behaviors.api, hydration.api, text.api, links.api, crud.api, stamps.api, ghost.api, icons.api, selection.api, measurement.api, pointer.api, drafts.api, markup.api, scripts.api, settings.api, comments.api, { canRead: authority.canRead, canCreate: authority.canCreate, canEdit: authority.canEdit, canDelete: authority.canDelete, onCreated: events.created.on, onUpdated: events.updated.on, onDeleted: events.deleted.on, onSelectionChanged: events.selectionChanged.on, onDraftChanged: events.draftChanged.on, onEditingChanged: events.editingChanged.on, } , ]) satisfies AnnotationHostCapability; return api; } previewBucket [FunctionDeclaration] (from packages/plugin/annotation/src/host-contract.ts): export function previewBucket(devicePixelWidth: number, cap = 4096): number{ const px = Math.max(128, Math.ceil(devicePixelWidth)); return Math.min(cap, 2 ** Math.ceil(Math.log2(px))); }