MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / constructor

Method constructor

packages/core/src/document/document.ts:121–138  ·  view source on GitHub ↗
(project: Project, schema?: RootSchema)

Source from the content-addressed store, hash-verified

119 }
120
121 constructor(project: Project, schema?: RootSchema) {
122 this.project = project
123 this.designer = project.designer
124 this.id = schema?.docId ?? uniqueId('doc')
125 this.history = new History(
126 () => this.export(TRANSFORM_STAGE.SERIALIZE),
127 schema => {
128 this.import(schema, true)
129 this.simulator?.rerender()
130 },
131 this,
132 )
133
134 if (schema) {
135 this.rootNode = this.createNode(schema)
136 this._blank = false
137 }
138 }
139
140 @action
141 import(schema?: RootSchema, checkId = false) {

Callers

nothing calls this directly

Calls 5

exportMethod · 0.95
importMethod · 0.95
createNodeMethod · 0.95
uniqueIdFunction · 0.90
rerenderMethod · 0.45

Tested by

no test coverage detected