@embedpdf/plugin-annotation 1.1.1 → 1.2.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 (107) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1916 -390
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/actions.d.ts +21 -15
  6. package/dist/lib/annotation-plugin.d.ts +30 -7
  7. package/dist/lib/handlers/circle.handler.d.ts +3 -0
  8. package/dist/lib/handlers/click-detector.d.ts +27 -0
  9. package/dist/lib/handlers/free-text.handler.d.ts +3 -0
  10. package/dist/lib/handlers/index.d.ts +8 -0
  11. package/dist/lib/handlers/ink.handler.d.ts +3 -0
  12. package/dist/lib/handlers/line.handler.d.ts +3 -0
  13. package/dist/lib/handlers/polygon.handler.d.ts +3 -0
  14. package/dist/lib/handlers/polyline.handler.d.ts +3 -0
  15. package/dist/lib/handlers/square.handler.d.ts +3 -0
  16. package/dist/lib/handlers/stamp.handler.d.ts +3 -0
  17. package/dist/lib/handlers/types.d.ts +139 -0
  18. package/dist/lib/helpers.d.ts +1 -6
  19. package/dist/lib/index.d.ts +3 -1
  20. package/dist/lib/patching/index.d.ts +1 -1
  21. package/dist/lib/patching/patch-registry.d.ts +27 -0
  22. package/dist/lib/patching/patches/index.d.ts +4 -0
  23. package/dist/lib/patching/patches/ink.patch.d.ts +3 -0
  24. package/dist/lib/patching/patches/line.patch.d.ts +3 -0
  25. package/dist/lib/patching/patches/polygon.patch.d.ts +3 -0
  26. package/dist/lib/patching/patches/polyline.patch.d.ts +3 -0
  27. package/dist/lib/selectors.d.ts +8 -12
  28. package/dist/lib/tools/default-tools.d.ts +450 -0
  29. package/dist/lib/tools/tools-utils.d.ts +25 -0
  30. package/dist/lib/tools/types.d.ts +96 -0
  31. package/dist/lib/types.d.ts +78 -161
  32. package/dist/lib/utils/index.d.ts +1 -0
  33. package/dist/lib/utils/use-state.d.ts +12 -0
  34. package/dist/preact/adapter.d.ts +1 -5
  35. package/dist/preact/index.cjs +1 -1
  36. package/dist/preact/index.cjs.map +1 -1
  37. package/dist/preact/index.js +390 -1795
  38. package/dist/preact/index.js.map +1 -1
  39. package/dist/react/adapter.d.ts +2 -4
  40. package/dist/react/index.cjs +1 -1
  41. package/dist/react/index.cjs.map +1 -1
  42. package/dist/react/index.js +391 -1794
  43. package/dist/react/index.js.map +1 -1
  44. package/dist/shared-preact/components/annotation-container.d.ts +18 -16
  45. package/dist/shared-preact/components/annotation-layer.d.ts +9 -2
  46. package/dist/shared-preact/components/annotation-paint-layer.d.ts +6 -0
  47. package/dist/shared-preact/components/annotations/free-text.d.ts +1 -0
  48. package/dist/shared-preact/components/annotations/polygon.d.ts +4 -1
  49. package/dist/shared-preact/components/annotations.d.ts +4 -1
  50. package/dist/shared-preact/components/preview-renderer.d.ts +7 -0
  51. package/dist/shared-preact/components/text-markup/highlight.d.ts +2 -2
  52. package/dist/shared-preact/components/text-markup/squiggly.d.ts +2 -2
  53. package/dist/shared-preact/components/text-markup/strikeout.d.ts +2 -2
  54. package/dist/shared-preact/components/text-markup/underline.d.ts +2 -2
  55. package/dist/shared-preact/types.d.ts +32 -2
  56. package/dist/shared-react/components/annotation-container.d.ts +18 -16
  57. package/dist/shared-react/components/annotation-layer.d.ts +9 -2
  58. package/dist/shared-react/components/annotation-paint-layer.d.ts +6 -0
  59. package/dist/shared-react/components/annotations/free-text.d.ts +1 -0
  60. package/dist/shared-react/components/annotations/polygon.d.ts +4 -1
  61. package/dist/shared-react/components/annotations.d.ts +4 -1
  62. package/dist/shared-react/components/preview-renderer.d.ts +7 -0
  63. package/dist/shared-react/components/text-markup/highlight.d.ts +2 -2
  64. package/dist/shared-react/components/text-markup/squiggly.d.ts +2 -2
  65. package/dist/shared-react/components/text-markup/strikeout.d.ts +2 -2
  66. package/dist/shared-react/components/text-markup/underline.d.ts +2 -2
  67. package/dist/shared-react/types.d.ts +32 -2
  68. package/dist/vue/hooks/index.d.ts +1 -0
  69. package/dist/vue/hooks/use-annotation.d.ts +3 -0
  70. package/dist/vue/index.cjs +2 -0
  71. package/dist/vue/index.cjs.map +1 -0
  72. package/dist/vue/index.d.ts +2 -0
  73. package/dist/vue/index.js +10 -0
  74. package/dist/vue/index.js.map +1 -0
  75. package/package.json +18 -11
  76. package/dist/lib/patching/derived-rect.d.ts +0 -2
  77. package/dist/lib/variant-key.d.ts +0 -8
  78. package/dist/shared-preact/components/annotations/circle-paint.d.ts +0 -10
  79. package/dist/shared-preact/components/annotations/free-text-paint.d.ts +0 -10
  80. package/dist/shared-preact/components/annotations/ink-highlight-paint.d.ts +0 -0
  81. package/dist/shared-preact/components/annotations/ink-paint.d.ts +0 -18
  82. package/dist/shared-preact/components/annotations/line-paint.d.ts +0 -10
  83. package/dist/shared-preact/components/annotations/polygon-paint.d.ts +0 -9
  84. package/dist/shared-preact/components/annotations/polyline-paint.d.ts +0 -10
  85. package/dist/shared-preact/components/annotations/square-paint.d.ts +0 -10
  86. package/dist/shared-preact/components/annotations/stamp-paint.d.ts +0 -8
  87. package/dist/shared-preact/components/resize-handles.d.ts +0 -9
  88. package/dist/shared-preact/components/vertex-editor.d.ts +0 -19
  89. package/dist/shared-preact/hooks/use-drag-resize.d.ts +0 -38
  90. package/dist/shared-preact/patch-ink.d.ts +0 -16
  91. package/dist/shared-preact/patchers.d.ts +0 -9
  92. package/dist/shared-preact/vertex-patchers.d.ts +0 -10
  93. package/dist/shared-react/components/annotations/circle-paint.d.ts +0 -10
  94. package/dist/shared-react/components/annotations/free-text-paint.d.ts +0 -10
  95. package/dist/shared-react/components/annotations/ink-highlight-paint.d.ts +0 -0
  96. package/dist/shared-react/components/annotations/ink-paint.d.ts +0 -17
  97. package/dist/shared-react/components/annotations/line-paint.d.ts +0 -10
  98. package/dist/shared-react/components/annotations/polygon-paint.d.ts +0 -9
  99. package/dist/shared-react/components/annotations/polyline-paint.d.ts +0 -10
  100. package/dist/shared-react/components/annotations/square-paint.d.ts +0 -10
  101. package/dist/shared-react/components/annotations/stamp-paint.d.ts +0 -8
  102. package/dist/shared-react/components/resize-handles.d.ts +0 -9
  103. package/dist/shared-react/components/vertex-editor.d.ts +0 -19
  104. package/dist/shared-react/hooks/use-drag-resize.d.ts +0 -38
  105. package/dist/shared-react/patch-ink.d.ts +0 -16
  106. package/dist/shared-react/patchers.d.ts +0 -9
  107. package/dist/shared-react/vertex-patchers.d.ts +0 -10
@@ -1,10 +0,0 @@
1
- interface LinePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const LinePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor }: LinePaintProps) => import("preact").JSX.Element | null;
10
- export {};
@@ -1,9 +0,0 @@
1
- interface PolygonPaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- cursor?: string;
7
- }
8
- export declare const PolygonPaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: PolygonPaintProps) => import("preact").JSX.Element | null;
9
- export {};
@@ -1,10 +0,0 @@
1
- interface PolylinePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const PolylinePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: PolylinePaintProps) => import("preact").JSX.Element | null;
10
- export {};
@@ -1,10 +0,0 @@
1
- interface SquarePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const SquarePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: SquarePaintProps) => import("preact").JSX.Element | null;
10
- export {};
@@ -1,8 +0,0 @@
1
- interface StampPaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- }
7
- export declare const StampPaint: ({ pageIndex, scale, pageWidth, pageHeight }: StampPaintProps) => import("preact").JSX.Element | null;
8
- export {};
@@ -1,9 +0,0 @@
1
- import { ResizeDirection } from '../types';
2
- import { PointerEvent } from '../../preact/adapter.ts';
3
- interface Props {
4
- rotation: number;
5
- outlineOffset?: number;
6
- startResize: (d: ResizeDirection) => (e: PointerEvent<HTMLDivElement>) => void;
7
- }
8
- export declare function ResizeHandles({ rotation, outlineOffset, startResize }: Props): import("preact").JSX.Element;
9
- export {};
@@ -1,19 +0,0 @@
1
- import { JSX } from '../../preact/adapter.ts';
2
- import { Position, Rect } from '@embedpdf/models';
3
- export interface VertexEditorProps {
4
- /** Bounding box (PDF units) of the annotation */
5
- rect: Rect;
6
- /** Page rotation (0-3) */
7
- rotation: number;
8
- /** Current zoom factor */
9
- scale: number;
10
- /** Array of vertices in PDF units */
11
- vertices: Position[];
12
- /** Called *every* drag frame with new vertices */
13
- onEdit: (v: Position[]) => void;
14
- /** Called once at end of drag to commit changes */
15
- onCommit: (v: Position[]) => void;
16
- /** Size of handle in CSS px */
17
- handleSize?: number;
18
- }
19
- export declare function VertexEditor({ rect, rotation, scale, vertices, onEdit, onCommit, handleSize, }: VertexEditorProps): JSX.Element;
@@ -1,38 +0,0 @@
1
- import { PointerEvent, TouchEvent } from '../../preact/adapter.ts';
2
- import { PdfAnnotationObject, Position, Rect } from '@embedpdf/models';
3
- import { TrackedAnnotation } from '../../lib/index.ts';
4
- import { ResizeDirection } from '../types';
5
- import { ComputePatch } from '../patchers';
6
- interface UseDragResizeOpts<T extends PdfAnnotationObject> {
7
- scale: number;
8
- pageWidth: number;
9
- pageHeight: number;
10
- rotation: number;
11
- tracked: TrackedAnnotation<T>;
12
- isSelected: boolean;
13
- isDraggable: boolean;
14
- isResizable: boolean;
15
- computePatch?: ComputePatch<T>;
16
- computeVertices?: (a: T) => Position[];
17
- lockAspectRatio?: boolean;
18
- currentRect: Rect;
19
- setCurrentRect: (r: Rect) => void;
20
- setCurrentVertices: (v: Position[]) => void;
21
- setPreviewObject: (p: Partial<T> | null) => void;
22
- commit: (patch: Partial<T>) => void;
23
- }
24
- export declare function useDragResize<T extends PdfAnnotationObject>({ scale, pageWidth, pageHeight, rotation, tracked, isSelected, isDraggable, isResizable, computePatch, computeVertices, lockAspectRatio, currentRect, setCurrentRect, setCurrentVertices, setPreviewObject, commit, }: UseDragResizeOpts<T>): {
25
- rootHandlers: {
26
- onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
27
- onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
28
- onPointerUp: (e?: PointerEvent<HTMLDivElement>) => void;
29
- onPointerCancel: () => void;
30
- onLostPointerCapture: () => void;
31
- onTouchStart: (e: TouchEvent<HTMLDivElement>) => void;
32
- onTouchMove: (e: TouchEvent<HTMLDivElement>) => void;
33
- onTouchEnd: () => void;
34
- onTouchCancel: () => void;
35
- };
36
- startResize: (direction: ResizeDirection) => (e: PointerEvent<HTMLDivElement>) => void;
37
- };
38
- export {};
@@ -1,16 +0,0 @@
1
- import { PdfInkAnnoObject } from '@embedpdf/models';
2
- import { ComputePatch } from './patchers';
3
- /**
4
- * Computes a patch for resizing an ink annotation.
5
- * - Scales all points in inkList to fit the new rect.
6
- * - Scales strokeWidth proportionally (using average scale factor).
7
- * - Handles non-uniform scaling (stretch).
8
- * - Optionally preserves aspect ratio (set uniform=true).
9
- *
10
- * @param original The original ink annotation object.
11
- * @param newRect The new bounding rect after resize.
12
- * @param direction The resize handle direction (affects origin adjustments if needed).
13
- * @param uniform If true, constrains to uniform scaling (uses min scale factor).
14
- * @returns Partial patch { rect, inkList, strokeWidth } to apply.
15
- */
16
- export declare const patchInk: ComputePatch<PdfInkAnnoObject>;
@@ -1,9 +0,0 @@
1
- import { PdfAnnotationObject, Rect, Position } from '@embedpdf/models';
2
- import { ResizeDirection } from './types';
3
- export interface PatchContext {
4
- rect: Rect;
5
- vertices?: Position[];
6
- direction?: ResizeDirection;
7
- uniform?: boolean;
8
- }
9
- export type ComputePatch<T extends PdfAnnotationObject> = (original: T, ctx: PatchContext) => Partial<T>;
@@ -1,10 +0,0 @@
1
- import { PdfAnnotationSubtype, PdfAnnotationObject, PdfLineAnnoObject, PdfPolylineAnnoObject, PdfPolygonAnnoObject, Rect, Position } from '@embedpdf/models';
2
- export interface PatchContext {
3
- rect: Rect;
4
- vertices?: Position[];
5
- }
6
- export type PatchFn<T extends PdfAnnotationObject> = (original: T, ctx: PatchContext) => Partial<T>;
7
- export declare const patchLine: PatchFn<PdfLineAnnoObject>;
8
- export declare const patchPolyline: PatchFn<PdfPolylineAnnoObject>;
9
- export declare const patchPolygon: PatchFn<PdfPolygonAnnoObject>;
10
- export declare function getPatchFn(type: PdfAnnotationSubtype): PatchFn<PdfLineAnnoObject> | PatchFn<PdfPolylineAnnoObject> | PatchFn<PdfPolygonAnnoObject> | undefined;
@@ -1,10 +0,0 @@
1
- interface CirclePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const CirclePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: CirclePaintProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,10 +0,0 @@
1
- interface FreeTextPaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const FreeTextPaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: FreeTextPaintProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,17 +0,0 @@
1
- interface InkPaintProps {
2
- /** Index of the page this layer lives on */
3
- pageIndex: number;
4
- /** Scale of the page */
5
- scale: number;
6
- /** Width of the page */
7
- pageWidth: number;
8
- /** Height of the page */
9
- pageHeight: number;
10
- }
11
- /**
12
- * Allows the user to draw freehand ink annotations.
13
- * Hook it into the interaction-manager with modeId = 'inkPaint'.
14
- * Supports multi-stroke annotations: if the user starts a new stroke within 3 seconds of releasing the previous one, it adds to the same annotation.
15
- */
16
- export declare const InkPaint: ({ pageIndex, scale, pageWidth, pageHeight }: InkPaintProps) => import("react/jsx-runtime").JSX.Element | null;
17
- export {};
@@ -1,10 +0,0 @@
1
- interface LinePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const LinePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor }: LinePaintProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,9 +0,0 @@
1
- interface PolygonPaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- cursor?: string;
7
- }
8
- export declare const PolygonPaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: PolygonPaintProps) => import("react/jsx-runtime").JSX.Element | null;
9
- export {};
@@ -1,10 +0,0 @@
1
- interface PolylinePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const PolylinePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: PolylinePaintProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,10 +0,0 @@
1
- interface SquarePaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- /** Optional preview cursor */
7
- cursor?: string;
8
- }
9
- export declare const SquarePaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: SquarePaintProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,8 +0,0 @@
1
- interface StampPaintProps {
2
- pageIndex: number;
3
- scale: number;
4
- pageWidth: number;
5
- pageHeight: number;
6
- }
7
- export declare const StampPaint: ({ pageIndex, scale, pageWidth, pageHeight }: StampPaintProps) => import("react/jsx-runtime").JSX.Element | null;
8
- export {};
@@ -1,9 +0,0 @@
1
- import { ResizeDirection } from '../types';
2
- import { PointerEvent } from '../../react/adapter.ts';
3
- interface Props {
4
- rotation: number;
5
- outlineOffset?: number;
6
- startResize: (d: ResizeDirection) => (e: PointerEvent<HTMLDivElement>) => void;
7
- }
8
- export declare function ResizeHandles({ rotation, outlineOffset, startResize }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,19 +0,0 @@
1
- import { JSX } from '../../react/adapter.ts';
2
- import { Position, Rect } from '@embedpdf/models';
3
- export interface VertexEditorProps {
4
- /** Bounding box (PDF units) of the annotation */
5
- rect: Rect;
6
- /** Page rotation (0-3) */
7
- rotation: number;
8
- /** Current zoom factor */
9
- scale: number;
10
- /** Array of vertices in PDF units */
11
- vertices: Position[];
12
- /** Called *every* drag frame with new vertices */
13
- onEdit: (v: Position[]) => void;
14
- /** Called once at end of drag to commit changes */
15
- onCommit: (v: Position[]) => void;
16
- /** Size of handle in CSS px */
17
- handleSize?: number;
18
- }
19
- export declare function VertexEditor({ rect, rotation, scale, vertices, onEdit, onCommit, handleSize, }: VertexEditorProps): JSX.Element;
@@ -1,38 +0,0 @@
1
- import { PointerEvent, TouchEvent } from '../../react/adapter.ts';
2
- import { PdfAnnotationObject, Position, Rect } from '@embedpdf/models';
3
- import { TrackedAnnotation } from '../../lib/index.ts';
4
- import { ResizeDirection } from '../types';
5
- import { ComputePatch } from '../patchers';
6
- interface UseDragResizeOpts<T extends PdfAnnotationObject> {
7
- scale: number;
8
- pageWidth: number;
9
- pageHeight: number;
10
- rotation: number;
11
- tracked: TrackedAnnotation<T>;
12
- isSelected: boolean;
13
- isDraggable: boolean;
14
- isResizable: boolean;
15
- computePatch?: ComputePatch<T>;
16
- computeVertices?: (a: T) => Position[];
17
- lockAspectRatio?: boolean;
18
- currentRect: Rect;
19
- setCurrentRect: (r: Rect) => void;
20
- setCurrentVertices: (v: Position[]) => void;
21
- setPreviewObject: (p: Partial<T> | null) => void;
22
- commit: (patch: Partial<T>) => void;
23
- }
24
- export declare function useDragResize<T extends PdfAnnotationObject>({ scale, pageWidth, pageHeight, rotation, tracked, isSelected, isDraggable, isResizable, computePatch, computeVertices, lockAspectRatio, currentRect, setCurrentRect, setCurrentVertices, setPreviewObject, commit, }: UseDragResizeOpts<T>): {
25
- rootHandlers: {
26
- onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
27
- onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
28
- onPointerUp: (e?: PointerEvent<HTMLDivElement>) => void;
29
- onPointerCancel: () => void;
30
- onLostPointerCapture: () => void;
31
- onTouchStart: (e: TouchEvent<HTMLDivElement>) => void;
32
- onTouchMove: (e: TouchEvent<HTMLDivElement>) => void;
33
- onTouchEnd: () => void;
34
- onTouchCancel: () => void;
35
- };
36
- startResize: (direction: ResizeDirection) => (e: PointerEvent<HTMLDivElement>) => void;
37
- };
38
- export {};
@@ -1,16 +0,0 @@
1
- import { PdfInkAnnoObject } from '@embedpdf/models';
2
- import { ComputePatch } from './patchers';
3
- /**
4
- * Computes a patch for resizing an ink annotation.
5
- * - Scales all points in inkList to fit the new rect.
6
- * - Scales strokeWidth proportionally (using average scale factor).
7
- * - Handles non-uniform scaling (stretch).
8
- * - Optionally preserves aspect ratio (set uniform=true).
9
- *
10
- * @param original The original ink annotation object.
11
- * @param newRect The new bounding rect after resize.
12
- * @param direction The resize handle direction (affects origin adjustments if needed).
13
- * @param uniform If true, constrains to uniform scaling (uses min scale factor).
14
- * @returns Partial patch { rect, inkList, strokeWidth } to apply.
15
- */
16
- export declare const patchInk: ComputePatch<PdfInkAnnoObject>;
@@ -1,9 +0,0 @@
1
- import { PdfAnnotationObject, Rect, Position } from '@embedpdf/models';
2
- import { ResizeDirection } from './types';
3
- export interface PatchContext {
4
- rect: Rect;
5
- vertices?: Position[];
6
- direction?: ResizeDirection;
7
- uniform?: boolean;
8
- }
9
- export type ComputePatch<T extends PdfAnnotationObject> = (original: T, ctx: PatchContext) => Partial<T>;
@@ -1,10 +0,0 @@
1
- import { PdfAnnotationSubtype, PdfAnnotationObject, PdfLineAnnoObject, PdfPolylineAnnoObject, PdfPolygonAnnoObject, Rect, Position } from '@embedpdf/models';
2
- export interface PatchContext {
3
- rect: Rect;
4
- vertices?: Position[];
5
- }
6
- export type PatchFn<T extends PdfAnnotationObject> = (original: T, ctx: PatchContext) => Partial<T>;
7
- export declare const patchLine: PatchFn<PdfLineAnnoObject>;
8
- export declare const patchPolyline: PatchFn<PdfPolylineAnnoObject>;
9
- export declare const patchPolygon: PatchFn<PdfPolygonAnnoObject>;
10
- export declare function getPatchFn(type: PdfAnnotationSubtype): PatchFn<PdfLineAnnoObject> | PatchFn<PdfPolylineAnnoObject> | PatchFn<PdfPolygonAnnoObject> | undefined;