@component-hook/pdf-canvas 1.0.4 → 1.0.5-alpha.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.
@@ -14,7 +14,7 @@ import { TEvent } from 'fabric';
14
14
  import { TextProps } from 'fabric';
15
15
  import { TOptions } from 'fabric';
16
16
 
17
- declare function addImage(src: string, options?: TOptions<ImageProps>): void;
17
+ declare function addImage(src: string, options?: TOptions<ImageProps>, size?: Record<'width' | 'height', number>): void;
18
18
 
19
19
  declare function addText(text: string, options?: TOptions<TextProps>): void;
20
20
 
@@ -37,6 +37,7 @@ export declare interface ComponentProps {
37
37
  dropTextOptions?: TOptions<TextProps>;
38
38
  dropImageOptions?: TOptions<ImageProps>;
39
39
  closeSvgOptions?: CloseSvgOptions;
40
+ onDestroy?: (callback: () => void) => void;
40
41
  }
41
42
 
42
43
  export declare interface CreateCloseFabricArgs {
@@ -52,7 +53,11 @@ addText: typeof addText;
52
53
  clearActive: () => void;
53
54
  deleteCanvas: () => void;
54
55
  canvasRef: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
55
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ComponentProps> & Readonly<{}>, {
56
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
57
+ loaded: () => any;
58
+ }, string, PublicProps, Readonly<ComponentProps> & Readonly<{
59
+ onLoaded?: (() => any) | undefined;
60
+ }>, {
56
61
  page: number;
57
62
  canvasId: string;
58
63
  fileZoom: number;
@@ -60,6 +65,7 @@ fileScale: number;
60
65
  canvasScale: number;
61
66
  canvasClass: string;
62
67
  isDrop: boolean;
68
+ onDestroy: (callback: () => void) => void;
63
69
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
64
70
  canvasRef: HTMLCanvasElement;
65
71
  }, HTMLDivElement>;
@@ -112,7 +118,7 @@ export declare function useFabric(id?: string): {
112
118
  } | undefined>;
113
119
  specifyPage: ({ page, PDFBase64, scale, password }: SpecifyPageArgs) => Promise<void>;
114
120
  renderImage: ({ url, scale }: RenderImageArgs) => Promise<void>;
115
- addFabric: (src: string, options?: TOptions<ImageProps>) => Promise<void>;
121
+ addFabric: (src: string, options?: TOptions<ImageProps>, size?: Record<"width" | "height", number>) => Promise<void>;
116
122
  addTextFabric: (text: string, options?: TOptions<TextProps>) => void;
117
123
  clearActive: () => void;
118
124
  deleteCanvas: () => void;