@betterbugs/rrweb-snapshot 2.0.0-alpha.19
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/README.md +214 -0
- package/dist/index.d.cts +240 -0
- package/dist/index.d.ts +240 -0
- package/dist/rrweb-snapshot.cjs +5515 -0
- package/dist/rrweb-snapshot.cjs.map +1 -0
- package/dist/rrweb-snapshot.js +5515 -0
- package/dist/rrweb-snapshot.js.map +1 -0
- package/dist/rrweb-snapshot.umd.cjs +5581 -0
- package/dist/rrweb-snapshot.umd.cjs.map +7 -0
- package/dist/rrweb-snapshot.umd.min.cjs +58 -0
- package/dist/rrweb-snapshot.umd.min.cjs.map +7 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# rrweb-snapshot
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/rrweb-io/rrweb) [](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg)
|
|
4
|
+
|
|
5
|
+
Snapshot the DOM into a stateful and serializable data structure.
|
|
6
|
+
Also, provide the ability to rebuild the DOM via snapshot.
|
|
7
|
+
|
|
8
|
+
## API
|
|
9
|
+
|
|
10
|
+
This module export following methods:
|
|
11
|
+
|
|
12
|
+
### snapshot
|
|
13
|
+
|
|
14
|
+
`snapshot` will traverse the DOM and return a stateful and serializable data structure which can represent the current DOM **view**.
|
|
15
|
+
|
|
16
|
+
There are several things will be done during snapshot:
|
|
17
|
+
|
|
18
|
+
1. Inline some DOM states into HTML attributes, e.g, HTMLInputElement's value.
|
|
19
|
+
2. Turn script tags into `noscript` tags to avoid scripts being executed.
|
|
20
|
+
3. Try to inline stylesheets to make sure local stylesheets can be used.
|
|
21
|
+
4. Make relative paths in href, src, CSS to be absolute paths.
|
|
22
|
+
5. Give an id to each Node, and return the id node map when snapshot finished.
|
|
23
|
+
|
|
24
|
+
#### rebuild
|
|
25
|
+
|
|
26
|
+
`rebuild` will build the DOM according to the taken snapshot.
|
|
27
|
+
|
|
28
|
+
There are several things will be done during rebuild:
|
|
29
|
+
|
|
30
|
+
1. Add data-rrid attribute if the Node is an Element.
|
|
31
|
+
2. Create some extra DOM node like text node to place inline CSS and some states.
|
|
32
|
+
3. Add data-extra-child-index attribute if Node has some extra child DOM.
|
|
33
|
+
|
|
34
|
+
#### serializeNodeWithId
|
|
35
|
+
|
|
36
|
+
`serializeNodeWithId` can serialize a node into snapshot format with id.
|
|
37
|
+
|
|
38
|
+
#### buildNodeWithSN
|
|
39
|
+
|
|
40
|
+
`buildNodeWithSN` will build DOM from serialized node and store serialized information in the `mirror.getMeta(node)`.
|
|
41
|
+
|
|
42
|
+
## Sponsors
|
|
43
|
+
|
|
44
|
+
[Become a sponsor](https://opencollective.com/rrweb#sponsor) and get your logo on our README on Github with a link to your site.
|
|
45
|
+
|
|
46
|
+
### Gold Sponsors 🥇
|
|
47
|
+
|
|
48
|
+
<div dir="auto">
|
|
49
|
+
|
|
50
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/0/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
51
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/1/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
52
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/2/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
53
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/3/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
54
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/4/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
55
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/5/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
56
|
+
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/6/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
### Silver Sponsors 🥈
|
|
61
|
+
|
|
62
|
+
<div dir="auto">
|
|
63
|
+
|
|
64
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/0/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
65
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/1/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
66
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/2/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
67
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/3/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
68
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/4/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
69
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/5/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
70
|
+
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/6/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
71
|
+
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
### Bronze Sponsors 🥉
|
|
75
|
+
|
|
76
|
+
<div dir="auto">
|
|
77
|
+
|
|
78
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/0/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
79
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/1/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
80
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/2/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
81
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/3/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
82
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/4/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
83
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/5/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
84
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/6/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
85
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/7/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
86
|
+
<a href="https://opencollective.com/rrweb/tiers/sponsors/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/8/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
### Backers
|
|
91
|
+
|
|
92
|
+
<a href="https://opencollective.com/rrweb#sponsor" rel="nofollow"><img src="https://opencollective.com/rrweb/tiers/backers.svg?avatarHeight=36"></a>
|
|
93
|
+
|
|
94
|
+
## Core Team Members
|
|
95
|
+
|
|
96
|
+
<table>
|
|
97
|
+
<tr>
|
|
98
|
+
<td align="center">
|
|
99
|
+
<a href="https://github.com/Yuyz0112">
|
|
100
|
+
<img
|
|
101
|
+
src="https://avatars.githubusercontent.com/u/13651389?s=100"
|
|
102
|
+
width="100px;"
|
|
103
|
+
alt=""
|
|
104
|
+
/>
|
|
105
|
+
<br /><sub><b>Yuyz0112</b></sub>
|
|
106
|
+
<br /><br />
|
|
107
|
+
</a>
|
|
108
|
+
</td>
|
|
109
|
+
<td align="center">
|
|
110
|
+
<a href="https://github.com/YunFeng0817">
|
|
111
|
+
<img
|
|
112
|
+
src="https://avatars.githubusercontent.com/u/27533910?s=100"
|
|
113
|
+
width="100px;"
|
|
114
|
+
alt=""
|
|
115
|
+
/>
|
|
116
|
+
<br /><sub><b>Yun Feng</b></sub>
|
|
117
|
+
<br /><br />
|
|
118
|
+
</a>
|
|
119
|
+
</td>
|
|
120
|
+
<td align="center">
|
|
121
|
+
<a href="https://github.com/eoghanmurray">
|
|
122
|
+
<img
|
|
123
|
+
src="https://avatars.githubusercontent.com/u/156780?s=100"
|
|
124
|
+
width="100px;"
|
|
125
|
+
alt=""
|
|
126
|
+
/>
|
|
127
|
+
<br /><sub><b>eoghanmurray</b></sub>
|
|
128
|
+
<br /><br />
|
|
129
|
+
</a>
|
|
130
|
+
</td>
|
|
131
|
+
<td align="center">
|
|
132
|
+
<a href="https://github.com/Juice10">
|
|
133
|
+
<img
|
|
134
|
+
src="https://avatars.githubusercontent.com/u/4106?s=100"
|
|
135
|
+
width="100px;"
|
|
136
|
+
alt=""
|
|
137
|
+
/>
|
|
138
|
+
<br /><sub><b>Juice10</b></sub>
|
|
139
|
+
<br /><sub>open for rrweb consulting</sub>
|
|
140
|
+
</a>
|
|
141
|
+
</td>
|
|
142
|
+
</tr>
|
|
143
|
+
</table>
|
|
144
|
+
|
|
145
|
+
## Who's using rrweb?
|
|
146
|
+
|
|
147
|
+
<table>
|
|
148
|
+
<tr>
|
|
149
|
+
<td align="center">
|
|
150
|
+
<a href="http://www.smartx.com/" target="_blank">
|
|
151
|
+
<img width="195px" src="https://www.rrweb.io/logos/smartx.png">
|
|
152
|
+
</a>
|
|
153
|
+
</td>
|
|
154
|
+
<td align="center">
|
|
155
|
+
<a href="https://posthog.com?utm_source=rrweb&utm_medium=sponsorship&utm_campaign=open-source-sponsorship" target="_blank">
|
|
156
|
+
<img width="195px" src="https://www.rrweb.io/logos/posthog.png">
|
|
157
|
+
</a>
|
|
158
|
+
</td>
|
|
159
|
+
<td align="center">
|
|
160
|
+
<a href="https://statcounter.com/session-replay/" target="_blank">
|
|
161
|
+
<img width="195px" src="https://statcounter.com/images/logo-statcounter-arc-blue.svg">
|
|
162
|
+
</a>
|
|
163
|
+
</td>
|
|
164
|
+
<td align="center">
|
|
165
|
+
<a href="https://recordonce.com/" target="_blank">
|
|
166
|
+
<img width="195px" alt="Smart screen recording for SaaS" src="https://uploads-ssl.webflow.com/5f3d133183156245630d4446/5f3d1940abe8db8612c23521_Record-Once-logo-554x80px.svg">
|
|
167
|
+
</a>
|
|
168
|
+
</td>
|
|
169
|
+
</tr>
|
|
170
|
+
<tr>
|
|
171
|
+
<td align="center">
|
|
172
|
+
<a href="https://cux.io" target="_blank">
|
|
173
|
+
<img style="padding: 8px" alt="The first ever UX automation tool" width="195px" src="https://cux.io/cux-logo.svg">
|
|
174
|
+
</a>
|
|
175
|
+
</td>
|
|
176
|
+
<td align="center">
|
|
177
|
+
<a href="https://remsupp.com" target="_blank">
|
|
178
|
+
<img style="padding: 8px" alt="Remote Access & Co-Browsing" width="195px" src="https://remsupp.com/images/logo.png">
|
|
179
|
+
</a>
|
|
180
|
+
</td>
|
|
181
|
+
<td align="center">
|
|
182
|
+
<a href="https://highlight.io" target="_blank">
|
|
183
|
+
<img style="padding: 8px" alt="The open source, fullstack Monitoring Platform." width="195px" src="https://github.com/highlight/highlight/raw/main/highlight.io/public/images/logo.png">
|
|
184
|
+
</a>
|
|
185
|
+
</td>
|
|
186
|
+
<td align="center">
|
|
187
|
+
<a href="https://analyzee.io" target="_blank">
|
|
188
|
+
<img style="padding: 8px" alt="Comprehensive data analytics platform that empowers businesses to gain valuable insights and make data-driven decisions." width="195px" src="https://cdn.analyzee.io/assets/analyzee-logo.png">
|
|
189
|
+
</a>
|
|
190
|
+
</td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td align="center">
|
|
194
|
+
<a href="https://requestly.io" target="_blank">
|
|
195
|
+
<img style="padding: 8px" alt="Intercept, Modify, Record & Replay HTTP Requests." width="195px" src="https://github.com/requestly/requestly/assets/16779465/652552db-c867-44cb-9bb5-94a2026e04ca">
|
|
196
|
+
</a>
|
|
197
|
+
</td>
|
|
198
|
+
<td align="center">
|
|
199
|
+
<a href="https://gleap.io" target="_blank">
|
|
200
|
+
<img style="padding: 8px" alt="In-app bug reporting & customer feedback platform." width="195px" src="https://assets-global.website-files.com/6506f3f29c68b1724807619d/6506f56010237164c6306591_GleapLogo.svg">
|
|
201
|
+
</a>
|
|
202
|
+
</td>
|
|
203
|
+
<td align="center">
|
|
204
|
+
<a href="https://uxwizz.com" target="_blank">
|
|
205
|
+
<img style="padding: 8px" alt="Self-hosted website analytics with heatmaps and session recordings." width="195px" src="https://github.com/UXWizz/public-files/raw/main/assets/logo.png">
|
|
206
|
+
</a>
|
|
207
|
+
</td>
|
|
208
|
+
<td align="center">
|
|
209
|
+
<a href="https://www.howdygo.com" target="_blank">
|
|
210
|
+
<img style="padding: 8px" alt="Interactive product demos for small marketing teams" width="195px" src="https://assets-global.website-files.com/650afb446f1dd5bd410f00cc/650b2cec6188ff54dd9b01e1_Logo.svg">
|
|
211
|
+
</a>
|
|
212
|
+
</td>
|
|
213
|
+
</tr>
|
|
214
|
+
</table>
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { DataURLOptions } from '@betterbugs/types';
|
|
2
|
+
import { IMirror } from '@betterbugs/types';
|
|
3
|
+
import { serializedElementNodeWithId } from '@betterbugs/types';
|
|
4
|
+
import { serializedNode } from '@betterbugs/types';
|
|
5
|
+
import { serializedNodeWithId } from '@betterbugs/types';
|
|
6
|
+
|
|
7
|
+
export declare function absolutifyURLs(cssText: string | null, href: string): string;
|
|
8
|
+
|
|
9
|
+
export declare function adaptCssForReplay(cssText: string, cache: BuildCache): string;
|
|
10
|
+
|
|
11
|
+
export declare type BuildCache = {
|
|
12
|
+
stylesWithHoverClass: Map<string, string>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
16
|
+
doc: Document;
|
|
17
|
+
mirror: Mirror;
|
|
18
|
+
skipChild?: boolean;
|
|
19
|
+
hackCss: boolean;
|
|
20
|
+
afterAppend?: (n: Node, id: number) => unknown;
|
|
21
|
+
cache: BuildCache;
|
|
22
|
+
}): Node | null;
|
|
23
|
+
|
|
24
|
+
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
|
25
|
+
|
|
26
|
+
export declare function cleanupSnapshot(): void;
|
|
27
|
+
|
|
28
|
+
export declare function createCache(): BuildCache;
|
|
29
|
+
|
|
30
|
+
export declare function createMirror(): Mirror;
|
|
31
|
+
|
|
32
|
+
declare interface CSSImportRule_2 extends CSSRule {
|
|
33
|
+
readonly href: string;
|
|
34
|
+
readonly layerName: string | null;
|
|
35
|
+
readonly media: MediaList;
|
|
36
|
+
readonly styleSheet: CSSStyleSheet;
|
|
37
|
+
readonly supportsText?: string | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare type DialogAttributes = {
|
|
41
|
+
open: string;
|
|
42
|
+
rr_open_mode: 'modal' | 'non-modal';
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export declare function escapeImportStatement(rule: CSSImportRule_2): string;
|
|
46
|
+
|
|
47
|
+
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
|
|
48
|
+
|
|
49
|
+
export declare function fixSafariColons(cssStringified: string): string;
|
|
50
|
+
|
|
51
|
+
export declare function genId(): number;
|
|
52
|
+
|
|
53
|
+
export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
|
|
54
|
+
|
|
55
|
+
export declare interface ICanvas extends HTMLCanvasElement {
|
|
56
|
+
__context: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare type idNodeMap = Map<number, Node>;
|
|
60
|
+
|
|
61
|
+
export declare function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean;
|
|
62
|
+
|
|
63
|
+
export declare const IGNORED_NODE = -2;
|
|
64
|
+
|
|
65
|
+
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
|
66
|
+
|
|
67
|
+
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule_2;
|
|
68
|
+
|
|
69
|
+
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
|
|
70
|
+
|
|
71
|
+
export declare function isElement(n: Node): n is Element;
|
|
72
|
+
|
|
73
|
+
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
74
|
+
|
|
75
|
+
export declare function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean;
|
|
76
|
+
|
|
77
|
+
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
|
78
|
+
|
|
79
|
+
export declare type KeepIframeSrcFn = (src: string) => boolean;
|
|
80
|
+
|
|
81
|
+
export declare function markCssSplits(cssText: string, style: HTMLStyleElement): string;
|
|
82
|
+
|
|
83
|
+
export declare type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
84
|
+
|
|
85
|
+
export declare type MaskInputOptions = Partial<{
|
|
86
|
+
color: boolean;
|
|
87
|
+
date: boolean;
|
|
88
|
+
'datetime-local': boolean;
|
|
89
|
+
email: boolean;
|
|
90
|
+
month: boolean;
|
|
91
|
+
number: boolean;
|
|
92
|
+
range: boolean;
|
|
93
|
+
search: boolean;
|
|
94
|
+
tel: boolean;
|
|
95
|
+
text: boolean;
|
|
96
|
+
time: boolean;
|
|
97
|
+
url: boolean;
|
|
98
|
+
week: boolean;
|
|
99
|
+
textarea: boolean;
|
|
100
|
+
select: boolean;
|
|
101
|
+
password: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
|
|
104
|
+
export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
|
|
105
|
+
element: HTMLElement;
|
|
106
|
+
maskInputOptions: MaskInputOptions;
|
|
107
|
+
tagName: string;
|
|
108
|
+
type: string | null;
|
|
109
|
+
value: string | null;
|
|
110
|
+
maskInputFn?: MaskInputFn;
|
|
111
|
+
}): string;
|
|
112
|
+
|
|
113
|
+
export declare type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
114
|
+
|
|
115
|
+
export declare class Mirror implements IMirror<Node> {
|
|
116
|
+
private idNodeMap;
|
|
117
|
+
private nodeMetaMap;
|
|
118
|
+
getId(n: Node | undefined | null): number;
|
|
119
|
+
getNode(id: number): Node | null;
|
|
120
|
+
getIds(): number[];
|
|
121
|
+
getMeta(n: Node): serializedNodeWithId | null;
|
|
122
|
+
removeNodeFromMap(n: Node): void;
|
|
123
|
+
has(id: number): boolean;
|
|
124
|
+
hasNode(node: Node): boolean;
|
|
125
|
+
add(n: Node, meta: serializedNodeWithId): void;
|
|
126
|
+
replace(id: number, n: Node): void;
|
|
127
|
+
reset(): void;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
131
|
+
|
|
132
|
+
export declare type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
|
|
133
|
+
|
|
134
|
+
export declare function normalizeCssString(cssText: string, _testNoPxNorm?: boolean): string;
|
|
135
|
+
|
|
136
|
+
export declare function rebuild(n: serializedNodeWithId, options: {
|
|
137
|
+
doc: Document;
|
|
138
|
+
onVisit?: (node: Node) => unknown;
|
|
139
|
+
hackCss?: boolean;
|
|
140
|
+
afterAppend?: (n: Node, id: number) => unknown;
|
|
141
|
+
cache: BuildCache;
|
|
142
|
+
mirror: Mirror;
|
|
143
|
+
}): Node | null;
|
|
144
|
+
|
|
145
|
+
export declare function serializeNodeWithId(n: Node, options: {
|
|
146
|
+
doc: Document;
|
|
147
|
+
mirror: Mirror;
|
|
148
|
+
blockClass: string | RegExp;
|
|
149
|
+
blockSelector: string | null;
|
|
150
|
+
maskTextClass: string | RegExp;
|
|
151
|
+
maskTextSelector: string | null;
|
|
152
|
+
skipChild: boolean;
|
|
153
|
+
inlineStylesheet: boolean;
|
|
154
|
+
newlyAddedElement?: boolean;
|
|
155
|
+
maskInputOptions?: MaskInputOptions;
|
|
156
|
+
needsMask?: boolean;
|
|
157
|
+
maskTextFn: MaskTextFn | undefined;
|
|
158
|
+
maskInputFn: MaskInputFn | undefined;
|
|
159
|
+
slimDOMOptions: SlimDOMOptions;
|
|
160
|
+
dataURLOptions?: DataURLOptions;
|
|
161
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
162
|
+
inlineImages?: boolean;
|
|
163
|
+
recordCanvas?: boolean;
|
|
164
|
+
preserveWhiteSpace?: boolean;
|
|
165
|
+
onSerialize?: (n: Node) => unknown;
|
|
166
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
167
|
+
iframeLoadTimeout?: number;
|
|
168
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
169
|
+
stylesheetLoadTimeout?: number;
|
|
170
|
+
cssCaptured?: boolean;
|
|
171
|
+
}): serializedNodeWithId | null;
|
|
172
|
+
|
|
173
|
+
export declare function slimDOMDefaults(_slimDOMOptions: SlimDOMOptions | 'all' | true | false | undefined): Partial<{
|
|
174
|
+
script: boolean;
|
|
175
|
+
comment: boolean;
|
|
176
|
+
headFavicon: boolean;
|
|
177
|
+
headWhitespace: boolean;
|
|
178
|
+
headMetaDescKeywords: boolean;
|
|
179
|
+
headMetaSocial: boolean;
|
|
180
|
+
headMetaRobots: boolean;
|
|
181
|
+
headMetaHttpEquiv: boolean;
|
|
182
|
+
headMetaAuthorship: boolean;
|
|
183
|
+
headMetaVerification: boolean;
|
|
184
|
+
headTitleMutations: boolean;
|
|
185
|
+
}>;
|
|
186
|
+
|
|
187
|
+
export declare type SlimDOMOptions = Partial<{
|
|
188
|
+
script: boolean;
|
|
189
|
+
comment: boolean;
|
|
190
|
+
headFavicon: boolean;
|
|
191
|
+
headWhitespace: boolean;
|
|
192
|
+
headMetaDescKeywords: boolean;
|
|
193
|
+
headMetaSocial: boolean;
|
|
194
|
+
headMetaRobots: boolean;
|
|
195
|
+
headMetaHttpEquiv: boolean;
|
|
196
|
+
headMetaAuthorship: boolean;
|
|
197
|
+
headMetaVerification: boolean;
|
|
198
|
+
headTitleMutations: boolean;
|
|
199
|
+
}>;
|
|
200
|
+
|
|
201
|
+
export declare function snapshot(n: Document, options?: {
|
|
202
|
+
mirror?: Mirror;
|
|
203
|
+
blockClass?: string | RegExp;
|
|
204
|
+
blockSelector?: string | null;
|
|
205
|
+
maskTextClass?: string | RegExp;
|
|
206
|
+
maskTextSelector?: string | null;
|
|
207
|
+
inlineStylesheet?: boolean;
|
|
208
|
+
maskAllInputs?: boolean | MaskInputOptions;
|
|
209
|
+
maskTextFn?: MaskTextFn;
|
|
210
|
+
maskInputFn?: MaskInputFn;
|
|
211
|
+
slimDOM?: 'all' | boolean | SlimDOMOptions;
|
|
212
|
+
dataURLOptions?: DataURLOptions;
|
|
213
|
+
inlineImages?: boolean;
|
|
214
|
+
recordCanvas?: boolean;
|
|
215
|
+
preserveWhiteSpace?: boolean;
|
|
216
|
+
onSerialize?: (n: Node) => unknown;
|
|
217
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
218
|
+
iframeLoadTimeout?: number;
|
|
219
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
220
|
+
stylesheetLoadTimeout?: number;
|
|
221
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
222
|
+
}): serializedNodeWithId | null;
|
|
223
|
+
|
|
224
|
+
export declare function splitCssText(cssText: string, style: HTMLStyleElement, _testNoPxNorm?: boolean): string[];
|
|
225
|
+
|
|
226
|
+
export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
|
|
227
|
+
|
|
228
|
+
export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
|
|
229
|
+
|
|
230
|
+
export declare type tagMap = {
|
|
231
|
+
[key: string]: string;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
|
|
235
|
+
|
|
236
|
+
export declare function transformAttribute(doc: Document, tagName: Lowercase<string>, name: Lowercase<string>, value: string | null): string | null;
|
|
237
|
+
|
|
238
|
+
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
239
|
+
|
|
240
|
+
export { }
|