import type DesignerUtils from "./designer"; import type { RulerStyle } from "./lib/types"; export type Hook = "init" | "ready" | "documentShortcutKeys" | "shortcutKeys" | "createPrintElement" | "beforePrint" | "beforePrint2" | "getOptionItem" | "onDesigned" | "onPreview" | "newPrintTemplate" | "newPanel" | string; interface Run { (...args: any): any | Promise; } export type HookOptions = { hook: Hook; name: string; description?: string; priority?: Number; run: Run; }; interface Init { (input: any): any; } export type PluginOptions = { name: string; description: string; init?: Init | any; hooks: Array; config?: Object; leastHiprintVersion?: string; }; export declare abstract class Provider { constructor(); abstract addElementTypes(ctx: any): void; } export type themeType = { theme?: string; primaryColor: string; primaryContent?: string; secondaryColor?: string; secondaryContent?: string; accentColor?: string; accentContent?: string; neutralColor?: string; neutralContent?: string; base100?: string; base200?: string; base300?: string; baseContent?: string; info?: string; infoContent?: string; success?: string; successContent?: string; warning?: string; warningContent?: string; error?: string; errorContent?: string; }; export interface Props { autoConnect?: boolean | undefined; config?: any; providers?: Provider[]; providerMap?: ProviderMap | ProviderMap[]; plugins?: PluginOptions[]; template?: any; templateOptions?: DesignerPrintTemplateOptions; designOptions?: DesignOptions; printData?: any; templateKey?: string; title?: string; authKey: string; headerLogoHtml?: string; headerTitle?: string; headerNewEle?: boolean; headerEleList?: Array; headerNewMenu?: boolean; headerMenuList?: Array; events?: Events; tags?: string[]; styleOption?: StyleOption; showOption?: ShowOption; paperList?: PaperType[]; theme?: string | themeType | themeType[]; themeList?: string[]; pageStructureGridMode?: boolean | undefined; miniMapOriginMode?: boolean | undefined; rulerStyle?: RulerStyle; previewOptions?: PreviewOptions; onPreviewClick?: (e: MouseEvent) => boolean | undefined; onZoomChange?: (scale: number) => void | undefined; onImageChooseClick?: (target: any) => void | undefined; customDataFun?: (data: any, filed: string, printData?: any) => string | object | number; onPanelAddClick?: (panel: any, createPanel: any) => void | undefined; onFunctionClick?: (option: any, printElement: any, event: any) => void | undefined; onBeforeDragIn?: (printTemplate: any, panel: any, printElement: any) => void | boolean; } export type DragBoxMode = "default" | "top" | "left" | "bottom" | "right" | "fixed"; export interface StyleOptions { mode?: DragBoxMode; html?: HTMLElement; style?: string; show?: boolean; other?: any; } export interface StyleOption { paperBox?: StyleOptions; panels?: StyleOptions; draggableEls?: StyleOptions; options?: StyleOptions; pageStructure?: StyleOptions; history?: StyleOptions; locationExchange?: StyleOptions; miniMap?: StyleOptions; editableTools?: StyleOptions; zIndexTools?: StyleOptions; fontTools?: StyleOptions; zoomTools?: StyleOptions; rotateTools?: StyleOptions; } export interface ShowOption { showHeader?: boolean; showToolbar?: boolean; showFooter?: boolean; showPower?: boolean; } export interface PaperType { type: string; width: number; height: number; } export interface ProviderMap { container: string; value: string; render?: (e: any[]) => any; } export interface PreviewOptions { showPdf?: boolean; showImg?: boolean; showPrint2?: boolean; } export interface Events { onSave?: (key: string, data: any) => boolean; onEdit?: (data: any) => boolean; onEditData?: (data: any) => boolean; onKeyDownEvent?: (e: KeyboardEvent, designerUtils: DesignerUtils) => boolean; } export interface DesignerOptions { connect?: boolean; config?: any; providers?: Provider[]; providerMap?: ProviderMap | ProviderMap[]; clearProviderContainer?: boolean; plugins?: Props["plugins"]; tags?: string[]; templateKey?: string; title?: string; printData?: any; events?: Events; designOptions?: DesignOptions; } export type DesignerPrintTemplateOptions = { template: Object | string | JSON; fontList?: any[]; fields?: any[]; onImageChooseClick?: (target: any) => void; onZoomChange?: (scale: number) => void; onPanelAddClick?: (panel: any, createPanel: any) => void; onFunctionClick?: Props["onFunctionClick"]; dataMode?: 1 | 2; history?: boolean; onDataChanged?: (type: string, json: string | JSON) => void; onUpdateError?: (e: any) => void; settingContainer?: string; designContainer?: string; paginationContainer?: string; }; export type DesignOptions = { grid?: boolean; activePanel?: boolean; adaptToSize?: boolean; }; export type PreviewShowOptions = { showPdf?: boolean; showImg?: boolean; showPrint2?: boolean; showPrint?: boolean; selectedPrinter?: string; options?: { leftOffset?: number; topOffset?: number; isDownload?: boolean; name?: string; paperWidth?: number; paperHeight?: number; pixelRatio?: number; quality?: number; limit?: number; toType?: "url" | "blob"; onProgress?: (cur: number, total: number) => void; printer?: string; printType?: "html" | "template" | "pdf" | "url_pdf" | "other" | string; type?: "pdf" | "url_pdf" | "capture" | string; silent?: boolean; printBackground?: boolean; color?: boolean; margins?: { marginType?: "default" | "none" | "printableArea" | "custom"; top?: number; bottom?: number; left?: number; right?: number; }; landscape?: boolean; scaleFactor?: number; pagesPerSheet?: number; collate?: boolean; copies?: number; pageRanges?: { from: number; to: number; }[]; duplexMode?: "simplex" | "shortEdge" | "longEdge"; dpi?: Record; header?: string; footer?: string; pageSize?: ("A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "Legal" | "Letter" | "Tabloid") | { height: number; width: number; }; displayHeaderFooter?: boolean; scale?: number | string; headerTemplate?: string; footerTemplate?: string; preferCSSPageSize?: boolean; generateTaggedPDF?: boolean; generateDocumentOutline?: boolean; pages?: string; subset?: string; orientation?: string; monochrome?: boolean; side?: string; bin?: string; paperSize?: string; printDialog?: boolean; sumatraPdfPath?: string; pdf_path?: string; axiosOptions?: { baseURL?: string; url?: string; method?: "get" | "GET" | "delete" | "DELETE" | "head" | "HEAD" | "options" | "OPTIONS" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | "purge" | "PURGE" | "link" | "LINK" | "unlink" | "UNLINK"; params?: any; data?: any; responseType?: ResponseType; }; options?: string[]; }; callBackOptions?: { importCss?: boolean; printContainer?: boolean; callback?: () => void; statusCallback?: (data?: { code: number; message: string; data: any; timestamp: number; }) => void; styleHandler?: () => string; }; onClick?: (type: string) => boolean; onClose?: () => void; onRender?: (container: HTMLElement) => void; }; export {};