@posthog/rrweb-snapshot 0.0.54 → 0.0.56
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/dist/record.d.cts +277 -5
- package/dist/record.d.ts +277 -5
- package/dist/replay.d.cts +219 -5
- package/dist/replay.d.ts +219 -5
- package/dist/rrweb-snapshot.d.cts +299 -1
- package/dist/rrweb-snapshot.d.ts +299 -1
- package/package.json +3 -3
- package/dist/css.d.cts +0 -5
- package/dist/css.d.ts +0 -5
- package/dist/index.d.cts +0 -6
- package/dist/index.d.ts +0 -6
- package/dist/rebuild.d.cts +0 -23
- package/dist/rebuild.d.ts +0 -23
- package/dist/snapshot.d.cts +0 -71
- package/dist/snapshot.d.ts +0 -71
- package/dist/types.d.cts +0 -103
- package/dist/types.d.ts +0 -103
- package/dist/utils.d.cts +0 -51
- package/dist/utils.d.ts +0 -51
package/dist/record.d.cts
CHANGED
|
@@ -1,5 +1,277 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DataURLOptions } from '@posthog/rrweb-types';
|
|
2
|
+
import { IMirror } from '@posthog/rrweb-types';
|
|
3
|
+
import { serializedElementNodeWithId as serializedElementNodeWithId_2 } from '@posthog/rrweb-types';
|
|
4
|
+
import { serializedNode as serializedNode_2 } from '@posthog/rrweb-types';
|
|
5
|
+
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
6
|
+
|
|
7
|
+
export declare function absolutifyURLs(cssText: string | null, href: string): string;
|
|
8
|
+
|
|
9
|
+
export declare type attributes = {
|
|
10
|
+
[key: string]: string | number | true | null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare type BuildCache = {
|
|
14
|
+
stylesWithHoverClass: Map<string, string>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare type cdataNode = {
|
|
18
|
+
type: NodeType.CDATA;
|
|
19
|
+
textContent: '';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export declare function checkDataURLSize(dataURL: string, maxLength: number | undefined): string;
|
|
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 type commentNode = {
|
|
29
|
+
type: NodeType.Comment;
|
|
30
|
+
textContent: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export declare function createMirror(): Mirror;
|
|
34
|
+
|
|
35
|
+
declare interface CSSImportRule_2 extends CSSRule {
|
|
36
|
+
readonly href: string;
|
|
37
|
+
readonly layerName: string | null;
|
|
38
|
+
readonly media: MediaList;
|
|
39
|
+
readonly styleSheet: CSSStyleSheet;
|
|
40
|
+
readonly supportsText?: string | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const DEFAULT_MAX_DEPTH = 50;
|
|
44
|
+
|
|
45
|
+
export declare type DialogAttributes = {
|
|
46
|
+
open: string;
|
|
47
|
+
rr_open_mode: 'modal' | 'non-modal';
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export declare type documentNode = {
|
|
51
|
+
type: NodeType.Document;
|
|
52
|
+
childNodes: serializedNodeWithId[];
|
|
53
|
+
compatMode?: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export declare type documentTypeNode = {
|
|
57
|
+
type: NodeType.DocumentType;
|
|
58
|
+
name: string;
|
|
59
|
+
publicId: string;
|
|
60
|
+
systemId: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export declare type elementNode = {
|
|
64
|
+
type: NodeType.Element;
|
|
65
|
+
tagName: string;
|
|
66
|
+
attributes: attributes;
|
|
67
|
+
childNodes: serializedNodeWithId[];
|
|
68
|
+
isSVG?: true;
|
|
69
|
+
needBlock?: boolean;
|
|
70
|
+
isCustom?: true;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export declare function escapeImportStatement(rule: CSSImportRule_2): string;
|
|
74
|
+
|
|
75
|
+
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
|
|
76
|
+
|
|
77
|
+
export declare function fixSafariColons(cssStringified: string): string;
|
|
78
|
+
|
|
79
|
+
export declare function genId(): number;
|
|
80
|
+
|
|
81
|
+
export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
|
|
82
|
+
|
|
83
|
+
export declare interface ICanvas extends HTMLCanvasElement {
|
|
84
|
+
__context: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare type idNodeMap = Map<number, Node>;
|
|
88
|
+
|
|
89
|
+
export declare function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean;
|
|
90
|
+
|
|
91
|
+
export declare const IGNORED_NODE = -2;
|
|
92
|
+
|
|
93
|
+
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
|
94
|
+
|
|
95
|
+
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule_2;
|
|
96
|
+
|
|
97
|
+
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
|
|
98
|
+
|
|
99
|
+
export declare function isElement(n: Node): n is Element;
|
|
100
|
+
|
|
101
|
+
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
102
|
+
|
|
103
|
+
export declare function isNodeMetaEqual(a: serializedNode_2, b: serializedNode_2): boolean;
|
|
104
|
+
|
|
105
|
+
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
|
106
|
+
|
|
107
|
+
export declare type KeepIframeSrcFn = (src: string) => boolean;
|
|
108
|
+
|
|
109
|
+
export declare type legacyAttributes = {
|
|
110
|
+
selected: false;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export declare type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
114
|
+
|
|
115
|
+
export declare type MaskInputOptions = Partial<{
|
|
116
|
+
color: boolean;
|
|
117
|
+
date: boolean;
|
|
118
|
+
'datetime-local': boolean;
|
|
119
|
+
email: boolean;
|
|
120
|
+
month: boolean;
|
|
121
|
+
number: boolean;
|
|
122
|
+
range: boolean;
|
|
123
|
+
search: boolean;
|
|
124
|
+
tel: boolean;
|
|
125
|
+
text: boolean;
|
|
126
|
+
time: boolean;
|
|
127
|
+
url: boolean;
|
|
128
|
+
week: boolean;
|
|
129
|
+
textarea: boolean;
|
|
130
|
+
select: boolean;
|
|
131
|
+
password: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
|
|
134
|
+
export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
|
|
135
|
+
element: HTMLElement;
|
|
136
|
+
maskInputOptions: MaskInputOptions;
|
|
137
|
+
tagName: string;
|
|
138
|
+
type: string | null;
|
|
139
|
+
value: string | null;
|
|
140
|
+
maskInputFn?: MaskInputFn;
|
|
141
|
+
}): string;
|
|
142
|
+
|
|
143
|
+
export declare type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
144
|
+
|
|
145
|
+
export declare class Mirror implements IMirror<Node> {
|
|
146
|
+
private idNodeMap;
|
|
147
|
+
private nodeMetaMap;
|
|
148
|
+
getId(n: Node | undefined | null): number;
|
|
149
|
+
getNode(id: number): Node | null;
|
|
150
|
+
getIds(): number[];
|
|
151
|
+
getMeta(n: Node): serializedNodeWithId | null;
|
|
152
|
+
removeNodeFromMap(n: Node): void;
|
|
153
|
+
has(id: number): boolean;
|
|
154
|
+
hasNode(node: Node): boolean;
|
|
155
|
+
add(n: Node, meta: serializedNodeWithId): void;
|
|
156
|
+
replace(id: number, n: Node): void;
|
|
157
|
+
reset(): void;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
161
|
+
|
|
162
|
+
export declare type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
|
|
163
|
+
|
|
164
|
+
export declare enum NodeType {
|
|
165
|
+
Document = 0,
|
|
166
|
+
DocumentType = 1,
|
|
167
|
+
Element = 2,
|
|
168
|
+
Text = 3,
|
|
169
|
+
CDATA = 4,
|
|
170
|
+
Comment = 5
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare function recompressBase64Image(img: HTMLImageElement, dataURL: string, type?: string, quality?: number): string;
|
|
174
|
+
|
|
175
|
+
export declare function resetMaxDepthState(): void;
|
|
176
|
+
|
|
177
|
+
export declare type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
|
|
178
|
+
|
|
179
|
+
export declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
180
|
+
rootId?: number;
|
|
181
|
+
isShadowHost?: boolean;
|
|
182
|
+
isShadow?: boolean;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export declare function serializeNodeWithId(n: Node, options: {
|
|
186
|
+
doc: Document;
|
|
187
|
+
mirror: Mirror;
|
|
188
|
+
blockClass: string | RegExp;
|
|
189
|
+
blockSelector: string | null;
|
|
190
|
+
maskTextClass: string | RegExp;
|
|
191
|
+
maskTextSelector: string | null;
|
|
192
|
+
skipChild: boolean;
|
|
193
|
+
inlineStylesheet: boolean;
|
|
194
|
+
newlyAddedElement?: boolean;
|
|
195
|
+
maskInputOptions?: MaskInputOptions;
|
|
196
|
+
needsMask?: boolean;
|
|
197
|
+
maskTextFn: MaskTextFn | undefined;
|
|
198
|
+
maskInputFn: MaskInputFn | undefined;
|
|
199
|
+
slimDOMOptions: SlimDOMOptions;
|
|
200
|
+
dataURLOptions?: DataURLOptions;
|
|
201
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
202
|
+
inlineImages?: boolean;
|
|
203
|
+
recordCanvas?: boolean;
|
|
204
|
+
preserveWhiteSpace?: boolean;
|
|
205
|
+
onSerialize?: (n: Node) => unknown;
|
|
206
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId_2) => unknown;
|
|
207
|
+
iframeLoadTimeout?: number;
|
|
208
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId_2) => unknown;
|
|
209
|
+
stylesheetLoadTimeout?: number;
|
|
210
|
+
depth?: number;
|
|
211
|
+
maxDepth?: number;
|
|
212
|
+
onMaxDepthReached?: () => void;
|
|
213
|
+
}): serializedNodeWithId | null;
|
|
214
|
+
|
|
215
|
+
export declare function slimDOMDefaults(slimDOM: 'all' | boolean | SlimDOMOptions): SlimDOMOptions;
|
|
216
|
+
|
|
217
|
+
export declare type SlimDOMOptions = Partial<{
|
|
218
|
+
script: boolean;
|
|
219
|
+
comment: boolean;
|
|
220
|
+
headFavicon: boolean;
|
|
221
|
+
headWhitespace: boolean;
|
|
222
|
+
headMetaDescKeywords: boolean;
|
|
223
|
+
headMetaSocial: boolean;
|
|
224
|
+
headMetaRobots: boolean;
|
|
225
|
+
headMetaHttpEquiv: boolean;
|
|
226
|
+
headMetaAuthorship: boolean;
|
|
227
|
+
headMetaVerification: boolean;
|
|
228
|
+
headTitleMutations: boolean;
|
|
229
|
+
}>;
|
|
230
|
+
|
|
231
|
+
export declare function snapshot(n: Document, options?: {
|
|
232
|
+
mirror?: Mirror;
|
|
233
|
+
blockClass?: string | RegExp;
|
|
234
|
+
blockSelector?: string | null;
|
|
235
|
+
maskTextClass?: string | RegExp;
|
|
236
|
+
maskTextSelector?: string | null;
|
|
237
|
+
inlineStylesheet?: boolean;
|
|
238
|
+
maskAllInputs?: boolean | MaskInputOptions;
|
|
239
|
+
maskTextFn?: MaskTextFn;
|
|
240
|
+
maskInputFn?: MaskInputFn;
|
|
241
|
+
slimDOM?: 'all' | boolean | SlimDOMOptions;
|
|
242
|
+
dataURLOptions?: DataURLOptions;
|
|
243
|
+
inlineImages?: boolean;
|
|
244
|
+
recordCanvas?: boolean;
|
|
245
|
+
preserveWhiteSpace?: boolean;
|
|
246
|
+
onSerialize?: (n: Node) => unknown;
|
|
247
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId_2) => unknown;
|
|
248
|
+
iframeLoadTimeout?: number;
|
|
249
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId_2) => unknown;
|
|
250
|
+
stylesheetLoadTimeout?: number;
|
|
251
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
252
|
+
maxDepth?: number;
|
|
253
|
+
}): serializedNodeWithId | null;
|
|
254
|
+
|
|
255
|
+
export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
|
|
256
|
+
|
|
257
|
+
export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
|
|
258
|
+
|
|
259
|
+
export declare type tagMap = {
|
|
260
|
+
[key: string]: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export declare type textNode = {
|
|
264
|
+
type: NodeType.Text;
|
|
265
|
+
textContent: string;
|
|
266
|
+
isStyle?: true;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
|
|
270
|
+
|
|
271
|
+
export declare function transformAttribute(doc: Document, tagName: Lowercase<string>, name: Lowercase<string>, value: string | null, element?: HTMLElement, dataURLOptions?: DataURLOptions): string | null;
|
|
272
|
+
|
|
273
|
+
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
274
|
+
|
|
275
|
+
export declare function wasMaxDepthReached(): boolean;
|
|
276
|
+
|
|
277
|
+
export { }
|
package/dist/record.d.ts
CHANGED
|
@@ -1,5 +1,277 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DataURLOptions } from '@posthog/rrweb-types';
|
|
2
|
+
import { IMirror } from '@posthog/rrweb-types';
|
|
3
|
+
import { serializedElementNodeWithId as serializedElementNodeWithId_2 } from '@posthog/rrweb-types';
|
|
4
|
+
import { serializedNode as serializedNode_2 } from '@posthog/rrweb-types';
|
|
5
|
+
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
6
|
+
|
|
7
|
+
export declare function absolutifyURLs(cssText: string | null, href: string): string;
|
|
8
|
+
|
|
9
|
+
export declare type attributes = {
|
|
10
|
+
[key: string]: string | number | true | null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare type BuildCache = {
|
|
14
|
+
stylesWithHoverClass: Map<string, string>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare type cdataNode = {
|
|
18
|
+
type: NodeType.CDATA;
|
|
19
|
+
textContent: '';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export declare function checkDataURLSize(dataURL: string, maxLength: number | undefined): string;
|
|
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 type commentNode = {
|
|
29
|
+
type: NodeType.Comment;
|
|
30
|
+
textContent: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export declare function createMirror(): Mirror;
|
|
34
|
+
|
|
35
|
+
declare interface CSSImportRule_2 extends CSSRule {
|
|
36
|
+
readonly href: string;
|
|
37
|
+
readonly layerName: string | null;
|
|
38
|
+
readonly media: MediaList;
|
|
39
|
+
readonly styleSheet: CSSStyleSheet;
|
|
40
|
+
readonly supportsText?: string | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const DEFAULT_MAX_DEPTH = 50;
|
|
44
|
+
|
|
45
|
+
export declare type DialogAttributes = {
|
|
46
|
+
open: string;
|
|
47
|
+
rr_open_mode: 'modal' | 'non-modal';
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export declare type documentNode = {
|
|
51
|
+
type: NodeType.Document;
|
|
52
|
+
childNodes: serializedNodeWithId[];
|
|
53
|
+
compatMode?: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export declare type documentTypeNode = {
|
|
57
|
+
type: NodeType.DocumentType;
|
|
58
|
+
name: string;
|
|
59
|
+
publicId: string;
|
|
60
|
+
systemId: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export declare type elementNode = {
|
|
64
|
+
type: NodeType.Element;
|
|
65
|
+
tagName: string;
|
|
66
|
+
attributes: attributes;
|
|
67
|
+
childNodes: serializedNodeWithId[];
|
|
68
|
+
isSVG?: true;
|
|
69
|
+
needBlock?: boolean;
|
|
70
|
+
isCustom?: true;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export declare function escapeImportStatement(rule: CSSImportRule_2): string;
|
|
74
|
+
|
|
75
|
+
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
|
|
76
|
+
|
|
77
|
+
export declare function fixSafariColons(cssStringified: string): string;
|
|
78
|
+
|
|
79
|
+
export declare function genId(): number;
|
|
80
|
+
|
|
81
|
+
export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
|
|
82
|
+
|
|
83
|
+
export declare interface ICanvas extends HTMLCanvasElement {
|
|
84
|
+
__context: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare type idNodeMap = Map<number, Node>;
|
|
88
|
+
|
|
89
|
+
export declare function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean;
|
|
90
|
+
|
|
91
|
+
export declare const IGNORED_NODE = -2;
|
|
92
|
+
|
|
93
|
+
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
|
94
|
+
|
|
95
|
+
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule_2;
|
|
96
|
+
|
|
97
|
+
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
|
|
98
|
+
|
|
99
|
+
export declare function isElement(n: Node): n is Element;
|
|
100
|
+
|
|
101
|
+
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
102
|
+
|
|
103
|
+
export declare function isNodeMetaEqual(a: serializedNode_2, b: serializedNode_2): boolean;
|
|
104
|
+
|
|
105
|
+
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
|
106
|
+
|
|
107
|
+
export declare type KeepIframeSrcFn = (src: string) => boolean;
|
|
108
|
+
|
|
109
|
+
export declare type legacyAttributes = {
|
|
110
|
+
selected: false;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export declare type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
114
|
+
|
|
115
|
+
export declare type MaskInputOptions = Partial<{
|
|
116
|
+
color: boolean;
|
|
117
|
+
date: boolean;
|
|
118
|
+
'datetime-local': boolean;
|
|
119
|
+
email: boolean;
|
|
120
|
+
month: boolean;
|
|
121
|
+
number: boolean;
|
|
122
|
+
range: boolean;
|
|
123
|
+
search: boolean;
|
|
124
|
+
tel: boolean;
|
|
125
|
+
text: boolean;
|
|
126
|
+
time: boolean;
|
|
127
|
+
url: boolean;
|
|
128
|
+
week: boolean;
|
|
129
|
+
textarea: boolean;
|
|
130
|
+
select: boolean;
|
|
131
|
+
password: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
|
|
134
|
+
export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
|
|
135
|
+
element: HTMLElement;
|
|
136
|
+
maskInputOptions: MaskInputOptions;
|
|
137
|
+
tagName: string;
|
|
138
|
+
type: string | null;
|
|
139
|
+
value: string | null;
|
|
140
|
+
maskInputFn?: MaskInputFn;
|
|
141
|
+
}): string;
|
|
142
|
+
|
|
143
|
+
export declare type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
144
|
+
|
|
145
|
+
export declare class Mirror implements IMirror<Node> {
|
|
146
|
+
private idNodeMap;
|
|
147
|
+
private nodeMetaMap;
|
|
148
|
+
getId(n: Node | undefined | null): number;
|
|
149
|
+
getNode(id: number): Node | null;
|
|
150
|
+
getIds(): number[];
|
|
151
|
+
getMeta(n: Node): serializedNodeWithId | null;
|
|
152
|
+
removeNodeFromMap(n: Node): void;
|
|
153
|
+
has(id: number): boolean;
|
|
154
|
+
hasNode(node: Node): boolean;
|
|
155
|
+
add(n: Node, meta: serializedNodeWithId): void;
|
|
156
|
+
replace(id: number, n: Node): void;
|
|
157
|
+
reset(): void;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
161
|
+
|
|
162
|
+
export declare type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
|
|
163
|
+
|
|
164
|
+
export declare enum NodeType {
|
|
165
|
+
Document = 0,
|
|
166
|
+
DocumentType = 1,
|
|
167
|
+
Element = 2,
|
|
168
|
+
Text = 3,
|
|
169
|
+
CDATA = 4,
|
|
170
|
+
Comment = 5
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare function recompressBase64Image(img: HTMLImageElement, dataURL: string, type?: string, quality?: number): string;
|
|
174
|
+
|
|
175
|
+
export declare function resetMaxDepthState(): void;
|
|
176
|
+
|
|
177
|
+
export declare type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
|
|
178
|
+
|
|
179
|
+
export declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
180
|
+
rootId?: number;
|
|
181
|
+
isShadowHost?: boolean;
|
|
182
|
+
isShadow?: boolean;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export declare function serializeNodeWithId(n: Node, options: {
|
|
186
|
+
doc: Document;
|
|
187
|
+
mirror: Mirror;
|
|
188
|
+
blockClass: string | RegExp;
|
|
189
|
+
blockSelector: string | null;
|
|
190
|
+
maskTextClass: string | RegExp;
|
|
191
|
+
maskTextSelector: string | null;
|
|
192
|
+
skipChild: boolean;
|
|
193
|
+
inlineStylesheet: boolean;
|
|
194
|
+
newlyAddedElement?: boolean;
|
|
195
|
+
maskInputOptions?: MaskInputOptions;
|
|
196
|
+
needsMask?: boolean;
|
|
197
|
+
maskTextFn: MaskTextFn | undefined;
|
|
198
|
+
maskInputFn: MaskInputFn | undefined;
|
|
199
|
+
slimDOMOptions: SlimDOMOptions;
|
|
200
|
+
dataURLOptions?: DataURLOptions;
|
|
201
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
202
|
+
inlineImages?: boolean;
|
|
203
|
+
recordCanvas?: boolean;
|
|
204
|
+
preserveWhiteSpace?: boolean;
|
|
205
|
+
onSerialize?: (n: Node) => unknown;
|
|
206
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId_2) => unknown;
|
|
207
|
+
iframeLoadTimeout?: number;
|
|
208
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId_2) => unknown;
|
|
209
|
+
stylesheetLoadTimeout?: number;
|
|
210
|
+
depth?: number;
|
|
211
|
+
maxDepth?: number;
|
|
212
|
+
onMaxDepthReached?: () => void;
|
|
213
|
+
}): serializedNodeWithId | null;
|
|
214
|
+
|
|
215
|
+
export declare function slimDOMDefaults(slimDOM: 'all' | boolean | SlimDOMOptions): SlimDOMOptions;
|
|
216
|
+
|
|
217
|
+
export declare type SlimDOMOptions = Partial<{
|
|
218
|
+
script: boolean;
|
|
219
|
+
comment: boolean;
|
|
220
|
+
headFavicon: boolean;
|
|
221
|
+
headWhitespace: boolean;
|
|
222
|
+
headMetaDescKeywords: boolean;
|
|
223
|
+
headMetaSocial: boolean;
|
|
224
|
+
headMetaRobots: boolean;
|
|
225
|
+
headMetaHttpEquiv: boolean;
|
|
226
|
+
headMetaAuthorship: boolean;
|
|
227
|
+
headMetaVerification: boolean;
|
|
228
|
+
headTitleMutations: boolean;
|
|
229
|
+
}>;
|
|
230
|
+
|
|
231
|
+
export declare function snapshot(n: Document, options?: {
|
|
232
|
+
mirror?: Mirror;
|
|
233
|
+
blockClass?: string | RegExp;
|
|
234
|
+
blockSelector?: string | null;
|
|
235
|
+
maskTextClass?: string | RegExp;
|
|
236
|
+
maskTextSelector?: string | null;
|
|
237
|
+
inlineStylesheet?: boolean;
|
|
238
|
+
maskAllInputs?: boolean | MaskInputOptions;
|
|
239
|
+
maskTextFn?: MaskTextFn;
|
|
240
|
+
maskInputFn?: MaskInputFn;
|
|
241
|
+
slimDOM?: 'all' | boolean | SlimDOMOptions;
|
|
242
|
+
dataURLOptions?: DataURLOptions;
|
|
243
|
+
inlineImages?: boolean;
|
|
244
|
+
recordCanvas?: boolean;
|
|
245
|
+
preserveWhiteSpace?: boolean;
|
|
246
|
+
onSerialize?: (n: Node) => unknown;
|
|
247
|
+
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId_2) => unknown;
|
|
248
|
+
iframeLoadTimeout?: number;
|
|
249
|
+
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId_2) => unknown;
|
|
250
|
+
stylesheetLoadTimeout?: number;
|
|
251
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
252
|
+
maxDepth?: number;
|
|
253
|
+
}): serializedNodeWithId | null;
|
|
254
|
+
|
|
255
|
+
export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
|
|
256
|
+
|
|
257
|
+
export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
|
|
258
|
+
|
|
259
|
+
export declare type tagMap = {
|
|
260
|
+
[key: string]: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export declare type textNode = {
|
|
264
|
+
type: NodeType.Text;
|
|
265
|
+
textContent: string;
|
|
266
|
+
isStyle?: true;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
|
|
270
|
+
|
|
271
|
+
export declare function transformAttribute(doc: Document, tagName: Lowercase<string>, name: Lowercase<string>, value: string | null, element?: HTMLElement, dataURLOptions?: DataURLOptions): string | null;
|
|
272
|
+
|
|
273
|
+
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
274
|
+
|
|
275
|
+
export declare function wasMaxDepthReached(): boolean;
|
|
276
|
+
|
|
277
|
+
export { }
|