/** * Every asset URL the subtree references, absolute, sorted, de-duplicated. * * Sorted because the result is folded into a digest through an object key order * nobody should have to reason about, and a list whose order depends on document * traversal is a list that will one day differ for a reason nobody can name. * * Schemes that carry their own bytes — `data:` — are excluded: the bytes are * already in the document, so hashing them again would put the same information * in the key twice and make an inline SVG look like a fetch. `blob:` and * `about:` are excluded because nothing on the wire corresponds to them. */ export declare function referencedAssets(root: Element): readonly string[]; /** An attribute that names a file: `srcset` names one per candidate. */ export interface FileAttribute { readonly name: string; readonly namespace: string | null; readonly candidates: boolean; } /** * The attributes that name a file, by element. * * `href` is read only on SVG's `` and ``. On an `` it is a * destination rather than an asset, and hashing every link target would put the * whole site in one subject's key. * * **Every `srcset` candidate, not the one the browser picked.** Which candidate * is used depends on the device pixel ratio, and a key that recorded only the * chosen one would let a 2× asset change without moving the 1× runner's key — * the same file, the same URL list, and a baseline that is quietly of different * bytes. Over-inclusion here costs a re-render nobody needed; under-inclusion * costs a false `unchanged`. */ export declare function fileAttributes(element: Element): readonly FileAttribute[]; /** One candidate in a `srcset`: its URL, and the descriptor offered with it. */ export interface SrcsetCandidate { readonly url: string; /** `2x`, `640w`, or empty. */ readonly descriptor: string; } /** * `a.png 1x, b.png 2x` → each URL with its descriptor, by HTML's rule. * * A URL is a run of anything but ASCII whitespace, so the comma inside a `data:` URL is part of * it: splitting on every comma cut such a URL in two, and the second half * resolved as a file next to the page. A comma ends a candidate only after its * URL, or trailing it. */ export declare function srcsetCandidates(value: string): readonly SrcsetCandidate[]; /** * The observed assets, narrowed to the ones this subject references. * * Where the two halves meet: the driver knows the bytes and the page knows the * subject. Returned as a plain object because that is what `EnvironmentInputs` * carries, and built in referenced order so the shape is stable. * * An asset the page's own origin serves is keyed by its path. A collector serves * a build on whatever port the machine had free, and a key holding that port * makes one build served twice two environments. An asset from another origin * keeps its absolute URL, because there the host is part of what was fetched. */ export declare function assetsFor(root: Element, observed: Readonly>): Readonly>; //# sourceMappingURL=assets.d.ts.map