import { App, TFile } from "obsidian"; import { BinaryFileData, DataURL } from "@zsviczian/excalidraw/types/types"; import ExcalidrawPlugin from "../main"; import { ExcalidrawElement } from "@zsviczian/excalidraw/types/element/types"; import { ExportSettings } from "../ExcalidrawView"; import ExcalidrawScene from "src/svgToExcalidraw/elements/ExcalidrawScene"; import { FILENAMEPARTS } from "./UtilTypes"; import { Mutable } from "@zsviczian/excalidraw/types/utility-types"; declare module "obsidian" { interface Workspace { getAdjacentLeafInDirection(leaf: WorkspaceLeaf, direction: string): WorkspaceLeaf; } interface Vault { getConfig(option: "attachmentFolderPath"): string; } } export declare const checkExcalidrawVersion: (app: App) => Promise; export declare const randomInteger: () => number; export declare function wrapTextAtCharLength(text: string, lineLen: number, forceWrap?: boolean, tolerance?: number): string; export declare const rotatedDimensions: (element: ExcalidrawElement) => [number, number, number, number]; export declare const getDataURL: (file: ArrayBuffer, mimeType: string) => Promise; export declare const getFontDataURL: (app: App, fontFileName: string, sourcePath: string, name?: string) => Promise<{ fontDef: string; fontName: string; dataURL: string; }>; export declare const base64StringToBlob: (base64String: string, mimeType: string) => Blob; export declare const svgToBase64: (svg: string) => string; export declare const getBinaryFileFromDataURL: (dataURL: string) => Promise; export declare const getSVG: (scene: any, exportSettings: ExportSettings, padding: number) => Promise; export declare function filterFiles(files: Record): Record; export declare const getPNG: (scene: any, exportSettings: ExportSettings, padding: number, scale?: number) => Promise; export declare const getQuickImagePreview: (plugin: ExcalidrawPlugin, path: string, extension: "png" | "svg") => Promise; export declare const embedFontsInSVG: (svg: SVGSVGElement, plugin: ExcalidrawPlugin) => SVGSVGElement; export declare const getImageSize: (src: string) => Promise<{ height: number; width: number; }>; export declare const addAppendUpdateCustomData: (el: Mutable, newData: any) => ExcalidrawElement; export declare const scaleLoadedImage: (scene: any, files: any) => { dirty: boolean; scene: any; }; export declare const setDocLeftHandedMode: (isLeftHanded: boolean, ownerDocument: Document) => void; export declare const setLeftHandedMode: (isLeftHanded: boolean) => void; export type LinkParts = { original: string; path: string; isBlockRef: boolean; ref: string; width: number; height: number; page: number; }; export declare const getLinkParts: (fname: string, file?: TFile) => LinkParts; export declare const compress: (data: string) => string; export declare const decompress: (data: string) => string; export declare const hasExportTheme: (plugin: ExcalidrawPlugin, file: TFile) => boolean; export declare const getExportTheme: (plugin: ExcalidrawPlugin, file: TFile, theme: string) => string; export declare const hasExportBackground: (plugin: ExcalidrawPlugin, file: TFile) => boolean; export declare const getWithBackground: (plugin: ExcalidrawPlugin, file: TFile) => boolean; export declare const getExportPadding: (plugin: ExcalidrawPlugin, file: TFile) => number; export declare const getPNGScale: (plugin: ExcalidrawPlugin, file: TFile) => number; export declare const isVersionNewerThanOther: (version: string, otherVersion: string) => boolean; export declare const getEmbeddedFilenameParts: (fname: string) => FILENAMEPARTS; export declare const fragWithHTML: (html: string) => DocumentFragment; export declare const errorlog: (data: {}) => void; export declare const sleep: (ms: number) => Promise; /**REACT 18 //see also: https://github.com/zsviczian/obsidian-excalidraw-plugin/commit/b67d70c5196f30e2968f9da919d106ee66f2a5eb //https://github.com/zsviczian/obsidian-excalidraw-plugin/commit/cc9d7828c7ee7755c1ef942519c43df32eae249f export const awaitNextAnimationFrame = async () => new Promise(requestAnimationFrame); */ export declare const log: any; export declare const debug: any; export declare const getContainerElement: (element: (ExcalidrawElement & { containerId: ExcalidrawElement["id"] | null; }) | null, scene: ExcalidrawScene) => import("../svgToExcalidraw/elements/ExcalidrawElement").ExcalidrawGenericElement; export declare const updateFrontmatterInString: (data: string, keyValuePairs: [ string, string ][]) => string; export declare const isContainer: (el: ExcalidrawElement) => boolean; export declare const hyperlinkIsImage: (data: string) => boolean; export declare const hyperlinkIsYouTubeLink: (link: string) => boolean; export declare const getYouTubeThumbnailLink: (youtubelink: string) => Promise; export declare const isCallerFromTemplaterPlugin: (stackTrace: string) => boolean; export declare const convertSVGStringToElement: (svg: string) => SVGSVGElement;