@component-hook/pdf-canvas 1.1.0-alpha.10 → 1.1.0-alpha.12

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.
@@ -33,9 +33,9 @@ declare interface CacheProperties {
33
33
  }
34
34
 
35
35
  export declare interface CloseSvgOptions {
36
- stroke: string;
37
- hoverStroke: string;
38
- src: string;
36
+ stroke?: string;
37
+ hoverStroke?: string;
38
+ src?: string;
39
39
  }
40
40
 
41
41
  export declare interface ComponentProps {
@@ -69,22 +69,27 @@ addImage: typeof addImage;
69
69
  addText: typeof addText;
70
70
  clearActive: () => void;
71
71
  deleteCanvas: () => void;
72
+ copyActiveFabric: () => Promise<void>;
73
+ deleteActiveFabric: () => void;
72
74
  canvasRef: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
73
75
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
74
76
  pointerDown: (event: TPointerEventInfo<TPointerEvent>) => any;
75
77
  pointerMove: (event: TPointerEventInfo<TPointerEvent>) => any;
76
78
  pointerUp: (event: TPointerEventInfo<TPointerEvent>) => any;
79
+ selectionCreated: (event: FabricSelectionCreatedEvent) => any;
80
+ selectionCleared: (event: FabricSelectionClearedEvent) => any;
77
81
  loaded: () => any;
78
82
  reload: () => any;
79
83
  }, string, PublicProps, Readonly<ComponentProps> & Readonly<{
80
84
  onPointerDown?: ((event: TPointerEventInfo<TPointerEvent>) => any) | undefined;
81
85
  onPointerMove?: ((event: TPointerEventInfo<TPointerEvent>) => any) | undefined;
82
86
  onPointerUp?: ((event: TPointerEventInfo<TPointerEvent>) => any) | undefined;
87
+ onSelectionCreated?: ((event: FabricSelectionCreatedEvent) => any) | undefined;
88
+ onSelectionCleared?: ((event: FabricSelectionClearedEvent) => any) | undefined;
83
89
  onLoaded?: (() => any) | undefined;
84
90
  onReload?: (() => any) | undefined;
85
91
  }>, {
86
92
  page: number;
87
- selectionOptions: TOptions<FabricObjectProps>;
88
93
  canvasId: string;
89
94
  fileZoom: number;
90
95
  fileScale: number;
@@ -104,10 +109,20 @@ export declare interface FabricHookParams {
104
109
  pointerDown?: (event: FabricPointerEvent) => void;
105
110
  pointerMove?: (event: FabricPointerEvent) => void;
106
111
  pointerUp?: (event: FabricPointerEvent) => void;
112
+ selectionCreated?: (event: FabricSelectionCreatedEvent) => void;
113
+ selectionCleared?: (event: FabricSelectionClearedEvent) => void;
107
114
  }
108
115
 
109
116
  export declare type FabricPointerEvent = TPointerEventInfo<TPointerEvent>;
110
117
 
118
+ export declare type FabricSelectionClearedEvent = Partial<TEvent<TPointerEvent>> & {
119
+ deselected: FabricObject[];
120
+ };
121
+
122
+ export declare type FabricSelectionCreatedEvent = Partial<TEvent<TPointerEvent>> & {
123
+ selected: FabricObject[];
124
+ };
125
+
111
126
  export declare function loadFile(file: File, password?: string, id?: string): Promise<{
112
127
  pages: number;
113
128
  PDFId: string;
@@ -165,7 +180,7 @@ export declare function useFabric(params?: FabricHookParams & {
165
180
  updateDate: number;
166
181
  PDFBase64: string;
167
182
  } | undefined>;
168
- specifyPage: (params: SpecifyPageArgs) => Promise<number>;
183
+ specifyPage: (specifyPageParams: SpecifyPageArgs) => Promise<number>;
169
184
  renderImage: ({ url, scale }: RenderImageArgs) => Promise<void>;
170
185
  addFabric: (src: string, options?: TOptions<ImageProps>, offset?: DropOffset) => Promise<void>;
171
186
  addTextFabric: (text: string, options?: TOptions<TextProps>, offset?: DropOffset) => void;
@@ -173,6 +188,8 @@ export declare function useFabric(params?: FabricHookParams & {
173
188
  deleteCanvas: () => void;
174
189
  scaleFabric: (scale: number, isCreate?: boolean) => void;
175
190
  setCloseSvgOptions: (options?: CloseSvgOptions) => void;
191
+ copyActiveFabric: () => Promise<void>;
192
+ deleteActiveFabric: () => void;
176
193
  };
177
194
 
178
195
  export { }