@voila.dev/replay 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Voila Development
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
- # Temporary Holding Version
1
+ # @voila.dev/replay
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Session recording and replay for the web. A small recorder, a flat tape format, and a player that rebuilds the page through the DOM API, never through the HTML parser.
4
+
5
+ ```ts
6
+ import { record } from "@voila.dev/replay/record";
7
+ import { connect } from "@voila.dev/replay/send";
8
+ import { cssom, shadow } from "@voila.dev/replay/modules";
9
+
10
+ const recorder = record(window, { mask: "inputs", modules: [shadow(), cssom()] });
11
+ const link = connect({ endpoint: "/replay", head: () => ({ url: location.href, pv: pageViewId }) });
12
+ link.send(recorder.snap());
13
+ setInterval(() => link.send(recorder.drain()), 5000);
14
+ addEventListener("pagehide", () => link.leave(recorder.drain()));
15
+ ```
16
+
17
+ ```ts
18
+ import { createPlayer } from "@voila.dev/replay/play";
19
+
20
+ const player = createPlayer({ root, chunks });
21
+ player.play();
22
+ ```
23
+
24
+ ## What it does
25
+
26
+ - **One flat tape.** An opcode, then its operands (`src/format`). Nodes are numbered implicitly, in the order they are made, on both sides. Codes from 128 are framed, so an older player skips what it does not know.
27
+ - **The page is read at rest.** The `MutationObserver` only notes what changed; the page is read at most every 50 ms. What the visitor does (pointer, taps, scroll, focus, size) is written at once, with its own tick.
28
+ - **Masking happens in the core, before any module.** Typed values are hidden by default (`mask: "inputs"`), all text with `mask: "text"`, nothing with `mask: "none"`. Passwords, card numbers, one-time codes and hidden fields are always hidden. `data-va-mask`, `data-va-unmask` and `data-va-block` refine it per element. `contenteditable` is replayed whole, its text as stars of the same length.
29
+ - **What the server may already hold goes as a hash.** A snapshot is cut by its content into pieces of about 4 KB; long strings (stylesheets, pictures) go by hash too.
30
+ - **Holes are said, not replayed.** Each chunk carries its rank and the number its first node takes; the player marks a hole and resumes at the next snapshot. A fingerprint (`PRINT`) lets the player check its copy against the page.
31
+ - **A page view has a budget.** Past 8 MB of tape (`budget`), `END 2` goes on the next tape and recording stops. A module that throws is cut alone: `ERR` and its name on the tape, said again in each snapshot, and the rest goes on.
32
+ - **Back from the back/forward cache, a new snapshot is due.** The beacon on the way out may not have held all the tape: `needsSnap` turns true on `pageshow` with `persisted`, and the page view goes on from a new snapshot.
33
+ - **Seeking back does not replay from the start.** Every 10 s of tape, the player keeps a checkpoint: a copy of the rebuilt page in a document of no window, its node numbers, and what a copy does not carry (constructed sheets and who adopts them, canvas pixels, modal dialogs and popovers, scroll positions, frames' documents). A seek starts from the nearest checkpoint or snapshot before it. Past 64 checkpoints, one in two goes.
34
+ - **The copy cannot act.** It plays in a sandboxed iframe without scripts; event handlers, `javascript:` URLs, `<script>`, `<base>` and `target` are dropped.
35
+
36
+ ## Browsers
37
+
38
+ Recorder: Safari 15.4, Chrome and Edge 92, Firefox 90 and later. Below, `record` returns `null`.
39
+
40
+ ## Tests
41
+
42
+ ```
43
+ bun test test/unit # format, sending, joining chunks
44
+ npm run test:browser # 46 cases, each also played back through a checkpoint, then the budget, a module that throws and the cache return; Chromium, WebKit and Firefox
45
+ node test/browser/fuzz.mjs # random mutations, the copy judged after each round
46
+ npm run size
47
+ ```
48
+
49
+ ## License
50
+
51
+ MIT
@@ -0,0 +1,141 @@
1
+ export declare const VERSION = 2;
2
+ export declare enum Op {
3
+ /** Closes the node opened last. */
4
+ X = 0,
5
+ /** name, n, then n (name, value) pairs. Makes an element and opens it. */
6
+ E = 1,
7
+ /** data. Makes a text node. */
8
+ T = 2,
9
+ /** name, publicId, systemId. Makes a doctype. */
10
+ D = 3,
11
+ /** name, width, height. Makes an element recorded as an empty box. */
12
+ B = 4,
13
+ /** Opens the content of the template opened last. Makes a node. */
14
+ TPL = 5,
15
+ /** mode. Opens the shadow root of the element opened last. Makes a node. */
16
+ SHADOW = 6,
17
+ /** Opens the document of the iframe opened last. Makes a node. */
18
+ FRAME = 7,
19
+ /** id. A node already numbered, moved here. */
20
+ R = 8,
21
+ /** parent, anchor (0: at the end). Opens a node to insert before the anchor. */
22
+ INS = 16,
23
+ /** id */
24
+ DEL = 17,
25
+ /** id, name, value or null */
26
+ ATTR = 18,
27
+ /** id, data */
28
+ TEXT = 19,
29
+ /** id, value: a string, or 0/1 for `checked` and for an option's `selected` */
30
+ VAL = 20,
31
+ /** id, state: 0 closed, 1 open, 2 modal */
32
+ OPEN = 21,
33
+ /** node or 0 (a constructed sheet), sheet number, rules as text */
34
+ SHEET = 32,
35
+ /** sheet number, index path ("3", "3.1"), rule text or null (deleted) */
36
+ RULE = 33,
37
+ /** node (the document or a shadow root), n, then n sheet numbers */
38
+ ADOPT = 34,
39
+ /** milliseconds since the previous tick */
40
+ TICK = 48,
41
+ /** x, y */
42
+ MOVE = 49,
43
+ /** kind (1 down, 2 up, 3 click), id, x, y */
44
+ TAP = 50,
45
+ /** id (1: the page), x, y */
46
+ SCROLL = 51,
47
+ /** width, height */
48
+ SIZE = 52,
49
+ /** id, or 0 when nothing has focus */
50
+ FOCUS = 53,
51
+ /** 0 visible, 1 hidden */
52
+ HIDE = 54,
53
+ /** version, url, time (ms since epoch), width, height, mode (0 standards, 1 quirks) */
54
+ META = 96,
55
+ /** nodes, fingerprint: what the player checks its copy against */
56
+ PRINT = 97,
57
+ /** reason (see End) */
58
+ END = 98,
59
+ /** framed: id, a canvas as a data URL */
60
+ SHOT = 128,
61
+ /** framed: the name of a module cut off after it threw */
62
+ ERR = 129
63
+ }
64
+ export declare enum End {
65
+ Consent = 1,
66
+ Budget = 2,
67
+ Network = 3
68
+ }
69
+ export type Token = number | string | null;
70
+ export type Tape = Array<Token>;
71
+ /** On the wire, `[hash]` stands for a long string and `[hash, 1]` for a piece of tape. */
72
+ export type WireToken = Token | [string] | [string, 1];
73
+ export type WireTape = Array<WireToken>;
74
+ /** The ops that make a node, and so take the next number. */
75
+ export declare function makesNode(op: number): boolean;
76
+ /** The ops a matching X closes. */
77
+ export declare function opens(op: number): boolean;
78
+ /**
79
+ * How many tokens the op at `i` takes, its code included; -1 when the tape is cut short or the
80
+ * code is unknown and not framed.
81
+ */
82
+ export declare function length(tape: ReadonlyArray<unknown>, i: number): number;
83
+ export type Invalid = {
84
+ readonly at: number;
85
+ readonly reason: string;
86
+ };
87
+ /**
88
+ * Checks a tape before anything reads it: lengths, operand types, balanced opens, and node
89
+ * numbers that exist. `base` is the number the first node made in this tape takes (from the
90
+ * envelope); a tape that starts on a META needs none.
91
+ */
92
+ export declare function validate(tape: ReadonlyArray<unknown>, base?: number): Invalid | null;
93
+ /** How many nodes a tape makes; when it holds a META, counted from its last META. */
94
+ export declare function made(tape: Tape): {
95
+ nodes: number;
96
+ fromMeta: boolean;
97
+ };
98
+ /** Recorded milliseconds of a tape: the time of its first META (if any) plus its ticks. */
99
+ export declare function span(tape: Tape): {
100
+ start: number | null;
101
+ ms: number;
102
+ };
103
+ /** Puts back what the wire replaced by hashes. Throws on a hash it cannot find. */
104
+ export declare function resolve(wire: ReadonlyArray<WireToken>, blob: (hash: string) => string | undefined, depth?: number): Tape;
105
+ export declare class MissingBlob extends Error {
106
+ readonly hash: string;
107
+ constructor(hash: string);
108
+ }
109
+ /** The hashes a wire tape refers to, pieces' own references not included. */
110
+ export declare function references(wire: ReadonlyArray<WireToken>): Array<string>;
111
+ /** 32-bit FNV-1a, step by step: what PRINT's fingerprint is made of. */
112
+ export declare function fnv(h: number, v: number): number;
113
+ export declare const FNV_START = 2166136261;
114
+ /** What a chunk carries besides its tape, as both sides see it. */
115
+ export interface Chunk {
116
+ /** The number the first node made in this chunk takes. */
117
+ readonly base: number;
118
+ /** Its rank in the page view: 0, 1, 2… A missing rank is a hole, even one that made no node. */
119
+ readonly seq?: number;
120
+ readonly tape: Tape;
121
+ }
122
+ /**
123
+ * Joins chunks into one tape: a hole (a chunk lost on the way) becomes a tick of the time it
124
+ * spanned, and nothing is played until the next snapshot.
125
+ */
126
+ export declare function join(chunks: ReadonlyArray<Chunk>, into?: Tape, from?: {
127
+ next: number;
128
+ broken: boolean;
129
+ seq?: number;
130
+ }): {
131
+ tape: Tape;
132
+ gaps: {
133
+ index: number;
134
+ ms: number;
135
+ }[];
136
+ state: {
137
+ next: number;
138
+ broken: boolean;
139
+ seq?: number;
140
+ };
141
+ };
package/dist/format.js ADDED
@@ -0,0 +1,34 @@
1
+ import {
2
+ End,
3
+ FNV_START,
4
+ MissingBlob,
5
+ Op,
6
+ VERSION,
7
+ fnv,
8
+ join,
9
+ length,
10
+ made,
11
+ makesNode,
12
+ opens,
13
+ references,
14
+ resolve,
15
+ span,
16
+ validate
17
+ } from "./shared/chunk-6US53Q3A.js";
18
+ export {
19
+ End,
20
+ FNV_START,
21
+ MissingBlob,
22
+ Op,
23
+ VERSION,
24
+ fnv,
25
+ join,
26
+ length,
27
+ made,
28
+ makesNode,
29
+ opens,
30
+ references,
31
+ resolve,
32
+ span,
33
+ validate
34
+ };
@@ -0,0 +1,12 @@
1
+ import type { Module } from "../record/index";
2
+ /** Shadow roots, closed ones included: `attachShadow` is watched from the start. */
3
+ export declare function shadow(): Module;
4
+ /** Iframes of the same origin: their document is recorded inside the page. */
5
+ export declare function iframes(): Module;
6
+ /** 2D canvases, as pictures, at most every `everyMs`. Never in a masked or blocked zone. */
7
+ export declare function canvas(everyMs?: number, quality?: number): Module;
8
+ /**
9
+ * What scripts do to stylesheets: `insertRule`, `deleteRule`, `replace`, `replaceSync`, and
10
+ * `adoptedStyleSheets`. A changed sheet is sent again whole, once per read at rest.
11
+ */
12
+ export declare function cssom(): Module;
@@ -0,0 +1,213 @@
1
+ import "./shared/chunk-6US53Q3A.js";
2
+
3
+ // src/modules/index.ts
4
+ function shadow() {
5
+ const closed = /* @__PURE__ */ new WeakMap();
6
+ let kit;
7
+ let restore;
8
+ const rootOf = (el) => kit.native.shadow(el) || closed.get(el) || null;
9
+ return {
10
+ name: "shadow",
11
+ setup(k) {
12
+ kit = k;
13
+ const proto = k.w.Element.prototype;
14
+ const original = proto.attachShadow;
15
+ if (!original) return;
16
+ proto.attachShadow = function(init) {
17
+ const root = original.call(this, init);
18
+ if (init.mode === "closed") closed.set(this, root);
19
+ if (kit.id(this)) kit.redo(this);
20
+ return root;
21
+ };
22
+ restore = () => {
23
+ proto.attachShadow = original;
24
+ };
25
+ },
26
+ onElement(el, zone) {
27
+ const root = rootOf(el);
28
+ if (!root) return;
29
+ kit.take(root, el);
30
+ kit.push(6 /* SHADOW */, root.mode);
31
+ for (let c = kit.native.first(root); c; c = kit.native.next(c)) kit.ser(c, zone);
32
+ kit.push(0 /* X */);
33
+ kit.observe(root);
34
+ kit.listen(root);
35
+ },
36
+ inner: (n) => n.nodeType === 1 ? rootOf(n) : null,
37
+ onStop: () => restore?.()
38
+ };
39
+ }
40
+ function iframes() {
41
+ let kit;
42
+ const loaded = /* @__PURE__ */ new WeakSet();
43
+ const docOf = (el) => {
44
+ if (kit.native.local(el) !== "iframe") return null;
45
+ try {
46
+ return el.contentDocument;
47
+ } catch {
48
+ return null;
49
+ }
50
+ };
51
+ return {
52
+ name: "iframes",
53
+ setup(k) {
54
+ kit = k;
55
+ },
56
+ onElement(el, zone) {
57
+ const doc = kit.native.local(el) === "iframe" ? docOf(el) : null;
58
+ if (kit.native.local(el) === "iframe" && !loaded.has(el)) {
59
+ loaded.add(el);
60
+ el.addEventListener("load", () => kit.redo(el));
61
+ }
62
+ if (!doc) return;
63
+ kit.take(doc, el);
64
+ kit.push(7 /* FRAME */);
65
+ for (let c = kit.native.first(doc); c; c = kit.native.next(c)) kit.ser(c, zone);
66
+ kit.push(0 /* X */);
67
+ kit.observe(doc);
68
+ kit.listen(doc);
69
+ },
70
+ inner: (n) => n.nodeType === 1 ? docOf(n) : null
71
+ };
72
+ }
73
+ function canvas(everyMs = 500, quality = 0.5) {
74
+ let kit;
75
+ const seen = /* @__PURE__ */ new Set();
76
+ const shown = /* @__PURE__ */ new WeakMap();
77
+ let timer;
78
+ return {
79
+ name: "canvas",
80
+ setup(k) {
81
+ kit = k;
82
+ timer = setInterval(() => {
83
+ if (seen.size) kit.dirty();
84
+ }, everyMs);
85
+ },
86
+ onElement(el, zone) {
87
+ if (zone === 0 && kit.native.local(el) === "canvas") seen.add(el);
88
+ },
89
+ onSync() {
90
+ seen.forEach((c) => {
91
+ const id = kit.id(c);
92
+ if (!id || !c.isConnected) {
93
+ seen.delete(c);
94
+ return;
95
+ }
96
+ if (!c.width || !c.height || kit.zone(c) !== 0) return;
97
+ let url;
98
+ try {
99
+ url = c.toDataURL("image/webp", quality);
100
+ } catch {
101
+ seen.delete(c);
102
+ return;
103
+ }
104
+ if (shown.get(c) === url) return;
105
+ shown.set(c, url);
106
+ kit.push(128 /* SHOT */, 2, id, url);
107
+ });
108
+ },
109
+ onStop: () => clearInterval(timer)
110
+ };
111
+ }
112
+ function cssom() {
113
+ let kit;
114
+ const changed = /* @__PURE__ */ new Set();
115
+ const adopting = /* @__PURE__ */ new Set();
116
+ const restores = [];
117
+ const text = (sheet) => {
118
+ let css = "";
119
+ for (const rule of Array.from(sheet.cssRules)) css += rule.cssText;
120
+ return css;
121
+ };
122
+ const send = (sheet) => {
123
+ const node = sheet.ownerNode;
124
+ const id = node ? kit.id(node) : 0;
125
+ if (node && !id) return;
126
+ if (node && kit.zone(node) === 2) return;
127
+ try {
128
+ kit.push(32 /* SHEET */, id || 0, kit.sheet(sheet), text(sheet));
129
+ } catch {
130
+ }
131
+ };
132
+ const adopt = (root) => {
133
+ const id = kit.id(root);
134
+ const sheets = root.adoptedStyleSheets;
135
+ if (!id || !sheets) return;
136
+ const numbers = [];
137
+ for (const s of sheets) {
138
+ if (!kit.sheetKnown(s)) send(s);
139
+ numbers.push(kit.sheet(s));
140
+ }
141
+ kit.push(34 /* ADOPT */, id, numbers.length, ...numbers);
142
+ };
143
+ return {
144
+ name: "cssom",
145
+ setup(k) {
146
+ kit = k;
147
+ const W = k.w;
148
+ const proto = W.CSSStyleSheet?.prototype;
149
+ if (!proto) return;
150
+ for (const method of ["insertRule", "deleteRule", "replace", "replaceSync"]) {
151
+ const original = proto[method];
152
+ if (typeof original !== "function") continue;
153
+ proto[method] = function(...args) {
154
+ const out = original.apply(this, args);
155
+ const mark = () => {
156
+ changed.add(this);
157
+ kit.dirty();
158
+ };
159
+ if (out && typeof out.then === "function")
160
+ out.then(mark, () => {
161
+ });
162
+ else mark();
163
+ return out;
164
+ };
165
+ restores.push(() => {
166
+ proto[method] = original;
167
+ });
168
+ }
169
+ for (const target of [W.Document?.prototype, W.ShadowRoot?.prototype]) {
170
+ if (!target) continue;
171
+ const d = Object.getOwnPropertyDescriptor(target, "adoptedStyleSheets");
172
+ if (!d?.set || !d.get) continue;
173
+ Object.defineProperty(target, "adoptedStyleSheets", {
174
+ configurable: true,
175
+ enumerable: d.enumerable,
176
+ get: d.get,
177
+ set(v) {
178
+ d.set?.call(this, v);
179
+ adopting.add(this);
180
+ kit.dirty();
181
+ }
182
+ });
183
+ restores.push(() => Object.defineProperty(target, "adoptedStyleSheets", d));
184
+ }
185
+ },
186
+ onElement(el) {
187
+ const root = kit.native.shadow(el);
188
+ if (root?.adoptedStyleSheets?.length) adopting.add(root);
189
+ },
190
+ onSnap() {
191
+ if (kit.d.adoptedStyleSheets?.length) adopting.add(kit.d);
192
+ },
193
+ onSync() {
194
+ if (changed.size) {
195
+ for (const s of changed) if (kit.sheetKnown(s) || s.ownerNode) send(s);
196
+ changed.clear();
197
+ }
198
+ if (adopting.size) {
199
+ for (const root of adopting) adopt(root);
200
+ adopting.clear();
201
+ }
202
+ },
203
+ onStop() {
204
+ for (const f of restores) f();
205
+ }
206
+ };
207
+ }
208
+ export {
209
+ canvas,
210
+ cssom,
211
+ iframes,
212
+ shadow
213
+ };
@@ -0,0 +1,58 @@
1
+ import { type Chunk } from "../format/index";
2
+ export { join } from "../format/index";
3
+ export { fingerprint, mirror } from "./mirror";
4
+ export type { Checkpoint, Mirror, MirrorHooks } from "./mirror";
5
+ export interface PlayerOptions {
6
+ readonly root: HTMLElement;
7
+ readonly chunks: ReadonlyArray<Chunk>;
8
+ readonly speed?: number;
9
+ readonly skipIdle?: boolean;
10
+ /** Ms of recording between two checkpoints; a seek starts from the nearest one. */
11
+ readonly every?: number;
12
+ }
13
+ export interface Gap {
14
+ /** Ms from the start of the recording. */
15
+ readonly at: number;
16
+ readonly ms: number;
17
+ }
18
+ export interface Print {
19
+ readonly at: number;
20
+ readonly ok: boolean;
21
+ readonly detail?: string;
22
+ }
23
+ type Events = {
24
+ time: number;
25
+ size: {
26
+ width: number;
27
+ height: number;
28
+ };
29
+ end: undefined;
30
+ print: Print;
31
+ play: undefined;
32
+ pause: undefined;
33
+ };
34
+ export interface Player {
35
+ readonly iframe: HTMLIFrameElement;
36
+ readonly document: Document;
37
+ /** Ms of recording. */
38
+ readonly duration: number;
39
+ /** Ms from the start of the recording. */
40
+ readonly time: number;
41
+ readonly size: {
42
+ width: number;
43
+ height: number;
44
+ };
45
+ readonly playing: boolean;
46
+ readonly gaps: ReadonlyArray<Gap>;
47
+ readonly prints: ReadonlyArray<Print>;
48
+ play(): void;
49
+ pause(): void;
50
+ seek(ms: number): void;
51
+ setSpeed(speed: number): void;
52
+ setSkipIdle(on: boolean): void;
53
+ /** Adds chunks that came after the ones given at first. */
54
+ append(chunks: ReadonlyArray<Chunk>): void;
55
+ on<K extends keyof Events>(event: K, handler: (payload: Events[K]) => void): () => void;
56
+ destroy(): void;
57
+ }
58
+ export declare function createPlayer(options: PlayerOptions): Player;
@@ -0,0 +1,48 @@
1
+ import { type Tape } from "../format/index";
2
+ export interface MirrorHooks {
3
+ readonly pointer?: (x: number, y: number) => void;
4
+ readonly tap?: (kind: number, x: number, y: number) => void;
5
+ readonly size?: (width: number, height: number) => void;
6
+ readonly focus?: (el: Element | null) => void;
7
+ readonly print?: (ok: boolean, at: number, detail: string) => void;
8
+ }
9
+ export interface Mirror {
10
+ /** Runs the tape from `from`, up to the tick that would pass `until`. Returns where it stopped. */
11
+ run(tape: Tape, from?: number, until?: number): number;
12
+ /** Recorded time of the last tick run, ms since epoch. */
13
+ readonly time: number;
14
+ /** The number the next node made takes. */
15
+ readonly next: number;
16
+ readonly url: string;
17
+ readonly nodes: ReadonlyArray<Node | undefined>;
18
+ /** True between batches, where a checkpoint may be taken. */
19
+ readonly rest: boolean;
20
+ /** A copy of the rebuilt page and of what numbers it, to come back to without the tape. */
21
+ save(): Checkpoint;
22
+ /** Puts the page back as it was saved; the tape then runs on from where the save was. */
23
+ restore(cp: Checkpoint): void;
24
+ }
25
+ /**
26
+ * What a copy of the document does not carry is kept beside it: the rules of constructed sheets,
27
+ * which roots adopt them, the frames' documents, canvas pixels, modal dialogs and open popovers,
28
+ * scroll positions, and the last size and pointer.
29
+ */
30
+ export interface Checkpoint {
31
+ readonly holder: Document;
32
+ readonly nodes: ReadonlyArray<Node | undefined>;
33
+ readonly frames: ReadonlyMap<Element, Node>;
34
+ readonly sheets: ReadonlyArray<string | undefined>;
35
+ readonly adopted: ReadonlyArray<readonly [Node, ReadonlyArray<number>]>;
36
+ readonly pixels: ReadonlyArray<readonly [Node, HTMLCanvasElement]>;
37
+ readonly shown: ReadonlyArray<readonly [Node, number]>;
38
+ readonly scrolls: ReadonlyArray<readonly [Node, number, number]>;
39
+ readonly seq: number;
40
+ readonly base: string;
41
+ readonly now: number;
42
+ readonly mode: number;
43
+ readonly size: readonly [number, number] | null;
44
+ readonly pointer: readonly [number, number] | null;
45
+ }
46
+ export declare function mirror(doc: Document, hooks?: MirrorHooks): Mirror;
47
+ /** The PRINT of a rebuilt document, as the recorder computes it of the page. */
48
+ export declare function fingerprint(root: Node): [number, number];