@zeainc/zea-ux
Version:
138 lines • 5.43 kB
TypeScript
export default domtoimage;
declare namespace domtoimage {
export { toSvg };
export { toPng };
export { toJpeg };
export { toBlob };
export { toPixelData };
export { toCanvas };
export namespace impl {
export { fontFaces };
export { images };
export { util };
export { inliner };
export namespace options {
let cacheBust: any;
let imagePlaceholder: any;
}
}
}
/**
* @param {HTMLElement} node - The DOM Node object to render
* @param {Object} options - Rendering options
* @param {Function} options.filter - Should return true if passed node should be included in the output
* (excluding node means excluding it's children as well). Not called on the root node.
* @param options.bgcolor - color for the background, any valid CSS color value.
* @param options.width - width to be applied to node before rendering.
* @param options.height - height to be applied to node before rendering.
* @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
* @param options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
defaults to 1.0.
* @param options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
* @param options.cacheBust - set to true to cache bust by appending the time to the request url
* @return {Promise} - A promise that is fulfilled with a SVG image data URL
* */
declare function toSvg(node: HTMLElement, options?: {
filter: Function;
bgcolor: any;
width: any;
height: any;
style: Object;
quality: any;
imagePlaceholder: any;
cacheBust: any;
}): Promise<any>;
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a PNG image data URL
* */
declare function toPng(node: Node, options: Object): Promise<any>;
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a JPEG image data URL
* */
declare function toJpeg(node: Node, options: Object): Promise<any>;
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a PNG image blob
* */
declare function toBlob(node: Node, options: Object): Promise<any>;
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
* */
declare function toPixelData(node: Node, options: Object): Promise<any>;
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
* */
declare function toCanvas(node: Node, options: Object): Promise<any>;
declare namespace fontFaces {
export { resolveAll };
export namespace impl_1 {
export { readAll };
}
export { impl_1 as impl };
}
declare namespace images {
export { inlineAll };
export namespace impl_2 {
export { newImage };
}
export { impl_2 as impl };
}
declare namespace util {
export { escape };
export { parseExtension };
export { mimeType };
export { dataAsUrl };
export { isDataUrl };
export { canvasToBlob };
export { resolveUrl };
export { getAndEncode };
export function uid(): string;
export { delay };
export { asArray };
export { escapeXhtml };
export { makeImage };
export { width };
export { height };
}
declare namespace inliner {
export { inlineAll };
export { shouldProcess };
export namespace impl_3 {
export { readUrls };
export { inline };
}
export { impl_3 as impl };
}
declare function resolveAll(): Promise<string>;
declare function readAll(document: any): Promise<any>;
declare function inlineAll(node: any): any;
declare function newImage(element: any): {
inline: (get: any) => Promise<any>;
};
declare function parseExtension(url: any): string;
declare function mimeType(url: any): any;
declare function dataAsUrl(content: any, type: any): string;
declare function isDataUrl(url: any): boolean;
declare function canvasToBlob(canvas: any): Promise<any>;
declare function resolveUrl(url: any, baseUrl: any): string;
declare function getAndEncode(url: any): Promise<any>;
declare function delay(ms: any): (arg: any) => Promise<any>;
declare function asArray(arrayLike: any): any[];
declare function escapeXhtml(string: any): any;
declare function makeImage(uri: any): Promise<any>;
declare function width(node: any): any;
declare function height(node: any): any;
declare function inlineAll_1(string: any, baseUrl: any, get: any): Promise<any>;
declare function shouldProcess(string: any): boolean;
declare function readUrls(string: any): string[];
declare function inline(string: any, url: any, baseUrl: any, get: any): Promise<any>;
//# sourceMappingURL=dom-to-image.d.ts.map