11import { markRaw } from '@vue/reactivity'
22
3- export const enum NodeTypes {
3+ export const enum TestNodeTypes {
44 TEXT = 'text' ,
55 ELEMENT = 'element' ,
66 COMMENT = 'comment'
@@ -17,7 +17,7 @@ export const enum NodeOpTypes {
1717
1818export interface TestElement {
1919 id : number
20- type : NodeTypes . ELEMENT
20+ type : TestNodeTypes . ELEMENT
2121 parentNode : TestElement | null
2222 tag : string
2323 children : TestNode [ ]
@@ -27,14 +27,14 @@ export interface TestElement {
2727
2828export interface TestText {
2929 id : number
30- type : NodeTypes . TEXT
30+ type : TestNodeTypes . TEXT
3131 parentNode : TestElement | null
3232 text : string
3333}
3434
3535export interface TestComment {
3636 id : number
37- type : NodeTypes . COMMENT
37+ type : TestNodeTypes . COMMENT
3838 parentNode : TestElement | null
3939 text : string
4040}
@@ -43,7 +43,7 @@ export type TestNode = TestElement | TestText | TestComment
4343
4444export interface NodeOp {
4545 type : NodeOpTypes
46- nodeType ?: NodeTypes
46+ nodeType ?: TestNodeTypes
4747 tag ?: string
4848 text ?: string
4949 targetNode ?: TestNode
@@ -74,7 +74,7 @@ export function dumpOps(): NodeOp[] {
7474function createElement ( tag : string ) : TestElement {
7575 const node : TestElement = {
7676 id : nodeId ++ ,
77- type : NodeTypes . ELEMENT ,
77+ type : TestNodeTypes . ELEMENT ,
7878 tag,
7979 children : [ ] ,
8080 props : { } ,
@@ -83,7 +83,7 @@ function createElement(tag: string): TestElement {
8383 }
8484 logNodeOp ( {
8585 type : NodeOpTypes . CREATE ,
86- nodeType : NodeTypes . ELEMENT ,
86+ nodeType : TestNodeTypes . ELEMENT ,
8787 targetNode : node ,
8888 tag
8989 } )
@@ -95,13 +95,13 @@ function createElement(tag: string): TestElement {
9595function createText ( text : string ) : TestText {
9696 const node : TestText = {
9797 id : nodeId ++ ,
98- type : NodeTypes . TEXT ,
98+ type : TestNodeTypes . TEXT ,
9999 text,
100100 parentNode : null
101101 }
102102 logNodeOp ( {
103103 type : NodeOpTypes . CREATE ,
104- nodeType : NodeTypes . TEXT ,
104+ nodeType : TestNodeTypes . TEXT ,
105105 targetNode : node ,
106106 text
107107 } )
@@ -113,13 +113,13 @@ function createText(text: string): TestText {
113113function createComment ( text : string ) : TestComment {
114114 const node : TestComment = {
115115 id : nodeId ++ ,
116- type : NodeTypes . COMMENT ,
116+ type : TestNodeTypes . COMMENT ,
117117 text,
118118 parentNode : null
119119 }
120120 logNodeOp ( {
121121 type : NodeOpTypes . CREATE ,
122- nodeType : NodeTypes . COMMENT ,
122+ nodeType : TestNodeTypes . COMMENT ,
123123 targetNode : node ,
124124 text
125125 } )
@@ -203,7 +203,7 @@ function setElementText(el: TestElement, text: string) {
203203 el . children = [
204204 {
205205 id : nodeId ++ ,
206- type : NodeTypes . TEXT ,
206+ type : TestNodeTypes . TEXT ,
207207 text,
208208 parentNode : el
209209 }
0 commit comments