@betterbugs/rrdom 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 +179 -0
- package/dist/index.d.cts +379 -0
- package/dist/index.d.ts +379 -0
- package/dist/rrdom.cjs +4945 -0
- package/dist/rrdom.cjs.map +1 -0
- package/dist/rrdom.js +4945 -0
- package/dist/rrdom.js.map +1 -0
- package/dist/rrdom.umd.cjs +5006 -0
- package/dist/rrdom.umd.cjs.map +7 -0
- package/dist/rrdom.umd.min.cjs +58 -0
- package/dist/rrdom.umd.min.cjs.map +7 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# rrdom
|
|
2
|
+
|
|
3
|
+
`rrdom` is a virtual dom library that is used by `rrweb` to replay DOM mutations. It is a standalone library that can be used to create a virtual dom tree and apply patches to the real dom. It's used in `rrweb` to optimize replay performance especially when seeking.
|
|
4
|
+
|
|
5
|
+
See the [guide](../../guide.md) for more info on rrweb.
|
|
6
|
+
|
|
7
|
+
## Sponsors
|
|
8
|
+
|
|
9
|
+
[Become a sponsor](https://opencollective.com/rrweb#sponsor) and get your logo on our README on Github with a link to your site.
|
|
10
|
+
|
|
11
|
+
### Gold Sponsors 🥇
|
|
12
|
+
|
|
13
|
+
<div dir="auto">
|
|
14
|
+
|
|
15
|
+
<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>
|
|
16
|
+
<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>
|
|
17
|
+
<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>
|
|
18
|
+
<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>
|
|
19
|
+
<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>
|
|
20
|
+
<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>
|
|
21
|
+
<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>
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
### Silver Sponsors 🥈
|
|
26
|
+
|
|
27
|
+
<div dir="auto">
|
|
28
|
+
|
|
29
|
+
<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>
|
|
30
|
+
<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>
|
|
31
|
+
<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>
|
|
32
|
+
<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>
|
|
33
|
+
<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>
|
|
34
|
+
<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>
|
|
35
|
+
<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>
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
### Bronze Sponsors 🥉
|
|
40
|
+
|
|
41
|
+
<div dir="auto">
|
|
42
|
+
|
|
43
|
+
<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>
|
|
44
|
+
<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>
|
|
45
|
+
<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>
|
|
46
|
+
<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>
|
|
47
|
+
<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>
|
|
48
|
+
<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>
|
|
49
|
+
<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>
|
|
50
|
+
<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>
|
|
51
|
+
<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>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
### Backers
|
|
56
|
+
|
|
57
|
+
<a href="https://opencollective.com/rrweb#sponsor" rel="nofollow"><img src="https://opencollective.com/rrweb/tiers/backers.svg?avatarHeight=36"></a>
|
|
58
|
+
|
|
59
|
+
## Core Team Members
|
|
60
|
+
|
|
61
|
+
<table>
|
|
62
|
+
<tr>
|
|
63
|
+
<td align="center">
|
|
64
|
+
<a href="https://github.com/Yuyz0112">
|
|
65
|
+
<img
|
|
66
|
+
src="https://avatars.githubusercontent.com/u/13651389?s=100"
|
|
67
|
+
width="100px;"
|
|
68
|
+
alt=""
|
|
69
|
+
/>
|
|
70
|
+
<br /><sub><b>Yuyz0112</b></sub>
|
|
71
|
+
<br /><br />
|
|
72
|
+
</a>
|
|
73
|
+
</td>
|
|
74
|
+
<td align="center">
|
|
75
|
+
<a href="https://github.com/YunFeng0817">
|
|
76
|
+
<img
|
|
77
|
+
src="https://avatars.githubusercontent.com/u/27533910?s=100"
|
|
78
|
+
width="100px;"
|
|
79
|
+
alt=""
|
|
80
|
+
/>
|
|
81
|
+
<br /><sub><b>Yun Feng</b></sub>
|
|
82
|
+
<br /><br />
|
|
83
|
+
</a>
|
|
84
|
+
</td>
|
|
85
|
+
<td align="center">
|
|
86
|
+
<a href="https://github.com/eoghanmurray">
|
|
87
|
+
<img
|
|
88
|
+
src="https://avatars.githubusercontent.com/u/156780?s=100"
|
|
89
|
+
width="100px;"
|
|
90
|
+
alt=""
|
|
91
|
+
/>
|
|
92
|
+
<br /><sub><b>eoghanmurray</b></sub>
|
|
93
|
+
<br /><br />
|
|
94
|
+
</a>
|
|
95
|
+
</td>
|
|
96
|
+
<td align="center">
|
|
97
|
+
<a href="https://github.com/Juice10">
|
|
98
|
+
<img
|
|
99
|
+
src="https://avatars.githubusercontent.com/u/4106?s=100"
|
|
100
|
+
width="100px;"
|
|
101
|
+
alt=""
|
|
102
|
+
/>
|
|
103
|
+
<br /><sub><b>Juice10</b></sub>
|
|
104
|
+
<br /><sub>open for rrweb consulting</sub>
|
|
105
|
+
</a>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
</table>
|
|
109
|
+
|
|
110
|
+
## Who's using rrweb?
|
|
111
|
+
|
|
112
|
+
<table>
|
|
113
|
+
<tr>
|
|
114
|
+
<td align="center">
|
|
115
|
+
<a href="http://www.smartx.com/" target="_blank">
|
|
116
|
+
<img width="195px" src="https://www.rrweb.io/logos/smartx.png">
|
|
117
|
+
</a>
|
|
118
|
+
</td>
|
|
119
|
+
<td align="center">
|
|
120
|
+
<a href="https://posthog.com?utm_source=rrweb&utm_medium=sponsorship&utm_campaign=open-source-sponsorship" target="_blank">
|
|
121
|
+
<img width="195px" src="https://www.rrweb.io/logos/posthog.png">
|
|
122
|
+
</a>
|
|
123
|
+
</td>
|
|
124
|
+
<td align="center">
|
|
125
|
+
<a href="https://statcounter.com/session-replay/" target="_blank">
|
|
126
|
+
<img width="195px" src="https://statcounter.com/images/logo-statcounter-arc-blue.svg">
|
|
127
|
+
</a>
|
|
128
|
+
</td>
|
|
129
|
+
<td align="center">
|
|
130
|
+
<a href="https://recordonce.com/" target="_blank">
|
|
131
|
+
<img width="195px" alt="Smart screen recording for SaaS" src="https://uploads-ssl.webflow.com/5f3d133183156245630d4446/5f3d1940abe8db8612c23521_Record-Once-logo-554x80px.svg">
|
|
132
|
+
</a>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td align="center">
|
|
137
|
+
<a href="https://cux.io" target="_blank">
|
|
138
|
+
<img style="padding: 8px" alt="The first ever UX automation tool" width="195px" src="https://cux.io/cux-logo.svg">
|
|
139
|
+
</a>
|
|
140
|
+
</td>
|
|
141
|
+
<td align="center">
|
|
142
|
+
<a href="https://remsupp.com" target="_blank">
|
|
143
|
+
<img style="padding: 8px" alt="Remote Access & Co-Browsing" width="195px" src="https://remsupp.com/images/logo.png">
|
|
144
|
+
</a>
|
|
145
|
+
</td>
|
|
146
|
+
<td align="center">
|
|
147
|
+
<a href="https://highlight.io" target="_blank">
|
|
148
|
+
<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">
|
|
149
|
+
</a>
|
|
150
|
+
</td>
|
|
151
|
+
<td align="center">
|
|
152
|
+
<a href="https://analyzee.io" target="_blank">
|
|
153
|
+
<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">
|
|
154
|
+
</a>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<td align="center">
|
|
159
|
+
<a href="https://requestly.io" target="_blank">
|
|
160
|
+
<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">
|
|
161
|
+
</a>
|
|
162
|
+
</td>
|
|
163
|
+
<td align="center">
|
|
164
|
+
<a href="https://gleap.io" target="_blank">
|
|
165
|
+
<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">
|
|
166
|
+
</a>
|
|
167
|
+
</td>
|
|
168
|
+
<td align="center">
|
|
169
|
+
<a href="https://uxwizz.com" target="_blank">
|
|
170
|
+
<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">
|
|
171
|
+
</a>
|
|
172
|
+
</td>
|
|
173
|
+
<td align="center">
|
|
174
|
+
<a href="https://www.howdygo.com" target="_blank">
|
|
175
|
+
<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">
|
|
176
|
+
</a>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</table>
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { canvasEventWithTime } from '@betterbugs/types';
|
|
2
|
+
import { canvasMutationData } from '@betterbugs/types';
|
|
3
|
+
import { IMirror } from '@betterbugs/types';
|
|
4
|
+
import { inputData } from '@betterbugs/types';
|
|
5
|
+
import { Mirror as Mirror_2 } from '@betterbugs/rrweb-snapshot';
|
|
6
|
+
import { NodeType as NodeType_2 } from '@betterbugs/types';
|
|
7
|
+
import { scrollData } from '@betterbugs/types';
|
|
8
|
+
import { serializedNodeWithId } from '@betterbugs/types';
|
|
9
|
+
import { styleDeclarationData } from '@betterbugs/types';
|
|
10
|
+
import { styleSheetRuleData } from '@betterbugs/types';
|
|
11
|
+
|
|
12
|
+
export declare class BaseRRCDATASection extends BaseRRNode implements IRRCDATASection {
|
|
13
|
+
readonly nodeName: "#cdata-section";
|
|
14
|
+
readonly nodeType: number;
|
|
15
|
+
readonly RRNodeType = RRNodeType.CDATA;
|
|
16
|
+
data: string;
|
|
17
|
+
constructor(data: string);
|
|
18
|
+
get textContent(): string;
|
|
19
|
+
set textContent(textContent: string);
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare class BaseRRComment extends BaseRRNode implements IRRComment {
|
|
24
|
+
readonly nodeType: number;
|
|
25
|
+
readonly nodeName: "#comment";
|
|
26
|
+
readonly RRNodeType = RRNodeType.Comment;
|
|
27
|
+
data: string;
|
|
28
|
+
constructor(data: string);
|
|
29
|
+
get textContent(): string;
|
|
30
|
+
set textContent(textContent: string);
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare class BaseRRDialogElement extends BaseRRElement {
|
|
35
|
+
readonly tagName: "DIALOG";
|
|
36
|
+
readonly nodeName: "DIALOG";
|
|
37
|
+
get isModal(): boolean;
|
|
38
|
+
get open(): boolean;
|
|
39
|
+
close(): void;
|
|
40
|
+
show(): void;
|
|
41
|
+
showModal(): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare class BaseRRDocument extends BaseRRNode implements IRRDocument {
|
|
45
|
+
readonly nodeType: number;
|
|
46
|
+
readonly nodeName: "#document";
|
|
47
|
+
readonly compatMode: 'BackCompat' | 'CSS1Compat';
|
|
48
|
+
readonly RRNodeType = RRNodeType.Document;
|
|
49
|
+
textContent: string | null;
|
|
50
|
+
constructor(...args: any[]);
|
|
51
|
+
get documentElement(): IRRElement | null;
|
|
52
|
+
get body(): IRRElement | null;
|
|
53
|
+
get head(): IRRElement | null;
|
|
54
|
+
get implementation(): IRRDocument;
|
|
55
|
+
get firstElementChild(): IRRElement | null;
|
|
56
|
+
appendChild(newChild: IRRNode): IRRNode;
|
|
57
|
+
insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
|
|
58
|
+
removeChild(node: IRRNode): IRRNode;
|
|
59
|
+
open(): void;
|
|
60
|
+
close(): void;
|
|
61
|
+
write(content: string): void;
|
|
62
|
+
createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null): IRRDocument;
|
|
63
|
+
createDocumentType(qualifiedName: string, publicId: string, systemId: string): IRRDocumentType;
|
|
64
|
+
createElement(tagName: string): IRRElement;
|
|
65
|
+
createElementNS(_namespaceURI: string, qualifiedName: string): IRRElement;
|
|
66
|
+
createTextNode(data: string): IRRText;
|
|
67
|
+
createComment(data: string): IRRComment;
|
|
68
|
+
createCDATASection(data: string): IRRCDATASection;
|
|
69
|
+
toString(): string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare class BaseRRDocumentType extends BaseRRNode implements IRRDocumentType {
|
|
73
|
+
readonly nodeType: number;
|
|
74
|
+
readonly RRNodeType = RRNodeType.DocumentType;
|
|
75
|
+
readonly nodeName: string;
|
|
76
|
+
readonly name: string;
|
|
77
|
+
readonly publicId: string;
|
|
78
|
+
readonly systemId: string;
|
|
79
|
+
textContent: string | null;
|
|
80
|
+
constructor(qualifiedName: string, publicId: string, systemId: string);
|
|
81
|
+
toString(): string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare class BaseRRElement extends BaseRRNode implements IRRElement {
|
|
85
|
+
readonly nodeType: number;
|
|
86
|
+
readonly RRNodeType = RRNodeType.Element;
|
|
87
|
+
readonly nodeName: string;
|
|
88
|
+
tagName: string;
|
|
89
|
+
attributes: Record<string, string>;
|
|
90
|
+
shadowRoot: IRRElement | null;
|
|
91
|
+
scrollLeft?: number;
|
|
92
|
+
scrollTop?: number;
|
|
93
|
+
constructor(tagName: string);
|
|
94
|
+
get textContent(): string;
|
|
95
|
+
set textContent(textContent: string);
|
|
96
|
+
get classList(): ClassList;
|
|
97
|
+
get id(): string;
|
|
98
|
+
get className(): string;
|
|
99
|
+
get style(): CSSStyleDeclaration_2;
|
|
100
|
+
getAttribute(name: string): string | null;
|
|
101
|
+
setAttribute(name: string, attribute: string): void;
|
|
102
|
+
setAttributeNS(_namespace: string | null, qualifiedName: string, value: string): void;
|
|
103
|
+
removeAttribute(name: string): void;
|
|
104
|
+
appendChild(newChild: IRRNode): IRRNode;
|
|
105
|
+
insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
|
|
106
|
+
removeChild(node: IRRNode): IRRNode;
|
|
107
|
+
attachShadow(_init: ShadowRootInit): IRRElement;
|
|
108
|
+
dispatchEvent(_event: Event): boolean;
|
|
109
|
+
toString(): string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare class BaseRRMediaElement extends BaseRRElement {
|
|
113
|
+
currentTime?: number;
|
|
114
|
+
volume?: number;
|
|
115
|
+
paused?: boolean;
|
|
116
|
+
muted?: boolean;
|
|
117
|
+
playbackRate?: number;
|
|
118
|
+
loop?: boolean;
|
|
119
|
+
attachShadow(_init: ShadowRootInit): IRRElement;
|
|
120
|
+
play(): void;
|
|
121
|
+
pause(): void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare abstract class BaseRRNode implements IRRNode {
|
|
125
|
+
parentElement: IRRNode | null;
|
|
126
|
+
parentNode: IRRNode | null;
|
|
127
|
+
ownerDocument: IRRDocument;
|
|
128
|
+
firstChild: IRRNode | null;
|
|
129
|
+
lastChild: IRRNode | null;
|
|
130
|
+
previousSibling: IRRNode | null;
|
|
131
|
+
nextSibling: IRRNode | null;
|
|
132
|
+
abstract textContent: string | null;
|
|
133
|
+
readonly ELEMENT_NODE: number;
|
|
134
|
+
readonly TEXT_NODE: number;
|
|
135
|
+
readonly nodeType: number;
|
|
136
|
+
readonly nodeName: string;
|
|
137
|
+
readonly RRNodeType: NodeType_2;
|
|
138
|
+
constructor(..._args: any[]);
|
|
139
|
+
get childNodes(): IRRNode[];
|
|
140
|
+
contains(node: IRRNode): boolean;
|
|
141
|
+
appendChild(_newChild: IRRNode): IRRNode;
|
|
142
|
+
insertBefore(_newChild: IRRNode, _refChild: IRRNode | null): IRRNode;
|
|
143
|
+
removeChild(_node: IRRNode): IRRNode;
|
|
144
|
+
toString(): string;
|
|
145
|
+
}
|
|
146
|
+
export { BaseRRNode }
|
|
147
|
+
export { BaseRRNode as RRNode }
|
|
148
|
+
|
|
149
|
+
export declare class BaseRRText extends BaseRRNode implements IRRText {
|
|
150
|
+
readonly nodeType: number;
|
|
151
|
+
readonly nodeName: "#text";
|
|
152
|
+
readonly RRNodeType = RRNodeType.Text;
|
|
153
|
+
data: string;
|
|
154
|
+
constructor(data: string);
|
|
155
|
+
get textContent(): string;
|
|
156
|
+
set textContent(textContent: string);
|
|
157
|
+
toString(): string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare function buildFromDom(dom: Document, domMirror?: Mirror_2, rrdom?: IRRDocument): IRRDocument;
|
|
161
|
+
|
|
162
|
+
export declare function buildFromNode(node: Node, rrdom: IRRDocument, domMirror: Mirror_2, parentRRNode?: IRRNode | null): IRRNode | null;
|
|
163
|
+
|
|
164
|
+
export declare class ClassList {
|
|
165
|
+
private onChange;
|
|
166
|
+
classes: string[];
|
|
167
|
+
constructor(classText?: string, onChange?: ((newClassText: string) => void) | undefined);
|
|
168
|
+
add: (...classNames: string[]) => void;
|
|
169
|
+
remove: (...classNames: string[]) => void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare function createMirror(): Mirror;
|
|
173
|
+
|
|
174
|
+
export declare function createOrGetNode(rrNode: IRRNode, domMirror: Mirror_2, rrnodeMirror: Mirror): Node;
|
|
175
|
+
|
|
176
|
+
declare type CSSStyleDeclaration_2 = Record<string, string> & {
|
|
177
|
+
setProperty: (name: string, value: string | null, priority?: string | null) => void;
|
|
178
|
+
removeProperty: (name: string) => string;
|
|
179
|
+
};
|
|
180
|
+
export { CSSStyleDeclaration_2 as CSSStyleDeclaration }
|
|
181
|
+
|
|
182
|
+
export declare function diff(oldTree: Node, newTree: IRRNode, replayer: ReplayerHandler, rrnodeMirror?: Mirror): void;
|
|
183
|
+
|
|
184
|
+
export declare function getDefaultSN(node: IRRNode, id: number): serializedNodeWithId;
|
|
185
|
+
|
|
186
|
+
export declare interface IRRCDATASection extends IRRNode {
|
|
187
|
+
readonly nodeName: '#cdata-section';
|
|
188
|
+
data: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export declare interface IRRComment extends IRRNode {
|
|
192
|
+
readonly nodeName: '#comment';
|
|
193
|
+
data: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare interface IRRDocument extends IRRNode {
|
|
197
|
+
documentElement: IRRElement | null;
|
|
198
|
+
body: IRRElement | null;
|
|
199
|
+
head: IRRElement | null;
|
|
200
|
+
implementation: IRRDocument;
|
|
201
|
+
firstElementChild: IRRElement | null;
|
|
202
|
+
readonly nodeName: '#document';
|
|
203
|
+
compatMode: 'BackCompat' | 'CSS1Compat';
|
|
204
|
+
createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null): IRRDocument;
|
|
205
|
+
createDocumentType(qualifiedName: string, publicId: string, systemId: string): IRRDocumentType;
|
|
206
|
+
createElement(tagName: string): IRRElement;
|
|
207
|
+
createElementNS(_namespaceURI: string, qualifiedName: string): IRRElement;
|
|
208
|
+
createTextNode(data: string): IRRText;
|
|
209
|
+
createComment(data: string): IRRComment;
|
|
210
|
+
createCDATASection(data: string): IRRCDATASection;
|
|
211
|
+
open(): void;
|
|
212
|
+
close(): void;
|
|
213
|
+
write(content: string): void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare interface IRRDocumentType extends IRRNode {
|
|
217
|
+
readonly name: string;
|
|
218
|
+
readonly publicId: string;
|
|
219
|
+
readonly systemId: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export declare interface IRRElement extends IRRNode {
|
|
223
|
+
tagName: string;
|
|
224
|
+
attributes: Record<string, string>;
|
|
225
|
+
shadowRoot: IRRElement | null;
|
|
226
|
+
scrollLeft?: number;
|
|
227
|
+
scrollTop?: number;
|
|
228
|
+
id: string;
|
|
229
|
+
className: string;
|
|
230
|
+
classList: ClassList;
|
|
231
|
+
style: CSSStyleDeclaration_2;
|
|
232
|
+
attachShadow(init: ShadowRootInit): IRRElement;
|
|
233
|
+
getAttribute(name: string): string | null;
|
|
234
|
+
setAttribute(name: string, attribute: string): void;
|
|
235
|
+
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
236
|
+
removeAttribute(name: string): void;
|
|
237
|
+
dispatchEvent(event: Event): boolean;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export declare interface IRRNode {
|
|
241
|
+
parentElement: IRRNode | null;
|
|
242
|
+
parentNode: IRRNode | null;
|
|
243
|
+
ownerDocument: IRRDocument;
|
|
244
|
+
readonly childNodes: IRRNode[];
|
|
245
|
+
readonly ELEMENT_NODE: number;
|
|
246
|
+
readonly TEXT_NODE: number;
|
|
247
|
+
readonly nodeType: number;
|
|
248
|
+
readonly nodeName: string;
|
|
249
|
+
readonly RRNodeType: NodeType_2;
|
|
250
|
+
firstChild: IRRNode | null;
|
|
251
|
+
lastChild: IRRNode | null;
|
|
252
|
+
previousSibling: IRRNode | null;
|
|
253
|
+
nextSibling: IRRNode | null;
|
|
254
|
+
textContent: string | null;
|
|
255
|
+
contains(node: IRRNode): boolean;
|
|
256
|
+
appendChild(newChild: IRRNode): IRRNode;
|
|
257
|
+
insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
|
|
258
|
+
removeChild(node: IRRNode): IRRNode;
|
|
259
|
+
toString(): string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export declare interface IRRText extends IRRNode {
|
|
263
|
+
readonly nodeName: '#text';
|
|
264
|
+
data: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare class Mirror implements IMirror<BaseRRNode> {
|
|
268
|
+
private idNodeMap;
|
|
269
|
+
private nodeMetaMap;
|
|
270
|
+
getId(n: BaseRRNode | undefined | null): number;
|
|
271
|
+
getNode(id: number): BaseRRNode | null;
|
|
272
|
+
getIds(): number[];
|
|
273
|
+
getMeta(n: BaseRRNode): serializedNodeWithId | null;
|
|
274
|
+
removeNodeFromMap(n: BaseRRNode): void;
|
|
275
|
+
has(id: number): boolean;
|
|
276
|
+
hasNode(node: BaseRRNode): boolean;
|
|
277
|
+
add(n: BaseRRNode, meta: serializedNodeWithId): void;
|
|
278
|
+
replace(id: number, n: BaseRRNode): void;
|
|
279
|
+
reset(): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export declare enum NodeType {
|
|
283
|
+
PLACEHOLDER = 0,
|
|
284
|
+
ELEMENT_NODE = 1,
|
|
285
|
+
ATTRIBUTE_NODE = 2,
|
|
286
|
+
TEXT_NODE = 3,
|
|
287
|
+
CDATA_SECTION_NODE = 4,
|
|
288
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
289
|
+
ENTITY_NODE = 6,
|
|
290
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
291
|
+
COMMENT_NODE = 8,
|
|
292
|
+
DOCUMENT_NODE = 9,
|
|
293
|
+
DOCUMENT_TYPE_NODE = 10,
|
|
294
|
+
DOCUMENT_FRAGMENT_NODE = 11
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export declare function printRRDom(rootNode: IRRNode, mirror: IMirror<IRRNode>): string;
|
|
298
|
+
|
|
299
|
+
export declare type ReplayerHandler = {
|
|
300
|
+
mirror: Mirror_2;
|
|
301
|
+
applyCanvas: (canvasEvent: canvasEventWithTime, canvasMutationData: canvasMutationData, target: HTMLCanvasElement) => void;
|
|
302
|
+
applyInput: (data: inputData) => void;
|
|
303
|
+
applyScroll: (data: scrollData, isSync: boolean) => void;
|
|
304
|
+
applyStyleSheetMutation: (data: styleDeclarationData | styleSheetRuleData, styleSheet: CSSStyleSheet) => void;
|
|
305
|
+
afterAppend?(node: Node, id: number): void;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
export declare class RRCanvasElement extends RRElement implements IRRElement {
|
|
309
|
+
rr_dataURL: string | null;
|
|
310
|
+
canvasMutations: {
|
|
311
|
+
event: canvasEventWithTime;
|
|
312
|
+
mutation: canvasMutationData;
|
|
313
|
+
}[];
|
|
314
|
+
getContext(): RenderingContext | null;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare const RRCDATASection: typeof BaseRRCDATASection;
|
|
318
|
+
|
|
319
|
+
export declare type RRCDATASection = typeof RRCDATASection;
|
|
320
|
+
|
|
321
|
+
export declare const RRComment: typeof BaseRRComment;
|
|
322
|
+
|
|
323
|
+
export declare type RRComment = typeof RRComment;
|
|
324
|
+
|
|
325
|
+
export declare class RRDialogElement extends BaseRRDialogElement {
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export declare class RRDocument extends BaseRRDocument {
|
|
329
|
+
private UNSERIALIZED_STARTING_ID;
|
|
330
|
+
private _unserializedId;
|
|
331
|
+
get unserializedId(): number;
|
|
332
|
+
mirror: Mirror;
|
|
333
|
+
scrollData: scrollData | null;
|
|
334
|
+
constructor(mirror?: Mirror);
|
|
335
|
+
createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null): RRDocument;
|
|
336
|
+
createDocumentType(qualifiedName: string, publicId: string, systemId: string): BaseRRDocumentType;
|
|
337
|
+
createElement<K extends keyof HTMLElementTagNameMap>(tagName: K): RRElementType<K>;
|
|
338
|
+
createElement(tagName: string): RRElement;
|
|
339
|
+
createComment(data: string): BaseRRComment;
|
|
340
|
+
createCDATASection(data: string): BaseRRCDATASection;
|
|
341
|
+
createTextNode(data: string): BaseRRText;
|
|
342
|
+
destroyTree(): void;
|
|
343
|
+
open(): void;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export declare const RRDocumentType: typeof BaseRRDocumentType;
|
|
347
|
+
|
|
348
|
+
export declare class RRElement extends BaseRRElement {
|
|
349
|
+
inputData: inputData | null;
|
|
350
|
+
scrollData: scrollData | null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
declare interface RRElementTagNameMap {
|
|
354
|
+
audio: RRMediaElement;
|
|
355
|
+
canvas: RRCanvasElement;
|
|
356
|
+
iframe: RRIFrameElement;
|
|
357
|
+
style: RRStyleElement;
|
|
358
|
+
video: RRMediaElement;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare type RRElementType<K extends keyof HTMLElementTagNameMap> = K extends keyof RRElementTagNameMap ? RRElementTagNameMap[K] : RRElement;
|
|
362
|
+
|
|
363
|
+
export declare class RRIFrameElement extends RRElement {
|
|
364
|
+
contentDocument: RRDocument;
|
|
365
|
+
constructor(upperTagName: string, mirror: Mirror);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export declare class RRMediaElement extends BaseRRMediaElement {
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export declare class RRStyleElement extends RRElement {
|
|
372
|
+
rules: (styleSheetRuleData | styleDeclarationData)[];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export declare const RRText: typeof BaseRRText;
|
|
376
|
+
|
|
377
|
+
export declare type RRText = typeof RRText;
|
|
378
|
+
|
|
379
|
+
export { }
|