(project: Project, schema?: RootSchema)
| 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) { |
nothing calls this directly
no test coverage detected