@xtctwins/tctwins-pdf-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +0 -0
  2. package/dist/PdfViewer.d.ts +81 -0
  3. package/dist/PdfViewer.d.ts.map +1 -0
  4. package/dist/annotations/index.d.ts +3 -0
  5. package/dist/annotations/index.d.ts.map +1 -0
  6. package/dist/annotations/types.d.ts +3 -0
  7. package/dist/annotations/types.d.ts.map +1 -0
  8. package/dist/annotations/utils.d.ts +11 -0
  9. package/dist/annotations/utils.d.ts.map +1 -0
  10. package/dist/components/PdfViewer.d.ts +65 -0
  11. package/dist/components/PdfViewer.d.ts.map +1 -0
  12. package/dist/components/PdfViewer.vue.d.ts +44 -0
  13. package/dist/components/PdfViewer.vue.d.ts.map +1 -0
  14. package/dist/components/interaction.d.ts +15 -0
  15. package/dist/components/interaction.d.ts.map +1 -0
  16. package/dist/components/types.d.ts +3 -0
  17. package/dist/components/types.d.ts.map +1 -0
  18. package/dist/components/useAnnotationCanvas.d.ts +49 -0
  19. package/dist/components/useAnnotationCanvas.d.ts.map +1 -0
  20. package/dist/components/usePointerInteraction.d.ts +51 -0
  21. package/dist/components/usePointerInteraction.d.ts.map +1 -0
  22. package/dist/components/useViewerLayout.d.ts +46 -0
  23. package/dist/components/useViewerLayout.d.ts.map +1 -0
  24. package/dist/components/useViewerManager.d.ts +46 -0
  25. package/dist/components/useViewerManager.d.ts.map +1 -0
  26. package/dist/core/PDFLoader.d.ts +15 -0
  27. package/dist/core/PDFLoader.d.ts.map +1 -0
  28. package/dist/core/TileCache.d.ts +18 -0
  29. package/dist/core/TileCache.d.ts.map +1 -0
  30. package/dist/core/TileRenderer.d.ts +29 -0
  31. package/dist/core/TileRenderer.d.ts.map +1 -0
  32. package/dist/core/coords/CoordTransformer.d.ts +19 -0
  33. package/dist/core/coords/CoordTransformer.d.ts.map +1 -0
  34. package/dist/core/coords/Types.d.ts +3 -0
  35. package/dist/core/coords/Types.d.ts.map +1 -0
  36. package/dist/index.d.ts +16 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/pdf-core.js +1308 -0
  39. package/dist/style.css +2 -0
  40. package/dist/tools/MeasureTool.d.ts +59 -0
  41. package/dist/tools/MeasureTool.d.ts.map +1 -0
  42. package/dist/tools/ToolManager.d.ts +42 -0
  43. package/dist/tools/ToolManager.d.ts.map +1 -0
  44. package/dist/tools/index.d.ts +8 -0
  45. package/dist/tools/index.d.ts.map +1 -0
  46. package/dist/tools/measure/AngleMeasure.d.ts +23 -0
  47. package/dist/tools/measure/AngleMeasure.d.ts.map +1 -0
  48. package/dist/tools/measure/AreaMeasure.d.ts +22 -0
  49. package/dist/tools/measure/AreaMeasure.d.ts.map +1 -0
  50. package/dist/tools/measure/DistanceMeasure.d.ts +22 -0
  51. package/dist/tools/measure/DistanceMeasure.d.ts.map +1 -0
  52. package/dist/tools/measure/MeasureBase.d.ts +87 -0
  53. package/dist/tools/measure/MeasureBase.d.ts.map +1 -0
  54. package/dist/tools/measure/index.d.ts +5 -0
  55. package/dist/tools/measure/index.d.ts.map +1 -0
  56. package/dist/tools/types.d.ts +4 -0
  57. package/dist/tools/types.d.ts.map +1 -0
  58. package/dist/types/annotations.d.ts +29 -0
  59. package/dist/types/annotations.d.ts.map +1 -0
  60. package/dist/types/components.d.ts +28 -0
  61. package/dist/types/components.d.ts.map +1 -0
  62. package/dist/types/coords.d.ts +28 -0
  63. package/dist/types/coords.d.ts.map +1 -0
  64. package/dist/types/core.d.ts +44 -0
  65. package/dist/types/core.d.ts.map +1 -0
  66. package/dist/types/index.d.ts +18 -0
  67. package/dist/types/index.d.ts.map +1 -0
  68. package/dist/types/tools.d.ts +113 -0
  69. package/dist/types/tools.d.ts.map +1 -0
  70. package/dist/utils/EventTrigger.d.ts +45 -0
  71. package/dist/utils/EventTrigger.d.ts.map +1 -0
  72. package/dist/vue/index.d.ts +2 -0
  73. package/dist/vue/index.d.ts.map +1 -0
  74. package/dist/vue/plugin.d.ts +5 -0
  75. package/dist/vue/plugin.d.ts.map +1 -0
  76. package/dist/vue/useAnnotations.d.ts +12 -0
  77. package/dist/vue/useAnnotations.d.ts.map +1 -0
  78. package/dist/vue/useInteraction.d.ts +13 -0
  79. package/dist/vue/useInteraction.d.ts.map +1 -0
  80. package/dist/vue/useMeasurement.d.ts +10 -0
  81. package/dist/vue/useMeasurement.d.ts.map +1 -0
  82. package/dist/vue/usePdfCore.d.ts +28 -0
  83. package/dist/vue/usePdfCore.d.ts.map +1 -0
  84. package/package.json +61 -0
package/README.md ADDED
File without changes
@@ -0,0 +1,81 @@
1
+ import type { ViewerInteractionController } from "./components/interaction";
2
+ import type { AnnotationItem } from "./types/annotations";
3
+ import type { ToolManager } from "./tools/ToolManager";
4
+ import type { MeasureSubType } from "./types/tools";
5
+ /**
6
+ * 最大 3200%(32x),更高倍率会导致 canvas 尺寸超过浏览器安全上限(~16384px)
7
+ * 通过 IntersectionObserver 懒渲染 + 固定 tileSize=4096,确保单个 tile 始终在安全范围内
8
+ */
9
+ export declare const ZOOM_LEVELS: number[];
10
+ export declare function getNextZoom(current: number, direction: "in" | "out"): number;
11
+ /**
12
+ * 缩放控制器接口(由 PdfViewer.vue 在注册时注入)
13
+ */
14
+ export interface ZoomController {
15
+ setScale(scale: number): Promise<void>;
16
+ getScale(): number;
17
+ getContainerEl(): HTMLElement | null;
18
+ }
19
+ /**
20
+ * PDF 查看器全局管理器
21
+ * 暴露为 window.pdfViewer,与 DxfViewer 保持一致的全局单例模式
22
+ *
23
+ * 使用方式:
24
+ * - PdfViewer.vue 组件挂载时调用 register() 注册交互控制器
25
+ * - 外部通过 window.pdfViewer 调用工具方法
26
+ */
27
+ export declare class PdfViewer {
28
+ private interaction;
29
+ private toolManager;
30
+ private drawCallback;
31
+ private domContainerId;
32
+ private zoomCtrl;
33
+ private initialScale;
34
+ /** 注册交互控制器和绘制回调(旧接口,保持兼容) */
35
+ register(interaction: ViewerInteractionController, drawFn: () => void, zoomCtrl?: ZoomController, containerId?: string): void;
36
+ /** 注册 ToolManager(新接口,参考 DxfViewer 集成模式) */
37
+ registerWithToolManager(toolManager: ToolManager, drawFn: () => void, zoomCtrl?: ZoomController, containerId?: string): void;
38
+ /** 注销(由 PdfViewer 组件在销毁时调用) */
39
+ unregister(): void;
40
+ /** 进入测量模式(默认距离) */
41
+ setMeasureMode(): void;
42
+ /** 设置测量子类型(distance / angle / area) */
43
+ setMeasureSubType(subType: MeasureSubType): void;
44
+ /** 进入矩形标注模式 */
45
+ setRectangleMode(): void;
46
+ /** 取消当前工具 */
47
+ cancelTool(): void;
48
+ /** 获取当前激活模式 */
49
+ getMode(): string;
50
+ /** 放大一档 */
51
+ zoomIn(): void;
52
+ /** 缩小一档 */
53
+ zoomOut(): void;
54
+ /** 设置缩放比例(scale=1.0 即 100%) */
55
+ setScale(scale: number): void;
56
+ /** 获取当前缩放比例 */
57
+ getScale(): number;
58
+ /** 获取当前缩放百分比 */
59
+ getScalePercent(): number;
60
+ /** 复位视图 */
61
+ resetView(): void;
62
+ /** 获取所有标注 */
63
+ getAnnotations(): AnnotationItem[];
64
+ /** 清空所有标注 */
65
+ clearAnnotations(): void;
66
+ /** 删除选中的标注 */
67
+ deleteSelectedAnnotation(): void;
68
+ /** 选中标注 */
69
+ selectAnnotation(id: string | null): void;
70
+ /** 获取当前选中的标注 ID */
71
+ getSelectedAnnotationId(): string | null;
72
+ /** 获取 ToolManager 实例(新接口) */
73
+ getToolManager(): ToolManager | null;
74
+ /** 获取测量工具 */
75
+ getMeasureTool(): import("./tools").MeasureTool | null;
76
+ /** 一键关闭所有工具并清空标注 */
77
+ closeAll(): void;
78
+ /** 获取容器 ID */
79
+ getContainerId(): string | null;
80
+ }
81
+ //# sourceMappingURL=PdfViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../src/PdfViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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Ac,GAAG,IAAI;IAIhD,eAAe;IACf,gBAAgB,IAAI,IAAI;IAKxB,aAAa;IACb,UAAU,IAAI,IAAI;IAUlB,eAAe;IACf,OAAO,IAAI,MAAM;IAMjB,WAAW;IACX,MAAM,IAAI,IAAI;IAQd,WAAW;IACX,OAAO,IAAI,IAAI;IAQf,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,eAAe;IACf,QAAQ,IAAI,MAAM;IAIlB,gBAAgB;IAChB,eAAe,IAAI,MAAM;IAIzB,WAAW;IACX,SAAS,IAAI,IAAI;IAajB,aAAa;IACb,cAAc,IAAI,cAAc,EAAE;IAiBlC,aAAa;IACb,gBAAgB,IAAI,IAAI;IAMxB,cAAc;IACd,wBAAwB,IAAI,IAAI;IAKhC,WAAW;IACX,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKzC,mBAAmB;IACnB,uBAAuB,IAAI,MAAM,GAAG,IAAI;IAMxC,6BAA6B;IAC7B,cAAc,IAAI,WAAW,GAAG,IAAI;IAIpC,aAAa;IACb,cAAc;IAMd,oBAAoB;IACpB,QAAQ,IAAI,IAAI;IAOhB,cAAc;IACd,cAAc,IAAI,MAAM,GAAG,IAAI;CAG/B"}
@@ -0,0 +1,3 @@
1
+ export type { AnnotationKind, PointLike, AnnotationBase, MeasureAnnotation, ShapeAnnotation, AnnotationItem } from "../types/annotations";
2
+ export { createMeasureAnnotation, createShapeAnnotation } from "./utils";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/annotations/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1I,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** @deprecated 请改用 src/types/annotations */
2
+ export type { AnnotationKind, PointLike, AnnotationBase, MeasureAnnotation, ShapeAnnotation, AnnotationItem } from "../types/annotations";
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/annotations/types.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { AnnotationItem, MeasureAnnotation, ShapeAnnotation } from "../types/annotations";
2
+ export declare function createMeasureAnnotation(points: {
3
+ x: number;
4
+ y: number;
5
+ }[], value?: number, unit?: string): MeasureAnnotation;
6
+ export declare function createShapeAnnotation(points: {
7
+ x: number;
8
+ y: number;
9
+ }[], shapeType?: ShapeAnnotation["shapeType"]): ShapeAnnotation;
10
+ export declare function cloneAnnotation(annotation: AnnotationItem): AnnotationItem;
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/annotations/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,KAAK,SAAI,EAAE,IAAI,SAAO,GAAG,iBAAiB,CAWrH;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,SAAS,GAAE,eAAe,CAAC,WAAW,CAAe,GAAG,eAAe,CAUhJ;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,cAAc,CAE1E"}
@@ -0,0 +1,65 @@
1
+ export declare const PdfViewerComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: any;
4
+ default: null;
5
+ };
6
+ scale: {
7
+ type: NumberConstructor;
8
+ default: number;
9
+ };
10
+ width: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ default: string;
13
+ };
14
+ height: {
15
+ type: (NumberConstructor | StringConstructor)[];
16
+ default: string;
17
+ };
18
+ theme: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ toolbar: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
27
+ [key: string]: any;
28
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("loaded" | "error" | "annotation-added")[], "loaded" | "error" | "annotation-added", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ modelValue: {
30
+ type: any;
31
+ default: null;
32
+ };
33
+ scale: {
34
+ type: NumberConstructor;
35
+ default: number;
36
+ };
37
+ width: {
38
+ type: (NumberConstructor | StringConstructor)[];
39
+ default: string;
40
+ };
41
+ height: {
42
+ type: (NumberConstructor | StringConstructor)[];
43
+ default: string;
44
+ };
45
+ theme: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ toolbar: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ }>> & Readonly<{
54
+ onLoaded?: ((...args: any[]) => any) | undefined;
55
+ onError?: ((...args: any[]) => any) | undefined;
56
+ "onAnnotation-added"?: ((...args: any[]) => any) | undefined;
57
+ }>, {
58
+ scale: number;
59
+ theme: string;
60
+ modelValue: any;
61
+ width: string | number;
62
+ height: string | number;
63
+ toolbar: boolean;
64
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
+ //# sourceMappingURL=PdfViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../src/components/PdfViewer.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;cAGS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4BzC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { PdfViewerProps } from '../types/components';
2
+ declare const __VLS_export: import("vue").DefineComponent<PdfViewerProps, {
3
+ load: (source: File | ArrayBuffer) => Promise<void>;
4
+ clear: () => void;
5
+ setMode: (mode: "measure" | "rectangle" | "none") => void;
6
+ clearInteraction: () => void;
7
+ deleteSelectedAnnotation: () => void;
8
+ selectAnnotation: (id: string | null) => void;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
+ loaded: (payload: {
11
+ pageCount: number;
12
+ currentPage: number;
13
+ }) => any;
14
+ error: (payload: {
15
+ message: string;
16
+ }) => any;
17
+ "annotation-added": (payload: {
18
+ id: string;
19
+ kind: "measure" | "shape";
20
+ }) => any;
21
+ }, string, import("vue").PublicProps, Readonly<PdfViewerProps> & Readonly<{
22
+ onLoaded?: ((payload: {
23
+ pageCount: number;
24
+ currentPage: number;
25
+ }) => any) | undefined;
26
+ onError?: ((payload: {
27
+ message: string;
28
+ }) => any) | undefined;
29
+ "onAnnotation-added"?: ((payload: {
30
+ id: string;
31
+ kind: "measure" | "shape";
32
+ }) => any) | undefined;
33
+ }>, {
34
+ scale: number;
35
+ zoomSpeed: number;
36
+ theme: "light" | "dark";
37
+ modelValue: ArrayBuffer | null;
38
+ width: string | number;
39
+ height: string | number;
40
+ toolbar: boolean;
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const _default: typeof __VLS_export;
43
+ export default _default;
44
+ //# sourceMappingURL=PdfViewer.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewer.vue.d.ts","sourceRoot":"","sources":["../../src/components/PdfViewer.vue"],"names":[],"mappings":"AAwQA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AA2Q1E,QAAA,MAAM,YAAY;mBAlJU,IAAI,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAuJ5C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,15 @@
1
+ import type { AnnotationItem, PointLike } from "../types/annotations";
2
+ export interface ViewerInteractionController {
3
+ points: PointLike[];
4
+ annotations: AnnotationItem[];
5
+ mode: "measure" | "rectangle" | "none";
6
+ selectedAnnotationId: string | null;
7
+ setMode(mode: "measure" | "rectangle" | "none"): void;
8
+ addPoint(point: PointLike): AnnotationItem | null;
9
+ selectAnnotation(id: string | null): void;
10
+ deleteAnnotation(id: string): AnnotationItem | null;
11
+ deleteSelectedAnnotation(): AnnotationItem | null;
12
+ clear(): void;
13
+ }
14
+ export declare function createViewerInteractionController(): ViewerInteractionController;
15
+ //# sourceMappingURL=interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/components/interaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,2BAA2B;IAC3C,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACvC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,GAAG,IAAI,CAAC;IAClD,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACpD,wBAAwB,IAAI,cAAc,GAAG,IAAI,CAAC;IAClD,KAAK,IAAI,IAAI,CAAC;CACd;AAED,wBAAgB,iCAAiC,IAAI,2BAA2B,CAyE/E"}
@@ -0,0 +1,3 @@
1
+ /** @deprecated 请改用 src/types/components */
2
+ export type { PdfViewerProps, PdfViewerEmits } from "../types/components";
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { Ref } from "vue";
2
+ import type { ViewerInteractionController } from "./interaction";
3
+ export interface UseAnnotationCanvasOptions {
4
+ /** 标注 canvas 元素引用 */
5
+ annotationCanvas: Ref<HTMLCanvasElement | null>;
6
+ /** wrapper 元素引用(用于同步 canvas 尺寸) */
7
+ rootRef: Ref<HTMLElement | null>;
8
+ /** 交互控制器 */
9
+ interaction: ViewerInteractionController;
10
+ /** 预览点(拖拽过程中跟随鼠标的点) */
11
+ previewPoint: Ref<{
12
+ x: number;
13
+ y: number;
14
+ } | null>;
15
+ }
16
+ /**
17
+ * Canvas 标注渲染 Composable
18
+ * 负责在 overlay canvas 上绘制测量线、矩形标注及其预览
19
+ */
20
+ export declare function useAnnotationCanvas(options: UseAnnotationCanvasOptions): {
21
+ getCanvasPoint: (event: MouseEvent) => {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ getDistanceToSegment: (point: {
26
+ x: number;
27
+ y: number;
28
+ }, start: {
29
+ x: number;
30
+ y: number;
31
+ }, end: {
32
+ x: number;
33
+ y: number;
34
+ }) => number;
35
+ hitTestAnnotation: (point: {
36
+ x: number;
37
+ y: number;
38
+ }, annotation: {
39
+ kind: string;
40
+ points: Array<{
41
+ x: number;
42
+ y: number;
43
+ }>;
44
+ shapeType?: string;
45
+ }) => boolean;
46
+ drawAnnotations: () => void;
47
+ syncCanvasSize: () => void;
48
+ };
49
+ //# sourceMappingURL=useAnnotationCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnnotationCanvas.d.ts","sourceRoot":"","sources":["../../src/components/useAnnotationCanvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,WAAW,0BAA0B;IAC1C,qBAAqB;IACrB,gBAAgB,EAAE,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAChD,mCAAmC;IACnC,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACjC,YAAY;IACZ,WAAW,EAAE,2BAA2B,CAAC;IACzC,uBAAuB;IACvB,YAAY,EAAE,GAAG,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;4BAMvC,UAAU;;;;kCASJ;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,SAAS;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,OAAO;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;+BAc3F;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,cAAc;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;;;EA8IrJ"}
@@ -0,0 +1,51 @@
1
+ import type { Ref } from "vue";
2
+ import type { ViewerInteractionController } from "./interaction";
3
+ import type { PdfViewerEmits } from "../types/components";
4
+ export interface UsePointerInteractionOptions {
5
+ /** 标注 canvas 元素引用 */
6
+ annotationCanvas: Ref<HTMLCanvasElement | null>;
7
+ /** 交互控制器 */
8
+ interaction: ViewerInteractionController;
9
+ /** 预览点 */
10
+ previewPoint: Ref<{
11
+ x: number;
12
+ y: number;
13
+ } | null>;
14
+ /** 矩形拖拽状态 */
15
+ isRectangleDragging: Ref<boolean>;
16
+ /** 获取鼠标在 canvas 上的坐标 */
17
+ getCanvasPoint: (event: MouseEvent) => {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ /** 命中检测 */
22
+ hitTestAnnotation: (point: {
23
+ x: number;
24
+ y: number;
25
+ }, annotation: {
26
+ kind: string;
27
+ points: Array<{
28
+ x: number;
29
+ y: number;
30
+ }>;
31
+ shapeType?: string;
32
+ }) => boolean;
33
+ /** 重绘标注 */
34
+ drawAnnotations: () => void;
35
+ /** 删除选中标注 */
36
+ deleteSelectedAnnotation: () => void;
37
+ /** emit 函数 */
38
+ emit: PdfViewerEmits;
39
+ }
40
+ export interface UsePointerInteractionResult {
41
+ handlePointerDown: (event: PointerEvent) => void;
42
+ handlePointerMove: (event: PointerEvent) => void;
43
+ handlePointerUp: (event: PointerEvent) => void;
44
+ handleKeydown: (event: KeyboardEvent) => void;
45
+ }
46
+ /**
47
+ * 指针交互 & 键盘 Composable
48
+ * 处理鼠标/触控笔的 Pointer 事件和键盘快捷键
49
+ */
50
+ export declare function usePointerInteraction(options: UsePointerInteractionOptions): UsePointerInteractionResult;
51
+ //# sourceMappingURL=usePointerInteraction.d.ts.map
@@ -0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M,WAAW,2BAA2B;IAC3C,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,2BAA2B,CA0GxG"}
@@ -0,0 +1,46 @@
1
+ import { type ComputedRef, type Ref } from "vue";
2
+ export interface ViewerContainerStyle {
3
+ width: string;
4
+ height: string;
5
+ background: string;
6
+ overflow: "auto";
7
+ borderRadius: string;
8
+ border: string;
9
+ position: "relative";
10
+ touchAction: "pan-x pan-y";
11
+ display: "flex";
12
+ }
13
+ export interface UseViewerLayoutOptions {
14
+ /** 外层滚动容器 */
15
+ viewerRef: Ref<HTMLElement | null>;
16
+ /** 内层 wrapper */
17
+ rootRef: Ref<HTMLElement | null>;
18
+ /** PDF 内容层 */
19
+ pdfLayerRef: Ref<HTMLElement | null>;
20
+ /** 当前缩放比例 */
21
+ currentScale: Ref<number>;
22
+ /** 设置缩放 */
23
+ setScale: (scale: number) => Promise<void>;
24
+ /** 缩放速率 */
25
+ zoomSpeed: number;
26
+ /** 主题 */
27
+ theme: "light" | "dark";
28
+ /** 同步 canvas 尺寸 */
29
+ syncCanvasSize: () => void;
30
+ /** 重绘标注 */
31
+ drawAnnotations: () => void;
32
+ }
33
+ export interface UseViewerLayoutResult {
34
+ containerStyle: ComputedRef<ViewerContainerStyle>;
35
+ adjustLayout: (resetScroll?: boolean) => void;
36
+ handleWheel: (event: WheelEvent) => void;
37
+ handleTouchStart: (event: TouchEvent) => void;
38
+ handleTouchMove: (event: TouchEvent) => void;
39
+ handleTouchEnd: () => void;
40
+ }
41
+ /**
42
+ * 缩放与布局 Composable
43
+ * 包括容器样式、wrapper 尺寸调整、鼠标滚轮缩放、触屏双指缩放
44
+ */
45
+ export declare function useViewerLayout(options: UseViewerLayoutOptions): UseViewerLayoutResult;
46
+ //# sourceMappingURL=useViewerLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerLayout.d.ts","sourceRoot":"","sources":["../../src/components/useViewerLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAG3D,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,UAAU,CAAC;IACrB,WAAW,EAAE,aAAa,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,aAAa;IACb,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnC,iBAAiB;IACjB,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACjC,cAAc;IACd,WAAW,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACrC,aAAa;IACb,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,WAAW;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS;IACT,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,mBAAmB;IACnB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW;IACX,eAAe,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACrC,cAAc,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAClD,YAAY,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,gBAAgB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,MAAM,IAAI,CAAC;CAC3B;AAgCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAqMtF"}
@@ -0,0 +1,46 @@
1
+ import { type Ref } from "vue";
2
+ import type { AnnotationItem } from "../types/annotations";
3
+ import type { MeasureSubType } from "../types/tools";
4
+ import { ToolManager } from "../tools";
5
+ export interface UseViewerManagerOptions {
6
+ /** 绘制回调 */
7
+ drawAnnotations: () => void;
8
+ /** 当前缩放 */
9
+ currentScale: Ref<number>;
10
+ /** 设置缩放 */
11
+ setScale: (scale: number) => Promise<void>;
12
+ /** 外层滚动容器 */
13
+ viewerRef: Ref<HTMLElement | null>;
14
+ /** 布局调整 */
15
+ adjustLayout: (resetScroll?: boolean) => void;
16
+ /** 屏幕坐标 → 场景坐标转换(由 PdfViewer.vue 注入) */
17
+ screenToScene: (event: PointerEvent) => {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ }
22
+ export interface UseViewerManagerResult {
23
+ /** ToolManager 实例(替代旧的 ViewerInteractionController) */
24
+ toolManager: ToolManager;
25
+ /** 兼容旧接口:当前激活模式 */
26
+ mode: Ref<string>;
27
+ /** 兼容旧接口:标注列表(从 ToolManager 同步) */
28
+ annotations: Ref<AnnotationItem[]>;
29
+ /** 兼容旧接口:选中标注 ID */
30
+ selectedAnnotationId: Ref<string | null>;
31
+ setMode: (mode: "measure" | "rectangle" | "none") => void;
32
+ setMeasureSubType: (subType: MeasureSubType) => void;
33
+ clearInteraction: () => void;
34
+ deleteSelectedAnnotation: () => void;
35
+ selectAnnotation: (id: string | null) => void;
36
+ /** 注册全局 PdfViewer(挂载时调用) */
37
+ registerManager: () => void;
38
+ /** 注销全局 PdfViewer(卸载时调用) */
39
+ unregisterManager: () => void;
40
+ }
41
+ /**
42
+ * 全局 Viewer 管理器 Composable
43
+ * 基于 ToolManager(参考 dxf-viewer 的 ToolManager 集成模式)
44
+ */
45
+ export declare function useViewerManager(options: UseViewerManagerOptions): UseViewerManagerResult;
46
+ //# sourceMappingURL=useViewerManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerManager.d.ts","sourceRoot":"","sources":["../../src/components/useViewerManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAc,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAY,cAAc,EAAqC,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,WAAW,EAA6B,MAAM,UAAU,CAAC;AAGlE,MAAM,WAAW,uBAAuB;IACvC,WAAW;IACX,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW;IACX,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,aAAa;IACb,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnC,WAAW;IACX,YAAY,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,wCAAwC;IACxC,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAED,MAAM,WAAW,sBAAsB;IACtC,uDAAuD;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB;IACnB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,mCAAmC;IACnC,WAAW,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;IACnC,oBAAoB;IACpB,oBAAoB,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEzC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAE9C,4BAA4B;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,4BAA4B;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CAwHzF"}
@@ -0,0 +1,15 @@
1
+ import type { PDFDocumentProxy } from "pdfjs-dist";
2
+ export interface PDFLoadOptions {
3
+ workerSrc?: string;
4
+ }
5
+ export interface PDFLoadResult {
6
+ arrayBuffer: ArrayBuffer;
7
+ doc: PDFDocumentProxy;
8
+ pageCount: number;
9
+ }
10
+ /** 设置 PDF worker 路径,自动 CDN 兜底 */
11
+ export declare function setPDFWorkerSrc(workerSrc?: string): void;
12
+ /** 使用默认 worker 配置(本地 + CDN 兜底),调用方无需关心 worker 路径 */
13
+ export declare function useDefaultWorker(localPath?: string): void;
14
+ export declare function loadPDF(source: File | ArrayBuffer, options?: PDFLoadOptions): Promise<PDFLoadResult>;
15
+ //# sourceMappingURL=PDFLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PDFLoader.d.ts","sourceRoot":"","sources":["../../src/core/PDFLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,gBAAgB,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,iCAAiC;AACjC,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAIxD;AAED,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,SAAS,GAAE,MAA8B,GAAG,IAAI,CAShF;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,WAAW,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAe9G"}
@@ -0,0 +1,18 @@
1
+ export type TileKey = string;
2
+ export interface CachedTile {
3
+ canvas: HTMLCanvasElement;
4
+ key: TileKey;
5
+ }
6
+ export declare class TileLRUCache {
7
+ private capacity;
8
+ private cache;
9
+ constructor(capacity?: number);
10
+ static quantizeScale(scale: number): number;
11
+ static makeKey(pageNum: number, scale: number, col: number, row: number): TileKey;
12
+ get(key: TileKey): HTMLCanvasElement | null;
13
+ set(key: TileKey, canvas: HTMLCanvasElement): void;
14
+ has(key: TileKey): boolean;
15
+ clear(): void;
16
+ get size(): number;
17
+ }
18
+ //# sourceMappingURL=TileCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TileCache.d.ts","sourceRoot":"","sources":["../../src/core/TileCache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,OAAO,CAAC;CACb;AAED,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAyC;gBAE1C,QAAQ,SAAM;IAI1B,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAKjF,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI;IAQ3C,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAclD,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IAI1B,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACD"}
@@ -0,0 +1,29 @@
1
+ import type { PDFPageProxy } from "pdfjs-dist";
2
+ import { TileLRUCache } from "./TileCache";
3
+ export interface TileRenderOptions {
4
+ scale?: number;
5
+ tileSize?: number;
6
+ cache?: TileLRUCache;
7
+ /** CSS 颜色字符串,作为 PDF 页面渲染背景和 canvas CSS 背景 */
8
+ backgroundColor?: string;
9
+ }
10
+ export interface Tile {
11
+ canvas: HTMLCanvasElement;
12
+ col: number;
13
+ row: number;
14
+ x: number;
15
+ y: number;
16
+ cssWidth: number;
17
+ cssHeight: number;
18
+ }
19
+ export interface TiledPage {
20
+ container: HTMLDivElement;
21
+ pageWidth: number;
22
+ pageHeight: number;
23
+ tiles: Tile[];
24
+ }
25
+ export declare function renderPageTiledVirtual(page: PDFPageProxy, options?: TileRenderOptions): Promise<{
26
+ tiledPage: TiledPage;
27
+ observer: IntersectionObserver;
28
+ }>;
29
+ //# sourceMappingURL=TileRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TileRenderer.d.ts","sourceRoot":"","sources":["../../src/core/TileRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,IAAI;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACzB,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,IAAI,EAAE,CAAC;CACd;AAcD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,oBAAoB,CAAA;CAAE,CAAC,CA0GnK"}
@@ -0,0 +1,19 @@
1
+ import type { ScreenPoint, PagePoint, PdfLibPoint, PageSizePt, ViewportLike } from "../../types/coords";
2
+ export declare class CoordTransformer {
3
+ private readonly viewport;
4
+ private readonly scale;
5
+ private readonly pageSizePt;
6
+ constructor(viewport: ViewportLike, scale: number, pageSizePt: PageSizePt);
7
+ pageToScreen(point: PagePoint): ScreenPoint;
8
+ pageToScreen(x: number, y: number): ScreenPoint;
9
+ screenToPage(point: ScreenPoint): PagePoint;
10
+ screenToPage(sx: number, sy: number): PagePoint;
11
+ pagePointToPdfLib(point: PagePoint): PdfLibPoint;
12
+ pdfLibToPagePoint(point: PdfLibPoint): PagePoint;
13
+ screenToPdfLib(point: ScreenPoint): PdfLibPoint;
14
+ screenToPdfLib(sx: number, sy: number): PdfLibPoint;
15
+ pdfLibToScreen(point: PdfLibPoint): ScreenPoint;
16
+ get currentScale(): number;
17
+ get pageSize(): PageSizePt;
18
+ }
19
+ //# sourceMappingURL=CoordTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoordTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/coords/CoordTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAExG,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,UAAU;IAOxC,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW;IAC3C,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;IAO/C,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS;IAC3C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS;IAO/C,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW;IAIhD,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS;IAIhD,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAC/C,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW;IAMnD,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;IAI/C,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,QAAQ,IAAI,UAAU,CAEzB;CACD"}
@@ -0,0 +1,3 @@
1
+ /** @deprecated 请改用 src/types/coords */
2
+ export type { ScreenPoint, PagePoint, PdfLibPoint, PageSizePt, ViewportLike } from "../../types/coords";
3
+ //# sourceMappingURL=Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/core/coords/Types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export { loadPDF, setPDFWorkerSrc, useDefaultWorker, type PDFLoadResult, type PDFLoadOptions } from "./core/PDFLoader";
2
+ export { TileLRUCache, type TileKey, type CachedTile } from "./core/TileCache";
3
+ export { renderPageTiledVirtual, type TileRenderOptions, type Tile, type TiledPage } from "./core/TileRenderer";
4
+ export { CoordTransformer } from "./core/coords/CoordTransformer";
5
+ export type { ScreenPoint, PagePoint, PdfLibPoint, PageSizePt, ViewportLike } from "./types/coords";
6
+ export { ZOOM_LEVELS, getNextZoom } from "./PdfViewer";
7
+ export * from "./annotations";
8
+ export { usePdfCore, type UsePdfCoreOptions, type UsePdfCoreResult } from "./vue/usePdfCore";
9
+ export type { PdfCoreEventMap, PdfLoadedEvent, PdfRenderCompleteEvent, PdfScaleChangedEvent, PdfErrorEvent, PdfPageChangedEvent } from "./types/core";
10
+ export { useAnnotations, type UseAnnotationsResult } from "./vue/useAnnotations";
11
+ export { useMeasurement, type UseMeasurementResult } from "./vue/useMeasurement";
12
+ export { useInteraction, type UseInteractionResult } from "./vue/useInteraction";
13
+ export { installPdfCore, PdfViewer } from "./vue/plugin";
14
+ export { PdfViewer as PdfViewerCore, type ZoomController } from "./PdfViewer";
15
+ export { ToolManager, MeasureTool, MeasureBase, DistanceMeasure, AngleMeasure, AreaMeasure, EventTrigger, DEFAULT_TOOL_STATE, type ToolManagerOptions, type MeasureToolOptions, type MeasureBaseOptions, type MeasureCoordProvider, type ToolMode, type MeasureSubType, type ToolState, type Point2D, type MeasureResult, type UnitType, type PrecisionType, type ScaleCalibration, type MeasureStartEvent, type MeasureCreatedEvent, type MeasureCancelEvent, type ToolActiveEvent, type ToolModeChangedEvent, type ToolEventMap, type ITool } from "./tools";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,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