export interface Options { filter?: (node: Node) => boolean; bgcolor?: string; width?: number; height?: number; style?: Record; quality?: number; imagePlaceholder?: string; cacheBust?: boolean; } export interface Util { escape: (string: string) => string; parseExtension: (url: string) => string; mimeType: (url: string) => string; dataAsUrl: (content: string, type: string) => string; isDataUrl: (url: string) => boolean; canvasToBlob: (canvas: HTMLCanvasElement) => Promise; resolveUrl: (url: string, baseUrl: string) => string; getAndEncode: (url: string) => Promise; uid: () => string; delay: (ms: number) => (arg: T) => Promise; asArray: (arrayLike: ArrayLike) => T[]; escapeXhtml: (string: string) => string; makeImage: (uri: string) => Promise; width: (node: HTMLElement) => number; height: (node: HTMLElement) => number; } export interface InlinerImpl { readUrls: (string: string) => string[]; inline: (string: string, url: string, baseUrl?: string, get?: (url: string) => Promise) => Promise; } export interface Inliner { inlineAll: (string: string, baseUrl?: string, get?: (url: string) => Promise) => Promise; shouldProcess: (string: string) => boolean; impl: InlinerImpl; } export interface FontFacesImpl { readAll: () => Promise; } export interface WebFont { resolve: () => Promise; src: () => string; } export interface FontFaces { resolveAll: () => Promise; impl: FontFacesImpl; } export interface ImageImpl { inline: (get?: (url: string) => Promise) => Promise; } export interface ImageHandler { newImage: (element: HTMLImageElement) => ImageImpl; } export interface Images { inlineAll: (node: Node) => Promise; impl: ImageHandler; } export interface Impl { fontFaces: FontFaces; images: Images; util: Util; inliner: Inliner; options: { imagePlaceholder?: string; cacheBust?: boolean; }; } export interface DomToImage { toSvg: (node: Node, options?: Options) => Promise; toPng: (node: Node, options?: Options) => Promise; toJpeg: (node: Node, options?: Options) => Promise; toBlob: (node: Node, options?: Options) => Promise; toPixelData: (node: Node, options?: Options) => Promise; impl: Impl; }