# `impl` reference Everything hanging off `domtoimage.impl` is an **internal implementation surface**, exposed only so the unit tests (and a few advanced integrations) can reach the moving parts. It is **not** part of the stable public API (`toSvg`, `toPng`, `toJpeg`, `toBlob`, `toCanvas`, `toPixelData`) and may change between releases without notice. ```js domtoimage.impl; ``` | Member | Kind | Summary | | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ | | `util` | object | Low-level helpers (type guards, geometry, URL/resource fetching). Documented separately in [UTILS.md](UTILS.md). | | `fontFaces` | object | Discovers `@font-face` web fonts and inlines them as `data:` URLs. | | `images` | object | Inlines `` and SVG `` sources and CSS `background`/`background-image`/`mask` URLs. | | `inliner` | object | The URL-rewriting engine shared by `fontFaces` and `images`. | | `urlCache` | array | Per-render cache of fetched resources, keyed by URL. | | `options` | object | The **live, resolved** options for the current/last render. | | `copyOptions` | function | Merges caller options over the defaults into `impl.options`. | | `resetUrlCache` | function | Clears `urlCache`. Called at the start/end of a render; exposed for tests/advanced callers driving the helpers directly. | --- ## `impl.options` The resolved options object that the render pipeline actually reads. It is **not** the object you pass to `toPng(node, options)` — that one is normalized by `copyOptions` (filling in defaults for anything omitted) and the result is stored here. Inspecting it after a call shows the effective configuration that was used. See the **Rendering options** section of the [README](../README.md#rendering-options) for the full list of fields and their defaults. ## `impl.copyOptions(options)` `(options: object) => void` Normalizes `options` against the library defaults and writes the result into `impl.options`. Every option is copied through an explicit `typeof options.x === 'undefined' ? default : options.x` check, so passing `{}` restores the full default configuration. Called automatically at the start of each top-level render; exposed mainly so tests can set up `impl.options` directly when exercising helpers like `util.getAndEncode` in isolation. --- ## `impl.fontFaces` Produced by `newFontFaces()`. | Member | Signature | Summary | | ---------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `resolveAll()` | `() => Promise` | Reads every web-font `@font-face` rule, inlines its `src` URLs as `data:` URLs, and resolves to the concatenated CSS text (newline-joined) ready to drop into a single `