import { FileId } from "@zsviczian/excalidraw/types/element/types"; import { BinaryFileData, DataURL } from "@zsviczian/excalidraw/types/types"; import { TFile } from "obsidian"; import { ExcalidrawData } from "./ExcalidrawData"; import ExcalidrawPlugin from "./main"; import { LinkParts } from "./utils/Utils"; import { ValueOf } from "./types"; export declare const IMAGE_MIME_TYPES: { readonly svg: "image/svg+xml"; readonly png: "image/png"; readonly jpg: "image/jpeg"; readonly gif: "image/gif"; readonly webp: "image/webp"; readonly bmp: "image/bmp"; readonly ico: "image/x-icon"; readonly avif: "image/avif"; readonly jfif: "image/jfif"; }; export declare type MimeType = ValueOf | "application/octet-stream"; export type FileData = BinaryFileData & { size: Size; hasSVGwithBitmap: boolean; shouldScale: boolean; }; export type Size = { height: number; width: number; }; export interface ColorMap { [color: string]: string; } export declare class EmbeddedFile { file: TFile; isSVGwithBitmap: boolean; private img; private imgInverted; mtime: number; private plugin; mimeType: MimeType; size: Size; linkParts: LinkParts; private hostPath; attemptCounter: number; isHyperlink: boolean; hyperlink: DataURL; colorMap: ColorMap | null; constructor(plugin: ExcalidrawPlugin, hostPath: string, imgPath: string, colorMapJSON?: string); resetImage(hostPath: string, imgPath: string): void; private fileChanged; setImage(imgBase64: string, mimeType: MimeType, size: Size, isDark: boolean, isSVGwithBitmap: boolean): void; isLoaded(isDark: boolean): boolean; getImage(isDark: boolean): string; /** * * @returns true if image should scale such as the updated images has the same area as the previous images, false if the image should be displayed at 100% */ shouldScale(): boolean; } export declare class EmbeddedFilesLoader { private pdfDocsMap; private plugin; private isDark; terminate: boolean; uid: string; constructor(plugin: ExcalidrawPlugin, isDark?: boolean); emptyPDFDocsMap(): void; getObsidianImage(inFile: TFile | EmbeddedFile, depth: number): Promise<{ mimeType: MimeType; fileId: FileId; dataURL: DataURL; created: number; hasSVGwithBitmap: boolean; size: { height: number; width: number; }; }>; private _getObsidianImage; loadSceneFiles(excalidrawData: ExcalidrawData, addFiles: (files: FileData[], isDark: boolean, final?: boolean) => void, depth: number): Promise; private pdfToDataURL; private convertMarkdownToSVG; } export declare const generateIdFromFile: (file: ArrayBuffer) => Promise;