import { Canvas } from 'fabric'; import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import { DefineComponent } from 'vue'; import { FabricImage } from 'fabric'; import { FabricObject } from 'fabric'; import { FabricObjectProps } from 'fabric'; import { FabricText } from 'fabric'; import { ImageProps } from 'fabric'; import { ObjectEvents } from 'fabric'; import { Point } from 'fabric'; import { PublicProps } from 'vue'; import { Ref } from 'vue'; import { SerializedObjectProps } from 'fabric'; import { TEvent } from 'fabric'; import { TextProps } from 'fabric'; import { TOptions } from 'fabric'; import { TPointerEvent } from 'fabric'; import { TPointerEventInfo } from 'fabric'; declare const __VLS_export: DefineComponent void; deleteCanvas: () => void; setActiveFabric: (options: TOptions< FabricObjectProps>) => void; copyActiveFabric: () => Promise; deleteActiveFabric: () => void; canvasRef: Ref; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { pointerDown: (event: FabricPointerEvent) => any; pointerMove: (event: FabricPointerEvent) => any; pointerUp: (event: FabricPointerEvent) => any; selectionCreated: (event: FabricSelectionCreatedEvent) => any; selectionCleared: (event: FabricSelectionClearedEvent) => any; loaded: () => any; reload: () => any; }, string, PublicProps, Readonly & Readonly<{ onPointerDown?: ((event: FabricPointerEvent) => any) | undefined; onPointerMove?: ((event: FabricPointerEvent) => any) | undefined; onPointerUp?: ((event: FabricPointerEvent) => any) | undefined; onSelectionCreated?: ((event: FabricSelectionCreatedEvent) => any) | undefined; onSelectionCleared?: ((event: FabricSelectionClearedEvent) => any) | undefined; onLoaded?: (() => any) | undefined; onReload?: (() => any) | undefined; }>, { page: number; canvasId: string; fileZoom: number; fileScale: number; canvasScale: number; canvasClass: string; isDrop: boolean; onDestroy: (callback: () => void) => void; }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; declare function addImage(src: string, options?: TOptions, offset?: DropOffset): void; declare function addText(text: string, options?: TOptions, offset?: DropOffset): void; export declare type CacheFabricImage = FabricImage & CacheProperties; export declare type CacheFabricObject = FabricObject & CacheProperties; export declare type CacheFabricText = FabricText & CacheProperties; declare interface CacheProperties { _cornerSize?: number; } export declare interface CloseSvgOptions { stroke?: string; hoverStroke?: string; src?: string; } export declare interface ComponentProps { file: PDF; page?: number; canvasId?: string; fileZoom?: number; fileScale?: number; canvasScale?: number; canvasClass?: string; isDrop?: boolean; password?: string; dropTextOptions?: TOptions; dropImageOptions?: TOptions; selectionOptions?: TOptions; closeSvgOptions?: CloseSvgOptions; manualReload?: boolean; onDestroy?: (callback: () => void) => void; } export declare interface CreateCloseFabricArgs { canvas: Canvas; target: FabricObject; stroke?: string; uuid?: number; } declare const _default: typeof __VLS_export; export default _default; export declare type DropOffset = Record<'x' | 'y', number>; export declare interface FabricHookParams { id: string; pointerDown?: (event: FabricPointerEvent) => void; pointerMove?: (event: FabricPointerEvent) => void; pointerUp?: (event: FabricPointerEvent) => void; selectionCreated?: (event: FabricSelectionCreatedEvent) => void; selectionCleared?: (event: FabricSelectionClearedEvent) => void; } export declare type FabricPointerEvent = TPointerEventInfo; export declare type FabricSelectionClearedEvent = Partial> & { deselected: FabricObject[]; }; export declare type FabricSelectionCreatedEvent = Partial> & { selected: FabricObject[]; }; export declare function loadFile(file: File, password?: string, id?: string): Promise<{ pages: number; PDFId: string; name: string; updateDate: number; data: File; }>; export declare interface PDF { PDFId: string; name: string; updateDate: number; data?: File | null; pages: number; } export declare interface RenderImageArgs { data: Blob; scale?: number; } export declare type SelectedEvent = Partial & { target: FabricObject, SerializedObjectProps, ObjectEvents>; }; declare function setPDF(): Promise; export declare interface SpecifyPageArgs { page: number; data: Blob; scale: number; password?: string; } export declare type SupportFileType = 'application/pdf' | 'image/png' | 'image/jpeg'; export declare interface TCornerPoint { tl: Point; tr: Point; bl: Point; br: Point; } export declare function useFabric(params?: FabricHookParams & { selectionOptions?: Ref>; }): { createCanvas: () => Canvas | undefined; loadFile: (file: File, password?: string) => Promise<{ pages: number; PDFId: string; name: string; updateDate: number; data: File; }>; specifyPage: (specifyPageParams: SpecifyPageArgs) => Promise; renderImage: ({ data, scale }: RenderImageArgs) => Promise; addFabric: (src: string, options?: TOptions, offset?: DropOffset) => Promise; addTextFabric: (text: string, options?: TOptions, offset?: DropOffset) => void; clearActive: () => void; deleteCanvas: () => void; scaleFabric: (scale: number, isCreate?: boolean) => void; setCloseSvgOptions: (options?: CloseSvgOptions) => void; setActiveFabric: (options: TOptions) => void; copyActiveFabric: () => Promise; deleteActiveFabric: () => void; }; export { }