@cloudbase/cals 1.0.3-alpha.8 → 1.0.3-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/lib/parser/cals/index.d.ts +379 -366
  2. package/lib/parser/cals/index.d.ts.map +1 -1
  3. package/lib/parser/cals/index.js +75 -13
  4. package/lib/parser/cals/utils/block/index.d.ts +14 -14
  5. package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
  6. package/lib/parser/cals/utils/block/index.js +3 -3
  7. package/lib/parser/cals/utils/code/index.d.ts +30 -30
  8. package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
  9. package/lib/parser/cals/utils/code/index.js +12 -13
  10. package/lib/parser/cals/utils/common.d.ts +11 -11
  11. package/lib/parser/cals/utils/common.d.ts.map +0 -0
  12. package/lib/parser/cals/utils/common.js +0 -0
  13. package/lib/parser/cals/utils/runtime.d.ts +13 -13
  14. package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
  15. package/lib/parser/cals/utils/runtime.js +2 -2
  16. package/lib/parser/cals/utils/spinoff/index.d.ts +9 -9
  17. package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
  18. package/lib/parser/cals/utils/spinoff/index.js +0 -0
  19. package/lib/parser/cals/utils/style.d.ts +42 -42
  20. package/lib/parser/cals/utils/style.d.ts.map +1 -1
  21. package/lib/parser/cals/utils/style.js +3 -3
  22. package/lib/parser/cals/utils/template.d.ts +5 -5
  23. package/lib/parser/cals/utils/template.d.ts.map +0 -0
  24. package/lib/parser/cals/utils/template.js +6 -3
  25. package/lib/parser/cals/utils/version/common.d.ts +4 -4
  26. package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
  27. package/lib/parser/cals/utils/version/common.js +34 -11
  28. package/lib/parser/cals/utils/version/config.d.ts +13 -13
  29. package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
  30. package/lib/parser/cals/utils/version/config.js +0 -0
  31. package/lib/parser/cals/utils/version/index.d.ts +2 -2
  32. package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
  33. package/lib/parser/cals/utils/version/index.js +0 -0
  34. package/lib/parser/cals/utils/version/parses.d.ts +15 -15
  35. package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
  36. package/lib/parser/cals/utils/version/parses.js +37 -14
  37. package/lib/parser/cals/utils/version/utils.d.ts +13 -13
  38. package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
  39. package/lib/parser/cals/utils/version/utils.js +2 -2
  40. package/lib/parser/constants.d.ts +2 -0
  41. package/lib/parser/constants.d.ts.map +1 -0
  42. package/lib/parser/constants.js +4 -0
  43. package/lib/parser/expression/index.d.ts +122 -122
  44. package/lib/parser/expression/index.d.ts.map +0 -0
  45. package/lib/parser/expression/index.js +0 -0
  46. package/lib/parser/index.d.ts +8 -8
  47. package/lib/parser/index.d.ts.map +0 -0
  48. package/lib/parser/index.js +0 -0
  49. package/lib/parser/plugins/postcss-rpx2clac.d.ts +17 -17
  50. package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
  51. package/lib/types/basic/app.d.ts +72 -72
  52. package/lib/types/basic/app.d.ts.map +0 -0
  53. package/lib/types/basic/app.js +0 -0
  54. package/lib/types/basic/common.d.ts +88 -88
  55. package/lib/types/basic/common.d.ts.map +1 -1
  56. package/lib/types/basic/common.js +0 -0
  57. package/lib/types/basic/component.d.ts +213 -208
  58. package/lib/types/basic/component.d.ts.map +1 -1
  59. package/lib/types/basic/component.js +0 -0
  60. package/lib/types/basic/datasource.d.ts +49 -49
  61. package/lib/types/basic/datasource.d.ts.map +0 -0
  62. package/lib/types/basic/datasource.js +0 -0
  63. package/lib/types/index.d.ts +10 -9
  64. package/lib/types/index.d.ts.map +1 -1
  65. package/lib/types/index.js +1 -14
  66. package/lib/types/lcds.d.ts +334 -447
  67. package/lib/types/lcds.d.ts.map +1 -1
  68. package/lib/types/lcds.js +0 -0
  69. package/lib/types/platform/app.d.ts +176 -176
  70. package/lib/types/platform/app.d.ts.map +0 -0
  71. package/lib/types/platform/app.js +0 -0
  72. package/lib/types/platform/common.d.ts +147 -137
  73. package/lib/types/platform/common.d.ts.map +1 -1
  74. package/lib/types/platform/common.js +0 -0
  75. package/lib/types/platform/component.d.ts +145 -140
  76. package/lib/types/platform/component.d.ts.map +1 -1
  77. package/lib/types/platform/component.js +0 -0
  78. package/lib/types/platform/datasource.d.ts +466 -466
  79. package/lib/types/platform/datasource.d.ts.map +0 -0
  80. package/lib/types/platform/datasource.js +0 -0
  81. package/lib/types/platform/eventFlow.d.ts +20 -0
  82. package/lib/types/platform/eventFlow.d.ts.map +1 -0
  83. package/lib/types/platform/eventFlow.js +2 -0
  84. package/lib/types/platform/query.d.ts +58 -0
  85. package/lib/types/platform/query.d.ts.map +1 -0
  86. package/lib/types/platform/query.js +2 -0
  87. package/lib/types/platform/widget/form.d.ts +89 -89
  88. package/lib/types/platform/widget/form.d.ts.map +0 -0
  89. package/lib/types/platform/widget/form.js +0 -0
  90. package/lib/types/platform/widget/meta.d.ts +59 -59
  91. package/lib/types/platform/widget/meta.d.ts.map +0 -0
  92. package/lib/types/platform/widget/meta.js +0 -0
  93. package/lib/utils/CSSProperty.d.ts +63 -63
  94. package/lib/utils/CSSProperty.d.ts.map +0 -0
  95. package/lib/utils/CSSProperty.js +0 -0
  96. package/lib/utils/build.d.ts +1 -1
  97. package/lib/utils/build.d.ts.map +0 -0
  98. package/lib/utils/build.js +6 -3
  99. package/lib/utils/constant.d.ts +40 -40
  100. package/lib/utils/constant.d.ts.map +0 -0
  101. package/lib/utils/constant.js +0 -0
  102. package/lib/utils/dts/auto-generated.d.ts +1 -1
  103. package/lib/utils/dts/auto-generated.d.ts.map +1 -1
  104. package/lib/utils/dts/auto-generated.js +35 -1227
  105. package/lib/utils/dts/build.d.ts +1 -1
  106. package/lib/utils/dts/build.js +4 -1
  107. package/lib/utils/dts/index.d.ts +93 -130
  108. package/lib/utils/dts/index.d.ts.map +1 -1
  109. package/lib/utils/dts/index.js +66 -359
  110. package/lib/utils/index.d.ts +7 -7
  111. package/lib/utils/index.d.ts.map +0 -0
  112. package/lib/utils/index.js +0 -0
  113. package/lib/utils/version/common.d.ts +2 -2
  114. package/lib/utils/version/featureChecker.d.ts +2 -2
  115. package/lib/utils/version/featureChecker.d.ts.map +1 -1
  116. package/lib/utils/version/migrations/version4.d.ts +2 -2
  117. package/lib/utils/version/migrations/version4.js +2 -2
  118. package/lib/utils/version-migrations/common.d.ts +5 -0
  119. package/lib/utils/version-migrations/common.d.ts.map +1 -0
  120. package/lib/utils/version-migrations/common.js +29 -0
  121. package/lib/utils/version-migrations/version4.d.ts +3 -0
  122. package/lib/utils/version-migrations/version4.d.ts.map +1 -0
  123. package/lib/utils/version-migrations/version4.js +199 -0
  124. package/package.json +3 -13
  125. package/lib/cloudbase.cals.umd.min.js +0 -5
@@ -1,448 +1,335 @@
1
- import type * as CSS from 'csstype';
2
- /**
3
- * 低码组件库开发规范 (LCDS, Lowcode Components Development Specification)
4
- *
5
- * 基于 LCDS 开发的组件库, 可以在云开发低码平台内使用
6
- */
7
- /**
8
- * 低码的平台方法的开发配置
9
- */
10
- export interface IAction {
11
- /**
12
- * 选填, 平台方法的唯一标识
13
- * @maxLength 214
14
- * @minLength 1
15
- */
16
- name?: string;
17
- /**
18
- * 选填, 平台方法可以接收的数据
19
- * 需要符合 JSON SCHEMA 规范
20
- *
21
- * @default {}
22
- */
23
- data?: any;
24
- /**
25
- * 选填, 组件对外开放的只读属性,可通过 $w.id1.xx 获取
26
- * 需要符合 JSON SCHEMA 规范
27
- */
28
- properties?: any;
29
- /**
30
- * 选填, 平台方法适配的平台
31
- *
32
- * 如果该字段为空, 则进行智能推断
33
- */
34
- platforms?: string[];
35
- /**
36
- * 选填, 仅用于在低码平台的信息展示
37
- */
38
- meta?: {
39
- /**
40
- * 选填, 平台方法的别名, 建议用中文
41
- */
42
- title?: string;
43
- /**
44
- * 选填, 平台方法的简介, 建议用中文
45
- */
46
- description?: string;
47
- };
48
- /**
49
- * 选填, 扩展字段, 尽量避免用
50
- */
51
- extra?: any;
52
- }
53
- /**
54
- * 低码组件开发配置
55
- */
56
- export interface IComponent {
57
- /**
58
- * 选填, 组件唯一标识
59
- * @maxLength 214
60
- * @minLength 1
61
- */
62
- name?: string;
63
- /**
64
- * 选填, 组件可以接收的数据, 用作组件props入参
65
- * 需要符合 JSON SCHEMA 规范
66
- *
67
- * @default {}
68
- */
69
- data?: any;
70
- /**
71
- * 选填, 组件可以被捕获的事件信息
72
- *
73
- * @default []
74
- */
75
- events?: IEvent[];
76
- /**
77
- * 选填,组件样式 API
78
- */
79
- classes?: IClasses[];
80
- /**
81
- * 选填,组件属性 API
82
- */
83
- properties?: IClasses[];
84
- /**
85
- * 选填, 组件内定义的自定义方法
86
- *
87
- * @default []
88
- */
89
- methods?: IMethod[];
90
- /**
91
- * 选填, 组件需要在运行时获取的配置项
92
- * @deprecated
93
- */
94
- compConfig?: {
95
- /**
96
- * 选填, 组件是否开启数据容器功能
97
- * 默认为 false, 设置为 true 后, 在组件内可通过调用 onDataChange 事件将内部数据挂载到组件的 $context 上下文对象
98
- */
99
- isDataContainer?: boolean;
100
- /**
101
- * 选填, 组件类型
102
- * 支持将表单类组件设置为 formField,即可在表单容器中收集值
103
- */
104
- componentType?: string;
105
- };
106
- /**
107
- * 选填, 组件适配的平台
108
- *
109
- * 如果该字段为空, 则进行智能推断
110
- */
111
- platforms?: string[];
112
- /**
113
- * 选填, 仅用于在低码平台的信息展示
114
- */
115
- meta?: {
116
- /**
117
- * 选填, 组件英文标识
118
- */
119
- name?: string;
120
- /**
121
- * 选填, 用于生成组件 id 的前缀标识
122
- */
123
- componentName?: string;
124
- /**
125
- * 选填, 组件别名, 建议用中文
126
- */
127
- title?: string;
128
- /**
129
- * 选填, 组件简介, 建议用中文
130
- */
131
- description?: string;
132
- /**
133
- * 选填, 组件图标, 支持本地图片
134
- */
135
- icon?: string;
136
- /**
137
- * 选填, 组件分类, 建议用中文
138
- */
139
- category?: string;
140
- /**
141
- * 选填, 组件的排序权重
142
- *
143
- * @minimum 1
144
- * @maximum 10000
145
- */
146
- componentOrder?: number;
147
- /**
148
- * 选填, 组件生效的平台
149
- */
150
- platform?: XPlatform[];
151
- /**
152
- * 选填, 组件可见性配置
153
- * 默认均显示,[]表示隐藏, ['APP']表示只在应用编辑器显示,['COMPONENT']表示只在组件编辑器显示
154
- */
155
- visible?: VisibleItem[];
156
- /**
157
- * 选填,组件模板配置
158
- * {@link https://tapd.woa.com/20422223/prong/stories/view/1020422223884227747 使用文档}
159
- */
160
- templates?: ITemplate[];
161
- /**
162
- * 选填, 标识旧组件废弃,控制单组件升级按钮显隐
163
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002411487 使用文档}
164
- */
165
- deprecated?: boolean;
166
- /**
167
- * 选填, 单组件渲染模式[升级/替换]
168
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002411487 使用文档}
169
- */
170
- renderMode?: IRenderMode[];
171
- /**
172
- * 选填, 组件说明文档的地址
173
- */
174
- docsUrl?: string;
175
- /**
176
- * 选填, 组件快捷编辑协议
177
- */
178
- shortcut?: IShortcut;
179
- /**
180
- * 选填,组件上下文协议,配置后可通过 $context.id.state.xx 读取属性值
181
- * @deprecated
182
- */
183
- contextData?: {
184
- extra?: Record<string, any>;
185
- };
186
- /**
187
- * 选填,组件相对位置限制
188
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002466153 使用文档}
189
- */
190
- positionConstraint?: {
191
- /**
192
- * 可选,允许子组件类型
193
- */
194
- allowChildren?: {
195
- /**
196
- * 组件对应类型,对应 componentConfig.componentType
197
- */
198
- componentType: string;
199
- /**
200
- * 是否允许为隔代子组件
201
- */
202
- recursive: boolean;
203
- }[];
204
- /**
205
- * 可选,允许父组件类型
206
- */
207
- allowParent?: {
208
- /**
209
- * 组件对应类型,对应 componentConfig.componentType
210
- */
211
- componentType: string;
212
- /**
213
- * 是否允许为隔代父组件
214
- */
215
- recursive: boolean;
216
- }[];
217
- };
218
- /**
219
- * 选填,搜索关键词
220
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002460167 使用文档}
221
- */
222
- keyWords?: string[];
223
- /**
224
- * 选填,属性面板提示,支持 markdown
225
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002460139 使用文档}
226
- */
227
- propertyPanelTips?: string;
228
- /**
229
- * 选填,检查功能
230
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002459983 使用文档}
231
- */
232
- validate?: {
233
- /**
234
- * 规则名称
235
- */
236
- rule: string;
237
- /**
238
- * 标题,支持 markdown
239
- */
240
- title: string;
241
- /**
242
- * 描述,支持 markdown
243
- */
244
- description: string;
245
- /**
246
- * 类型
247
- */
248
- type: string;
249
- /**
250
- * 选填,版本,版本,支持 markdown
251
- */
252
- version?: string;
253
- /**
254
- * 可选,是否允许失败
255
- */
256
- allowFailure?: boolean;
257
- /**
258
- * 可选,限制当前选中平台,不填不限制,默认为 null
259
- */
260
- matchedSelectedPlatform?: Array<'h5' | 'miniprogram' | 'pc'>;
261
- /**
262
- * 可选,限制当前发布平台,不填不限制,默认为 'all'
263
- */
264
- matchedPublishedPlatform?: 'web' | 'miniprogram' | 'all';
265
- /**
266
- * 特殊字段,因 rule 的不同而不同
267
- */
268
- extra?: any;
269
- /**
270
- * 选填,操作字段,组件无需填写
271
- */
272
- options?: {
273
- /**
274
- * 名称
275
- */
276
- name: string;
277
- /**
278
- * 标签
279
- */
280
- label: string;
281
- /**
282
- * 点击事件
283
- */
284
- click: Function;
285
- /**
286
- * 提示
287
- */
288
- tooltip: string;
289
- };
290
- };
291
- /**
292
- * 选填,样式配置属性屏蔽
293
- * {@link https://tapd.woa.com/TCB_new/markdown_wikis/show/#1220422223002470249 使用文档}
294
- */
295
- inlineStyleForm?: {
296
- [key: string]: {
297
- visible: boolean;
298
- };
299
- };
300
- };
301
- /**
302
- * 选填, 扩展字段, 尽量避免用
303
- */
304
- extra?: any;
305
- /**
306
- * 选填, 是否容器组件
307
- *
308
- * 容器可以包含子节点,但是不能配置插槽
309
- */
310
- isContainer?: boolean;
311
- /**
312
- * 默认样式
313
- * defaultStyles 接收一个React.CSSProperties对象
314
- */
315
- defaultStyles?: CSS.Properties<string | number>;
316
- }
317
- /**
318
- * 低码组件可以被捕获的事件信息
319
- */
320
- export interface IEvent {
321
- /**
322
- * 必填, 用作抛出和捕获事件的唯一标识
323
- */
324
- name: string;
325
- /**
326
- * 选填, 事件别名, 用于低码平台展示
327
- */
328
- title: string;
329
- /**
330
- * 选填,事件生效的平台
331
- */
332
- 'x-platforms'?: XPlatform;
333
- /**
334
- * 事件参数对象
335
- */
336
- detail?: Record<string, any>;
337
- }
338
- /**
339
- * 低码组件可以暴露的自定义方法
340
- */
341
- export interface IMethod {
342
- /**
343
- * 必填, 用作组件方法的唯一标识
344
- */
345
- name: string;
346
- /**
347
- * 必填, 组件方法别名, 用于低码平台展示
348
- */
349
- label: string;
350
- /**
351
- * 选填, 组件方法可以接收的数据
352
- * 需要符合 JSON SCHEMA 规范
353
- *
354
- * @default {}
355
- */
356
- params?: any;
357
- /**
358
- * 选填, 组件自定义方法适配的平台
359
- */
360
- platforms?: string[];
361
- /**
362
- * 选填, 组件方法描述
363
- */
364
- description?: string;
365
- }
366
- export interface IRenderMode {
367
- /**
368
- * 必填, 转换的目标组件名称
369
- */
370
- component: string;
371
- /**
372
- * 必填, 表示升级还是替换
373
- */
374
- renderType: 'update' | 'replace';
375
- /**
376
- * 选填, [源组件的属性路径]:[转换目标组件的属性路径] 标记属性路径的映射关系
377
- */
378
- props?: {
379
- [name: string]: string;
380
- };
381
- /**
382
- * 选填, 表示升级组件所属组件库,默认与废弃组件同库
383
- */
384
- materialName?: string;
385
- /**
386
- * 选填, 升级说明
387
- */
388
- description?: string;
389
- }
390
- /** 组件/方法/属性所支持的平台 */
391
- export declare type XPlatform = 'MP' | 'WEB' | 'PCWEB' | 'MOBILEWEB';
392
- /** 组件在应用编辑器/低码编辑器的生效情况*/
393
- export declare type VisibleItem = 'APP' | 'COMPONENT';
394
- /** 组件模板配置 */
395
- export interface ITemplate {
396
- /**
397
- * 插入模板的节点或插槽
398
- * 不设置或设置 $children 表示插入到当前组件,可配置多个节点或插槽并用逗号隔开
399
- */
400
- to?: '$children' | string;
401
- /**
402
- * 插入模板的时机
403
- * 不设置或设置 $attached 表示刚拖入组件时执行,可配置多个属性名称并用逗号隔开
404
- */
405
- when?: '$attached' | string;
406
- /**
407
- * 插入的模板主体
408
- * 目前仅支持 toml 配置语法,结构内容参考组件 CALS
409
- */
410
- body?: string;
411
- /**
412
- * 插入模板时自动选中的节点
413
- * 如 template[0] 表示选中所插入模板的第1个节点
414
- */
415
- autoSelectPath?: `template${string}`;
416
- }
417
- /** 组件快捷编辑协议 */
418
- export interface IShortcut {
419
- /**
420
- * 选填,快捷编辑面板中支持的组件属性
421
- */
422
- props?: string[];
423
- /**
424
- * 选填,快捷编辑面板中支持拖入的组件
425
- */
426
- extra?: Record<string, {
427
- 'x-component': 'container';
428
- 'x-component-props'?: string[];
429
- 'x-index'?: number;
430
- 'x-insert-path'?: string;
431
- }>;
432
- }
433
- /** 组件样式 API */
434
- export interface IClasses {
435
- /**
436
- * 样式名称
437
- */
438
- name?: string;
439
- /**
440
- * 样式选择器
441
- */
442
- selector?: string;
443
- /**
444
- * 样式说明
445
- */
446
- description?: string;
447
- }
1
+ import type * as CSS from 'csstype';
2
+ /**
3
+ * 低码组件库开发规范 (LCDS, Lowcode Components Development Specification)
4
+ *
5
+ * 基于 LCDS 开发的组件库, 可以在云开发低码平台内使用
6
+ */
7
+ export declare namespace LCDS {
8
+ /**
9
+ * 低码的平台方法的开发配置
10
+ */
11
+ interface IAction {
12
+ /**
13
+ * 选填, 平台方法的唯一标识
14
+ * @maxLength 214
15
+ * @minLength 1
16
+ */
17
+ name?: string;
18
+ /**
19
+ * 选填, 平台方法可以接收的数据
20
+ * 需要符合 JSON SCHEMA 规范
21
+ *
22
+ * @default {}
23
+ */
24
+ data?: any;
25
+ /**
26
+ * 选填, 组件对外开放的只读属性,可通过 $w.id1.xx 获取
27
+ * 需要符合 JSON SCHEMA 规范
28
+ */
29
+ properties?: any;
30
+ /**
31
+ * 选填, 平台方法适配的平台
32
+ *
33
+ * 如果该字段为空, 则进行智能推断
34
+ */
35
+ platforms?: string[];
36
+ /**
37
+ * 选填, 仅用于在低码平台的信息展示
38
+ */
39
+ meta?: {
40
+ /**
41
+ * 选填, 平台方法的别名, 建议用中文
42
+ */
43
+ title?: string;
44
+ /**
45
+ * 选填, 平台方法的简介, 建议用中文
46
+ */
47
+ description?: string;
48
+ };
49
+ /**
50
+ * 选填, 扩展字段, 尽量避免用
51
+ */
52
+ extra?: any;
53
+ }
54
+ /**
55
+ * 低码组件开发配置
56
+ */
57
+ interface IComponent {
58
+ /**
59
+ * 选填, 组件唯一标识
60
+ * @maxLength 214
61
+ * @minLength 1
62
+ */
63
+ name?: string;
64
+ /**
65
+ * 选填, 组件可以被捕获的事件信息
66
+ *
67
+ * @default []
68
+ */
69
+ events?: IEvent[];
70
+ /**
71
+ * 选填,组件样式 API
72
+ */
73
+ classes?: IClasses[];
74
+ /**
75
+ * 选填, 组件内定义的自定义方法
76
+ *
77
+ * @default []
78
+ */
79
+ methods?: IMethod[];
80
+ /**
81
+ * 选填, 组件需要在运行时获取的配置项
82
+ */
83
+ compConfig?: {
84
+ /**
85
+ * 选填, 组件是否开启数据容器功能
86
+ * 默认为 false, 设置为 true 后, 在组件内可通过调用 onDataChange 事件将内部数据挂载到组件的 $context 上下文对象
87
+ */
88
+ isDataContainer?: boolean;
89
+ /**
90
+ * 选填, 组件类型
91
+ * 支持将表单类组件设置为 formField,即可在表单容器中收集值
92
+ */
93
+ componentType?: string;
94
+ };
95
+ /**
96
+ * 选填, 组件可以接收的数据, 用作组件props入参
97
+ * 需要符合 JSON SCHEMA 规范
98
+ *
99
+ * @default {}
100
+ */
101
+ data?: any;
102
+ /**
103
+ * 选填, 组件适配的平台
104
+ *
105
+ * 如果该字段为空, 则进行智能推断
106
+ */
107
+ platforms?: string[];
108
+ /**
109
+ * 选填, 仅用于在低码平台的信息展示
110
+ */
111
+ meta?: IConfigMeta & {
112
+ /**
113
+ * 选填, 组件英文标识
114
+ */
115
+ name?: string;
116
+ /**
117
+ * 选填, 用于生成组件 id 的前缀标识
118
+ */
119
+ componentName?: string;
120
+ /**
121
+ * 选填, 组件别名, 建议用中文
122
+ */
123
+ title?: string;
124
+ /**
125
+ * 选填, 组件简介, 建议用中文
126
+ */
127
+ description?: string;
128
+ /**
129
+ * 选填, 组件图标, 支持本地图片
130
+ */
131
+ icon?: string;
132
+ /**
133
+ * 选填, 组件分类, 建议用中文
134
+ */
135
+ category?: string;
136
+ /**
137
+ * 选填, 组件的排序权重
138
+ *
139
+ * @minimum 1
140
+ * @maximum 10000
141
+ */
142
+ componentOrder?: number;
143
+ /**
144
+ * 选填, 组件生效的平台
145
+ */
146
+ platform?: XPlatform[];
147
+ /**
148
+ * 选填, 组件可见性配置
149
+ * 默认均显示,[]表示隐藏, ['APP']表示只在应用编辑器显示,['COMPONENT']表示只在组件编辑器显示
150
+ */
151
+ visible?: VisibleItem[];
152
+ /**
153
+ * 选填,组件模板配置
154
+ */
155
+ templates?: ITemplate[];
156
+ /**
157
+ * 选填, 标识旧组件废弃,控制单组件升级按钮显隐
158
+ */
159
+ deprecated?: boolean;
160
+ /**
161
+ * 选填, 单组件渲染模式[升级/替换]
162
+ */
163
+ renderMode?: IRenderMode[];
164
+ };
165
+ /**
166
+ * 选填, 扩展字段, 尽量避免用
167
+ */
168
+ extra?: any;
169
+ /**
170
+ * 选填, 是否容器组件
171
+ *
172
+ * 容器可以包含子节点,但是不能配置插槽
173
+ */
174
+ isContainer?: boolean;
175
+ /**
176
+ * 默认样式
177
+ * defaultStyles 接收一个React.CSSProperties对象
178
+ */
179
+ defaultStyles?: CSS.Properties<string | number>;
180
+ }
181
+ /**
182
+ * 低码组件可以被捕获的事件信息
183
+ */
184
+ interface IEvent {
185
+ /**
186
+ * 必填, 用作抛出和捕获事件的唯一标识
187
+ */
188
+ name: string;
189
+ /**
190
+ * 选填, 事件别名, 用于低码平台展示
191
+ */
192
+ title: string;
193
+ /**
194
+ * 选填,事件生效的平台
195
+ */
196
+ 'x-platforms'?: XPlatform;
197
+ /**
198
+ * 事件参数对象
199
+ */
200
+ detail?: Record<string, any>;
201
+ }
202
+ /**
203
+ * 低码组件可以暴露的自定义方法
204
+ */
205
+ interface IMethod {
206
+ /**
207
+ * 必填, 用作组件方法的唯一标识
208
+ */
209
+ name: string;
210
+ /**
211
+ * 必填, 组件方法别名, 用于低码平台展示
212
+ */
213
+ label: string;
214
+ /**
215
+ * 选填, 组件方法可以接收的数据
216
+ * 需要符合 JSON SCHEMA 规范
217
+ *
218
+ * @default {}
219
+ */
220
+ params?: any;
221
+ /**
222
+ * 选填, 组件自定义方法适配的平台
223
+ */
224
+ platforms?: string[];
225
+ /**
226
+ * 选填, 组件方法描述
227
+ */
228
+ description?: string;
229
+ }
230
+ interface IRenderMode {
231
+ /**
232
+ * 必填, 转换的目标组件名称
233
+ */
234
+ component: string;
235
+ /**
236
+ * 必填, 表示升级还是替换
237
+ */
238
+ renderType: 'update' | 'replace';
239
+ /**
240
+ * 选填, [源组件的属性路径]:[转换目标组件的属性路径] 标记属性路径的映射关系
241
+ */
242
+ props?: {
243
+ [name: string]: string;
244
+ };
245
+ /**
246
+ * 选填, 表示升级组件所属组件库,默认与废弃组件同库
247
+ */
248
+ materialName?: string;
249
+ /**
250
+ * 选填, 升级说明
251
+ */
252
+ description?: string;
253
+ }
254
+ }
255
+ /** 组件/方法/属性所支持的平台 */
256
+ declare type XPlatform = 'MP' | 'WEB' | 'PCWEB' | 'MOBILEWEB';
257
+ /** 组件在应用编辑器/低码编辑器的生效情况*/
258
+ declare type VisibleItem = 'APP' | 'COMPONENT';
259
+ /** 组件模板配置 */
260
+ interface ITemplate {
261
+ /**
262
+ * 插入模板的节点或插槽
263
+ * 不设置或设置 $children 表示插入到当前组件,可配置多个节点或插槽并用逗号隔开
264
+ */
265
+ to?: '$children' | string;
266
+ /**
267
+ * 插入模板的时机
268
+ * 不设置或设置 $attached 表示刚拖入组件时执行,可配置多个属性名称并用逗号隔开
269
+ */
270
+ when?: '$attached' | string;
271
+ /**
272
+ * 插入的模板主体
273
+ * 目前仅支持 toml 配置语法,结构内容参考组件 CALS
274
+ */
275
+ body?: string;
276
+ /**
277
+ * 插入模板时自动选中的节点
278
+ * 如 template[0] 表示选中所插入模板的第1个节点
279
+ */
280
+ autoSelectPath?: `template${string}`;
281
+ }
282
+ /** 组件配置 */
283
+ interface IConfigMeta {
284
+ /**
285
+ * 选填, 组件说明文档的地址
286
+ */
287
+ docsUrl?: string;
288
+ /**
289
+ * 选填, 组件可见性配置
290
+ */
291
+ visible?: VisibleItem[];
292
+ /**
293
+ * 选填, 组件快捷编辑协议
294
+ */
295
+ shortcut?: IShortcut;
296
+ /**
297
+ * 选填,组件上下文协议,配置后可通过 $context.id.state.xx 读取属性值
298
+ */
299
+ contextData?: {
300
+ extra?: Record<string, any>;
301
+ };
302
+ }
303
+ /** 组件快捷编辑协议 */
304
+ interface IShortcut {
305
+ /**
306
+ * 选填,快捷编辑面板中支持的组件属性
307
+ */
308
+ props?: string[];
309
+ /**
310
+ * 选填,快捷编辑面板中支持拖入的组件
311
+ */
312
+ extra?: Record<string, {
313
+ 'x-component': 'container';
314
+ 'x-component-props'?: string[];
315
+ 'x-index'?: number;
316
+ 'x-insert-path'?: string;
317
+ }>;
318
+ }
319
+ /** 组件样式 API */
320
+ interface IClasses {
321
+ /**
322
+ * 样式名称
323
+ */
324
+ name?: string;
325
+ /**
326
+ * 样式选择器
327
+ */
328
+ selector?: string;
329
+ /**
330
+ * 样式说明
331
+ */
332
+ description?: string;
333
+ }
334
+ export {};
448
335
  //# sourceMappingURL=lcds.d.ts.map