@component-hook/pdf-canvas 1.1.0-alpha.8 → 1.1.0
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/README.md +18 -41
- package/dist/react/pdf-canvas.es.d.ts +43 -8
- package/dist/react/pdf-canvas.es.js +5795 -5678
- package/dist/react/pdf-canvas.umd.js +73 -73
- package/dist/vue/pdf-canvas.es.d.ts +29 -12
- package/dist/vue/pdf-canvas.es.js +4916 -4837
- package/dist/vue/pdf-canvas.umd.js +63 -63
- package/package.json +1 -1
|
@@ -33,9 +33,9 @@ declare interface CacheProperties {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export declare interface CloseSvgOptions {
|
|
36
|
-
stroke
|
|
37
|
-
hoverStroke
|
|
38
|
-
src
|
|
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
|
-
pointerDown: (event:
|
|
75
|
-
pointerMove: (event:
|
|
76
|
-
pointerUp: (event:
|
|
76
|
+
pointerDown: (event: FabricPointerEvent) => any;
|
|
77
|
+
pointerMove: (event: FabricPointerEvent) => any;
|
|
78
|
+
pointerUp: (event: FabricPointerEvent) => 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
|
-
onPointerDown?: ((event:
|
|
81
|
-
onPointerMove?: ((event:
|
|
82
|
-
onPointerUp?: ((event:
|
|
84
|
+
onPointerDown?: ((event: FabricPointerEvent) => any) | undefined;
|
|
85
|
+
onPointerMove?: ((event: FabricPointerEvent) => any) | undefined;
|
|
86
|
+
onPointerUp?: ((event: FabricPointerEvent) => 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;
|
|
@@ -155,7 +170,7 @@ export declare interface TCornerPoint {
|
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
export declare function useFabric(params?: FabricHookParams & {
|
|
158
|
-
selectionOptions
|
|
173
|
+
selectionOptions?: Ref<TOptions<FabricObjectProps>>;
|
|
159
174
|
}): {
|
|
160
175
|
createCanvas: () => Canvas | undefined;
|
|
161
176
|
loadFile: (file: File, password?: string) => Promise<{
|
|
@@ -165,7 +180,7 @@ export declare function useFabric(params?: FabricHookParams & {
|
|
|
165
180
|
updateDate: number;
|
|
166
181
|
PDFBase64: string;
|
|
167
182
|
} | undefined>;
|
|
168
|
-
specifyPage: (
|
|
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 { }
|