(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE)
| 148 | } |
| 149 | |
| 150 | export<T = NodeSchema>(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE): T { |
| 151 | const baseSchema: any = { |
| 152 | componentName: this.componentName, |
| 153 | } |
| 154 | |
| 155 | if (stage !== TRANSFORM_STAGE.CLONE) { |
| 156 | baseSchema.id = this.id |
| 157 | } |
| 158 | if (stage === TRANSFORM_STAGE.RENDER) { |
| 159 | baseSchema.docId = this.document.id |
| 160 | } |
| 161 | |
| 162 | const { props, extras } = this.props.export() |
| 163 | |
| 164 | const schema: any = { |
| 165 | ...baseSchema, |
| 166 | props: props ? this.document.designer.transformProps(props, this, stage) : undefined, |
| 167 | ...(extras ? this.document.designer.transformProps(extras, this, stage) : {}), |
| 168 | } |
| 169 | |
| 170 | if (this.isParental && this.children && this.children.size > 0) { |
| 171 | schema.children = this.children.export(stage) |
| 172 | } |
| 173 | |
| 174 | return schema |
| 175 | } |
| 176 | |
| 177 | purge() { |
| 178 | if (this.purged) { |
no test coverage detected