@embedpdf/plugin-annotation 2.15.0 → 3.0.0-next.1
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.
- package/LICENSE +192 -21
- package/dist/capability-fghl0JmE.js +2680 -0
- package/dist/capability-fghl0JmE.js.map +1 -0
- package/dist/capability-hb2AU0f6.cjs +2739 -0
- package/dist/capability-hb2AU0f6.cjs.map +1 -0
- package/dist/index.cjs +593 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -0
- package/dist/index.d.ts +65 -1
- package/dist/index.js +562 -6998
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +5 -0
- package/dist/internal.d.cts +13 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +2 -0
- package/dist/types-BhWgqgbX.d.cts +879 -0
- package/dist/types-Da6JRmhw.d.ts +879 -0
- package/package.json +26 -66
- package/dist/lib/actions.d.ts +0 -192
- package/dist/lib/annotation-plugin.d.ts +0 -310
- package/dist/lib/geometry/cloudy-border.d.ts +0 -90
- package/dist/lib/geometry/index.d.ts +0 -2
- package/dist/lib/geometry/rotation.d.ts +0 -32
- package/dist/lib/handlers/callout-free-text.handler.d.ts +0 -3
- package/dist/lib/handlers/circle.handler.d.ts +0 -3
- package/dist/lib/handlers/click-detector.d.ts +0 -27
- package/dist/lib/handlers/free-text.handler.d.ts +0 -3
- package/dist/lib/handlers/index.d.ts +0 -14
- package/dist/lib/handlers/ink.handler.d.ts +0 -3
- package/dist/lib/handlers/insert-text.handler.d.ts +0 -8
- package/dist/lib/handlers/line.handler.d.ts +0 -3
- package/dist/lib/handlers/link.handler.d.ts +0 -3
- package/dist/lib/handlers/polygon.handler.d.ts +0 -3
- package/dist/lib/handlers/polyline.handler.d.ts +0 -3
- package/dist/lib/handlers/replace-text.handler.d.ts +0 -9
- package/dist/lib/handlers/selection-utils.d.ts +0 -7
- package/dist/lib/handlers/square.handler.d.ts +0 -3
- package/dist/lib/handlers/stamp.handler.d.ts +0 -3
- package/dist/lib/handlers/text-markup.handler.d.ts +0 -7
- package/dist/lib/handlers/text.handler.d.ts +0 -3
- package/dist/lib/handlers/types.d.ts +0 -176
- package/dist/lib/helpers.d.ts +0 -46
- package/dist/lib/index.d.ts +0 -21
- package/dist/lib/manifest.d.ts +0 -4
- package/dist/lib/patching/base-patch.d.ts +0 -87
- package/dist/lib/patching/index.d.ts +0 -6
- package/dist/lib/patching/insert-upright.d.ts +0 -20
- package/dist/lib/patching/line-ending-handlers.d.ts +0 -20
- package/dist/lib/patching/line-endings.d.ts +0 -13
- package/dist/lib/patching/patch-registry.d.ts +0 -40
- package/dist/lib/patching/patch-utils.d.ts +0 -97
- package/dist/lib/patching/patches/callout-freetext.patch.d.ts +0 -3
- package/dist/lib/patching/patches/circle.patch.d.ts +0 -3
- package/dist/lib/patching/patches/freetext.patch.d.ts +0 -3
- package/dist/lib/patching/patches/index.d.ts +0 -9
- package/dist/lib/patching/patches/ink.patch.d.ts +0 -3
- package/dist/lib/patching/patches/line.patch.d.ts +0 -3
- package/dist/lib/patching/patches/polygon.patch.d.ts +0 -3
- package/dist/lib/patching/patches/polyline.patch.d.ts +0 -3
- package/dist/lib/patching/patches/square.patch.d.ts +0 -3
- package/dist/lib/patching/patches/stamp.patch.d.ts +0 -3
- package/dist/lib/reducer.d.ts +0 -6
- package/dist/lib/selectors.d.ts +0 -139
- package/dist/lib/tools/default-tools.d.ts +0 -521
- package/dist/lib/tools/tools-utils.d.ts +0 -453
- package/dist/lib/tools/types.d.ts +0 -209
- package/dist/lib/types.d.ts +0 -671
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/use-state.d.ts +0 -12
- package/dist/preact/adapter.d.ts +0 -14
- package/dist/preact/core.d.ts +0 -1
- package/dist/preact/index.cjs +0 -2
- package/dist/preact/index.cjs.map +0 -1
- package/dist/preact/index.d.ts +0 -1
- package/dist/preact/index.js +0 -4013
- package/dist/preact/index.js.map +0 -1
- package/dist/preact/interaction-manager.d.ts +0 -1
- package/dist/preact/selection.d.ts +0 -1
- package/dist/preact/utils.d.ts +0 -1
- package/dist/react/adapter.d.ts +0 -6
- package/dist/react/core.d.ts +0 -1
- package/dist/react/index.cjs +0 -2
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -4014
- package/dist/react/index.js.map +0 -1
- package/dist/react/interaction-manager.d.ts +0 -1
- package/dist/react/selection.d.ts +0 -1
- package/dist/react/utils.d.ts +0 -1
- package/dist/shared/annotation-bounds.d.ts +0 -14
- package/dist/shared/components/annotation-container.d.ts +0 -71
- package/dist/shared/components/annotation-layer.d.ts +0 -33
- package/dist/shared/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared/components/annotations/caret.d.ts +0 -24
- package/dist/shared/components/annotations/circle.d.ts +0 -35
- package/dist/shared/components/annotations/free-text.d.ts +0 -17
- package/dist/shared/components/annotations/ink.d.ts +0 -27
- package/dist/shared/components/annotations/line.d.ts +0 -35
- package/dist/shared/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared/components/annotations/link.d.ts +0 -28
- package/dist/shared/components/annotations/polygon.d.ts +0 -23
- package/dist/shared/components/annotations/polyline.d.ts +0 -23
- package/dist/shared/components/annotations/square.d.ts +0 -35
- package/dist/shared/components/annotations/stamp.d.ts +0 -13
- package/dist/shared/components/annotations/text.d.ts +0 -14
- package/dist/shared/components/annotations.d.ts +0 -22
- package/dist/shared/components/appearance-image.d.ts +0 -12
- package/dist/shared/components/built-in-renderers.d.ts +0 -2
- package/dist/shared/components/group-selection-box.d.ts +0 -40
- package/dist/shared/components/index.d.ts +0 -2
- package/dist/shared/components/preview-renderer.d.ts +0 -8
- package/dist/shared/components/render-annotation.d.ts +0 -13
- package/dist/shared/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared/components/text-markup/underline.d.ts +0 -16
- package/dist/shared/components/text-markup.d.ts +0 -7
- package/dist/shared/components/types.d.ts +0 -253
- package/dist/shared/context/index.d.ts +0 -1
- package/dist/shared/context/renderer-registry.d.ts +0 -21
- package/dist/shared/hooks/index.d.ts +0 -2
- package/dist/shared/hooks/use-annotation.d.ts +0 -19
- package/dist/shared/hooks/use-ios-zoom-prevention.d.ts +0 -16
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/types.d.ts +0 -10
- package/dist/shared-preact/annotation-bounds.d.ts +0 -14
- package/dist/shared-preact/components/annotation-container.d.ts +0 -71
- package/dist/shared-preact/components/annotation-layer.d.ts +0 -33
- package/dist/shared-preact/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared-preact/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared-preact/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared-preact/components/annotations/caret.d.ts +0 -24
- package/dist/shared-preact/components/annotations/circle.d.ts +0 -35
- package/dist/shared-preact/components/annotations/free-text.d.ts +0 -17
- package/dist/shared-preact/components/annotations/ink.d.ts +0 -27
- package/dist/shared-preact/components/annotations/line.d.ts +0 -35
- package/dist/shared-preact/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared-preact/components/annotations/link.d.ts +0 -28
- package/dist/shared-preact/components/annotations/polygon.d.ts +0 -23
- package/dist/shared-preact/components/annotations/polyline.d.ts +0 -23
- package/dist/shared-preact/components/annotations/square.d.ts +0 -35
- package/dist/shared-preact/components/annotations/stamp.d.ts +0 -13
- package/dist/shared-preact/components/annotations/text.d.ts +0 -14
- package/dist/shared-preact/components/annotations.d.ts +0 -22
- package/dist/shared-preact/components/appearance-image.d.ts +0 -12
- package/dist/shared-preact/components/built-in-renderers.d.ts +0 -2
- package/dist/shared-preact/components/group-selection-box.d.ts +0 -40
- package/dist/shared-preact/components/index.d.ts +0 -2
- package/dist/shared-preact/components/preview-renderer.d.ts +0 -8
- package/dist/shared-preact/components/render-annotation.d.ts +0 -13
- package/dist/shared-preact/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/underline.d.ts +0 -16
- package/dist/shared-preact/components/text-markup.d.ts +0 -7
- package/dist/shared-preact/components/types.d.ts +0 -253
- package/dist/shared-preact/context/index.d.ts +0 -1
- package/dist/shared-preact/context/renderer-registry.d.ts +0 -21
- package/dist/shared-preact/hooks/index.d.ts +0 -2
- package/dist/shared-preact/hooks/use-annotation.d.ts +0 -19
- package/dist/shared-preact/hooks/use-ios-zoom-prevention.d.ts +0 -15
- package/dist/shared-preact/index.d.ts +0 -6
- package/dist/shared-preact/types.d.ts +0 -10
- package/dist/shared-react/annotation-bounds.d.ts +0 -14
- package/dist/shared-react/components/annotation-container.d.ts +0 -71
- package/dist/shared-react/components/annotation-layer.d.ts +0 -33
- package/dist/shared-react/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared-react/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared-react/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared-react/components/annotations/caret.d.ts +0 -24
- package/dist/shared-react/components/annotations/circle.d.ts +0 -35
- package/dist/shared-react/components/annotations/free-text.d.ts +0 -17
- package/dist/shared-react/components/annotations/ink.d.ts +0 -27
- package/dist/shared-react/components/annotations/line.d.ts +0 -35
- package/dist/shared-react/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared-react/components/annotations/link.d.ts +0 -28
- package/dist/shared-react/components/annotations/polygon.d.ts +0 -23
- package/dist/shared-react/components/annotations/polyline.d.ts +0 -23
- package/dist/shared-react/components/annotations/square.d.ts +0 -35
- package/dist/shared-react/components/annotations/stamp.d.ts +0 -13
- package/dist/shared-react/components/annotations/text.d.ts +0 -14
- package/dist/shared-react/components/annotations.d.ts +0 -22
- package/dist/shared-react/components/appearance-image.d.ts +0 -12
- package/dist/shared-react/components/built-in-renderers.d.ts +0 -2
- package/dist/shared-react/components/group-selection-box.d.ts +0 -40
- package/dist/shared-react/components/index.d.ts +0 -2
- package/dist/shared-react/components/preview-renderer.d.ts +0 -8
- package/dist/shared-react/components/render-annotation.d.ts +0 -13
- package/dist/shared-react/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared-react/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared-react/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared-react/components/text-markup/underline.d.ts +0 -16
- package/dist/shared-react/components/text-markup.d.ts +0 -7
- package/dist/shared-react/components/types.d.ts +0 -253
- package/dist/shared-react/context/index.d.ts +0 -1
- package/dist/shared-react/context/renderer-registry.d.ts +0 -21
- package/dist/shared-react/hooks/index.d.ts +0 -2
- package/dist/shared-react/hooks/use-annotation.d.ts +0 -19
- package/dist/shared-react/hooks/use-ios-zoom-prevention.d.ts +0 -16
- package/dist/shared-react/index.d.ts +0 -6
- package/dist/shared-react/types.d.ts +0 -10
- package/dist/shared-vue/annotation-bounds.d.ts +0 -14
- package/dist/svelte/components/AnnotationContainer.svelte.d.ts +0 -26
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +0 -40
- package/dist/svelte/components/AnnotationNavigationHandler.svelte.d.ts +0 -3
- package/dist/svelte/components/AnnotationPaintLayer.svelte.d.ts +0 -8
- package/dist/svelte/components/Annotations.svelte.d.ts +0 -28
- package/dist/svelte/components/AppearanceImage.svelte.d.ts +0 -8
- package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +0 -40
- package/dist/svelte/components/PreviewRenderer.svelte.d.ts +0 -9
- package/dist/svelte/components/RenderAnnotation.svelte.d.ts +0 -14
- package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +0 -7
- package/dist/svelte/components/TextMarkup.svelte.d.ts +0 -8
- package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +0 -15
- package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Caret.svelte.d.ts +0 -13
- package/dist/svelte/components/annotations/Circle.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/CirclePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/FreeText.svelte.d.ts +0 -16
- package/dist/svelte/components/annotations/FreeTextPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Ink.svelte.d.ts +0 -15
- package/dist/svelte/components/annotations/InkPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Line.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/LinePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Link.svelte.d.ts +0 -24
- package/dist/svelte/components/annotations/LinkLockedMode.svelte.d.ts +0 -5
- package/dist/svelte/components/annotations/LinkPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Polygon.svelte.d.ts +0 -21
- package/dist/svelte/components/annotations/PolygonPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Polyline.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/PolylinePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Square.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/SquarePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Stamp.svelte.d.ts +0 -13
- package/dist/svelte/components/annotations/StampPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Text.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/index.d.ts +0 -10
- package/dist/svelte/components/built-in-renderers.d.ts +0 -2
- package/dist/svelte/components/index.d.ts +0 -11
- package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/CaretRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/CircleRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/FreeTextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/HighlightRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/InkRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/LineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/LinkRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/PolygonRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/PolylineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/SquareRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/SquigglyRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/StampRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/StrikeoutRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/TextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/UnderlineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Underline.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/index.d.ts +0 -4
- package/dist/svelte/components/types.d.ts +0 -66
- package/dist/svelte/context/index.d.ts +0 -2
- package/dist/svelte/context/renderer-registry.svelte.d.ts +0 -20
- package/dist/svelte/context/types.d.ts +0 -129
- package/dist/svelte/hooks/index.d.ts +0 -2
- package/dist/svelte/hooks/use-annotation.svelte.d.ts +0 -21
- package/dist/svelte/hooks/use-ios-zoom-prevention.svelte.d.ts +0 -6
- package/dist/svelte/index.cjs +0 -2
- package/dist/svelte/index.cjs.map +0 -1
- package/dist/svelte/index.d.ts +0 -6
- package/dist/svelte/index.js +0 -5257
- package/dist/svelte/index.js.map +0 -1
- package/dist/svelte/types.d.ts +0 -126
- package/dist/vue/components/annotation-container.vue.d.ts +0 -134
- package/dist/vue/components/annotation-layer.vue.d.ts +0 -99
- package/dist/vue/components/annotation-navigation-handler.vue.d.ts +0 -3
- package/dist/vue/components/annotation-paint-layer.vue.d.ts +0 -8
- package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/callout-free-text.vue.d.ts +0 -25
- package/dist/vue/components/annotations/caret.vue.d.ts +0 -24
- package/dist/vue/components/annotations/circle-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/circle.vue.d.ts +0 -37
- package/dist/vue/components/annotations/free-text-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/free-text.vue.d.ts +0 -25
- package/dist/vue/components/annotations/index.d.ts +0 -10
- package/dist/vue/components/annotations/ink-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/ink.vue.d.ts +0 -27
- package/dist/vue/components/annotations/line-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/line.vue.d.ts +0 -38
- package/dist/vue/components/annotations/link-locked.vue.d.ts +0 -5
- package/dist/vue/components/annotations/link-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/link.vue.d.ts +0 -47
- package/dist/vue/components/annotations/polygon-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/polygon.vue.d.ts +0 -43
- package/dist/vue/components/annotations/polyline-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/polyline.vue.d.ts +0 -38
- package/dist/vue/components/annotations/square-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/square.vue.d.ts +0 -37
- package/dist/vue/components/annotations/stamp-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/stamp.vue.d.ts +0 -19
- package/dist/vue/components/annotations/text.vue.d.ts +0 -14
- package/dist/vue/components/annotations.vue.d.ts +0 -111
- package/dist/vue/components/appearance-image.vue.d.ts +0 -9
- package/dist/vue/components/built-in-renderers.d.ts +0 -2
- package/dist/vue/components/group-selection-box.vue.d.ts +0 -98
- package/dist/vue/components/index.d.ts +0 -11
- package/dist/vue/components/preview-renderer.vue.d.ts +0 -9
- package/dist/vue/components/render-annotation.vue.d.ts +0 -16
- package/dist/vue/components/renderer-registry-provider.vue.d.ts +0 -13
- package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/caret-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/circle-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/free-text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/highlight-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/ink-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/line-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/link-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/polygon-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/polyline-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/square-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/squiggly-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/stamp-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/strikeout-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/underline-renderer.vue.d.ts +0 -6
- package/dist/vue/components/text-markup/highlight.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/index.d.ts +0 -4
- package/dist/vue/components/text-markup/squiggly.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/strikeout.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/underline.vue.d.ts +0 -27
- package/dist/vue/components/text-markup.vue.d.ts +0 -8
- package/dist/vue/context/index.d.ts +0 -2
- package/dist/vue/context/renderer-registry.d.ts +0 -26
- package/dist/vue/context/types.d.ts +0 -129
- package/dist/vue/hooks/index.d.ts +0 -2
- package/dist/vue/hooks/use-annotation.d.ts +0 -50
- package/dist/vue/hooks/use-ios-zoom-prevention.d.ts +0 -7
- package/dist/vue/index.cjs +0 -2
- package/dist/vue/index.cjs.map +0 -1
- package/dist/vue/index.d.ts +0 -6
- package/dist/vue/index.js +0 -4984
- package/dist/vue/index.js.map +0 -1
- package/dist/vue/types.d.ts +0 -94
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
import { ToolMapFromList } from './types';
|
|
2
|
-
import { defaultTools } from './default-tools';
|
|
3
|
-
export type ToolMap = ToolMapFromList<typeof defaultTools>;
|
|
4
|
-
/**
|
|
5
|
-
* A factory that creates a type-safe predicate function for a specific tool ID.
|
|
6
|
-
* This is more reliable for TypeScript's type inference than a single generic function.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createToolPredicate<K extends keyof ToolMap>(id: K): (tool: {
|
|
9
|
-
id: string;
|
|
10
|
-
} | undefined) => tool is ToolMap[K];
|
|
11
|
-
export declare const isHighlightTool: (tool: {
|
|
12
|
-
id: string;
|
|
13
|
-
} | undefined) => tool is {
|
|
14
|
-
id: "highlight";
|
|
15
|
-
name: string;
|
|
16
|
-
labelKey: string;
|
|
17
|
-
categories: string[];
|
|
18
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
19
|
-
interaction: {
|
|
20
|
-
exclusive: false;
|
|
21
|
-
textSelection: true;
|
|
22
|
-
isDraggable: false;
|
|
23
|
-
isResizable: false;
|
|
24
|
-
isRotatable: false;
|
|
25
|
-
isGroupDraggable: false;
|
|
26
|
-
isGroupResizable: false;
|
|
27
|
-
};
|
|
28
|
-
defaults: {
|
|
29
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.HIGHLIGHT;
|
|
30
|
-
strokeColor: string;
|
|
31
|
-
color: string;
|
|
32
|
-
opacity: number;
|
|
33
|
-
blendMode: import("@embedpdf/models").PdfBlendMode.Multiply;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export declare const isSquigglyTool: (tool: {
|
|
37
|
-
id: string;
|
|
38
|
-
} | undefined) => tool is {
|
|
39
|
-
id: "squiggly";
|
|
40
|
-
name: string;
|
|
41
|
-
labelKey: string;
|
|
42
|
-
categories: string[];
|
|
43
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
44
|
-
interaction: {
|
|
45
|
-
exclusive: false;
|
|
46
|
-
textSelection: true;
|
|
47
|
-
isDraggable: false;
|
|
48
|
-
isResizable: false;
|
|
49
|
-
isRotatable: false;
|
|
50
|
-
isGroupDraggable: false;
|
|
51
|
-
isGroupResizable: false;
|
|
52
|
-
};
|
|
53
|
-
defaults: {
|
|
54
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.SQUIGGLY;
|
|
55
|
-
strokeColor: string;
|
|
56
|
-
color: string;
|
|
57
|
-
opacity: number;
|
|
58
|
-
blendMode?: undefined;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export declare const isUnderlineTool: (tool: {
|
|
62
|
-
id: string;
|
|
63
|
-
} | undefined) => tool is {
|
|
64
|
-
id: "underline";
|
|
65
|
-
name: string;
|
|
66
|
-
labelKey: string;
|
|
67
|
-
categories: string[];
|
|
68
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
69
|
-
interaction: {
|
|
70
|
-
exclusive: false;
|
|
71
|
-
textSelection: true;
|
|
72
|
-
isDraggable: false;
|
|
73
|
-
isResizable: false;
|
|
74
|
-
isRotatable: false;
|
|
75
|
-
isGroupDraggable: false;
|
|
76
|
-
isGroupResizable: false;
|
|
77
|
-
};
|
|
78
|
-
defaults: {
|
|
79
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.UNDERLINE;
|
|
80
|
-
strokeColor: string;
|
|
81
|
-
color: string;
|
|
82
|
-
opacity: number;
|
|
83
|
-
blendMode?: undefined;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
export declare const isStrikeoutTool: (tool: {
|
|
87
|
-
id: string;
|
|
88
|
-
} | undefined) => tool is {
|
|
89
|
-
id: "strikeout";
|
|
90
|
-
name: string;
|
|
91
|
-
labelKey: string;
|
|
92
|
-
categories: string[];
|
|
93
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
94
|
-
interaction: {
|
|
95
|
-
exclusive: false;
|
|
96
|
-
textSelection: true;
|
|
97
|
-
isDraggable: false;
|
|
98
|
-
isResizable: false;
|
|
99
|
-
isRotatable: false;
|
|
100
|
-
isGroupDraggable: false;
|
|
101
|
-
isGroupResizable: false;
|
|
102
|
-
};
|
|
103
|
-
defaults: {
|
|
104
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.STRIKEOUT;
|
|
105
|
-
strokeColor: string;
|
|
106
|
-
color: string;
|
|
107
|
-
opacity: number;
|
|
108
|
-
blendMode?: undefined;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export declare const isInkTool: (tool: {
|
|
112
|
-
id: string;
|
|
113
|
-
} | undefined) => tool is {
|
|
114
|
-
id: "ink";
|
|
115
|
-
name: string;
|
|
116
|
-
labelKey: string;
|
|
117
|
-
categories: string[];
|
|
118
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 5;
|
|
119
|
-
interaction: {
|
|
120
|
-
exclusive: false;
|
|
121
|
-
cursor: string;
|
|
122
|
-
isDraggable: true;
|
|
123
|
-
isResizable: true;
|
|
124
|
-
lockAspectRatio: false;
|
|
125
|
-
lockGroupAspectRatio?: undefined;
|
|
126
|
-
};
|
|
127
|
-
defaults: {
|
|
128
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.INK;
|
|
129
|
-
strokeColor: string;
|
|
130
|
-
color: string;
|
|
131
|
-
opacity: number;
|
|
132
|
-
strokeWidth: number;
|
|
133
|
-
intent?: undefined;
|
|
134
|
-
blendMode?: undefined;
|
|
135
|
-
};
|
|
136
|
-
behavior: {
|
|
137
|
-
commitDelay: number;
|
|
138
|
-
smartLineRecognition?: undefined;
|
|
139
|
-
smartLineThreshold?: undefined;
|
|
140
|
-
};
|
|
141
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfInkAnnoObject>;
|
|
142
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfInkAnnoObject, string>;
|
|
143
|
-
};
|
|
144
|
-
export declare const isInkHighlighterTool: (tool: {
|
|
145
|
-
id: string;
|
|
146
|
-
} | undefined) => tool is {
|
|
147
|
-
id: "inkHighlighter";
|
|
148
|
-
name: string;
|
|
149
|
-
labelKey: string;
|
|
150
|
-
categories: string[];
|
|
151
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 10;
|
|
152
|
-
interaction: {
|
|
153
|
-
exclusive: false;
|
|
154
|
-
cursor: string;
|
|
155
|
-
isDraggable: true;
|
|
156
|
-
isResizable: true;
|
|
157
|
-
lockAspectRatio: false;
|
|
158
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
159
|
-
};
|
|
160
|
-
defaults: {
|
|
161
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.INK;
|
|
162
|
-
intent: string;
|
|
163
|
-
strokeColor: string;
|
|
164
|
-
color: string;
|
|
165
|
-
opacity: number;
|
|
166
|
-
strokeWidth: number;
|
|
167
|
-
blendMode: import("@embedpdf/models").PdfBlendMode.Multiply;
|
|
168
|
-
};
|
|
169
|
-
behavior: {
|
|
170
|
-
commitDelay: number;
|
|
171
|
-
smartLineRecognition: true;
|
|
172
|
-
smartLineThreshold: number;
|
|
173
|
-
};
|
|
174
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfInkAnnoObject>;
|
|
175
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfInkAnnoObject, string>;
|
|
176
|
-
};
|
|
177
|
-
export declare const isSquareTool: (tool: {
|
|
178
|
-
id: string;
|
|
179
|
-
} | undefined) => tool is {
|
|
180
|
-
id: "square";
|
|
181
|
-
name: string;
|
|
182
|
-
labelKey: string;
|
|
183
|
-
categories: string[];
|
|
184
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
185
|
-
interaction: {
|
|
186
|
-
exclusive: false;
|
|
187
|
-
cursor: string;
|
|
188
|
-
isDraggable: true;
|
|
189
|
-
isResizable: true;
|
|
190
|
-
lockAspectRatio: false;
|
|
191
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
192
|
-
};
|
|
193
|
-
defaults: {
|
|
194
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.SQUARE;
|
|
195
|
-
color: string;
|
|
196
|
-
opacity: number;
|
|
197
|
-
strokeWidth: number;
|
|
198
|
-
strokeColor: string;
|
|
199
|
-
strokeStyle: import("@embedpdf/models").PdfAnnotationBorderStyle.SOLID;
|
|
200
|
-
};
|
|
201
|
-
clickBehavior: {
|
|
202
|
-
enabled: true;
|
|
203
|
-
defaultSize: {
|
|
204
|
-
width: number;
|
|
205
|
-
height: number;
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfSquareAnnoObject>;
|
|
209
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfSquareAnnoObject, string>;
|
|
210
|
-
};
|
|
211
|
-
export declare const isCircleTool: (tool: {
|
|
212
|
-
id: string;
|
|
213
|
-
} | undefined) => tool is {
|
|
214
|
-
id: "circle";
|
|
215
|
-
name: string;
|
|
216
|
-
labelKey: string;
|
|
217
|
-
categories: string[];
|
|
218
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
219
|
-
interaction: {
|
|
220
|
-
exclusive: false;
|
|
221
|
-
cursor: string;
|
|
222
|
-
isDraggable: true;
|
|
223
|
-
isResizable: true;
|
|
224
|
-
lockAspectRatio: false;
|
|
225
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
226
|
-
};
|
|
227
|
-
defaults: {
|
|
228
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.CIRCLE;
|
|
229
|
-
color: string;
|
|
230
|
-
opacity: number;
|
|
231
|
-
strokeWidth: number;
|
|
232
|
-
strokeColor: string;
|
|
233
|
-
strokeStyle: import("@embedpdf/models").PdfAnnotationBorderStyle.SOLID;
|
|
234
|
-
};
|
|
235
|
-
clickBehavior: {
|
|
236
|
-
enabled: true;
|
|
237
|
-
defaultSize: {
|
|
238
|
-
width: number;
|
|
239
|
-
height: number;
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfCircleAnnoObject>;
|
|
243
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfCircleAnnoObject, string>;
|
|
244
|
-
};
|
|
245
|
-
export declare const isLineTool: (tool: {
|
|
246
|
-
id: string;
|
|
247
|
-
} | undefined) => tool is {
|
|
248
|
-
id: "line";
|
|
249
|
-
name: string;
|
|
250
|
-
labelKey: string;
|
|
251
|
-
categories: string[];
|
|
252
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 5;
|
|
253
|
-
interaction: {
|
|
254
|
-
exclusive: false;
|
|
255
|
-
cursor: string;
|
|
256
|
-
isDraggable: true;
|
|
257
|
-
isResizable: false;
|
|
258
|
-
lockAspectRatio: false;
|
|
259
|
-
isGroupResizable: true;
|
|
260
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
261
|
-
};
|
|
262
|
-
defaults: {
|
|
263
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.LINE;
|
|
264
|
-
color: string;
|
|
265
|
-
opacity: number;
|
|
266
|
-
strokeWidth: number;
|
|
267
|
-
strokeColor: string;
|
|
268
|
-
intent?: undefined;
|
|
269
|
-
lineEndings?: undefined;
|
|
270
|
-
};
|
|
271
|
-
clickBehavior: {
|
|
272
|
-
enabled: true;
|
|
273
|
-
defaultLength: number;
|
|
274
|
-
defaultAngle: number;
|
|
275
|
-
};
|
|
276
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfLineAnnoObject>;
|
|
277
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfLineAnnoObject, string>;
|
|
278
|
-
};
|
|
279
|
-
export declare const isPolylineTool: (tool: {
|
|
280
|
-
id: string;
|
|
281
|
-
} | undefined) => tool is {
|
|
282
|
-
id: "polyline";
|
|
283
|
-
name: string;
|
|
284
|
-
labelKey: string;
|
|
285
|
-
categories: string[];
|
|
286
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
287
|
-
interaction: {
|
|
288
|
-
exclusive: false;
|
|
289
|
-
cursor: string;
|
|
290
|
-
isDraggable: true;
|
|
291
|
-
isResizable: false;
|
|
292
|
-
lockAspectRatio: false;
|
|
293
|
-
isGroupResizable: true;
|
|
294
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
295
|
-
};
|
|
296
|
-
defaults: {
|
|
297
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.POLYLINE;
|
|
298
|
-
color: string;
|
|
299
|
-
opacity: number;
|
|
300
|
-
strokeWidth: number;
|
|
301
|
-
strokeColor: string;
|
|
302
|
-
};
|
|
303
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfPolylineAnnoObject>;
|
|
304
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfPolylineAnnoObject, string>;
|
|
305
|
-
};
|
|
306
|
-
export declare const isPolygonTool: (tool: {
|
|
307
|
-
id: string;
|
|
308
|
-
} | undefined) => tool is {
|
|
309
|
-
id: "polygon";
|
|
310
|
-
name: string;
|
|
311
|
-
labelKey: string;
|
|
312
|
-
categories: string[];
|
|
313
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
314
|
-
interaction: {
|
|
315
|
-
exclusive: false;
|
|
316
|
-
cursor: string;
|
|
317
|
-
isDraggable: true;
|
|
318
|
-
isResizable: false;
|
|
319
|
-
lockAspectRatio: false;
|
|
320
|
-
isGroupResizable: true;
|
|
321
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
322
|
-
};
|
|
323
|
-
defaults: {
|
|
324
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.POLYGON;
|
|
325
|
-
color: string;
|
|
326
|
-
opacity: number;
|
|
327
|
-
strokeWidth: number;
|
|
328
|
-
strokeColor: string;
|
|
329
|
-
};
|
|
330
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfPolygonAnnoObject>;
|
|
331
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfPolygonAnnoObject, string>;
|
|
332
|
-
};
|
|
333
|
-
export declare const isFreeTextTool: (tool: {
|
|
334
|
-
id: string;
|
|
335
|
-
} | undefined) => tool is {
|
|
336
|
-
id: "freeText";
|
|
337
|
-
name: string;
|
|
338
|
-
labelKey: string;
|
|
339
|
-
categories: string[];
|
|
340
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
341
|
-
interaction: {
|
|
342
|
-
exclusive: false;
|
|
343
|
-
cursor: string;
|
|
344
|
-
isDraggable: true;
|
|
345
|
-
isResizable: true;
|
|
346
|
-
lockAspectRatio: false;
|
|
347
|
-
lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
|
|
348
|
-
};
|
|
349
|
-
defaults: {
|
|
350
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.FREETEXT;
|
|
351
|
-
contents: string;
|
|
352
|
-
fontSize: number;
|
|
353
|
-
fontColor: string;
|
|
354
|
-
fontFamily: import("@embedpdf/models").PdfStandardFont.Helvetica;
|
|
355
|
-
textAlign: import("@embedpdf/models").PdfTextAlignment.Left;
|
|
356
|
-
verticalAlign: import("@embedpdf/models").PdfVerticalAlignment.Top;
|
|
357
|
-
color: string;
|
|
358
|
-
backgroundColor: string;
|
|
359
|
-
opacity: number;
|
|
360
|
-
};
|
|
361
|
-
clickBehavior: {
|
|
362
|
-
enabled: true;
|
|
363
|
-
defaultSize: {
|
|
364
|
-
width: number;
|
|
365
|
-
height: number;
|
|
366
|
-
};
|
|
367
|
-
defaultContent: string;
|
|
368
|
-
};
|
|
369
|
-
behavior: {
|
|
370
|
-
insertUpright: true;
|
|
371
|
-
editAfterCreate: true;
|
|
372
|
-
selectAfterCreate: true;
|
|
373
|
-
};
|
|
374
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfFreeTextAnnoObject>;
|
|
375
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfFreeTextAnnoObject, string>;
|
|
376
|
-
};
|
|
377
|
-
export declare const isStampTool: (tool: {
|
|
378
|
-
id: string;
|
|
379
|
-
} | undefined) => tool is {
|
|
380
|
-
id: "stamp";
|
|
381
|
-
name: string;
|
|
382
|
-
labelKey: string;
|
|
383
|
-
categories: string[];
|
|
384
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
|
|
385
|
-
interaction: {
|
|
386
|
-
exclusive: false;
|
|
387
|
-
cursor: string;
|
|
388
|
-
isDraggable: true;
|
|
389
|
-
isResizable: true;
|
|
390
|
-
lockAspectRatio: true;
|
|
391
|
-
lockGroupAspectRatio: true;
|
|
392
|
-
};
|
|
393
|
-
defaults: {
|
|
394
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.STAMP;
|
|
395
|
-
};
|
|
396
|
-
behavior: {
|
|
397
|
-
insertUpright: true;
|
|
398
|
-
useAppearanceStream: false;
|
|
399
|
-
};
|
|
400
|
-
transform: import('..').PatchFunction<import('@embedpdf/models').PdfStampAnnoObject>;
|
|
401
|
-
pointerHandler: import('..').HandlerFactory<import('@embedpdf/models').PdfStampAnnoObject, string>;
|
|
402
|
-
};
|
|
403
|
-
export declare const isInsertTextTool: (tool: {
|
|
404
|
-
id: string;
|
|
405
|
-
} | undefined) => tool is {
|
|
406
|
-
id: "insertText";
|
|
407
|
-
name: string;
|
|
408
|
-
labelKey: string;
|
|
409
|
-
categories: string[];
|
|
410
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1 | 2;
|
|
411
|
-
interaction: {
|
|
412
|
-
exclusive: false;
|
|
413
|
-
textSelection: true;
|
|
414
|
-
showSelectionRects: true;
|
|
415
|
-
isDraggable: false;
|
|
416
|
-
isResizable: false;
|
|
417
|
-
isRotatable: false;
|
|
418
|
-
isGroupDraggable: false;
|
|
419
|
-
isGroupResizable: false;
|
|
420
|
-
};
|
|
421
|
-
defaults: {
|
|
422
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.CARET;
|
|
423
|
-
strokeColor: string;
|
|
424
|
-
opacity: number;
|
|
425
|
-
intent: string;
|
|
426
|
-
};
|
|
427
|
-
selectionHandler: import('..').SelectionHandlerFactory<import('@embedpdf/models').PdfCaretAnnoObject>;
|
|
428
|
-
};
|
|
429
|
-
export declare const isReplaceTextTool: (tool: {
|
|
430
|
-
id: string;
|
|
431
|
-
} | undefined) => tool is {
|
|
432
|
-
id: "replaceText";
|
|
433
|
-
name: string;
|
|
434
|
-
labelKey: string;
|
|
435
|
-
categories: string[];
|
|
436
|
-
matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 2;
|
|
437
|
-
interaction: {
|
|
438
|
-
exclusive: false;
|
|
439
|
-
textSelection: true;
|
|
440
|
-
isDraggable: false;
|
|
441
|
-
isResizable: false;
|
|
442
|
-
isRotatable: false;
|
|
443
|
-
isGroupDraggable: false;
|
|
444
|
-
isGroupResizable: false;
|
|
445
|
-
};
|
|
446
|
-
defaults: {
|
|
447
|
-
type: import("@embedpdf/models").PdfAnnotationSubtype.STRIKEOUT;
|
|
448
|
-
strokeColor: string;
|
|
449
|
-
opacity: number;
|
|
450
|
-
intent: string;
|
|
451
|
-
};
|
|
452
|
-
selectionHandler: import('..').SelectionHandlerFactory<import('@embedpdf/models').PdfStrikeOutAnnoObject>;
|
|
453
|
-
};
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationObject, PdfAnnotationSubtype, Size } from '@embedpdf/models';
|
|
2
|
-
import { HandlerFactory, SelectionHandlerFactory } from '../handlers/types';
|
|
3
|
-
import { PatchFunction } from '../patching/patch-registry';
|
|
4
|
-
/**
|
|
5
|
-
* A dynamic boolean property that can be either a static boolean
|
|
6
|
-
* or a function that receives the annotation and returns a boolean.
|
|
7
|
-
*/
|
|
8
|
-
export type DynamicBooleanProp = boolean | ((annotation: PdfAnnotationObject) => boolean);
|
|
9
|
-
/**
|
|
10
|
-
* Resolves a dynamic boolean property to its actual value.
|
|
11
|
-
* @param prop The dynamic property (boolean or function)
|
|
12
|
-
* @param annotation The annotation to pass to the function if prop is a function
|
|
13
|
-
* @param defaultValue The default value if prop is undefined
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveInteractionProp(prop: DynamicBooleanProp | undefined, annotation: PdfAnnotationObject, defaultValue: boolean): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Specific configuration for Stamp tools.
|
|
18
|
-
*/
|
|
19
|
-
export interface StampToolConfig {
|
|
20
|
-
/** The base64 or URL source for the stamp's image. */
|
|
21
|
-
imageSrc?: string;
|
|
22
|
-
imageSize?: Size;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Click behavior for shape annotations (Circle, Square)
|
|
26
|
-
*/
|
|
27
|
-
export interface ShapeClickBehavior {
|
|
28
|
-
/** If true, creates annotation on click with default size */
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
/** Default size to use when clicking (PDF units) */
|
|
31
|
-
defaultSize: Size;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Click behavior for line annotations
|
|
35
|
-
*/
|
|
36
|
-
export interface LineClickBehavior {
|
|
37
|
-
/** If true, creates annotation on click with default length */
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
/** Default length of the line */
|
|
40
|
-
defaultLength: number;
|
|
41
|
-
/** Default angle in radians (0 = horizontal right) */
|
|
42
|
-
defaultAngle?: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Click behavior for free text annotations
|
|
46
|
-
*/
|
|
47
|
-
export interface FreeTextClickBehavior {
|
|
48
|
-
/** If true, creates annotation on click with default size */
|
|
49
|
-
enabled: boolean;
|
|
50
|
-
/** Default size for the text box */
|
|
51
|
-
defaultSize: Size;
|
|
52
|
-
/** Optional default content */
|
|
53
|
-
defaultContent?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* A central, extensible map that associates an annotation subtype
|
|
57
|
-
* with its unique tool configuration interface.
|
|
58
|
-
*/
|
|
59
|
-
export interface ToolConfigMap {
|
|
60
|
-
[PdfAnnotationSubtype.STAMP]: StampToolConfig;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Map of annotation subtypes to their click behavior configuration
|
|
64
|
-
*/
|
|
65
|
-
export interface ClickBehaviorMap {
|
|
66
|
-
[PdfAnnotationSubtype.CIRCLE]: ShapeClickBehavior;
|
|
67
|
-
[PdfAnnotationSubtype.SQUARE]: ShapeClickBehavior;
|
|
68
|
-
[PdfAnnotationSubtype.LINE]: LineClickBehavior;
|
|
69
|
-
[PdfAnnotationSubtype.FREETEXT]: FreeTextClickBehavior;
|
|
70
|
-
[PdfAnnotationSubtype.WIDGET]: ShapeClickBehavior;
|
|
71
|
-
[PdfAnnotationSubtype.LINK]: ShapeClickBehavior;
|
|
72
|
-
}
|
|
73
|
-
type GetToolConfig<T extends PdfAnnotationObject> = T['type'] extends keyof ToolConfigMap ? ToolConfigMap[T['type']] : {};
|
|
74
|
-
type ClickBehaviorFor<T extends PdfAnnotationObject> = Extract<T['type'], keyof ClickBehaviorMap> extends never ? {} : {
|
|
75
|
-
clickBehavior?: ClickBehaviorMap[Extract<T['type'], keyof ClickBehaviorMap>];
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Map of annotation types that support the insertUpright behavior.
|
|
79
|
-
* Only types with a "natural upright orientation" (readable text, image content)
|
|
80
|
-
* should be listed here.
|
|
81
|
-
*/
|
|
82
|
-
export interface InsertUprightBehaviorMap {
|
|
83
|
-
[PdfAnnotationSubtype.STAMP]: true;
|
|
84
|
-
[PdfAnnotationSubtype.FREETEXT]: true;
|
|
85
|
-
}
|
|
86
|
-
type InsertUprightBehaviorFor<T extends PdfAnnotationObject> = Extract<T['type'], keyof InsertUprightBehaviorMap> extends never ? {} : {
|
|
87
|
-
/** Counter-rotate new annotations to appear visually upright on rotated pages. */
|
|
88
|
-
insertUpright?: boolean;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Ink-specific behavior settings. Only available on tools whose annotation
|
|
92
|
-
* type is PdfAnnotationSubtype.INK (i.e. 'ink' and 'inkHighlighter').
|
|
93
|
-
*/
|
|
94
|
-
export interface InkBehavior {
|
|
95
|
-
/** ms of pointer inactivity before the accumulated strokes are committed. Default: 800. */
|
|
96
|
-
commitDelay?: number;
|
|
97
|
-
/** When true, line-like strokes are snapped to a clean 2-point straight line on pointerUp. */
|
|
98
|
-
smartLineRecognition?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Maximum allowed perpendicular-deviation ratio (maxDeviation / strokeLength) for a stroke
|
|
101
|
-
* to qualify as a straight line. Lower = stricter. Default: 0.15.
|
|
102
|
-
*/
|
|
103
|
-
smartLineThreshold?: number;
|
|
104
|
-
/**
|
|
105
|
-
* How many degrees from horizontal or vertical a recognised straight line may deviate
|
|
106
|
-
* before axis-snapping is skipped. Default: 15.
|
|
107
|
-
*/
|
|
108
|
-
snapAngleDeg?: number;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Non-distributive conditional: wrapping both sides in [...] prevents TypeScript from
|
|
112
|
-
* distributing over a union. [PdfAnnotationObject] extends [PdfInkAnnoObject] is false
|
|
113
|
-
* (the full union is not a subtype of the specific ink type), so InkBehavior is only added
|
|
114
|
-
* when T is specifically the INK annotation type.
|
|
115
|
-
*/
|
|
116
|
-
type InkBehaviorFor<T extends PdfAnnotationObject> = [T] extends [
|
|
117
|
-
Extract<PdfAnnotationObject, {
|
|
118
|
-
type: PdfAnnotationSubtype.INK;
|
|
119
|
-
}>
|
|
120
|
-
] ? InkBehavior : {};
|
|
121
|
-
/**
|
|
122
|
-
* The primary interface for defining an annotation tool.
|
|
123
|
-
* Uses a type alias to properly combine the base interface with conditional properties.
|
|
124
|
-
*/
|
|
125
|
-
export type AnnotationTool<T extends PdfAnnotationObject = PdfAnnotationObject, TId extends string = string> = {
|
|
126
|
-
/** A unique identifier, e.g., 'ink', 'arrow' */
|
|
127
|
-
id: TId;
|
|
128
|
-
/** A user-facing name for UI elements, e.g., 'Pen' */
|
|
129
|
-
name: string;
|
|
130
|
-
/** Translation key for the tool label, e.g., 'annotation.ink'. Used by the UI for i18n. */
|
|
131
|
-
labelKey?: string;
|
|
132
|
-
/** Category tags for authoring mode control, e.g., `['annotation', 'form']`. */
|
|
133
|
-
categories?: string[];
|
|
134
|
-
/**
|
|
135
|
-
* Determines how well this tool matches an existing annotation.
|
|
136
|
-
* Higher numbers indicate a more specific match.
|
|
137
|
-
*/
|
|
138
|
-
matchScore: (annotation: PdfAnnotationObject) => number;
|
|
139
|
-
/**
|
|
140
|
-
* The defaults combine the base annotation properties (Partial<T>)
|
|
141
|
-
* with any custom tool configuration (C) found in the ToolConfigMap.
|
|
142
|
-
*/
|
|
143
|
-
defaults: Partial<T> & GetToolConfig<T>;
|
|
144
|
-
/** Defines how this tool interacts with the viewer. */
|
|
145
|
-
interaction: {
|
|
146
|
-
mode?: string;
|
|
147
|
-
exclusive: boolean;
|
|
148
|
-
cursor?: string;
|
|
149
|
-
/** If true, this interaction mode is activated by selecting text. */
|
|
150
|
-
textSelection?: boolean;
|
|
151
|
-
/** Whether to show the native text selection rectangles. Only relevant when textSelection is true. Defaults to false. */
|
|
152
|
-
showSelectionRects?: boolean;
|
|
153
|
-
/** Whether this annotation can be dragged when selected individually. Can be dynamic based on annotation. */
|
|
154
|
-
isDraggable?: DynamicBooleanProp;
|
|
155
|
-
/** Whether this annotation can be resized when selected individually. Can be dynamic based on annotation. */
|
|
156
|
-
isResizable?: DynamicBooleanProp;
|
|
157
|
-
/** Whether this annotation can be rotated when selected individually. Can be dynamic based on annotation. */
|
|
158
|
-
isRotatable?: DynamicBooleanProp;
|
|
159
|
-
/** Whether to maintain aspect ratio during resize. Can be dynamic based on annotation. */
|
|
160
|
-
lockAspectRatio?: DynamicBooleanProp;
|
|
161
|
-
/** Whether to maintain aspect ratio during group resize. Defaults to lockAspectRatio. Can be dynamic based on annotation. */
|
|
162
|
-
lockGroupAspectRatio?: DynamicBooleanProp;
|
|
163
|
-
/** Whether this annotation can be dragged when part of a group. Defaults to isDraggable. Can be dynamic based on annotation. */
|
|
164
|
-
isGroupDraggable?: DynamicBooleanProp;
|
|
165
|
-
/** Whether this annotation can be resized when part of a group. Defaults to isResizable. Can be dynamic based on annotation. */
|
|
166
|
-
isGroupResizable?: DynamicBooleanProp;
|
|
167
|
-
/** Whether this annotation can be rotated when part of a group. Defaults to isRotatable. Can be dynamic based on annotation. */
|
|
168
|
-
isGroupRotatable?: DynamicBooleanProp;
|
|
169
|
-
};
|
|
170
|
-
/** Tool-specific behavior settings that override plugin defaults */
|
|
171
|
-
behavior?: {
|
|
172
|
-
/** When true, deactivate this tool after creating an annotation. Overrides plugin config. */
|
|
173
|
-
deactivateToolAfterCreate?: boolean;
|
|
174
|
-
/** When true, select the annotation immediately after creation. Overrides plugin config. */
|
|
175
|
-
selectAfterCreate?: boolean;
|
|
176
|
-
/** When true, automatically enter editing mode after creating the annotation. Implies selectAfterCreate. */
|
|
177
|
-
editAfterCreate?: boolean;
|
|
178
|
-
/** Override whether this annotation type uses AP rendering before editing (default: true) */
|
|
179
|
-
useAppearanceStream?: boolean;
|
|
180
|
-
/** Show a ghost image preview following the cursor. Defaults to false. */
|
|
181
|
-
showGhost?: boolean;
|
|
182
|
-
} & InsertUprightBehaviorFor<T> & InkBehaviorFor<T>;
|
|
183
|
-
/** Pointer-based creation handler (drag-to-create, click-to-place). */
|
|
184
|
-
pointerHandler?: HandlerFactory<T, TId>;
|
|
185
|
-
/** Text-selection-based creation handler. */
|
|
186
|
-
selectionHandler?: SelectionHandlerFactory<T>;
|
|
187
|
-
/** Transform function for move, resize, rotate, and property-update operations. */
|
|
188
|
-
transform?: PatchFunction<T>;
|
|
189
|
-
} & ClickBehaviorFor<T>;
|
|
190
|
-
export interface AnnotationToolRecord {
|
|
191
|
-
id: string;
|
|
192
|
-
defaults: Record<string, unknown>;
|
|
193
|
-
}
|
|
194
|
-
export type AnnotationToolMap = Record<string, AnnotationToolRecord>;
|
|
195
|
-
export type ToolId<TMap extends AnnotationToolMap> = Extract<keyof TMap, string>;
|
|
196
|
-
export type ToolById<TMap extends AnnotationToolMap, TId extends ToolId<TMap>> = TMap[TId];
|
|
197
|
-
export type ToolMapFromList<TTools extends readonly {
|
|
198
|
-
id: string;
|
|
199
|
-
}[]> = {
|
|
200
|
-
[T in TTools[number] as T['id']]: T;
|
|
201
|
-
};
|
|
202
|
-
export type UpsertToolMap<TMap extends AnnotationToolMap, TTool extends AnnotationTool> = Omit<TMap, TTool['id']> & {
|
|
203
|
-
[K in TTool['id']]: TTool;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Helper to preserve literal IDs and concrete tool typing.
|
|
207
|
-
*/
|
|
208
|
-
export declare const defineAnnotationTool: <const TTool extends AnnotationTool<any>>(tool: TTool) => TTool;
|
|
209
|
-
export {};
|