@embedpdf/svelte 0.0.0-stage → 3.0.0-next.15

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 (261) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +312 -2
  3. package/dist/actions/readers.svelte.d.ts +29 -0
  4. package/dist/actions/readers.svelte.js +55 -0
  5. package/dist/actions.d.ts +13 -0
  6. package/dist/actions.js +13 -0
  7. package/dist/anchored/Anchored.svelte +24 -0
  8. package/dist/anchored/Anchored.svelte.d.ts +4 -0
  9. package/dist/anchored/PlacedAnchored.svelte +97 -0
  10. package/dist/anchored/PlacedAnchored.svelte.d.ts +4 -0
  11. package/dist/anchored/context.d.ts +31 -0
  12. package/dist/anchored/context.js +36 -0
  13. package/dist/anchored/props.d.ts +29 -0
  14. package/dist/anchored/props.js +1 -0
  15. package/dist/anchored.d.ts +12 -0
  16. package/dist/anchored.js +2 -0
  17. package/dist/annotation/AnnotationChrome.svelte +173 -0
  18. package/dist/annotation/AnnotationChrome.svelte.d.ts +11 -0
  19. package/dist/annotation/AnnotationDraftMenu.svelte +27 -0
  20. package/dist/annotation/AnnotationDraftMenu.svelte.d.ts +4 -0
  21. package/dist/annotation/AnnotationFrame.svelte +46 -0
  22. package/dist/annotation/AnnotationFrame.svelte.d.ts +15 -0
  23. package/dist/annotation/AnnotationLayer.svelte +241 -0
  24. package/dist/annotation/AnnotationLayer.svelte.d.ts +4 -0
  25. package/dist/annotation/AnnotationLook.svelte +67 -0
  26. package/dist/annotation/AnnotationLook.svelte.d.ts +21 -0
  27. package/dist/annotation/AnnotationMenu.svelte +47 -0
  28. package/dist/annotation/AnnotationMenu.svelte.d.ts +4 -0
  29. package/dist/annotation/AnnotationRotationBadge.svelte +52 -0
  30. package/dist/annotation/AnnotationRotationBadge.svelte.d.ts +4 -0
  31. package/dist/annotation/AnnotationScene.svelte +27 -0
  32. package/dist/annotation/AnnotationScene.svelte.d.ts +7 -0
  33. package/dist/annotation/FreeTextBox.svelte +55 -0
  34. package/dist/annotation/FreeTextBox.svelte.d.ts +9 -0
  35. package/dist/annotation/NativeDrawing.svelte +61 -0
  36. package/dist/annotation/NativeDrawing.svelte.d.ts +10 -0
  37. package/dist/annotation/StampGhost.svelte +79 -0
  38. package/dist/annotation/StampGhost.svelte.d.ts +7 -0
  39. package/dist/annotation/chrome-paint.svelte.d.ts +30 -0
  40. package/dist/annotation/chrome-paint.svelte.js +27 -0
  41. package/dist/annotation/props.d.ts +181 -0
  42. package/dist/annotation/props.js +1 -0
  43. package/dist/annotation/readers.svelte.d.ts +59 -0
  44. package/dist/annotation/readers.svelte.js +136 -0
  45. package/dist/annotation/state.d.ts +18 -0
  46. package/dist/annotation/state.js +20 -0
  47. package/dist/annotation/text-box.svelte.d.ts +27 -0
  48. package/dist/annotation/text-box.svelte.js +94 -0
  49. package/dist/annotation.d.ts +32 -0
  50. package/dist/annotation.js +31 -0
  51. package/dist/commands/readers.svelte.d.ts +50 -0
  52. package/dist/commands/readers.svelte.js +83 -0
  53. package/dist/commands.d.ts +9 -0
  54. package/dist/commands.js +9 -0
  55. package/dist/form/ButtonControl.svelte +38 -0
  56. package/dist/form/ButtonControl.svelte.d.ts +11 -0
  57. package/dist/form/ComboControl.svelte +52 -0
  58. package/dist/form/ComboControl.svelte.d.ts +11 -0
  59. package/dist/form/FieldPictures.svelte +145 -0
  60. package/dist/form/FieldPictures.svelte.d.ts +3 -0
  61. package/dist/form/FormFocusRing.svelte +25 -0
  62. package/dist/form/FormFocusRing.svelte.d.ts +8 -0
  63. package/dist/form/FormLayer.svelte +98 -0
  64. package/dist/form/FormLayer.svelte.d.ts +3 -0
  65. package/dist/form/ListControl.svelte +49 -0
  66. package/dist/form/ListControl.svelte.d.ts +11 -0
  67. package/dist/form/NativeListBox.svelte +57 -0
  68. package/dist/form/NativeListBox.svelte.d.ts +4 -0
  69. package/dist/form/SignatureControl.svelte +53 -0
  70. package/dist/form/SignatureControl.svelte.d.ts +11 -0
  71. package/dist/form/TextControl.svelte +107 -0
  72. package/dist/form/TextControl.svelte.d.ts +11 -0
  73. package/dist/form/ToggleControl.svelte +50 -0
  74. package/dist/form/ToggleControl.svelte.d.ts +11 -0
  75. package/dist/form/WidgetBox.svelte +82 -0
  76. package/dist/form/WidgetBox.svelte.d.ts +15 -0
  77. package/dist/form/props.d.ts +21 -0
  78. package/dist/form/props.js +1 -0
  79. package/dist/form/readers.svelte.d.ts +46 -0
  80. package/dist/form/readers.svelte.js +52 -0
  81. package/dist/form/widget.d.ts +16 -0
  82. package/dist/form/widget.js +20 -0
  83. package/dist/form.d.ts +11 -0
  84. package/dist/form.js +12 -0
  85. package/dist/history/readers.d.ts +22 -0
  86. package/dist/history/readers.js +21 -0
  87. package/dist/history.d.ts +10 -0
  88. package/dist/history.js +11 -0
  89. package/dist/i18n/readers.svelte.d.ts +32 -0
  90. package/dist/i18n/readers.svelte.js +30 -0
  91. package/dist/i18n.d.ts +8 -0
  92. package/dist/i18n.js +9 -0
  93. package/dist/index.d.ts +28 -0
  94. package/dist/index.js +28 -0
  95. package/dist/interaction/PagePointerSource.svelte +37 -0
  96. package/dist/interaction/PagePointerSource.svelte.d.ts +3 -0
  97. package/dist/interaction/readers.svelte.d.ts +26 -0
  98. package/dist/interaction/readers.svelte.js +47 -0
  99. package/dist/interaction.d.ts +11 -0
  100. package/dist/interaction.js +13 -0
  101. package/dist/link/LinkLayer.svelte +164 -0
  102. package/dist/link/LinkLayer.svelte.d.ts +4 -0
  103. package/dist/link/props.d.ts +17 -0
  104. package/dist/link/props.js +1 -0
  105. package/dist/link/readers.svelte.d.ts +18 -0
  106. package/dist/link/readers.svelte.js +38 -0
  107. package/dist/link.d.ts +11 -0
  108. package/dist/link.js +11 -0
  109. package/dist/measurement/readers.d.ts +44 -0
  110. package/dist/measurement/readers.js +46 -0
  111. package/dist/measurement.d.ts +12 -0
  112. package/dist/measurement.js +13 -0
  113. package/dist/metadata/readers.d.ts +22 -0
  114. package/dist/metadata/readers.js +22 -0
  115. package/dist/metadata.d.ts +12 -0
  116. package/dist/metadata.js +13 -0
  117. package/dist/page-edit/readers.d.ts +7 -0
  118. package/dist/page-edit/readers.js +11 -0
  119. package/dist/page-edit.d.ts +12 -0
  120. package/dist/page-edit.js +13 -0
  121. package/dist/page-view/PageView.svelte +192 -0
  122. package/dist/page-view/PageView.svelte.d.ts +4 -0
  123. package/dist/page-view/props.d.ts +32 -0
  124. package/dist/page-view/props.js +1 -0
  125. package/dist/page-view.d.ts +8 -0
  126. package/dist/page-view.js +7 -0
  127. package/dist/redaction/readers.d.ts +37 -0
  128. package/dist/redaction/readers.js +38 -0
  129. package/dist/redaction.d.ts +12 -0
  130. package/dist/redaction.js +13 -0
  131. package/dist/render/RenderLayer.svelte +116 -0
  132. package/dist/render/RenderLayer.svelte.d.ts +4 -0
  133. package/dist/render/TileImage.svelte +65 -0
  134. package/dist/render/TileImage.svelte.d.ts +11 -0
  135. package/dist/render/TilePlane.svelte +88 -0
  136. package/dist/render/TilePlane.svelte.d.ts +7 -0
  137. package/dist/render/props.d.ts +16 -0
  138. package/dist/render/props.js +1 -0
  139. package/dist/render/readers.svelte.d.ts +9 -0
  140. package/dist/render/readers.svelte.js +13 -0
  141. package/dist/render.d.ts +10 -0
  142. package/dist/render.js +10 -0
  143. package/dist/runtime/DocumentGate.svelte +26 -0
  144. package/dist/runtime/DocumentGate.svelte.d.ts +4 -0
  145. package/dist/runtime/DocumentScope.svelte +14 -0
  146. package/dist/runtime/DocumentScope.svelte.d.ts +4 -0
  147. package/dist/runtime/KernelProvider.svelte +33 -0
  148. package/dist/runtime/KernelProvider.svelte.d.ts +4 -0
  149. package/dist/runtime/SvgShapes.svelte +30 -0
  150. package/dist/runtime/SvgShapes.svelte.d.ts +8 -0
  151. package/dist/runtime/Viewer.svelte +124 -0
  152. package/dist/runtime/Viewer.svelte.d.ts +4 -0
  153. package/dist/runtime/binding.svelte.d.ts +33 -0
  154. package/dist/runtime/binding.svelte.js +71 -0
  155. package/dist/runtime/capability-handle.d.ts +6 -0
  156. package/dist/runtime/capability-handle.js +71 -0
  157. package/dist/runtime/dev.d.ts +10 -0
  158. package/dist/runtime/dev.js +23 -0
  159. package/dist/runtime/documents.svelte.d.ts +34 -0
  160. package/dist/runtime/documents.svelte.js +49 -0
  161. package/dist/runtime/page-layers.svelte.d.ts +20 -0
  162. package/dist/runtime/page-layers.svelte.js +40 -0
  163. package/dist/runtime/page.d.ts +10 -0
  164. package/dist/runtime/page.js +23 -0
  165. package/dist/runtime/props.d.ts +63 -0
  166. package/dist/runtime/props.js +1 -0
  167. package/dist/runtime/readers.svelte.d.ts +47 -0
  168. package/dist/runtime/readers.svelte.js +122 -0
  169. package/dist/runtime/state.svelte.d.ts +35 -0
  170. package/dist/runtime/state.svelte.js +90 -0
  171. package/dist/runtime/theme.d.ts +12 -0
  172. package/dist/runtime/theme.js +15 -0
  173. package/dist/runtime/values.svelte.d.ts +28 -0
  174. package/dist/runtime/values.svelte.js +51 -0
  175. package/dist/runtime.d.ts +26 -0
  176. package/dist/runtime.js +25 -0
  177. package/dist/search/SearchLayer.svelte +94 -0
  178. package/dist/search/SearchLayer.svelte.d.ts +4 -0
  179. package/dist/search/props.d.ts +11 -0
  180. package/dist/search/props.js +1 -0
  181. package/dist/search/readers.svelte.d.ts +41 -0
  182. package/dist/search/readers.svelte.js +40 -0
  183. package/dist/search.d.ts +11 -0
  184. package/dist/search.js +11 -0
  185. package/dist/selection/SelectionClipboard.svelte +35 -0
  186. package/dist/selection/SelectionClipboard.svelte.d.ts +4 -0
  187. package/dist/selection/SelectionHandles.svelte +192 -0
  188. package/dist/selection/SelectionHandles.svelte.d.ts +4 -0
  189. package/dist/selection/SelectionLayer.svelte +67 -0
  190. package/dist/selection/SelectionLayer.svelte.d.ts +3 -0
  191. package/dist/selection/SelectionMenu.svelte +36 -0
  192. package/dist/selection/SelectionMenu.svelte.d.ts +4 -0
  193. package/dist/selection/props.d.ts +26 -0
  194. package/dist/selection/props.js +1 -0
  195. package/dist/selection/readers.svelte.d.ts +31 -0
  196. package/dist/selection/readers.svelte.js +26 -0
  197. package/dist/selection.d.ts +16 -0
  198. package/dist/selection.js +18 -0
  199. package/dist/shell/readers.svelte.d.ts +40 -0
  200. package/dist/shell/readers.svelte.js +40 -0
  201. package/dist/shell/surface-focus.svelte.d.ts +16 -0
  202. package/dist/shell/surface-focus.svelte.js +33 -0
  203. package/dist/shell.d.ts +12 -0
  204. package/dist/shell.js +11 -0
  205. package/dist/signature/readers.svelte.d.ts +43 -0
  206. package/dist/signature/readers.svelte.js +46 -0
  207. package/dist/signature.d.ts +15 -0
  208. package/dist/signature.js +16 -0
  209. package/dist/stage/PageSurface.svelte +126 -0
  210. package/dist/stage/PageSurface.svelte.d.ts +18 -0
  211. package/dist/stage/Scrollbar.svelte +148 -0
  212. package/dist/stage/Scrollbar.svelte.d.ts +4 -0
  213. package/dist/stage/Stage.svelte +181 -0
  214. package/dist/stage/Stage.svelte.d.ts +4 -0
  215. package/dist/stage/StageScope.svelte +14 -0
  216. package/dist/stage/StageScope.svelte.d.ts +9 -0
  217. package/dist/stage/props.d.ts +71 -0
  218. package/dist/stage/props.js +1 -0
  219. package/dist/stage/readers.svelte.d.ts +39 -0
  220. package/dist/stage/readers.svelte.js +84 -0
  221. package/dist/stage/stage-scope.d.ts +18 -0
  222. package/dist/stage/stage-scope.js +35 -0
  223. package/dist/stage/two-way.svelte.d.ts +13 -0
  224. package/dist/stage/two-way.svelte.js +26 -0
  225. package/dist/stage.d.ts +17 -0
  226. package/dist/stage.js +15 -0
  227. package/dist/stamp/readers.svelte.d.ts +50 -0
  228. package/dist/stamp/readers.svelte.js +76 -0
  229. package/dist/stamp.d.ts +16 -0
  230. package/dist/stamp.js +18 -0
  231. package/dist/toolbar/DefaultCollapsed.svelte +39 -0
  232. package/dist/toolbar/DefaultCollapsed.svelte.d.ts +9 -0
  233. package/dist/toolbar/DefaultCommand.svelte +33 -0
  234. package/dist/toolbar/DefaultCommand.svelte.d.ts +8 -0
  235. package/dist/toolbar/DefaultGroupTrigger.svelte +39 -0
  236. package/dist/toolbar/DefaultGroupTrigger.svelte.d.ts +9 -0
  237. package/dist/toolbar/DefaultOverflowMenu.svelte +106 -0
  238. package/dist/toolbar/DefaultOverflowMenu.svelte.d.ts +9 -0
  239. package/dist/toolbar/DefaultOverflowTrigger.svelte +25 -0
  240. package/dist/toolbar/DefaultOverflowTrigger.svelte.d.ts +7 -0
  241. package/dist/toolbar/Measured.svelte +46 -0
  242. package/dist/toolbar/Measured.svelte.d.ts +11 -0
  243. package/dist/toolbar/NativeSlotSocket.svelte +43 -0
  244. package/dist/toolbar/NativeSlotSocket.svelte.d.ts +11 -0
  245. package/dist/toolbar/Toolbar.svelte +314 -0
  246. package/dist/toolbar/Toolbar.svelte.d.ts +4 -0
  247. package/dist/toolbar/paint.d.ts +3 -0
  248. package/dist/toolbar/paint.js +9 -0
  249. package/dist/toolbar/props.d.ts +48 -0
  250. package/dist/toolbar/props.js +1 -0
  251. package/dist/toolbar/strip.svelte.d.ts +14 -0
  252. package/dist/toolbar/strip.svelte.js +35 -0
  253. package/dist/toolbar/views.d.ts +14 -0
  254. package/dist/toolbar/views.js +1 -0
  255. package/dist/toolbar.d.ts +16 -0
  256. package/dist/toolbar.js +12 -0
  257. package/dist/view-manager/readers.d.ts +19 -0
  258. package/dist/view-manager/readers.js +17 -0
  259. package/dist/view-manager.d.ts +11 -0
  260. package/dist/view-manager.js +12 -0
  261. package/package.json +195 -3
@@ -0,0 +1,17 @@
1
+ /** The props of `<LinkLayer>`. */
2
+ import type { Snippet } from 'svelte';
3
+ import type { Link } from '@embedpdf/plugin-link';
4
+ /** What the `link` snippet receives for each link. */
5
+ export interface LinkRenderProps {
6
+ /** The link: its `id`, its `bounds` on the page and its `target`. */
7
+ link: Link;
8
+ /** The layer's own clickable area, `{@render native()}`: wrap it to keep what a click does. */
9
+ native: Snippet;
10
+ }
11
+ export interface LinkLayerProps {
12
+ /**
13
+ * Draw each link yourself, usually around `{@render native()}`. To leave a link as it is,
14
+ * render only `native` for it.
15
+ */
16
+ link?: Snippet<[props: LinkRenderProps]>;
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { EventHook } from '@embedpdf/core';
2
+ import type { LinkCapability } from '@embedpdf/plugin-link';
3
+ /**
4
+ * Hand the link plugin this binding's website opener (`openExternalUri`) while the component
5
+ * lives: an allowed address opens in a new tab, anything else is refused and the plugin reports
6
+ * it. Registered again for each document.
7
+ */
8
+ export declare function useUriOpener(): void;
9
+ /**
10
+ * The link API (`listLinks()`, `activate()`, …) for app code. While a component uses it,
11
+ * `activate()` opens a website in a new tab.
12
+ */
13
+ export declare function useLink(): LinkCapability;
14
+ /**
15
+ * Subscribe to one link event while the component lives:
16
+ * `useLinkEvent((link) => link.onActivated, handler)`.
17
+ */
18
+ export declare function useLinkEvent<T>(select: (link: LinkCapability) => EventHook<T>, handler: (event: T) => void): void;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The link plugin's readers: `useLink()` (the API) and `useLinkEvent()`, and the website opener
3
+ * this binding hands the plugin while a link component is mounted.
4
+ */
5
+ import { untrack } from 'svelte';
6
+ import { LinkToken } from '@embedpdf/plugin-link';
7
+ import { LinkToken as LinkHostToken } from '@embedpdf/plugin-link/contract/host';
8
+ import { openExternalUri } from '@embedpdf/web';
9
+ import { useCapability, useCapabilityEvent, useOptionalCapability, } from '../runtime/readers.svelte.js';
10
+ /**
11
+ * Hand the link plugin this binding's website opener (`openExternalUri`) while the component
12
+ * lives: an allowed address opens in a new tab, anything else is refused and the plugin reports
13
+ * it. Registered again for each document.
14
+ */
15
+ export function useUriOpener() {
16
+ const host = useOptionalCapability(LinkHostToken);
17
+ $effect(() => {
18
+ const current = host.current;
19
+ if (!current)
20
+ return;
21
+ return untrack(() => current.registerUriOpener(openExternalUri));
22
+ });
23
+ }
24
+ /**
25
+ * The link API (`listLinks()`, `activate()`, …) for app code. While a component uses it,
26
+ * `activate()` opens a website in a new tab.
27
+ */
28
+ export function useLink() {
29
+ useUriOpener();
30
+ return useCapability(LinkToken);
31
+ }
32
+ /**
33
+ * Subscribe to one link event while the component lives:
34
+ * `useLinkEvent((link) => link.onActivated, handler)`.
35
+ */
36
+ export function useLinkEvent(select, handler) {
37
+ useCapabilityEvent(LinkToken, select, handler);
38
+ }
package/dist/link.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @embedpdf/svelte/link — following links.
3
+ *
4
+ * `<LinkLayer>` puts a real anchor over each link on a page (draw around it with its `link`
5
+ * snippet); `useLink()` is the plugin's API and opens websites while it's in use, and
6
+ * `useLinkEvent()` its events.
7
+ */
8
+ export * from '@embedpdf/plugin-link';
9
+ export { default as LinkLayer } from './link/LinkLayer.svelte';
10
+ export type { LinkLayerProps, LinkRenderProps } from './link/props.js';
11
+ export { useLink, useLinkEvent } from './link/readers.svelte.js';
package/dist/link.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @embedpdf/svelte/link — following links.
3
+ *
4
+ * `<LinkLayer>` puts a real anchor over each link on a page (draw around it with its `link`
5
+ * snippet); `useLink()` is the plugin's API and opens websites while it's in use, and
6
+ * `useLinkEvent()` its events.
7
+ */
8
+ // Registration travels with the UI.
9
+ export * from '@embedpdf/plugin-link';
10
+ export { default as LinkLayer } from './link/LinkLayer.svelte';
11
+ export { useLink, useLinkEvent } from './link/readers.svelte.js';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The measurement plugin's readers: `useMeasurement()` (the API), `useMeasurementState()`,
3
+ * `useMeasurementSettings()`, `useMeasurementEvent()`, and one per page scale and one per
4
+ * measurement, so a template updates only for its own page or measurement. Every one works before
5
+ * a document opens.
6
+ */
7
+ import type { EventHook, PageRef } from '@embedpdf/core';
8
+ import type { AnnotationRef, MeasurementCapability, MeasurementReadout, MeasurementUnavailable, PageScale } from '@embedpdf/plugin-measurement';
9
+ import { type CurrentValue, type MaybeGetter } from '../runtime/values.svelte.js';
10
+ /**
11
+ * The measurement API (scales, calibration, readouts, creating measurements) of the nearest
12
+ * `<DocumentScope>`'s document, else the active one. Outside a ready document every method throws
13
+ * `not-ready`.
14
+ */
15
+ export declare function useMeasurement(): MeasurementCapability;
16
+ /** Subscribe to one measurement event while the component lives: `useMeasurementEvent((measurement) => measurement.onScaleChanged, handler)`. */
17
+ export declare function useMeasurementEvent<T>(select: (measurement: MeasurementCapability) => EventHook<T>, handler: (event: T) => void): void;
18
+ /**
19
+ * The measurement state: whether a scale change runs, the calibration request waiting for its
20
+ * length, and the last change's reports (the page's State table, declared once in
21
+ * `measurementState`), as a reactive object (`state.calibrationRequest`). With a selector, the
22
+ * value it picks as `{ current }`. Empty without a document.
23
+ */
24
+ export declare const useMeasurementState: import("../index.js").StateReader<{
25
+ busy: boolean;
26
+ calibrationRequest: import("@embedpdf/plugin-measurement").CalibrationRequest | null;
27
+ lastReports: readonly import("@embedpdf/plugin-measurement").ScaleChangeReport[];
28
+ }>;
29
+ /** The measurement settings (`defaultScale`, `presets`), with or without a document. */
30
+ export declare const useMeasurementSettings: import("../index.js").SettingsReader<import("@embedpdf/plugin-measurement").MeasurementSettings & object>;
31
+ /**
32
+ * A page's measurement scale (its ref or its index; a function to follow a prop) as
33
+ * `{ current }`: for a scale bar or a "1:100" badge. Accepts `null` (no current page) and answers
34
+ * `null` then, so chrome can stay mounted without inventing a page.
35
+ */
36
+ export declare function usePageScale(page: MaybeGetter<PageRef | number>): CurrentValue<PageScale>;
37
+ export declare function usePageScale(page: MaybeGetter<PageRef | number | null>): CurrentValue<PageScale | null>;
38
+ /**
39
+ * A measurement's `{ kind, value, label }` as `{ current }`, or `{ unavailable }` with why there's
40
+ * none. A measurement that changes is a function: `useMeasurementReadout(() => annotation)`.
41
+ * Readouts are reference-stable in the plugin, so the value changes only when the measurement's
42
+ * does.
43
+ */
44
+ export declare function useMeasurementReadout(ref: MaybeGetter<AnnotationRef>): CurrentValue<MeasurementReadout | MeasurementUnavailable>;
@@ -0,0 +1,46 @@
1
+ import { MeasurementToken, measurementState, NO_PAGE_SCALE, NO_READOUT, } from '@embedpdf/plugin-measurement';
2
+ import { documentScopeOf } from '../runtime/binding.svelte.js';
3
+ import { useCapability, useCapabilityEvent, useKernelValue, useOptionalSelector, } from '../runtime/readers.svelte.js';
4
+ import { settingsReader, stateReader } from '../runtime/state.svelte.js';
5
+ import { valueOf } from '../runtime/values.svelte.js';
6
+ /**
7
+ * The measurement API (scales, calibration, readouts, creating measurements) of the nearest
8
+ * `<DocumentScope>`'s document, else the active one. Outside a ready document every method throws
9
+ * `not-ready`.
10
+ */
11
+ export function useMeasurement() {
12
+ return useCapability(MeasurementToken);
13
+ }
14
+ /** Subscribe to one measurement event while the component lives: `useMeasurementEvent((measurement) => measurement.onScaleChanged, handler)`. */
15
+ export function useMeasurementEvent(select, handler) {
16
+ useCapabilityEvent(MeasurementToken, select, handler);
17
+ }
18
+ /**
19
+ * The measurement state: whether a scale change runs, the calibration request waiting for its
20
+ * length, and the last change's reports (the page's State table, declared once in
21
+ * `measurementState`), as a reactive object (`state.calibrationRequest`). With a selector, the
22
+ * value it picks as `{ current }`. Empty without a document.
23
+ */
24
+ export const useMeasurementState = stateReader(measurementState);
25
+ /** The measurement settings (`defaultScale`, `presets`), with or without a document. */
26
+ export const useMeasurementSettings = settingsReader(MeasurementToken);
27
+ export function usePageScale(page) {
28
+ const scoped = documentScopeOf();
29
+ // Scales are reference-stable in the plugin, so the value changes only when this page's does.
30
+ return useKernelValue((kernel) => {
31
+ const wanted = valueOf(page);
32
+ if (wanted === null)
33
+ return null;
34
+ return (kernel.tryCapability(MeasurementToken, scoped() ?? undefined)?.getPageScale(wanted) ??
35
+ NO_PAGE_SCALE);
36
+ });
37
+ }
38
+ /**
39
+ * A measurement's `{ kind, value, label }` as `{ current }`, or `{ unavailable }` with why there's
40
+ * none. A measurement that changes is a function: `useMeasurementReadout(() => annotation)`.
41
+ * Readouts are reference-stable in the plugin, so the value changes only when the measurement's
42
+ * does.
43
+ */
44
+ export function useMeasurementReadout(ref) {
45
+ return useOptionalSelector(MeasurementToken, (measurement) => measurement.getReadout(valueOf(ref)), NO_READOUT);
46
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @embedpdf/svelte/measurement — distances, perimeters and areas in the page's scale.
3
+ *
4
+ * Measuring rides the annotation plugin (the `distance`, `perimeter` and `area` tools draw on its
5
+ * `<AnnotationLayer>`); these readers surface the scale, the calibration and the readouts:
6
+ *
7
+ * const measurement = useMeasurement();
8
+ * const scale = usePageScale(0); // scale.current: the cover's
9
+ * const readout = useMeasurementReadout(() => annotation); // readout.current.label
10
+ */
11
+ export * from '@embedpdf/plugin-measurement';
12
+ export { useMeasurement, useMeasurementEvent, useMeasurementReadout, useMeasurementSettings, useMeasurementState, usePageScale, } from './measurement/readers.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @embedpdf/svelte/measurement — distances, perimeters and areas in the page's scale.
3
+ *
4
+ * Measuring rides the annotation plugin (the `distance`, `perimeter` and `area` tools draw on its
5
+ * `<AnnotationLayer>`); these readers surface the scale, the calibration and the readouts:
6
+ *
7
+ * const measurement = useMeasurement();
8
+ * const scale = usePageScale(0); // scale.current: the cover's
9
+ * const readout = useMeasurementReadout(() => annotation); // readout.current.label
10
+ */
11
+ // Registration travels with the UI.
12
+ export * from '@embedpdf/plugin-measurement';
13
+ export { useMeasurement, useMeasurementEvent, useMeasurementReadout, useMeasurementSettings, useMeasurementState, usePageScale, } from './measurement/readers.js';
@@ -0,0 +1,22 @@
1
+ /** The metadata's readers: the API, the state declared once in `metadataState`, and its events. */
2
+ import type { EventHook } from '@embedpdf/core';
3
+ import type { MetadataCapability } from '@embedpdf/plugin-metadata';
4
+ /**
5
+ * The metadata API (`update`, `custom.update`, `refresh`, `canUpdate`) of the nearest
6
+ * `<DocumentScope>`'s document, else the active one. Outside a ready document, every method
7
+ * throws `not-ready`. `canUpdate()` is a read, so `disabled={!metadata.canUpdate()}` updates by
8
+ * itself.
9
+ */
10
+ export declare function useMetadata(): MetadataCapability;
11
+ /**
12
+ * The standard fields, your own fields and their load state (the page's State table, declared
13
+ * once in `metadataState`), as a reactive object: `state.metadata?.title`. With a selector, the
14
+ * value it picks as `{ current }`, which changes only when that value does.
15
+ */
16
+ export declare const useMetadataState: import("../index.js").StateReader<{
17
+ metadata: import("@embedpdf/core").DocumentMetadata | null;
18
+ custom: import("@embedpdf/core").CustomMetadata | null;
19
+ status: import("@embedpdf/core").ResourceStatus;
20
+ }>;
21
+ /** Subscribe to one metadata event while the component lives: `useMetadataEvent((metadata) => metadata.onUpdated, handler)`. */
22
+ export declare function useMetadataEvent<T>(select: (metadata: MetadataCapability) => EventHook<T>, handler: (event: T) => void): void;
@@ -0,0 +1,22 @@
1
+ import { MetadataToken, metadataState } from '@embedpdf/plugin-metadata';
2
+ import { useCapability, useCapabilityEvent } from '../runtime/readers.svelte.js';
3
+ import { stateReader } from '../runtime/state.svelte.js';
4
+ /**
5
+ * The metadata API (`update`, `custom.update`, `refresh`, `canUpdate`) of the nearest
6
+ * `<DocumentScope>`'s document, else the active one. Outside a ready document, every method
7
+ * throws `not-ready`. `canUpdate()` is a read, so `disabled={!metadata.canUpdate()}` updates by
8
+ * itself.
9
+ */
10
+ export function useMetadata() {
11
+ return useCapability(MetadataToken);
12
+ }
13
+ /**
14
+ * The standard fields, your own fields and their load state (the page's State table, declared
15
+ * once in `metadataState`), as a reactive object: `state.metadata?.title`. With a selector, the
16
+ * value it picks as `{ current }`, which changes only when that value does.
17
+ */
18
+ export const useMetadataState = stateReader(metadataState);
19
+ /** Subscribe to one metadata event while the component lives: `useMetadataEvent((metadata) => metadata.onUpdated, handler)`. */
20
+ export function useMetadataEvent(select, handler) {
21
+ useCapabilityEvent(MetadataToken, select, handler);
22
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @embedpdf/svelte/metadata — the document's properties and your own fields.
3
+ *
4
+ * The plugin keeps the metadata live off the document's event stream, so the state follows your
5
+ * own edits and other sessions':
6
+ *
7
+ * const metadata = useMetadata();
8
+ * const state = useMetadataState(); // state.metadata, state.custom, state.status
9
+ * await metadata.update({ title: 'New title' }); // resolves once the state shows it
10
+ */
11
+ export * from '@embedpdf/plugin-metadata';
12
+ export { useMetadata, useMetadataEvent, useMetadataState } from './metadata/readers.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @embedpdf/svelte/metadata — the document's properties and your own fields.
3
+ *
4
+ * The plugin keeps the metadata live off the document's event stream, so the state follows your
5
+ * own edits and other sessions':
6
+ *
7
+ * const metadata = useMetadata();
8
+ * const state = useMetadataState(); // state.metadata, state.custom, state.status
9
+ * await metadata.update({ title: 'New title' }); // resolves once the state shows it
10
+ */
11
+ // Registration travels with the UI.
12
+ export * from '@embedpdf/plugin-metadata';
13
+ export { useMetadata, useMetadataEvent, useMetadataState } from './metadata/readers.js';
@@ -0,0 +1,7 @@
1
+ import type { PageEditCapability } from '@embedpdf/plugin-page-edit';
2
+ /**
3
+ * The page edits of the nearest `<DocumentScope>`'s document, else the active one. Outside a
4
+ * ready document, every method throws `not-ready`. `canEdit()` and `canExtract()` are reads, so
5
+ * `disabled={!pageEdit.canEdit()}` updates by itself.
6
+ */
7
+ export declare function usePageEdit(): PageEditCapability;
@@ -0,0 +1,11 @@
1
+ /** The page edits' reader: the API. The plugin has no state of its own; the pages are the document's. */
2
+ import { PageEditToken } from '@embedpdf/plugin-page-edit';
3
+ import { useCapability } from '../runtime/readers.svelte.js';
4
+ /**
5
+ * The page edits of the nearest `<DocumentScope>`'s document, else the active one. Outside a
6
+ * ready document, every method throws `not-ready`. `canEdit()` and `canExtract()` are reads, so
7
+ * `disabled={!pageEdit.canEdit()}` updates by itself.
8
+ */
9
+ export function usePageEdit() {
10
+ return useCapability(PageEditToken);
11
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @embedpdf/svelte/page-edit — rotate, move, insert, delete and extract pages.
3
+ *
4
+ * The plugin turns a page relative to its rotation and resolves placements, so this is binding
5
+ * only. The pages themselves come from `usePageList()` (`@embedpdf/svelte/runtime`), which
6
+ * follows every edit:
7
+ *
8
+ * const pageEdit = usePageEdit();
9
+ * await pageEdit.rotateBy([page.ref], 90);
10
+ */
11
+ export * from '@embedpdf/plugin-page-edit';
12
+ export { usePageEdit } from './page-edit/readers.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @embedpdf/svelte/page-edit — rotate, move, insert, delete and extract pages.
3
+ *
4
+ * The plugin turns a page relative to its rotation and resolves placements, so this is binding
5
+ * only. The pages themselves come from `usePageList()` (`@embedpdf/svelte/runtime`), which
6
+ * follows every edit:
7
+ *
8
+ * const pageEdit = usePageEdit();
9
+ * await pageEdit.rotateBy([page.ref], 90);
10
+ */
11
+ // Registration travels with the UI.
12
+ export * from '@embedpdf/plugin-page-edit';
13
+ export { usePageEdit } from './page-edit/readers.js';
@@ -0,0 +1,192 @@
1
+ <!--
2
+ One page on its own, with no Stage: the same layers, rotation and chrome frame as a `<Stage>`
3
+ page, but no camera, scrolling or zoom, and no need for the stage plugin.
4
+
5
+ It builds the page's transform from a width, and provides the same page context a Stage page
6
+ does, so every layer (`<RenderLayer>`, the selection, search matches) works here unchanged. It
7
+ provides a projection too, measured from the page element in client space, so anchored UI (a
8
+ selection menu) works here as well: it sits on `<body>`, where no card or scrolling list clips it.
9
+ -->
10
+ <script lang="ts">
11
+ import { toPageRef } from '@embedpdf/core';
12
+ import { pageTransform, type PageFrame } from '@embedpdf/core-geometry';
13
+ import {
14
+ clientPageProjector,
15
+ livePageContext,
16
+ makePageContext,
17
+ observeClientGeometry,
18
+ pageSurfaceLayout,
19
+ pageViewTransformInput,
20
+ paint,
21
+ } from '@embedpdf/web';
22
+ import {
23
+ setProjectorBinding,
24
+ setShownPages,
25
+ type ProjectorBinding,
26
+ type ShownPages,
27
+ } from '../anchored/context.js';
28
+ import { InteractionToken as InteractionHostToken } from '@embedpdf/plugin-interaction/contract/host';
29
+ import PagePointerSource from '../interaction/PagePointerSource.svelte';
30
+ import DocumentScope from '../runtime/DocumentScope.svelte';
31
+ import { useViewerSettings } from '../runtime/documents.svelte.js';
32
+ import { setPageContext } from '../runtime/page.js';
33
+ import { useDocumentId, useKernelValue, useOptionalCapability } from '../runtime/readers.svelte.js';
34
+ import type { PageViewProps } from './props.js';
35
+
36
+ let {
37
+ page: wanted,
38
+ documentId,
39
+ fallback,
40
+ width = 240,
41
+ pageFrame: framePatch,
42
+ children,
43
+ pageChrome,
44
+ class: className,
45
+ style,
46
+ }: PageViewProps = $props();
47
+
48
+ // The document a <DocumentScope> around it names, else the active one.
49
+ const inScope = useDocumentId();
50
+ const docId = $derived(documentId ?? inScope.current);
51
+ // With the interaction plugin registered, the page view is the page's pointer surface.
52
+ const interaction = useOptionalCapability(InteractionHostToken);
53
+
54
+ // The page asked for: by its ref (which follows it when pages move) or by its index.
55
+ const wantedObjectNumber = $derived(typeof wanted === 'number' ? null : wanted.objectNumber);
56
+ const wantedIndex = $derived(typeof wanted === 'number' ? wanted : null);
57
+
58
+ // The page's entry in the document's page list, subscribed: a rotation or a move redraws this
59
+ // surface as it redraws a Stage page. Entries keep their identity until the page changes.
60
+ const base = useKernelValue((kernel) => {
61
+ if (!docId) return null;
62
+ const pages = kernel.documents.listPages(docId);
63
+ const found =
64
+ wantedObjectNumber !== null
65
+ ? pages.find((info) => info.ref.objectNumber === wantedObjectNumber)
66
+ : pages[wantedIndex ?? 0];
67
+ return found ?? null;
68
+ });
69
+
70
+ const pageIndex = $derived(base.current?.index ?? wantedIndex ?? 0);
71
+ // The page's address is the document's; a stand-in (object number = index + 1) only until the
72
+ // page list is known, and the fallback shows until then anyway. Derived from the number, so
73
+ // the context's `ref` keeps its identity while the number stays (layers key work on it).
74
+ const pageObjectNumber = $derived(
75
+ base.current?.ref.objectNumber ?? wantedObjectNumber ?? pageIndex + 1,
76
+ );
77
+ const pageRef = $derived(toPageRef(pageObjectNumber));
78
+
79
+ // The sides left out reserve nothing; built from the four numbers, so an equal frame passed
80
+ // again as a new object changes nothing.
81
+ const frameTop = $derived(framePatch?.top ?? 0);
82
+ const frameRight = $derived(framePatch?.right ?? 0);
83
+ const frameBottom = $derived(framePatch?.bottom ?? 0);
84
+ const frameLeft = $derived(framePatch?.left ?? 0);
85
+ const frame: PageFrame = $derived({
86
+ top: frameTop,
87
+ right: frameRight,
88
+ bottom: frameBottom,
89
+ left: frameLeft,
90
+ });
91
+
92
+ // What the transform depends on, each a value of its own, so an entry that changed something
93
+ // else keeps the transform.
94
+ const pageWidth = $derived(base.current?.size.width ?? null);
95
+ const pageHeight = $derived(base.current?.size.height ?? null);
96
+ const userUnit = $derived(base.current?.userUnit ?? 1);
97
+ const rotation = $derived(base.current?.rotation ?? 0);
98
+
99
+ // No camera: the transform comes from the width asked for (`pageViewTransformInput` from
100
+ // `@embedpdf/web`, the same in every framework).
101
+ const transform = $derived(
102
+ pageTransform(
103
+ pageViewTransformInput(
104
+ pageWidth !== null && pageHeight !== null
105
+ ? { size: { width: pageWidth, height: pageHeight }, rotation, userUnit }
106
+ : null,
107
+ width,
108
+ typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1,
109
+ ),
110
+ ),
111
+ );
112
+
113
+ // The page content box, once it's in the DOM: the client conversions measure it, and the
114
+ // projection answers nothing until it's there.
115
+ let contentElement = $state<HTMLDivElement | null>(null);
116
+
117
+ // This instance's view identity: two page views of one page (a compare strip) plan their
118
+ // rasters apart, as two stage lenses do.
119
+ const viewId = $props.id();
120
+ const context = $derived(
121
+ makePageContext(docId ?? '', `page-view:${viewId}`, pageRef, pageIndex, frame, transform, () =>
122
+ contentElement!.getBoundingClientRect(),
123
+ ),
124
+ );
125
+ const live = livePageContext(() => context);
126
+ setPageContext(live);
127
+
128
+ // The projection: no camera, so anchored UI is placed by measuring the page element in client
129
+ // space. `mounted` reads the element, a state value, so a placement computed before the
130
+ // element existed is computed again once it does. A new context (a new transform or page) is
131
+ // the binding's revision; `observeClientGeometry` reports what no state announces (the
132
+ // document scrolled, the window resized).
133
+ const projectorBinding: ProjectorBinding = $derived({
134
+ projector: clientPageProjector(context, () => contentElement !== null),
135
+ revision: context,
136
+ subscribe: observeClientGeometry,
137
+ });
138
+ setProjectorBinding(() => projectorBinding);
139
+ // A page view shows its one page.
140
+ const shownPages: ShownPages = $derived(new Set([pageObjectNumber]));
141
+ setShownPages(() => shownPages);
142
+
143
+ // The viewer's `page` settings; `--epdf-page-*` CSS variables win over them.
144
+ const look = useViewerSettings((settings) => settings.page);
145
+
146
+ // The outer box, the shadow at the footprint, and the content box centred on it and turned
147
+ // about its centre, as on a Stage page.
148
+ const layout = $derived(pageSurfaceLayout(transform, frame));
149
+ </script>
150
+
151
+ {#if docId && base.current}
152
+ <DocumentScope id={docId}>
153
+ <div
154
+ class={className}
155
+ style="position: relative; width: {layout.outer.width}px; height: {layout.outer
156
+ .height}px;{style ? ` ${style}` : ''}"
157
+ >
158
+ <!-- The drop shadow only: at the footprint, with no fill, so it never shows behind the
159
+ picture, and it stays put while the page turns. -->
160
+ <div
161
+ style:position="absolute"
162
+ style:left="{layout.shadow.left}px"
163
+ style:top="{layout.shadow.top}px"
164
+ style:width="{layout.shadow.width}px"
165
+ style:height="{layout.shadow.height}px"
166
+ style:box-shadow={paint('page-shadow', look.current.shadow)}
167
+ ></div>
168
+ <!-- The page: its background and its layers as one box, the only thing the rotation turns.
169
+ Native text and image selection is off: the selection layer draws its own. -->
170
+ <div
171
+ bind:this={contentElement}
172
+ style="user-select: none; -webkit-user-select: none"
173
+ style:position="absolute"
174
+ style:left="{layout.content.left}px"
175
+ style:top="{layout.content.top}px"
176
+ style:width="{layout.content.width}px"
177
+ style:height="{layout.content.height}px"
178
+ style:background={paint('page-background', look.current.background)}
179
+ style:transform={layout.turn ?? undefined}
180
+ >
181
+ <!-- The page's pointer surface, below the layers, like the Stage's own listener: a press
182
+ on a layer that lets the pointer through reaches the tools, a link keeps its own. -->
183
+ {#if interaction.current}<PagePointerSource />{/if}
184
+ {@render children(live)}
185
+ </div>
186
+ <!-- The page chrome fills the outer box and never turns. -->
187
+ {@render pageChrome?.(live)}
188
+ </div>
189
+ </DocumentScope>
190
+ {:else}
191
+ {@render fallback?.()}
192
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { PageViewProps } from './props.js';
2
+ declare const PageView: import("svelte").Component<PageViewProps, {}, "">;
3
+ type PageView = ReturnType<typeof PageView>;
4
+ export default PageView;
@@ -0,0 +1,32 @@
1
+ /** The props of `<PageView>`. */
2
+ import type { Snippet } from 'svelte';
3
+ import type { PageRef } from '@embedpdf/core';
4
+ import type { PageFrame } from '@embedpdf/core-geometry';
5
+ import type { PageContextValue } from '../runtime/page.js';
6
+ export interface PageViewProps {
7
+ /** The page: its `ref`, which follows it when pages move, or its index, from 0. */
8
+ page: PageRef | number;
9
+ /** Which document to show. Defaults to the active document. */
10
+ documentId?: string;
11
+ /** Shown while the document or the page is not available yet (default: nothing). */
12
+ fallback?: Snippet;
13
+ /** The width of the page upright, in pixels: a page turned a quarter is that tall. Default 240. */
14
+ width?: number;
15
+ /** Space reserved around the page for your own labels, in pixels per side; the sides left out are 0. */
16
+ pageFrame?: Partial<PageFrame>;
17
+ /**
18
+ * Page-space content (`<RenderLayer>`, the selection, search matches): what you write between
19
+ * `<PageView>` and `</PageView>`, or `{#snippet children(page)}` when it needs the page. It turns
20
+ * with the page, and positions are PDF points.
21
+ */
22
+ children: Snippet<[page: PageContextValue]>;
23
+ /**
24
+ * Box-space chrome (a label, a border) drawn into the outer box, page and `pageFrame`. It never
25
+ * turns, like `<Stage>`'s `pageChrome`.
26
+ */
27
+ pageChrome?: Snippet<[page: PageContextValue]>;
28
+ /** On the outer box, after its own. */
29
+ class?: string;
30
+ /** On the outer box, after its own. */
31
+ style?: string;
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @embedpdf/svelte/page-view — one page on its own, with no Stage.
3
+ *
4
+ * `<PageView>` shows a page anywhere in an app (a preview in a card, a page picker) with the same
5
+ * layers, rotation and chrome frame as a Stage page, and anchored UI that works inside it.
6
+ */
7
+ export { default as PageView } from './page-view/PageView.svelte';
8
+ export type { PageViewProps } from './page-view/props.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @embedpdf/svelte/page-view — one page on its own, with no Stage.
3
+ *
4
+ * `<PageView>` shows a page anywhere in an app (a preview in a card, a page picker) with the same
5
+ * layers, rotation and chrome frame as a Stage page, and anchored UI that works inside it.
6
+ */
7
+ export { default as PageView } from './page-view/PageView.svelte';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The redaction plugin's readers: `useRedaction()` (the API), `useRedactionState()`,
3
+ * `useRedactionSettings()`, `useRedactionEvent()`, and `usePendingRedactions()` for a list of the
4
+ * marks waiting to be applied.
5
+ */
6
+ import type { EventHook } from '@embedpdf/core';
7
+ import { redactionState } from '@embedpdf/plugin-redaction';
8
+ import type { RedactionCapability, RedactionMark, RedactionMarkFilter } from '@embedpdf/plugin-redaction';
9
+ import { type StateReader } from '../runtime/state.svelte.js';
10
+ import { type CurrentValue, type MaybeGetter } from '../runtime/values.svelte.js';
11
+ /**
12
+ * The redaction API (marking, the pending marks, applying them) of the nearest
13
+ * `<DocumentScope>`'s document, else the active one. Outside a ready document every method throws
14
+ * `not-ready`.
15
+ */
16
+ export declare function useRedaction(): RedactionCapability;
17
+ /** Subscribe to one redaction event while the component lives: `useRedactionEvent((redaction) => redaction.onApplied, handler)`. */
18
+ export declare function useRedactionEvent<T>(select: (redaction: RedactionCapability) => EventHook<T>, handler: (event: T) => void): void;
19
+ /**
20
+ * The redaction state: how many marks wait, whether marks are being applied, and the last apply's
21
+ * result (the page's State table, declared once in `redactionState`), as a reactive object
22
+ * (`state.pendingCount`). With a selector, the value it picks as `{ current }`. Empty without a
23
+ * document.
24
+ *
25
+ * Typed through the declaration, so the published types name it from `@embedpdf/plugin-redaction`, a
26
+ * dependency of this package, and not from the engine package `lastResult`'s type comes from, which
27
+ * isn't one.
28
+ */
29
+ export declare const useRedactionState: StateReader<ReturnType<typeof redactionState.read>>;
30
+ /** The redaction settings (`overlay`), with or without a document. */
31
+ export declare const useRedactionSettings: import("../index.js").SettingsReader<import("@embedpdf/plugin-redaction").RedactionSettings & object>;
32
+ /**
33
+ * The marks waiting to be applied, in page order, or one page's (its ref or its index; a function
34
+ * to follow a prop), as `{ current }`. The plugin's lists keep their identity until the marks
35
+ * change, so a list redraws only then. Empty without a document.
36
+ */
37
+ export declare function usePendingRedactions(filter?: MaybeGetter<RedactionMarkFilter | undefined>): CurrentValue<readonly RedactionMark[]>;