The domToDataUrl function converts a DOM node into a Data URL string (e.g., data:image/png;base64,...). It supports both direct node input with an options object or passing a pre-constructed Context.
When using image/png or image/jpeg types, the function can also handle DPI adjustments if a dpi is provided in the options, ensuring the resulting image reflects the requested resolution.
Overloads
domToDataUrl<T extends Node>(node: T, options?: Options): Promise<string>domToDataUrl<T extends Node>(context: Context<T>): Promise<string>