@embedpdf/plugin-capture 1.0.11 → 1.0.13

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 (39) hide show
  1. package/dist/index.cjs +2 -129
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +1 -46
  4. package/dist/index.js +21 -19
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/capture-plugin.d.ts +16 -0
  7. package/dist/lib/index.d.ts +7 -0
  8. package/dist/lib/manifest.d.ts +4 -0
  9. package/dist/lib/types.d.ts +23 -0
  10. package/dist/preact/adapter.d.ts +1 -0
  11. package/dist/preact/core.d.ts +1 -0
  12. package/dist/preact/index.cjs +2 -121
  13. package/dist/preact/index.cjs.map +1 -1
  14. package/dist/preact/index.d.ts +1 -37
  15. package/dist/preact/index.js +12 -12
  16. package/dist/preact/index.js.map +1 -1
  17. package/dist/preact/interaction-manager.d.ts +1 -0
  18. package/dist/react/adapter.d.ts +1 -0
  19. package/dist/react/core.d.ts +1 -0
  20. package/dist/react/index.cjs +2 -121
  21. package/dist/react/index.cjs.map +1 -1
  22. package/dist/react/index.d.ts +1 -37
  23. package/dist/react/index.js +12 -12
  24. package/dist/react/index.js.map +1 -1
  25. package/dist/react/interaction-manager.d.ts +1 -0
  26. package/dist/shared-preact/components/index.d.ts +1 -0
  27. package/dist/shared-preact/components/marquee-capture.d.ts +21 -0
  28. package/dist/shared-preact/hooks/index.d.ts +1 -0
  29. package/dist/shared-preact/hooks/use-capture.d.ts +11 -0
  30. package/dist/shared-preact/index.d.ts +2 -0
  31. package/dist/shared-react/components/index.d.ts +1 -0
  32. package/dist/shared-react/components/marquee-capture.d.ts +21 -0
  33. package/dist/shared-react/hooks/index.d.ts +1 -0
  34. package/dist/shared-react/hooks/use-capture.d.ts +11 -0
  35. package/dist/shared-react/index.d.ts +2 -0
  36. package/package.json +16 -14
  37. package/dist/index.d.cts +0 -46
  38. package/dist/preact/index.d.cts +0 -37
  39. package/dist/react/index.d.cts +0 -37
package/dist/index.d.cts DELETED
@@ -1,46 +0,0 @@
1
- import { BasePluginConfig, EventHook, BasePlugin, PluginRegistry, PluginManifest, PluginPackage } from '@embedpdf/core';
2
- import { ImageConversionTypes, Rect } from '@embedpdf/models';
3
-
4
- interface CapturePluginConfig extends BasePluginConfig {
5
- scale?: number;
6
- imageType?: ImageConversionTypes;
7
- withAnnotations?: boolean;
8
- }
9
- interface CaptureAreaEvent {
10
- pageIndex: number;
11
- rect: Rect;
12
- blob: Blob;
13
- imageType: ImageConversionTypes;
14
- scale: number;
15
- withAnnotations: boolean;
16
- }
17
- interface CaptureCapability {
18
- onCaptureArea: EventHook<CaptureAreaEvent>;
19
- captureArea(pageIndex: number, rect: Rect): void;
20
- enableMarqueeCapture: () => void;
21
- disableMarqueeCapture: () => void;
22
- toggleMarqueeCapture: () => void;
23
- isMarqueeCaptureActive: () => boolean;
24
- }
25
-
26
- declare class CapturePlugin extends BasePlugin<CapturePluginConfig, CaptureCapability> {
27
- static readonly id: "capture";
28
- private captureArea$;
29
- private renderCapability;
30
- private interactionManagerCapability;
31
- private config;
32
- constructor(id: string, registry: PluginRegistry, config: CapturePluginConfig);
33
- initialize(_: CapturePluginConfig): Promise<void>;
34
- protected buildCapability(): CaptureCapability;
35
- private captureArea;
36
- private enableMarqueeCapture;
37
- private disableMarqueeCapture;
38
- private toggleMarqueeCapture;
39
- }
40
-
41
- declare const CAPTURE_PLUGIN_ID = "capture";
42
- declare const manifest: PluginManifest<CapturePluginConfig>;
43
-
44
- declare const CapturePluginPackage: PluginPackage<CapturePlugin, CapturePluginConfig>;
45
-
46
- export { CAPTURE_PLUGIN_ID, type CaptureAreaEvent, type CaptureCapability, CapturePlugin, type CapturePluginConfig, CapturePluginPackage, manifest };
@@ -1,37 +0,0 @@
1
- import * as _embedpdf_plugin_capture from '@embedpdf/plugin-capture';
2
- import { CapturePlugin } from '@embedpdf/plugin-capture';
3
- import * as preact from 'preact';
4
-
5
- declare const useCaptureCapability: () => {
6
- provides: Readonly<_embedpdf_plugin_capture.CaptureCapability> | null;
7
- isLoading: boolean;
8
- ready: Promise<void>;
9
- };
10
- declare const useCapturePlugin: () => {
11
- plugin: CapturePlugin | null;
12
- isLoading: boolean;
13
- ready: Promise<void>;
14
- };
15
-
16
- interface MarqueeCaptureProps {
17
- /** Index of the page this layer lives on */
18
- pageIndex: number;
19
- /** Scale of the page */
20
- scale: number;
21
- /** Width of the page */
22
- pageWidth: number;
23
- /** Height of the page */
24
- pageHeight: number;
25
- /** Optional CSS class applied to the marquee rectangle */
26
- className?: string;
27
- /** Stroke / fill colours (defaults below) */
28
- stroke?: string;
29
- fill?: string;
30
- }
31
- /**
32
- * Draws a marquee rectangle while the user drags.
33
- * Hook it into the interaction-manager with modeId = 'marqueeCapture'.
34
- */
35
- declare const MarqueeCapture: ({ pageIndex, scale, pageWidth, pageHeight, className, stroke, fill, }: MarqueeCaptureProps) => preact.JSX.Element | null;
36
-
37
- export { MarqueeCapture, useCaptureCapability, useCapturePlugin };
@@ -1,37 +0,0 @@
1
- import * as _embedpdf_plugin_capture from '@embedpdf/plugin-capture';
2
- import { CapturePlugin } from '@embedpdf/plugin-capture';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
-
5
- declare const useCaptureCapability: () => {
6
- provides: Readonly<_embedpdf_plugin_capture.CaptureCapability> | null;
7
- isLoading: boolean;
8
- ready: Promise<void>;
9
- };
10
- declare const useCapturePlugin: () => {
11
- plugin: CapturePlugin | null;
12
- isLoading: boolean;
13
- ready: Promise<void>;
14
- };
15
-
16
- interface MarqueeCaptureProps {
17
- /** Index of the page this layer lives on */
18
- pageIndex: number;
19
- /** Scale of the page */
20
- scale: number;
21
- /** Width of the page */
22
- pageWidth: number;
23
- /** Height of the page */
24
- pageHeight: number;
25
- /** Optional CSS class applied to the marquee rectangle */
26
- className?: string;
27
- /** Stroke / fill colours (defaults below) */
28
- stroke?: string;
29
- fill?: string;
30
- }
31
- /**
32
- * Draws a marquee rectangle while the user drags.
33
- * Hook it into the interaction-manager with modeId = 'marqueeCapture'.
34
- */
35
- declare const MarqueeCapture: ({ pageIndex, scale, pageWidth, pageHeight, className, stroke, fill, }: MarqueeCaptureProps) => react_jsx_runtime.JSX.Element | null;
36
-
37
- export { MarqueeCapture, useCaptureCapability, useCapturePlugin };