1
1
import { markRaw } from '@vue/reactivity'
2
2
3
- export const enum NodeTypes {
3
+ export const enum TestNodeTypes {
4
4
TEXT = 'text' ,
5
5
ELEMENT = 'element' ,
6
6
COMMENT = 'comment'
@@ -17,7 +17,7 @@ export const enum NodeOpTypes {
17
17
18
18
export interface TestElement {
19
19
id : number
20
- type : NodeTypes . ELEMENT
20
+ type : TestNodeTypes . ELEMENT
21
21
parentNode : TestElement | null
22
22
tag : string
23
23
children : TestNode [ ]
@@ -27,14 +27,14 @@ export interface TestElement {
27
27
28
28
export interface TestText {
29
29
id : number
30
- type : NodeTypes . TEXT
30
+ type : TestNodeTypes . TEXT
31
31
parentNode : TestElement | null
32
32
text : string
33
33
}
34
34
35
35
export interface TestComment {
36
36
id : number
37
- type : NodeTypes . COMMENT
37
+ type : TestNodeTypes . COMMENT
38
38
parentNode : TestElement | null
39
39
text : string
40
40
}
@@ -43,7 +43,7 @@ export type TestNode = TestElement | TestText | TestComment
43
43
44
44
export interface NodeOp {
45
45
type : NodeOpTypes
46
- nodeType ?: NodeTypes
46
+ nodeType ?: TestNodeTypes
47
47
tag ?: string
48
48
text ?: string
49
49
targetNode ?: TestNode
@@ -74,7 +74,7 @@ export function dumpOps(): NodeOp[] {
74
74
function createElement ( tag : string ) : TestElement {
75
75
const node : TestElement = {
76
76
id : nodeId ++ ,
77
- type : NodeTypes . ELEMENT ,
77
+ type : TestNodeTypes . ELEMENT ,
78
78
tag,
79
79
children : [ ] ,
80
80
props : { } ,
@@ -83,7 +83,7 @@ function createElement(tag: string): TestElement {
83
83
}
84
84
logNodeOp ( {
85
85
type : NodeOpTypes . CREATE ,
86
- nodeType : NodeTypes . ELEMENT ,
86
+ nodeType : TestNodeTypes . ELEMENT ,
87
87
targetNode : node ,
88
88
tag
89
89
} )
@@ -95,13 +95,13 @@ function createElement(tag: string): TestElement {
95
95
function createText ( text : string ) : TestText {
96
96
const node : TestText = {
97
97
id : nodeId ++ ,
98
- type : NodeTypes . TEXT ,
98
+ type : TestNodeTypes . TEXT ,
99
99
text,
100
100
parentNode : null
101
101
}
102
102
logNodeOp ( {
103
103
type : NodeOpTypes . CREATE ,
104
- nodeType : NodeTypes . TEXT ,
104
+ nodeType : TestNodeTypes . TEXT ,
105
105
targetNode : node ,
106
106
text
107
107
} )
@@ -113,13 +113,13 @@ function createText(text: string): TestText {
113
113
function createComment ( text : string ) : TestComment {
114
114
const node : TestComment = {
115
115
id : nodeId ++ ,
116
- type : NodeTypes . COMMENT ,
116
+ type : TestNodeTypes . COMMENT ,
117
117
text,
118
118
parentNode : null
119
119
}
120
120
logNodeOp ( {
121
121
type : NodeOpTypes . CREATE ,
122
- nodeType : NodeTypes . COMMENT ,
122
+ nodeType : TestNodeTypes . COMMENT ,
123
123
targetNode : node ,
124
124
text
125
125
} )
@@ -203,7 +203,7 @@ function setElementText(el: TestElement, text: string) {
203
203
el . children = [
204
204
{
205
205
id : nodeId ++ ,
206
- type : NodeTypes . TEXT ,
206
+ type : TestNodeTypes . TEXT ,
207
207
text,
208
208
parentNode : el
209
209
}
0 commit comments