import { App } from 'vue'; import { AsTag } from 'reka-ui'; import { ClassProp } from 'class-variance-authority/types'; import { ClassValue } from 'clsx'; import { Component } from 'vue'; import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import { ComputedRef } from 'vue'; import { CSSProperties } from 'vue'; import { default as default_2 } from 'konva'; import { DefineComponent } from 'vue'; import { EventBus } from 'pdfjs-dist/legacy/web/pdf_viewer.mjs'; import { ExtractPropTypes } from 'vue'; import { HTMLAttributes } from 'vue'; import { InjectionKey } from 'vue'; import { IRect } from 'konva/lib/types'; import { PDFDocumentProxy } from 'pdfjs-dist/legacy/build/pdf.mjs'; import { PDFDocumentProxy as PDFDocumentProxy_2 } from 'pdfjs-dist/types/src/display/api'; import { PDFPageView } from 'pdfjs-dist/types/web/pdf_page_view'; import { PDFViewer } from 'pdfjs-dist/legacy/web/pdf_viewer.mjs'; import { PDFViewer as PDFViewer_2 } from 'pdfjs-dist/types/web/pdf_viewer'; import { PrimitiveProps } from 'reka-ui'; import { PropType } from 'vue'; import { PublicProps } from 'vue'; import { Ref } from 'vue'; import { ShallowRef } from 'vue'; import { StoreDefinition } from 'pinia'; import { VariantProps } from 'class-variance-authority'; declare const __VLS_component: DefineComponent, { title: string; locale: string; theme: string; initialScale: string; enableRange: string; showTextLayer: boolean; showAnnotations: boolean; defaultActiveSidebarKey: null; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { documentLoaded: (viewer: any) => void; eventBusReady: (bus: any) => void; }, string, PublicProps, Readonly, { title: string; locale: string; theme: string; initialScale: string; enableRange: string; showTextLayer: boolean; showAnnotations: boolean; defaultActiveSidebarKey: null; }>>> & Readonly<{ onDocumentLoaded?: ((viewer: any) => any) | undefined; onEventBusReady?: ((bus: any) => any) | undefined; }>, { title: string; locale: "zh-CN" | "en-US"; enableRange: boolean | "auto"; defaultActiveSidebarKey: SidebarPanelKey | null; theme: "ruby" | "indigo" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky"; initialScale: PdfScale; showTextLayer: boolean; showAnnotations: boolean; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_10: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:open": (value: boolean) => void; "close-auto-focus": (event: Event) => void; "focus-outside": (event: Event) => void; "open-auto-focus": (event: Event) => void; }, string, PublicProps, Readonly>> & Readonly<{ "onUpdate:open"?: ((value: boolean) => any) | undefined; "onClose-auto-focus"?: ((event: Event) => any) | undefined; "onFocus-outside"?: ((event: Event) => any) | undefined; "onOpen-auto-focus"?: ((event: Event) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_11: DefineComponent, { type: string; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly, { type: string; }>>> & Readonly<{}>, { type: "auto" | "always" | "scroll" | "hover"; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_12: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_13: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_14: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_15: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_16: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_17: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_2: DefineComponent, { title: string; locale: string; theme: string; initialScale: string; enableRange: string; user: () => { id: string; name: string; }; enableNativeAnnotations: boolean; defaultShowAnnotationsSidebar: boolean; defaultShowAnnotationAuthorLabels: boolean; }>>, { save: typeof handleSaveFromPainter; getAnnotations: typeof getAnnotations; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { save: (annotations: Annotation[]) => void; annotationDeleted: (id: string) => void; load: () => void; annotationAdded: (annotation: Annotation) => void; annotationSelected: (annotation: Annotation | null, isClick: boolean) => void; annotationUpdated: (annotation: Annotation) => void; }, string, PublicProps, Readonly, { title: string; locale: string; theme: string; initialScale: string; enableRange: string; user: () => { id: string; name: string; }; enableNativeAnnotations: boolean; defaultShowAnnotationsSidebar: boolean; defaultShowAnnotationAuthorLabels: boolean; }>>> & Readonly<{ onSave?: ((annotations: Annotation[]) => any) | undefined; onAnnotationDeleted?: ((id: string) => any) | undefined; onLoad?: (() => any) | undefined; onAnnotationAdded?: ((annotation: Annotation) => any) | undefined; onAnnotationSelected?: ((annotation: Annotation | null, isClick: boolean) => any) | undefined; onAnnotationUpdated?: ((annotation: Annotation) => any) | undefined; }>, { title: string; locale: "zh-CN" | "en-US"; enableRange: boolean | "auto"; theme: "ruby" | "indigo" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky"; initialScale: PdfScale; user: User; defaultShowAnnotationAuthorLabels: boolean; enableNativeAnnotations: boolean; defaultShowAnnotationsSidebar: boolean; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_3: DefineComponent, { title: string; sidebar: () => never[]; defaultActiveSidebarKey: null; layoutStyle: () => {}; theme: string; initialScale: string; user: null; toolbar: boolean; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly, { title: string; sidebar: () => never[]; defaultActiveSidebarKey: null; layoutStyle: () => {}; theme: string; initialScale: string; user: null; toolbar: boolean; }>>> & Readonly<{}>, { title: string; sidebar: { key: string; title: string; icon: string; }[]; toolbar: boolean; defaultActiveSidebarKey: SidebarPanelKey | null; layoutStyle: CSSProperties; theme: string; initialScale: PdfScale; user: User | null; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_4: DefineComponent, { as: string; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly, { as: string; }>>> & Readonly<{}>, { as: AsTag | Component; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_5: DefineComponent, { orientation: string; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:modelValue": (value: string) => void; }, string, PublicProps, Readonly, { orientation: string; }>>> & Readonly<{ "onUpdate:modelValue"?: ((value: string) => any) | undefined; }>, { orientation: "horizontal" | "vertical"; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_6: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_7: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_8: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_9: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare type __VLS_NonUndefinedable = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_10 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_11 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_12 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_13 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_14 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_15 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_16 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_17 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_18 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_19 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_2 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_20 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_21 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_22 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_23 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_3 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_4 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_5 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_6 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_7 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_8 = T extends undefined ? never : T; declare type __VLS_NonUndefinedable_9 = T extends undefined ? never : T; declare type __VLS_Prettify = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_2 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_3 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_4 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_5 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_6 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_7 = { [K in keyof T]: T[K]; } & {}; declare type __VLS_Prettify_8 = { [K in keyof T]: T[K]; } & {}; declare function __VLS_template(): Partial any>> & { toolbar?(_: { context: PdfViewerContextValue; }): any; actions?(_: { context: PdfViewerContextValue; }): any; "sidebar-search-sidebar"?(_: { context: PdfViewerContextValue; }): any; }; declare function __VLS_template_10(): { trigger?(_: {}): any; default?(_: {}): any; }; declare function __VLS_template_11(): { default?(_: {}): any; }; declare function __VLS_template_12(): { default?(_: {}): any; }; declare function __VLS_template_13(): { default?(_: {}): any; }; declare function __VLS_template_14(): { default?(_: {}): any; }; declare function __VLS_template_15(): { default?(_: {}): any; }; declare function __VLS_template_16(): { default?(_: {}): any; }; declare function __VLS_template_17(): { default?(_: {}): any; }; declare function __VLS_template_2(): { actions?(_: { onSave: typeof handleSaveFromPainter; getAnnotations: typeof getAnnotations; exportToExcel: typeof handleExportExcelFromPainter; exportToPdf: typeof handleExportPdf; }): any; }; declare function __VLS_template_3(): Partial any>> & { actions?(_: { context: PdfViewerContextValue; }): any; toolbar?(_: { context: PdfViewerContextValue; }): any; default?(_: {}): any; }; declare function __VLS_template_4(): { default?(_: {}): any; }; declare function __VLS_template_5(): { default?(_: {}): any; }; declare function __VLS_template_6(): { default?(_: {}): any; }; declare function __VLS_template_7(): { default?(_: {}): any; }; declare function __VLS_template_8(): { default?(_: {}): any; }; declare function __VLS_template_9(): { trigger?(_: {}): any; default?(_: {}): any; }; declare type __VLS_TypePropsToRuntimeProps = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_10 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_10>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_11 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_11>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_12 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_12>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_13 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_13>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_14 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_14>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_15 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_15>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_16 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_16>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_17 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_17>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_18 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_18>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_19 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_19>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_2 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_2>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_20 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_20>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_21 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_21>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_22 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_22>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_23 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_23>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_3 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_3>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_4 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_4>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_5 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_5>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_6 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_6>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_7 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_7>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_8 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_8>; } : { type: PropType; required: true; }; }; declare type __VLS_TypePropsToRuntimeProps_9 = { [K in keyof T]-?: {} extends Pick ? { type: PropType<__VLS_NonUndefinedable_9>; } : { type: PropType; required: true; }; }; declare type __VLS_WithDefaults = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify : P[K]; }; declare type __VLS_WithDefaults_2 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_2 : P[K]; }; declare type __VLS_WithDefaults_3 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_3 : P[K]; }; declare type __VLS_WithDefaults_4 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_4 : P[K]; }; declare type __VLS_WithDefaults_5 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_5 : P[K]; }; declare type __VLS_WithDefaults_6 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_6 : P[K]; }; declare type __VLS_WithDefaults_7 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_7 : P[K]; }; declare type __VLS_WithDefaults_8 = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify_8 : P[K]; }; declare type __VLS_WithTemplateSlots = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_10 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_11 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_12 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_13 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_14 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_15 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_16 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_17 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_2 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_3 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_4 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_5 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_6 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_7 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_8 = T & { new (): { $slots: S; }; }; declare type __VLS_WithTemplateSlots_9 = T & { new (): { $slots: S; }; }; /** 全局 Adapter 注册表 */ declare class AdapterRegistry { private adapters; /** 注册 Adapter */ register(adapter: AnnotationRendererAdapter): void; /** 获取 Adapter */ get(name: string): AnnotationRendererAdapter | undefined; /** 列出所有 Adapter */ list(): AnnotationRendererAdapter[]; } /** 全局 Adapter 注册表实例 */ export declare const adapterRegistry: AdapterRegistry; /** 批注(Annotation) * * 这是 InkLayer 的核心模型,是持久化存储的唯一事实来源。 * * 数据流: * - 写入:Konva Node → Adapter.extract() → Annotation → Storage * - 读取:Storage → Annotation → Adapter.render() → Konva Node → Canvas * * 约束: * - ❌ 禁止在此对象中出现 konva / canvas / viewport 字段 * - ❌ 禁止序列化 Konva Node 状态 * - ✅ 所有几何必须基于 PDF 用户空间 * - ✅ 所有字段都是可选的,便于渐进增强 */ export declare interface Annotation { /** 全局唯一标识符 * * 要求: * - 稳定:创建后不应改变 * - 唯一:跨文档/跨会话唯一 * - 建议使用 UUID / ULID */ id: string; /** 高层语义类型 * * 这是产品分类,不是 PDF subtype * PDF Subtype → AnnotationKind 的映射由 Adapter 处理 */ kind: AnnotationKind; /** 批注锚点(位置) */ target: AnnotationTarget; /** 语义内容(是什么) * * 表达批注的业务含义,不包含渲染细节 * 例如:文本批注的文本内容、印章的名称 */ payload?: AnnotationPayload; /** 外观提示(怎么画) * * 这是渲染提示,不是语义 * 不同渲染器可能有不同解释 */ appearance?: AnnotationAppearance; /** 批注关系(关联) * * 用于:回复链、Popup 关联、引用关系 */ relations?: AnnotationRelations; /** 元信息(生命周期) * * 不影响渲染,不参与导出计算 * 但对协作、审计、版本控制很重要 */ meta?: AnnotationMeta; /** 扩展点 * * 用于: * - Adapter 私有数据(如 PDF.js 具体类型) * - 业务扩展(如 AI 分析结果) * - 调试信息 * * 约束: * - 不能影响 Core 的序列化和兼容性 * - 不能作为业务逻辑的唯一依赖 */ extensions?: Record; } /** 批注外观 */ export declare interface AnnotationAppearance { /** 描边颜色 */ strokeColor?: string; /** 填充颜色 */ fillColor?: string; /** 描边粗细(pt) */ strokeWidth?: number; /** 透明度(0-1) */ opacity?: number; /** 虚线样式 */ dashArray?: number[]; /** 文字大小(用于 note / text-markup) */ fontSize?: number; /** 文字字体 */ fontFamily?: string; /** 文字对齐 */ textAlign?: 'left' | 'center' | 'right'; /** 渲染顺序(图层) */ zIndex?: number; } declare interface AnnotationHoverSnapshot { annotationId: string | null; source: AnnotationHoverSource | null; } declare type AnnotationHoverSource = 'sidebar-pointer' | 'sidebar-focus' | 'canvas' | 'canvas-passive'; export declare const AnnotationIcon: DefineComponent, { size: number; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly, { size: number; }>>> & Readonly<{}>, { size: number; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** Icon names used in toolbar — rendered by AnnotationIcon Vue component */ declare type AnnotationIconName = 'select' | 'highlight' | 'strikeout' | 'underline' | 'rectangle' | 'circle' | 'note' | 'arrow' | 'cloud' | 'freehand' | 'freeHighlight' | 'freeText' | 'signature' | 'stamp'; /** 批注类型(产品语义) * * 注意:这是 InkLayer 的语义分类,不是 PDF 的 Subtype * PDF Subtype → InkLayer Kind 的映射由 Adapter 处理 */ export declare type AnnotationKind = 'text-markup' | 'note' | 'ink' | 'shape' | 'line' | 'stamp' | 'file'; /** 批注元信息 */ export declare interface AnnotationMeta { /** Stable, document-scoped display number used by annotation references. */ referenceNumber?: number; /** 创建时间(ISO 8601) */ createdAt?: string; /** 更新时间(ISO 8601) */ updatedAt?: string; /** 作者标识 * * 可用形式: * - 字符串 ID:'user-123' * - 完整对象:{ id: 'user-123', name: 'Alice', avatarUrl: '...' } */ authorId?: string | { id: string; name?: string; avatarUrl?: string; }; /** 是否来自 PDF 原生批注 * * true: 从 PDF 文件中加载的原生批注 * false: InkLayer 创建的新批注 */ isNative?: boolean; /** 来源系统 * * - 'inklayer': InkLayer 创建 * - 'pdfjs': 从 PDF.js 导入 * - 'import': 从外部导入 */ source?: 'inklayer' | 'pdfjs' | 'import'; /** 版本号(用于协作冲突处理) */ version?: number; } /** 批注内容联合类型 */ export declare type AnnotationPayload = TextMarkupPayload | NotePayload | InkPayload | ShapePayload | LinePayload | StampPayload | FilePayload; export declare type AnnotationPermissionAction = 'annotation.create' | 'annotation.transform' | 'annotation.edit' | 'annotation.delete' | 'annotation.comment' | 'annotation.change-status' | 'comment.edit' | 'comment.delete'; export declare type AnnotationPermissionMode = 'unrestricted' | 'owner-only'; export declare interface AnnotationPermissionRequest { action: AnnotationPermissionAction; currentUser: User | null; annotation?: Readonly; comment?: Readonly; /** Result calculated by the configured permission mode. */ defaultAllowed: boolean; } export declare interface AnnotationPermissions { /** @default 'unrestricted' */ mode?: AnnotationPermissionMode; /** * Synchronously overrides the configured mode. Return undefined to keep * the default decision. */ can?: (request: AnnotationPermissionRequest) => boolean | undefined; } /** 批注关系 */ export declare interface AnnotationRelations { /** 父批注 ID(如回复的父批注) */ parentId?: string; /** 直接回复列表 */ replies?: string[]; /** Popup 所属批注(用于 Note 的 Popup 关联) */ popupFor?: string; /** 关联/引用批注 */ linkedAnnotationIds?: string[]; } /** Annotation Renderer Adapter * * 泛型参数: * - T: 渲染节点的类型(如 Konva.Node, SVGElement 等) * - C: 上下文类型(如 ViewportContext) */ export declare interface AnnotationRendererAdapter { /** 渲染器标识 */ readonly name: string; /** 渲染器版本 */ readonly version: string; /** * 从 Annotation 渲染节点 * * 这是"纯函数": * - 不依赖之前的状态 * - 相同的输入产生相同的输出 * - 可以安全缓存 */ render(annotation: Annotation, context: C): RenderResult; /** * 更新现有节点(可选,优化性能) * * 当 Annotation 或 Viewport 变化时,可以复用现有节点 * 而不必完全重新创建 */ update?(annotation: Annotation, context: C, existing: T): void; /** * 从渲染节点提取几何信息 * * 这是"从 UI 回写到数据"的唯一合法路径 * * @param node 渲染节点 * @param context 视口上下文 * @returns 提取的几何和外观信息 */ extract(node: T, context: C): ExtractResult; } export declare const AnnotationSidebar: DefineComponent; default: () => never[]; }; selectedId: { type: StringConstructor; default: null; }; annotationPermissions: { type: PropType; default: undefined; }; }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { delete: (id: string) => void; select: (ann: IAnnotationStore) => void; }, string, PublicProps, Readonly; default: () => never[]; }; selectedId: { type: StringConstructor; default: null; }; annotationPermissions: { type: PropType; default: undefined; }; }>> & Readonly<{ onDelete?: ((id: string) => any) | undefined; onSelect?: ((ann: IAnnotationStore) => any) | undefined; }>, { annotations: IAnnotationStore[]; annotationPermissions: AnnotationPermissions; selectedId: string; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** * 批量转换 Annotation 数组到 IAnnotationStore 数组 */ export declare function annotationsToStores(annotations: Annotation[]): IAnnotationStore[]; /** 批注锚点 * * 定义批注在哪个文档的哪一页的什么位置 */ export declare interface AnnotationTarget { /** PDF 页索引(从 0 开始) * * 注意:这是 PDF 逻辑页顺序,与打印页码、Viewer 显示页码可能不同 */ pageIndex: number; /** 几何信息(PDF 用户空间坐标) */ geometry: Geometry; /** 坐标系标识,当前固定为此值 * * 约束:所有几何必须基于 PDF User Space * 未来可能扩展:'viewport'(屏幕坐标) */ coordinateSystem: 'pdf-user-space'; /** 可选文档标识 * * 用于跨文档系统(如文档管理平台) * InkLayer Core 不强制要求,由应用层决定 */ documentId?: string; } export declare const AnnotationToolbar: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** * 将 InkLayer Annotation 转换为 PDF.js 批注对象 * * @param annotation InkLayer Annotation * @param options 选项 * @returns PDF.js 批注对象 */ export declare function annotationToPdfJs(annotation: Annotation, options?: { /** 页面索引 */ pageIndex?: number; }): PdfJsAnnotation; /** * 将 Annotation Core 转换回 IAnnotationStore(旧系统格式) * * 从 Annotation 的 extensions 字段提取 Konva 渲染数据和旧系统元数据。 * * 这主要用于: * - 渐进式迁移期间 * - 与旧系统兼容 * - 导出时需要旧格式 */ export declare function annotationToStore(annotation: Annotation): IAnnotationStore; declare enum AnnotationType { NONE = -1, SELECT = 0, HIGHLIGHT = 1, STRIKEOUT = 2, UNDERLINE = 3, FREETEXT = 4, RECTANGLE = 5, CIRCLE = 6, FREEHAND = 7, FREE_HIGHLIGHT = 8, SIGNATURE = 9, STAMP = 10, NOTE = 11, ARROW = 12, CLOUD = 13 } export declare const AnnotatorExtension: DefineComponent>, { getAnnotations: () => { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; }[]; save: () => void; selectTool: (tool: IAnnotationType | null, dataTransfer?: string | null) => void; getPainter: () => Painter | null; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { save: (annotations: any[]) => void; "annotation-added": (annotation: any) => void; "annotation-deleted": (id: string) => void; "annotation-selected": (annotation: IAnnotationStore | null, isClick: boolean) => void; "annotation-updated": (annotation: any) => void; }, string, PublicProps, Readonly>> & Readonly<{ onSave?: ((annotations: any[]) => any) | undefined; "onAnnotation-added"?: ((annotation: any) => any) | undefined; "onAnnotation-deleted"?: ((id: string) => any) | undefined; "onAnnotation-selected"?: ((annotation: IAnnotationStore | null, isClick: boolean) => any) | undefined; "onAnnotation-updated"?: ((annotation: any) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; export declare const Button: __VLS_WithTemplateSlots_4>; export declare type ButtonVariants = VariantProps; export declare const buttonVariants: (props?: ({ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined; size?: "default" | "sm" | "lg" | "icon" | null | undefined; } & ClassProp) | undefined) => string; declare type ButtonVariants_2 = VariantProps; declare const buttonVariants_2: (props?: ({ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined; size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined; } & ClassProp) | undefined) => string; /** 坐标转换:Canvas 空间 → PDF 空间 */ export declare function canvasToPdfPoint(canvasPoint: { x: number; y: number; }, context: ViewportContext): { x: number; y: number; }; export declare const Card: __VLS_WithTemplateSlots_12>; export declare const CardContent: __VLS_WithTemplateSlots_16>; export declare const CardDescription: __VLS_WithTemplateSlots_15>; export declare const CardFooter: __VLS_WithTemplateSlots_17>; export declare const CardHeader: __VLS_WithTemplateSlots_13>; export declare const CardTitle: __VLS_WithTemplateSlots_14>; export declare function cn(...inputs: ClassValue[]): string; export declare const ColorPicker: DefineComponent; default: () => string[] | undefined; }; disabled: { type: BooleanConstructor; default: boolean; }; popover: { type: BooleanConstructor; default: boolean; }; }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:modelValue": (value: string) => void; }, string, PublicProps, Readonly; default: () => string[] | undefined; }; disabled: { type: BooleanConstructor; default: boolean; }; popover: { type: BooleanConstructor; default: boolean; }; }>> & Readonly<{ "onUpdate:modelValue"?: ((value: string) => any) | undefined; }>, { disabled: boolean; presets: string[]; popover: boolean; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare enum CommentStatus { Accepted = "Accepted", Rejected = "Rejected", Cancelled = "Cancelled", Completed = "Completed", None = "None", Closed = "Closed" } /** * 创建 Konva 渲染器实例 */ export declare function createKonvaRenderer(context: KonvaRenderContext, options?: RenderOptions): KonvaAnnotationRenderer; export declare type DeepPartial = { [K in keyof T]?: T[K] extends object ? (T[K] extends Function ? T[K] : DeepPartial) : T[K]; }; declare interface DeleteUndoItemSummary { kind: 'annotation' | 'comment'; previewAnnotation: IAnnotationStore; previewComment?: IAnnotationComment; annotationReferenceNumber?: number; annotationType?: AnnotationType; pageNumber?: number; content?: string; author?: string; } declare interface DeleteUndoSnapshot { annotationCount: number; commentCount: number; totalCount: number; expiresAt: number; items: DeleteUndoItemSummary[]; } export declare function exportToExcel(annotations: IAnnotationStore[], fileName?: string): Promise; /** * 从 Konva 节点提取 Annotation 几何 */ export declare function extractGeometryFromKonva(node: default_2.Node, context: KonvaRenderContext): ExtractResult; /** 提取结果 */ export declare interface ExtractResult { /** 几何信息 */ geometry: Geometry; /** 更新的外观信息 */ appearance?: { strokeColor?: string; fillColor?: string; strokeWidth?: number; opacity?: number; }; } /** 文件附件(File Attachment) * * PDF 原生类型:FileAttachment */ export declare interface FilePayload { kind: 'file'; /** 文件名 */ fileName: string; /** 文件 URL 或路径 */ fileUrl: string; /** 文件大小(字节) */ size?: number; /** MIME 类型 */ mimeType?: string; } /** 批注几何类型联合 */ export declare type Geometry = RectGeometry | QuadGeometry | PathGeometry | LineGeometry | PolyGeometry; /** 根据 Geometry type 获取对应的几何类型 */ export declare type GeometryFor = T extends 'rect' ? RectGeometry : T extends 'quad' ? QuadGeometry : T extends 'path' ? PathGeometry : T extends 'line' ? LineGeometry : T extends 'poly' ? PolyGeometry : never; declare function getAnnotations(): Annotation[]; declare function handleExportExcelFromPainter(name?: string): void; declare function handleExportPdf(name?: string): Promise; declare function handleSaveFromPainter(): void; /** 检查几何类型 */ export declare function hasGeometry(annotation: Annotation): boolean; export declare interface IAnnotationComment { id: string; title: string; date: string | null; content: string; status?: CommentStatus; /** Stable author identity used by collaboration permissions. */ user?: User; /** Structured annotation references contained in `content`. */ references?: IAnnotationReference[]; } export declare interface IAnnotationContentsObj { text: string; /** Source text covered by a text-markup annotation. */ selectedText?: string; image?: string; /** Structured annotation references contained in `text`. */ references?: IAnnotationReference[]; } /** * A stable annotation target stored beside the readable #N text. * `annotationId` drives navigation; `label` only identifies the text token. */ export declare interface IAnnotationReference { type: 'annotation'; annotationId: string; label: string; } export declare interface IAnnotationStore { id: string; /** Stable, document-scoped display number used by annotation references. */ referenceNumber?: number; pageNumber: number; konvaString: string; konvaClientRect: IRect; title: string; type: AnnotationType; color?: string | null; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: IAnnotationContentsObj | null; comments: IAnnotationComment[]; user: User; native: boolean; } declare interface IAnnotationStyle { color?: string; fontSize?: number; opacity?: number; strokeWidth?: number; } declare interface IAnnotationType { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: IAnnotationStyle; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; }; } /** * Vue Plugin that automatically installs Pinia if the consumer * hasn't already done so. Use `app.use(inklayerVuePlugin)` in * your main.ts to get started with zero config. */ export declare const inklayerVuePlugin: { install(app: App): void; }; /** 自由手绘(Ink) * * PDF 原生类型:Ink */ export declare interface InkPayload { kind: 'ink'; /** 笔画颜色 */ color?: string; /** 笔画粗细(pt) */ width?: number; } export declare const Input: DefineComponent>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:modelValue": (payload: string | number) => void; keydown: (payload: KeyboardEvent) => void; }, string, PublicProps, Readonly>> & Readonly<{ onKeydown?: ((payload: KeyboardEvent) => any) | undefined; "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** 检查是否为有效的 Annotation */ export declare function isValidAnnotation(obj: unknown): obj is Annotation; export declare interface KeywordResult { query: string; countTotal: number; pageMatches: PageMatch[]; } /** InkLayer Kind → PDF.js Subtype 映射(默认) */ export declare const KIND_TO_PDFJS_SUBTYPE: Record; /** * Konva Annotation Renderer */ export declare class KonvaAnnotationRenderer { private context; private options; constructor(context: KonvaRenderContext, options?: RenderOptions); /** * 从 Annotation 渲染 Konva 节点 */ render(annotation: Annotation): default_2.Node; /** * 从 Konva 节点提取 Annotation(几何信息) */ extract(node: default_2.Node, _annotationId: string): ExtractResult; /** 渲染文本标注(高亮、下划线等) */ private renderTextMarkup; /** 渲染文本批注(Note) */ private renderNote; /** 渲染自由手绘(Ink) */ private renderInk; /** 渲染形状(矩形、椭圆、云形等) */ private renderShape; /** 渲染矩形 */ private renderRect; /** 渲染椭圆 */ private renderEllipse; /** 渲染云形 */ private renderCloud; /** 渲染多边形 */ private renderPolygon; /** 渲染线条/箭头 */ private renderLine; /** 渲染印章 */ private renderStamp; /** 默认渲染 */ private renderDefault; /** 从 Konva 节点提取几何信息 */ private extractGeometry; /** 从 Konva 节点提取外观信息 */ private extractAppearance; /** 获取外观样式 */ private getAppearanceStyle; /** PDF Rect → Canvas Rect */ private pdfRectToCanvas; /** Canvas Rect → PDF Rect */ private canvasRectToPdf; } declare interface KonvaCanvas { pageNumber: number; konvaStage: default_2.Stage; wrapper: HTMLDivElement; isActive: boolean; } /** Konva 渲染上下文 */ export declare interface KonvaRenderContext extends ViewportContext { /** Konva Stage */ stage: default_2.Stage; /** Konva Layer */ layer: default_2.Layer; /** 容器尺寸 */ containerSize: { width: number; height: number; }; } /** Konva 渲染结果 */ export declare interface KonvaRenderResult extends RenderResult { /** 渲染节点 */ node: default_2.Node; } /** Konva 渲染上下文 */ export declare interface KonvaViewportContext extends ViewportContext { /** 父级 Stage */ stage: default_2.Stage; /** 所在 Layer */ layer: default_2.Layer; /** 容器 DOM 元素尺寸 */ containerSize: { width: number; height: number; }; } /** 直线/箭头几何 * * 适用场景:直线、箭头、测量线 * * @property start - 起点 * @property end - 终点 */ export declare interface LineGeometry { type: 'line'; start: PdfPoint; end: PdfPoint; } /** 直线/箭头(Line) * * PDF 原生类型:Line */ export declare interface LinePayload { kind: 'line'; /** 起点是否有箭头 */ arrowStart?: boolean; /** 终点是否有箭头 */ arrowEnd?: boolean; } export declare interface MatchSnippet { matchIndex: number; charIndex: number; snippet: string; } /** 文本批注(Note / Popup) * * PDF 原生类型:FreeText, Popup */ export declare interface NotePayload { kind: 'note'; /** 批注内容文本 */ text: string; } export declare interface PageMatch { pageNumber: number; countTotal: number; matches: MatchSnippet[]; } declare class Painter { private primaryColor; private defaultOptions; private currentUser; private annotationPermissions?; private readonly permissionController; private konvaCanvasStore; private editorStore; private pdfViewerApplication; getPDFViewer(): PDFViewer_2; private webSelection; private currentAnnotation; private nextAnnotationReferenceNumber; private highlightRequestId; private highlightRetryTimer; private resolveHighlightRequest; private selector; private authorLabels; private hoverPreview; private passiveHover; private readonly annotationHover; private deleteUndoController?; private readonly unsubscribeAnnotationHover; private transform; private tempDataTransfer; readonly onTextSelected: (range: Range | null) => void; readonly onAnnotationAdd: (annotationStore: IAnnotationStore, isOriginal: boolean, currentAnnotation: IAnnotationType | undefined) => void; readonly onAnnotationDelete: (id: string) => void; readonly onAnnotationSelected: (annotationStore: IAnnotationStore | undefined, isClick: boolean, selectorRect: IRect) => void; readonly onAnnotationChanging: () => void; readonly onAnnotationChanged: (annotationStore: IAnnotationStore | undefined, selectorRect?: IRect) => void; private store; /** * 构造函数,初始化 PDFViewerApplication, EventBus, 和 WebSelection * @param params - 包含 store、PDFViewerApplication 和 EventBus 的对象 */ constructor({ primaryColor, defaultOptions, currentUser, annotationPermissions, defaultShowAnnotationAuthorLabels, PDFViewerApplication, store, onTextSelected, onAnnotationAdd, onAnnotationDelete, onAnnotationSelected, onAnnotationChanging, onAnnotationChanged }: { primaryColor: string; defaultOptions: PdfAnnotatorOptions; currentUser: User; annotationPermissions?: AnnotationPermissions; defaultShowAnnotationAuthorLabels?: boolean; PDFViewerApplication: PDFViewer_2; store: ReturnType; onTextSelected: (range: Range | null) => void; onAnnotationAdd: (annotationStore: IAnnotationStore, isOriginal: boolean, currentAnnotation: IAnnotationType | undefined) => void; onAnnotationDelete: (id: string) => void; onAnnotationSelected: (annotationStore: IAnnotationStore | undefined, isClick: boolean, selectorRect: IRect) => void; onAnnotationChanging: () => void; onAnnotationChanged: (annotationStore: IAnnotationStore | undefined, selectorRect?: IRect) => void; }); setPermissionContext(currentUser: User, annotationPermissions?: AnnotationPermissions): void; can(action: AnnotationPermissionAction, annotation?: IAnnotationStore, comment?: IAnnotationComment): boolean; areAnnotationAuthorLabelsVisible(): boolean; setAnnotationAuthorLabelsVisible(visible: boolean): void; setAnnotationHover(source: AnnotationHoverSource, annotationId: string): void; clearAnnotationHover(source: AnnotationHoverSource, annotationId: string): void; subscribeAnnotationHover(listener: (snapshot: AnnotationHoverSnapshot) => void): () => void; getAnnotationHoverSnapshot(): AnnotationHoverSnapshot; private setDefaultMode; /** * 绑定全局事件。 */ private bindGlobalEvents; /** * 全局键盘抬起事件处理器。 * @param e - 键盘事件。 */ private globalKeyUpHandler; /** * 创建绘图容器 (painterWrapper) * @param pageView - 当前 PDF 页面视图 * @param pageNumber - 当前页码 * @returns 绘图容器元素 */ private createPainterWrapper; /** * 创建 Konva Stage * @param container - 绘图容器元素 * @param viewport - 当前 PDF 页面视口 * @returns Konva Stage */ private createKonvaStage; /** * 清理无效的 canvasStore */ private cleanUpInvalidStore; private disposeCanvas; /** * 插入新的绘图容器和 Konva Stage * @param pageView - 当前 PDF 页面视图 * @param pageNumber - 当前页码 */ private insertCanvas; /** * 调整现有 KonvaCanvas 的缩放 * @param pageView - 当前 PDF 页面视图 * @param pageNumber - 当前页码 */ private scaleCanvas; /** * 设置当前模式 (绘画模式、默认模式) * @param mode - 模式类型 ('painting', 'default') */ private setMode; /** * 保存到存储 */ private saveToStore; /** * 更新存储 */ private updateStore; private createDeletedAnnotationEntry; private restoreDeletedAnnotation; private restoreDeletedComment; /** * 根据组 ID 查找编辑器 * @param groupId - 组 ID * @returns 编辑器实例 */ private findEditorForGroupId; /** * 根据页码和编辑器类型查找编辑器 * @param pageNumber - 页码 * @param editorType - 编辑器类型 * @returns 编辑器实例 */ private findEditor; /** * 启用特定类型的编辑器 * @param options - 包含 Konva Stage、页码和批注类型的对象 */ private enableEditor; /** * 启用绘画 */ private enablePainting; /** * 重新绘制批注 * @param pageNumber - 页码 */ private reDrawAnnotation; /** * 删除批注 * @param id - 批注 ID */ private deleteAnnotation; /** * 关闭绘画 */ private disablePainting; /** * 保存临时数据传输 * @param data - 数据 * @returns 临时数据传输 */ private saveTempDataTransfer; /** * 清除临时数据传输 * @returns 临时数据传输 */ private clearTempDataTransfer; /** * 初始化或更新 KonvaCanvas * @param params - 包含当前 PDF 页面视图、是否需要 CSS 转换和页码的对象 */ initCanvas({ pageView, cssTransform, pageNumber }: { pageView: PDFPageView; cssTransform: boolean; pageNumber: number; }): void; /** * 初始化 WebSelection * @param rootElement - 根 DOM 元素 */ initWebSelection(rootElement: HTMLDivElement): void; /** * 激活特定批注类型 * @param annotation - 批注类型对象 * @param dataTransfer - 数据传输 */ activate(annotation: IAnnotationType | null, dataTransfer: string | null): void; /** * 重置 PDF.js 批注存储 */ resetPdfjsAnnotationStorage(): void; /** * @description 根据 range 加亮 * @param range * @param annotation */ highlightRange(range: Range | null, annotation: IAnnotationType): void; /** * @description 选中对应 ID 批注 * @param id */ selectAnnotation(id: string, isClick: boolean): void; /** * @description 将annotation 存入 store, 包含外部 annotation 和 pdf 文件上的 annotation */ initAnnotationsOnce(annotations: IAnnotationStore[], enableNativeAnnotations: boolean): Promise; /** * @description 更新 store * @param id * @param updates */ update(id: string, updates: Partial, action?: AnnotationPermissionAction, comment?: IAnnotationComment): IAnnotationStore | null | undefined; /** * @description 删除 annotation * @param id */ delete(id: string, emit?: boolean): boolean; deleteComment(annotationId: string, commentId: string): boolean; subscribeDeleteUndo(listener: () => void): () => void; getDeleteUndoSnapshot(): DeleteUndoSnapshot | null; pauseDeleteUndo(): void; resumeDeleteUndo(): void; undoDelete(): number; private cancelHighlightRequest; /** * @description 高亮选中 annotation * @param annotation */ highlight(annotation: IAnnotationStore): Promise; getData(): { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; }[]; /** * @description 更新样式 * @param annotationStore * @param styles */ updateAnnotationStyle(annotationStore: IAnnotationStore, style: IAnnotationStyle): void; getKonvaCanvasStore(): Map; reRenderAnnotations(pageNumber: number): void; /** * 销毁 Painter 实例,清理所有资源 */ destroy(): void; } /** 路径几何(自由绘制) * * 适用场景:自由手绘(Ink)、云线、任意形状 * * @property points - 路径点序列 * @property closed - 是否闭合路径(默认 false) */ export declare interface PathGeometry { type: 'path'; /** 路径点序列 */ points: PdfPoint[]; /** 是否闭合,默认 false */ closed?: boolean; } /** 根据 Kind 获取对应的 Payload 类型 */ export declare type PayloadFor = K extends 'text-markup' ? TextMarkupPayload : K extends 'note' ? NotePayload : K extends 'ink' ? InkPayload : K extends 'shape' ? ShapePayload : K extends 'line' ? LinePayload : K extends 'stamp' ? StampPayload : K extends 'file' ? FilePayload : never; export declare const PdfAnnotator: __VLS_WithTemplateSlots_2>; /** * PDF 注解器配置选项 / PDF Annotator Configuration Options * 定义PDF注解器的所有可配置参数 / Defines all configurable parameters for the PDF annotator */ export declare type PdfAnnotatorOptions = { /** * 颜色选项 / Color options * 用户在注解工具中可以选择的颜色列表 / List of colors users can select in annotation tools * @default: ['#ff0000', '#ffbe00', '#ffff00', '#83d33c', '#00b445', '#00b2f4', '#1677ff', '#001f63', '#7828a4', '#ff00ff'] */ colors?: string[]; /** * 签名配置 / Signature configuration * 控制签名功能的相关设置 / Settings that control signature functionality */ signature?: { /** * 签名颜色选项 / Signature color options * 签名工具可用的颜色 / Colors available for the signature tool * @default: ['#000000', '#ff0000', '#1677ff'] */ colors?: string[]; /** * 默认签名类型 / Default signature type * Draw: 手绘签名 / Draw: Hand-drawn signature * Enter: 键入签名 / Enter: Typed signature * Upload: 上传签名 / Upload: Uploaded signature * @default: 'Draw' */ type?: 'Draw' | 'Enter' | 'Upload'; /** * 最大文件大小 / Maximum file size * 允许上传的签名文件最大字节数 / Maximum bytes allowed for uploaded signature files * @default: 1024 * 1024 * 5 (5MB) */ maxSize?: number; /** * 接受的文件类型 / Accepted file types * 签名上传功能接受的文件扩展名 / File extensions accepted by the signature upload feature * @default: '.png,.jpg,.jpeg,.bmp' */ accept?: string; /** * 默认的签名图片 base64 string / Default signature * @default: [] */ defaultSignature?: string[]; /** * 手写字体列表 / Handwriting font list * 特殊的手写字体选项 / Special handwriting font options * @example [ { label: '楷体', value: 'STKaiti', external: false, },{ label: 'font name', value: 'font value', external: true, url: 'font url' }, { label: '平方长安体', value: 'PingFangChangAnTi-2', external: true, url: PingFangChangAnTiFont import url } ] * @default: [] */ defaultFont?: { /** * 字体显示名称 / Font display name */ label: string; /** * 实际CSS字体值 / Actual CSS font value */ value: string; /** * 是否为外部字体 / Whether it's an external font * 如果为true,则从url加载字体 / If true, font is loaded from the url */ external: boolean; /** * 字体文件URL / Font file URL * 外部字体文件的位置 / Location of the external font file */ url?: string; }[]; }; /** * 盖章配置 / Stamp configuration * 控制盖章功能的相关设置 / Settings that control stamp functionality */ stamp?: { /** * 最大文件大小 / Maximum file size * 允许上传的印章文件最大字节数 / Maximum bytes allowed for uploaded stamp files * @default: 1024 * 1024 * 5 (5MB) */ maxSize?: number; /** * 接受的文件类型 / Accepted file types * 盖章上传功能接受的文件扩展名 / File extensions accepted by the stamp upload feature * @default: '.png,.jpg,.jpeg,.bmp' */ accept?: string; /** * 默认印章 base64 string / Default stamp * @default: [] */ defaultStamp?: string[]; /** * 印章编辑器配置 / Stamp editor configuration * 控制印章编辑器外观的设置 / Settings controlling the appearance of the stamp editor */ editor?: { /** * 默认背景颜色 / Default background color * 印章的默认背景颜色 / Default background color for stamps * @default: #00b445 */ defaultBackgroundColor?: string; /** * 默认边框颜色 / Default border color * 印章的默认边框颜色 / Default border color for stamps * @default: '' */ defaultBorderColor?: string; defaultBorderStyle?: 'none' | 'solid' | 'dashed'; /** * 默认文字颜色 / Default text color * 印章文字的默认颜色 / Default color for stamp text * @default: '#fff' */ defaultTextColor?: string; /** * 默认字体列表 / Default font * 提供的默认字体选项,包含标签和实际CSS字体值 / Provided default font options with labels and actual CSS font values * @default [ { label: 'Arial', value: 'Arial' }, { label: 'Times New Roman', value: 'Times New Roman' }, { label: 'Georgia', value: 'Georgia' }, { label: 'Verdana', value: 'Verdana' }, { label: 'Tahoma', value: 'Tahoma, Geneva, sans-serif' }, { label: 'Trebuchet MS', value: '"Trebuchet MS", sans-serif' }, { label: 'Courier New', value: '"Courier New", Courier, monospace' }, { label: 'Lucida Console', value: '"Lucida Console", Monaco, monospace' }, { label: '宋体', value: 'SimSun, Songti SC, STSong, 宋体, "Noto Serif SC", serif' }, { label: '黑体', value: 'Microsoft YaHei, PingFang SC, Heiti SC, SimHei, 黑体, sans-serif' }, { label: '楷体', value: 'KaiTi, KaiTi_GB2312, STFangsong, 楷体, "AR PL UKai CN", serif' } ] */ defaultFont?: { /** * 字体显示名称 / Font display name */ label: string; /** * 实际CSS字体值 / Actual CSS font value */ value: string; }[]; }; }; }; /** * PDF 批注组件的配置参数 */ export declare interface PdfAnnotatorProps extends PdfBaseProps { /** * 当前用户信息,用于标注作者标识 * @default: { id: 'null', name: 'unknown' } */ user?: User; /** * Client-side interaction permissions for collaborative review. * This does not replace server-side authorization. * @default { mode: 'unrestricted' } */ annotationPermissions?: AnnotationPermissions; /** * 是否在批注器初始化时显示全部批注作者标签。 * 用户仍可通过工具栏按钮切换,或在 macOS 按住 Command、 * Windows/Linux 按住 Alt 临时显示全部作者标签。 * @default false */ defaultShowAnnotationAuthorLabels?: boolean; /** * 是否加载PDF自带的批注 * @default false */ enableNativeAnnotations?: boolean; /** * 默认选项配置 * 如果不提供,则使用系统默认配置 */ defaultOptions?: DeepPartial; /** * 初始批注列表(Core 格式 Annotation[]),组件内部自动转换。 * 从后端/api 拿到数据后直接传入即可,无需额外处理。 * * @example * const annotations = await api.getAnnotations(docId) * */ initialAnnotations?: Annotation[]; /** * 是否默认显示批注侧边栏 * @default false */ defaultShowAnnotationsSidebar?: boolean; /** * 自定义额外按钮区域组件 * 可以是一个 Vue 组件,组件会通过 slot props 接收到以下属性: * - save: () => void 保存当前批注 * - getAnnotations: () => Annotation[] 获取当前批注(Core 格式) * - exportToExcel: () => void 导出到 Excel * - exportToPdf: () => Promise 导出到 PDF */ actions?: Component<{ save: () => void; getAnnotations: () => Annotation[]; exportToExcel: (fileName?: string) => void; exportToPdf: (fileName?: string) => Promise; }>; /** * 保存回调(Core 格式 Annotation[]) * 组件内部自动转换,调用方拿到的是干净的 Annotation[] */ onSave?: (annotations: Annotation[]) => void; /** * 加载完成回调 */ onLoad?: () => void; onAnnotationAdded?: (annotation: Annotation) => void; /** * 删除批注回调 * @param annotation * @returns */ onAnnotationDeleted?: (id: string) => void; onAnnotationSelected?: (annotation: Annotation | null, isClick: boolean) => void; onAnnotationUpdated?: (annotation: Annotation) => void; } declare type PdfAnnotatorUserOptions = DeepPartial; export declare interface PdfBaseProps { /** * 主题色 (accent color) * @default 'violet' */ theme?: 'ruby' | 'indigo' | 'gray' | 'gold' | 'bronze' | 'brown' | 'yellow' | 'amber' | 'orange' | 'tomato' | 'red' | 'crimson' | 'pink' | 'plum' | 'purple' | 'violet' | 'iris' | 'blue' | 'cyan' | 'teal' | 'jade' | 'green' | 'grass' | 'lime' | 'mint' | 'sky' | undefined; /** * 页面标题 */ title?: string; /** * PDF 文件地址,支持字符串 URL 或 URL 对象 * @example "https://example.com/doc.pdf" */ url?: string | URL; /** * PDF 数据 - 直接传入二进制数据,优先级高于 url * 支持 base64 字符串、ArrayBuffer、TypedArray 等格式 */ data?: string | number[] | ArrayBuffer | Uint8Array | Uint16Array | Uint32Array; /** * 语言区域,用于国际化 * @default 'zh-CN' */ locale?: 'zh-CN' | 'en-US'; /** * 默认选项,用于初始化 PDF 阅读器 缩放 * @default 'auto' */ initialScale?: PdfScale; /** * pdf viewer 容器的样式 * @default { width: '100vw', height: '100vh' } */ layoutStyle?: CSSProperties; /** * 是否开启流式加载模式, auto 为自动判断 * @default auto */ enableRange?: boolean | 'auto'; } /** PDF.js Subtype → InkLayer Kind 映射 */ export declare const PDFJS_SUBTYPE_TO_KIND: Record; /** PDF.js 批注对象结构(来自 PDF.js) */ export declare interface PdfJsAnnotation { /** 批注类型 */ subtype: PdfjsAnnotationSubtype; /** 批注类型编号 */ type: PdfjsAnnotationType; /** 唯一 ID */ id: string; /** 几何信息 */ rect?: number[]; quadPoints?: number[]; /** 颜色 */ color?: number[] | string; /** 内容 */ contents?: string; richText?: string; /** 样式 */ borderStyle?: { width: number; style: number; dashArray: number[]; }; /** 自由文本样式 */ textStyle?: { fontName?: string; fontSize?: number; color?: number[]; }; /** 线条终点 */ lineEndings?: ['None' | 'Square' | 'Circle' | 'Diamond' | 'OpenArrow' | 'ClosedArrow', 'None' | 'Square' | 'Circle' | 'Diamond' | 'OpenArrow' | 'ClosedArrow']; /** 创建者 */ creator?: string; /** 创建日期 */ creationDate?: string; /** 注释日期 */ modDate?: string; /** 父批注(用于回复) */ parentId?: string; /** 弹出框 */ popup?: { open: boolean; rect: number[]; }; } declare type PdfjsAnnotationSubtype = 'None' | 'Link' | 'Text' | 'Widget' | 'Popup' | 'FreeText' | 'Line' | 'Square' | 'Circle' | 'PolyLine' | 'Polygon' | 'Caret' | 'Ink' | 'Highlight' | 'Underline' | 'Squiggly' | 'StrikeOut' | 'Stamp' | 'FileAttachment' | 'Note' | 'Arrow'; declare enum PdfjsAnnotationType { NONE = 0, TEXT = 1, LINK = 2, FREETEXT = 3, LINE = 4, SQUARE = 5, CIRCLE = 6, POLYGON = 7, POLYLINE = 8, HIGHLIGHT = 9, UNDERLINE = 10, SQUIGGLY = 11, STRIKEOUT = 12, STAMP = 13, CARET = 14, INK = 15, POPUP = 16, FILEATTACHMENT = 17, SOUND = 18, MOVIE = 19, WIDGET = 20, SCREEN = 21, PRINTERMARK = 22, TRAPNET = 23, WATERMARK = 24, THREED = 25, REDACT = 26, NOTE = 27 } /** * 将 PDF.js 批注转换为 InkLayer Annotation * * @param pdfAnnotation PDF.js 批注对象 * @param options 选项 * @returns InkLayer Annotation 对象 */ export declare function pdfJsToAnnotation(pdfAnnotation: PdfJsAnnotation, options?: { /** 文档 ID(可选) */ documentId?: string; /** PDF 页面尺寸(用于坐标转换) */ pageSize?: { width: number; height: number; }; /** 默认用户 ID */ defaultAuthorId?: string; }): Annotation; /** * InkLayer Annotation Core v0.1 — Freeze Version * =============================================== * * 核心批注数据模型,作为 InkLayer SDK 的标准定义。 * * 设计原则: * - 与 UI / 渲染框架无关(Konva / PDF.js / React) * - 坐标统一使用 PDF 用户空间(左下角为原点,1pt = 1/72 inch) * - 持久化存储的唯一事实来源(Source of Truth) * - 可被 Adapter 转换为任意渲染引擎 * * 文档约定: * - pageIndex: PDF 逻辑页,从 0 开始 * - coordinateSystem: 当前固定为 'pdf-user-space' * - 所有颜色使用 CSS 颜色字符串(如 '#FF0000', 'rgba(0,0,0,0.5)') * * @author InkLayer * @version 0.1.0 */ /** PDF 空间中的点 */ export declare interface PdfPoint { /** X 坐标(从左向右) */ x: number; /** Y 坐标(从下向上) */ y: number; } /** 四边形点,用于文本高亮等多段区域 * * 顺序:p1→p2→p3→p4(顺时针或逆时针) * 常用于选中一段文本后的 QuadPoints */ export declare interface PdfQuad { p1: PdfPoint; p2: PdfPoint; p3: PdfPoint; p4: PdfPoint; } /** PDF 空间中的矩形 */ export declare interface PdfRect { /** 左下角 X 坐标 */ x: number; /** 左下角 Y 坐标 */ y: number; /** 宽度 */ width: number; /** 高度 */ height: number; } declare type PDFRef = Ref; export declare type PdfScale = 'auto' | 'page-actual' | 'page-fit' | 'page-width' | string; /** 坐标转换:PDF 空间 → Canvas 空间 */ export declare function pdfToCanvasPoint(pdfPoint: { x: number; y: number; }, context: ViewportContext): { x: number; y: number; }; export declare const PdfViewer: __VLS_WithTemplateSlots>; export declare const PdfViewerContextKey: InjectionKey; export declare interface PdfViewerContextValue { pdfDocument: PDFRef; pdfViewer: PDFRef; eventBus: PDFRef; viewerContainerRef: Readonly>; isReady: Ref; activeSidebarPanel: Ref; toggleSidebar: () => void; openSidebar: (key: SidebarPanelKey) => void; closeSidebar: () => void; isSidebarCollapsed: Ref; print: () => void; download: (fileName?: string) => void; } export declare interface PdfViewerProps extends PdfBaseProps { /** Custom actions area (replaces default Print button) */ actions?: Component | ((ctx: PdfViewerContextValue) => Component) | null; /** Custom sidebar panels (search sidebar always included first) */ sidebar?: SidebarPanel[]; /** Custom toolbar (ZoomTool always shown first, user content appended after separator) */ toolbar?: Component | ((ctx: PdfViewerContextValue) => Component); /** Show text layer for selection/search */ showTextLayer?: boolean; /** Show native PDF annotations */ showAnnotations?: boolean; /** Default active sidebar key */ defaultActiveSidebarKey?: SidebarPanelKey | null; /** Document loaded callback */ onDocumentLoaded?: (pdfViewer: any) => void; /** EventBus ready callback */ onEventBusReady?: (bus: any) => void; } export declare const PdfViewerProvider: __VLS_WithTemplateSlots_3>; /** 多边形/折线几何 * * 适用场景:多边形、折线、不规则形状 * * @property points - 顶点序列 * @property closed - 是否闭合(多边形 true,折线 false) */ export declare interface PolyGeometry { type: 'poly'; points: PdfPoint[]; /** 是否闭合:多边形=true,折线=false */ closed: boolean; } export declare const Popover: __VLS_WithTemplateSlots_10>; declare interface Props extends Omit { title?: string; toolbar?: boolean; sidebar?: { key: string; title: string; icon: string; }[]; defaultActiveSidebarKey?: SidebarPanelKey | null; /** Container CSS — aligned with PdfBaseProps.layoutStyle */ layoutStyle?: CSSProperties; theme?: string; initialScale?: PdfScale; user?: User | null; } declare interface Props_2 extends PrimitiveProps { variant?: ButtonVariants_2["variant"]; size?: ButtonVariants_2["size"]; class?: HTMLAttributes["class"]; disabled?: boolean; } /** 四边形几何(文本标注) * * 适用场景:文本高亮、下划线、删除线、波浪线 * PDF 中 TextMarkup annotation 使用 QuadPoints */ export declare interface QuadGeometry { type: 'quad'; /** 多组四边形,用于选中文本跨越多行的情况 */ quads: PdfQuad[]; } /** 矩形几何 * * 适用场景:印章、形状(矩形)、文本批注图标、边界框 */ export declare interface RectGeometry { type: 'rect'; rect: PdfRect; } /** * 批量渲染 Annotations 到 Konva Layer */ export declare function renderAnnotationsToLayer(annotations: Annotation[], context: KonvaRenderContext, layer: default_2.Layer, options?: RenderOptions): default_2.Node[]; /** * 渲染单个 Annotation 到 Konva 节点 */ export declare function renderAnnotationToKonva(annotation: Annotation, context: KonvaRenderContext, options?: RenderOptions): default_2.Node; /** 批注渲染选项 */ export declare interface RenderOptions { /** 是否可交互(可选) */ interactive?: boolean; /** 是否选中 */ selected?: boolean; /** 点击回调 */ onClick?: (annotation: Annotation) => void; /** 双击回调 */ onDblClick?: (annotation: Annotation) => void; } /** 渲染结果 */ export declare interface RenderResult { /** 根节点 */ node: T; /** 子节点(复杂图形可能需要多个节点) */ children?: T[]; /** 元数据 */ metadata?: { /** 是否使用了缓存 */ fromCache?: boolean; /** 渲染耗时(ms) */ renderTime?: number; }; } export declare const ScrollArea: __VLS_WithTemplateSlots_11>; declare interface SearchOptions { caseSensitive?: boolean; entireWord?: boolean; matchDiacritics?: boolean; } export declare const SearchSidebar: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare interface SelectionInfo { store: IAnnotationStore | null; source: SelectionSource | null; } declare enum SelectionSource { CANVAS = "canvas", SIDEBAR = "sidebar" } export declare const Separator: DefineComponent, { orientation: string; decorative: boolean; }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly, { orientation: string; decorative: boolean; }>>> & Readonly<{}>, { orientation: "horizontal" | "vertical"; decorative: boolean; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** 形状(Shape) * * PDF 原生类型:Square, Circle, Polygon, Cloud */ export declare interface ShapePayload { kind: 'shape'; /** 形状类型 */ shape: 'rect' | 'ellipse' | 'cloud' | 'polygon'; } export declare interface SidebarPanel { key: SidebarPanelKey; title: string; icon: string; } export declare type SidebarPanelKey = string; /** 印章(Stamp) * * PDF 原生类型:Stamp * * 设计说明:Stamp 的语义是"这是什么章",不是"怎么画出来" * 外观渲染由 AnnotationAppearance 和 Adapter 处理 */ export declare interface StampPayload { kind: 'stamp'; /** * 印章逻辑标识符 * * - 标准 PDF 印章使用规范名称:'Approved', 'Rejected', 'Draft', 'Final' 等 * - 自定义印章使用应用定义的标识符:'company-seal', 'personal-mark' 等 * * 用途:PDF 导出映射、多端协作一致性 */ name: string; /** * 可选显示标签 * * 用于 UI 展示、tooltip、可访问性 * 例如:'APPROVED' / '已批准' / 'Secret' */ label?: string; /** * 印章来源类型 * * - 'standard': PDF 标准印章 * - 'custom': 应用自定义印章 * - 'image': 图片印章 */ source?: 'standard' | 'custom' | 'image'; /** * 预定义外观资源引用 * * 用于企业章/图片章的复用场景 * 值可以是:asset id / URL / hash key * * 注意:不直接存储 base64/SVG,保持 Core 纯净 */ appearanceRef?: string; /** 可选旋转角度(度) */ rotation?: number; /** 可选缩放比例 */ scale?: number; } /** * 批量转换 IAnnotationStore 数组到 Annotation 数组 */ export declare function storesToAnnotations(stores: IAnnotationStore[]): Annotation[]; /** * 将 IAnnotationStore 转换为 Annotation Core * * @param store 旧系统的批注存储对象 * @param options 转换选项 * @returns InkLayer Annotation 对象 */ export declare function storeToAnnotation(store: IAnnotationStore): Annotation; export declare const Tabs: __VLS_WithTemplateSlots_5>; export declare const TabsContent: __VLS_WithTemplateSlots_8>; export declare const TabsList: __VLS_WithTemplateSlots_6>; export declare const TabsTrigger: __VLS_WithTemplateSlots_7>; export declare const Textarea: DefineComponent>, { textareaRef: Ref; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { keydown: (e: KeyboardEvent) => void; "update:modelValue": (value: string) => void; }, string, PublicProps, Readonly>> & Readonly<{ onKeydown?: ((e: KeyboardEvent) => any) | undefined; "onUpdate:modelValue"?: ((value: string) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; /** 文本标记(Text Markup) * * PDF 原生类型:Highlight, Underline, Squiggly, StrikeOut */ export declare interface TextMarkupPayload { kind: 'text-markup'; /** 文本标记变体 */ variant: 'highlight' | 'underline' | 'squiggly' | 'strikeout'; /** User-authored annotation text. */ text?: string; /** Source text covered by the markup geometry. */ selectedText?: string; /** 语义颜色(可选,用于显示优先级) * * 注意:这是语义提示,不是最终渲染颜色 * 实际渲染由 AnnotationAppearance 决定 */ color?: string; /** 透明度(0-1) */ opacity?: number; } export declare const Tooltip: __VLS_WithTemplateSlots_9>; export declare const useAnnotationStore: StoreDefinition<"annotation", Pick<{ annotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; originalAnnotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; selectedAnnotation: Ref< { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null, SelectionInfo | { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null>; selectionRevision: Ref; currentAnnotationType: Ref< { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null, IAnnotationType | { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null>; dataTransfer: Ref; _painter: ShallowRef; permissionRevision: Ref; annotationList: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; }[]>; selectedAnnotationStore: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null>; painter: ComputedRef; getAnnotation: (id: string) => IAnnotationStore | undefined; getByPage: (pageNumber: number) => IAnnotationStore[]; addAnnotation: (annotation: IAnnotationStore, isOriginal?: boolean) => IAnnotationStore; restoreAnnotation: (annotation: IAnnotationStore, index: number) => boolean; updateAnnotation: (id: string, updates: Partial) => IAnnotationStore | null; setAnnotationReferenceNumbers: (referenceNumbers: ReadonlyMap) => void; removeAnnotation: (id: string) => void; clearAnnotations: () => void; setSelectedAnnotation: (annotation: IAnnotationStore | null, source?: SelectionSource) => void; setCurrentAnnotationType: (annotationType: IAnnotationType | null) => void; setDataTransfer: (value: string | null) => void; clearSelectedAnnotation: () => void; setPainter: (p: Painter | null) => void; notifyPainterChanged: () => void; getPainter: () => Painter | null; }, "annotations" | "originalAnnotations" | "selectedAnnotation" | "selectionRevision" | "currentAnnotationType" | "dataTransfer" | "_painter" | "permissionRevision">, Pick<{ annotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; originalAnnotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; selectedAnnotation: Ref< { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null, SelectionInfo | { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null>; selectionRevision: Ref; currentAnnotationType: Ref< { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null, IAnnotationType | { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null>; dataTransfer: Ref; _painter: ShallowRef; permissionRevision: Ref; annotationList: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; }[]>; selectedAnnotationStore: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null>; painter: ComputedRef; getAnnotation: (id: string) => IAnnotationStore | undefined; getByPage: (pageNumber: number) => IAnnotationStore[]; addAnnotation: (annotation: IAnnotationStore, isOriginal?: boolean) => IAnnotationStore; restoreAnnotation: (annotation: IAnnotationStore, index: number) => boolean; updateAnnotation: (id: string, updates: Partial) => IAnnotationStore | null; setAnnotationReferenceNumbers: (referenceNumbers: ReadonlyMap) => void; removeAnnotation: (id: string) => void; clearAnnotations: () => void; setSelectedAnnotation: (annotation: IAnnotationStore | null, source?: SelectionSource) => void; setCurrentAnnotationType: (annotationType: IAnnotationType | null) => void; setDataTransfer: (value: string | null) => void; clearSelectedAnnotation: () => void; setPainter: (p: Painter | null) => void; notifyPainterChanged: () => void; getPainter: () => Painter | null; }, "annotationList" | "selectedAnnotationStore" | "painter">, Pick<{ annotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; originalAnnotations: Ref & Omit, keyof Map>, Map | (Map & Omit, keyof Map>)>; selectedAnnotation: Ref< { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null, SelectionInfo | { store: { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null; source: SelectionSource | null; } | null>; selectionRevision: Ref; currentAnnotationType: Ref< { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null, IAnnotationType | { name: string; type: AnnotationType; pdfjsAnnotationType: PdfjsAnnotationType; subtype: PdfjsAnnotationSubtype; webSelectionDependencies: boolean; isOnce: boolean; resizable: boolean; draggable: boolean; icon: AnnotationIconName; style?: { color?: string | undefined; fontSize?: number | undefined; opacity?: number | undefined; strokeWidth?: number | undefined; } | undefined; styleEditable?: { color: boolean; strokeWidth: boolean; opacity: boolean; } | undefined; } | null>; dataTransfer: Ref; _painter: ShallowRef; permissionRevision: Ref; annotationList: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; }[]>; selectedAnnotationStore: ComputedRef< { id: string; referenceNumber?: number | undefined; pageNumber: number; konvaString: string; konvaClientRect: { x: number; y: number; width: number; height: number; }; title: string; type: AnnotationType; color?: string | null | undefined; subtype: PdfjsAnnotationSubtype; pdfjsType: PdfjsAnnotationType; date: string | null; contentsObj?: { text: string; selectedText?: string | undefined; image?: string | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; } | null | undefined; comments: { id: string; title: string; date: string | null; content: string; status?: CommentStatus | undefined; user?: { id: string; name: string; avatarUrl?: string | undefined; } | undefined; references?: { type: "annotation"; annotationId: string; label: string; }[] | undefined; }[]; user: { id: string; name: string; avatarUrl?: string | undefined; }; native: boolean; } | null>; painter: ComputedRef; getAnnotation: (id: string) => IAnnotationStore | undefined; getByPage: (pageNumber: number) => IAnnotationStore[]; addAnnotation: (annotation: IAnnotationStore, isOriginal?: boolean) => IAnnotationStore; restoreAnnotation: (annotation: IAnnotationStore, index: number) => boolean; updateAnnotation: (id: string, updates: Partial) => IAnnotationStore | null; setAnnotationReferenceNumbers: (referenceNumbers: ReadonlyMap) => void; removeAnnotation: (id: string) => void; clearAnnotations: () => void; setSelectedAnnotation: (annotation: IAnnotationStore | null, source?: SelectionSource) => void; setCurrentAnnotationType: (annotationType: IAnnotationType | null) => void; setDataTransfer: (value: string | null) => void; clearSelectedAnnotation: () => void; setPainter: (p: Painter | null) => void; notifyPainterChanged: () => void; getPainter: () => Painter | null; }, "getAnnotation" | "getByPage" | "addAnnotation" | "restoreAnnotation" | "updateAnnotation" | "setAnnotationReferenceNumbers" | "removeAnnotation" | "clearAnnotations" | "setSelectedAnnotation" | "setCurrentAnnotationType" | "setDataTransfer" | "clearSelectedAnnotation" | "setPainter" | "notifyPainterChanged" | "getPainter">>; export declare function usePdfSearch(pdfViewer: Ref): { query: Ref; results: Ref<{ query: string; countTotal: number; pageMatches: { pageNumber: number; countTotal: number; matches: { matchIndex: number; charIndex: number; snippet: string; }[]; }[]; }[], KeywordResult[] | { query: string; countTotal: number; pageMatches: { pageNumber: number; countTotal: number; matches: { matchIndex: number; charIndex: number; snippet: string; }[]; }[]; }[]>; searching: Ref; searchOptions: Ref<{ caseSensitive?: boolean | undefined; entireWord?: boolean | undefined; matchDiacritics?: boolean | undefined; }, SearchOptions | { caseSensitive?: boolean | undefined; entireWord?: boolean | undefined; matchDiacritics?: boolean | undefined; }>; search: (keyword: string, options?: SearchOptions) => Promise; clearSearch: () => void; jumpToMatch: ({ pageNumber, matchIndex, }: { pageNumber: number; matchIndex: number; }) => Promise; }; export declare function usePdfTool(pdfDocument: Ref): { downloadClean: (filename?: string) => Promise; printClean: () => Promise; }; export declare function usePdfViewer(containerRef: Readonly>, options: UseViewerOptions): { loading: Ref; progress: Ref; pdfDocument: ShallowRef; pdfViewer: ShallowRef; eventBus: ShallowRef; metadata: Ref; loadError: Ref; reload: () => Promise; }; export declare interface User { id: string; name: string; avatarUrl?: string; } export declare const UserContextKey: InjectionKey; declare interface UserContextValue { user: ComputedRef; } export declare function useSystemAppearance(): Ref<"dark" | "light", "dark" | "light">; export declare interface UseViewerOptions { url?: string | URL; data?: string | number[] | ArrayBuffer | Uint8Array | Uint16Array | Uint32Array; enableRange?: boolean | 'auto'; onLoadSuccess?: (pdfDocument: PDFDocumentProxy) => void; onLoadError?: (error: Error) => void; onLoadEnd?: () => void; onViewerInit?: (viewer: PDFViewer) => void; eventBus?: EventBus; textLayerMode?: number; annotationMode?: number; externalLinkTarget?: number; } /** 视口上下文 * * 描述当前渲染环境的瞬时状态。 * 注意:这是"瞬时状态",不可存储,不可持久化。 */ export declare interface ViewportContext { /** PDF 页索引(从 0 开始) */ pageIndex: number; /** PDF 页面尺寸(PDF 用户空间单位) */ pageSize: { width: number; height: number; }; /** 缩放比例(PDF 空间 → Canvas 空间) */ scale: number; /** 页面旋转角度(0, 90, 180, 270) */ rotation: 0 | 90 | 180 | 270; /** 视口偏移(用于滚动) */ offset?: { x: number; y: number; }; } export declare const ZoomTool: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; export { }