MGDSLData
MGDSLData
interface MGDSLData {
readonly version: string
framework: Framework
readonly nodeMap: Record<NodeId, MGNode>
readonly localStyleMap: StyleMap
readonly fileMap: Record<FileId, MGDSLFile>
root: MGLayerNode
entry: FileId
settings: DSLSettings
importPath: ImportPath
importType: 'GLOBAL' | 'IMPORT'
}
version: dsl版本号。framework: dsl的框架类型,默认VUE3。nodeMap: 所有 MGNode 的映射表。localStyleMap: 自定义样式的映射表。fileMap: 虚拟文件MGDSLFile映射表。root: 入口节点。entry: 入口MGDSLFile的id。settings: DSL配置项。importPath: 导入模板文件路径配置。importType: 模板文件引入方式。 GLOBAL: 全局方式引入。IMPORT: esModule方式引入。
JSDSLData
interface JSDSLData extends MGDSLData{
globalStyleMap: {
[classId: string]: ClassStyle
}
}
interface ReactDSLData extends JSDSLData {
readonly framework: 'REACT'
}
interface Vue3DSLData extends JSDSLData {
readonly framework: 'VUE3'
}
interface Vue2DSLData extends JSDSLData {
readonly framework: 'VUE2'
}
AndroidDSLData
interface AndroidDSLData extends MGDSLData {
readonly framework: 'ANDROID'
}
IOSDSLData
interface IOSDSLData extends MGDSLData {
readonly framework: 'IOS'
}
Framework
type Framework = 'REACT' | 'VUE2' | 'VUE3' | 'ANDROID' | 'IOS'
NodeId
type NodeId = LayerId | OperationId
type LayerId = string
type OperationId = string
StyleMap
type StyleMap = {
[styleId: string]: TokenItem | AndroidStyleItem
}
TokenItem: 详见TokenAndroidStyleItem: any
FileId
ImportPath
type ImportPath = {
name: string
path: string
type: 'script' | 'style'
}[]