@cocojs/mvc 0.0.1-alpha202511172034

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.
@@ -0,0 +1,1151 @@
1
+ /// <reference types="@types" />
2
+
3
+ /**
4
+ * @public
5
+ */
6
+ export declare class Api extends Metadata {
7
+ }
8
+
9
+ export declare const api: () => Decorator<ClassDecoratorContext>;
10
+
11
+ /**
12
+ * 表示一个web应用实例
13
+ * @public
14
+ */
15
+ export declare class Application {
16
+ componentMetadataClass: ComponentMetadataClass;
17
+ metadataRepository: MetadataRepository;
18
+ idClassMap: IdClassMap;
19
+ propertiesConfig: PropertiesConfig;
20
+ constructor(jsonConfig?: Record<string, any>);
21
+ /**
22
+ * 在项目中,所以的组件都已经收集到coco/index里面了,所以不需要进行组件收集;
23
+ * 在测试时,组件是在执行到对应的行装饰器才会执行,所以需要先收集在启动。
24
+ */
25
+ start(): void;
26
+ destructor(): void;
27
+ /**
28
+ * 根据组件定义返回组件实例,如果存在多个子组件,需要通过qualify指定子组件id
29
+ * @param cls - 类定义
30
+ * @param option
31
+ */
32
+ getComponent<T>(cls: Class<T>, option?: {
33
+ qualifier?: string;
34
+ }): T;
35
+ getComponent<T>(id: string, option?: {
36
+ qualifier?: string;
37
+ }): T;
38
+ /**
39
+ * 仅用于view组件的实例化入口,其他ioc组件都应该使用getComponent
40
+ * @param viewClass view组件的类定义
41
+ * @param props 组件的props
42
+ * @returns
43
+ */
44
+ getViewComponent<T>(viewClass: Class<T>, props?: any[]): any;
45
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): string[];
46
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
47
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata>;
48
+ getMetaClassById(id: string): Class<Metadata>;
49
+ /**
50
+ * 启动所有配置boot的组件
51
+ */
52
+ private bootComponent;
53
+ }
54
+
55
+ /**
56
+ * 表示一个web应用实例
57
+ * @public
58
+ */
59
+ declare class Application_2 {
60
+ componentMetadataClass: ComponentMetadataClass_2;
61
+ metadataRepository: MetadataRepository_2;
62
+ idClassMap: IdClassMap_2;
63
+ propertiesConfig: PropertiesConfig_2;
64
+ constructor(jsonConfig?: Record<string, any>);
65
+ /**
66
+ * 在项目中,所以的组件都已经收集到coco/index里面了,所以不需要进行组件收集;
67
+ * 在测试时,组件是在执行到对应的行装饰器才会执行,所以需要先收集在启动。
68
+ */
69
+ start(): void;
70
+ destructor(): void;
71
+ /**
72
+ * 根据组件定义返回组件实例,如果存在多个子组件,需要通过qualify指定子组件id
73
+ * @param cls - 类定义
74
+ * @param option
75
+ */
76
+ getComponent<T>(cls: Class<T>, option?: {
77
+ qualifier?: string;
78
+ }): T;
79
+ getComponent<T>(id: string, option?: {
80
+ qualifier?: string;
81
+ }): T;
82
+ /**
83
+ * 仅用于view组件的实例化入口,其他ioc组件都应该使用getComponent
84
+ * @param viewClass view组件的类定义
85
+ * @param props 组件的props
86
+ * @returns
87
+ */
88
+ getViewComponent<T>(viewClass: Class<T>, props?: any[]): any;
89
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): string[];
90
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
91
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata_2>;
92
+ getMetaClassById(id: string): Class<Metadata_2>;
93
+ /**
94
+ * 启动所有配置boot的组件
95
+ */
96
+ private bootComponent;
97
+ }
98
+
99
+ /**
100
+ * 表示一个web应用实例
101
+ * @public
102
+ */
103
+ declare class Application_3 {
104
+ componentMetadataClass: ComponentMetadataClass_3;
105
+ metadataRepository: MetadataRepository_3;
106
+ idClassMap: IdClassMap_3;
107
+ propertiesConfig: PropertiesConfig_3;
108
+ constructor(jsonConfig?: Record<string, any>);
109
+ /**
110
+ * 在项目中,所以的组件都已经收集到coco/index里面了,所以不需要进行组件收集;
111
+ * 在测试时,组件是在执行到对应的行装饰器才会执行,所以需要先收集在启动。
112
+ */
113
+ start(): void;
114
+ destructor(): void;
115
+ /**
116
+ * 根据组件定义返回组件实例,如果存在多个子组件,需要通过qualify指定子组件id
117
+ * @param cls - 类定义
118
+ * @param option
119
+ */
120
+ getComponent<T>(cls: Class<T>, option?: {
121
+ qualifier?: string;
122
+ }): T;
123
+ getComponent<T>(id: string, option?: {
124
+ qualifier?: string;
125
+ }): T;
126
+ /**
127
+ * 仅用于view组件的实例化入口,其他ioc组件都应该使用getComponent
128
+ * @param viewClass view组件的类定义
129
+ * @param props 组件的props
130
+ * @returns
131
+ */
132
+ getViewComponent<T>(viewClass: Class<T>, props?: any[]): any;
133
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): string[];
134
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
135
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata_4>;
136
+ getMetaClassById(id: string): Class<Metadata_4>;
137
+ /**
138
+ * 启动所有配置boot的组件
139
+ */
140
+ private bootComponent;
141
+ }
142
+
143
+ /**
144
+ * @public
145
+ */
146
+ export declare class Autowired extends Metadata {
147
+ value: Class<any>;
148
+ }
149
+
150
+ export declare const autowired: (cls?: Class<any>) => Decorator<ClassFieldDecoratorContext>;
151
+
152
+ /**
153
+ * @public
154
+ */
155
+ export declare class Bind extends Metadata_3 {
156
+ }
157
+
158
+ export declare const bind: () => Decorator_2<ClassMethodDecoratorContext>;
159
+
160
+ declare interface BizMetadata {
161
+ classMetadata: Metadata[];
162
+ fieldMetadata: Map<Field, Metadata[]>;
163
+ methodMetadata: Map<Field, Metadata[]>;
164
+ }
165
+
166
+ declare interface BizMetadata_2 {
167
+ classMetadata: Metadata_2[];
168
+ fieldMetadata: Map<Field_2, Metadata_2[]>;
169
+ methodMetadata: Map<Field_2, Metadata_2[]>;
170
+ }
171
+
172
+ declare interface BizMetadata_3 {
173
+ classMetadata: Metadata_4[];
174
+ fieldMetadata: Map<Field_3, Metadata_4[]>;
175
+ methodMetadata: Map<Field_3, Metadata_4[]>;
176
+ }
177
+
178
+ /**
179
+ * Children
180
+ * @type {{
181
+ * map: (children: any, forEachFunc: any, forEachContext: any)=> void,
182
+ * forEach: (children: any, func: any, context: any) => void
183
+ * }}
184
+ */
185
+ export declare const Children: {
186
+ map: (children: any, forEachFunc: any, forEachContext: any) => void;
187
+ forEach: (children: any, func: any, context: any) => void;
188
+ };
189
+
190
+ /**
191
+ * Component不添加@scope(SCOPE.Singleton)的原因:
192
+ * 因为不设置默认就是singleton,还可以避免 scope <-> target 循环依赖的问题
193
+ */
194
+ /**
195
+ * @public
196
+ */
197
+ export declare class Component extends Metadata {
198
+ value?: Class<any>;
199
+ }
200
+
201
+ export declare const component: (value?: Class<any>) => Decorator<ClassDecoratorContext | ClassMethodDecoratorContext>;
202
+
203
+ /**
204
+ * @public
205
+ * @param metadata - 元数据实例对象
206
+ * @param application - 全局的application对象
207
+ */
208
+ declare type ComponentClassPostConstructFn = (metadata: Metadata, application: Application) => void;
209
+
210
+ /**
211
+ * @public
212
+ * @param metadata - 元数据实例对象
213
+ * @param application - 全局的application对象
214
+ * @param field - 被装饰的字段名
215
+ */
216
+ declare type ComponentFieldPostConstructFn = (metadata: Metadata, application: Application, field: Field) => void;
217
+
218
+ declare class ComponentMetadataClass {
219
+ isComponent: Map<Class<Metadata>, boolean>;
220
+ isComponentMetadata(MetadataClass: Class<Metadata>): boolean;
221
+ /**
222
+ * 校验元数据类的组件类,过滤掉所有非法的组件元数据信息
223
+ * @param metadataListMap 元数据类的元数据信息
224
+ * @returns 诊断信息
225
+ */
226
+ validateMetadata(metadataListMap: Map<Class<Metadata>, MetaMetadata>): Diagnose[];
227
+ /**
228
+ * 检测组件装饰器依赖图中的循环
229
+ * @param componentDecoratorSet 组件装饰器依赖图
230
+ * @returns 所有循环的集合,每个循环是一个 Set<Class<Metadata>>
231
+ */
232
+ private detectCycles;
233
+ }
234
+
235
+ declare class ComponentMetadataClass_2 {
236
+ isComponent: Map<Class<Metadata_2>, boolean>;
237
+ isComponentMetadata(MetadataClass: Class<Metadata_2>): boolean;
238
+ /**
239
+ * 校验元数据类的组件类,过滤掉所有非法的组件元数据信息
240
+ * @param metadataListMap 元数据类的元数据信息
241
+ * @returns 诊断信息
242
+ */
243
+ validateMetadata(metadataListMap: Map<Class<Metadata_2>, MetaMetadata_2>): Diagnose_2[];
244
+ /**
245
+ * 检测组件装饰器依赖图中的循环
246
+ * @param componentDecoratorSet 组件装饰器依赖图
247
+ * @returns 所有循环的集合,每个循环是一个 Set<Class<Metadata>>
248
+ */
249
+ private detectCycles;
250
+ }
251
+
252
+ declare class ComponentMetadataClass_3 {
253
+ isComponent: Map<Class<Metadata_4>, boolean>;
254
+ isComponentMetadata(MetadataClass: Class<Metadata_4>): boolean;
255
+ /**
256
+ * 校验元数据类的组件类,过滤掉所有非法的组件元数据信息
257
+ * @param metadataListMap 元数据类的元数据信息
258
+ * @returns 诊断信息
259
+ */
260
+ validateMetadata(metadataListMap: Map<Class<Metadata_4>, MetaMetadata_3>): Diagnose_3[];
261
+ /**
262
+ * 检测组件装饰器依赖图中的循环
263
+ * @param componentDecoratorSet 组件装饰器依赖图
264
+ * @returns 所有循环的集合,每个循环是一个 Set<Class<Metadata>>
265
+ */
266
+ private detectCycles;
267
+ }
268
+
269
+ /**
270
+ * @public
271
+ */
272
+ declare type ComponentMethodPostConstructFn = (metadata: Metadata, application: Application, field: Field) => void;
273
+
274
+ declare type ComponentPostConstruct = ComponentClassPostConstructFn | ComponentMethodPostConstructFn | ComponentFieldPostConstructFn;
275
+
276
+ /**
277
+ * @public
278
+ */
279
+ export declare class Configuration extends Metadata {
280
+ }
281
+
282
+ export declare const configuration: () => Decorator<ClassDecoratorContext>;
283
+
284
+ /**
285
+ * @public
286
+ */
287
+ export declare class ConstructorParam extends Metadata {
288
+ value: Class<any>[];
289
+ }
290
+
291
+ export declare const constructorParam: () => Decorator<ClassDecoratorContext>;
292
+
293
+ /**
294
+ * @public
295
+ */
296
+ export declare class Cookie extends Metadata_3 {
297
+ }
298
+
299
+ export declare const cookie: () => Decorator_2<ClassDecoratorContext>;
300
+
301
+ /**
302
+ * 使用元数据类创建一个装饰器函数
303
+ * 适用于装饰器不装饰自己元数据类的场景
304
+ * @public
305
+ */
306
+ export declare function createDecoratorExp(metadataCls: Class<any>, option?: CreateDecoratorExpOption): DecoratorExp;
307
+
308
+ declare interface CreateDecoratorExpOption {
309
+ /**
310
+ * 类实例化之后,会调用类的装饰器的componentPostConstruct做自定义的处理
311
+ * @param metadata 装饰器参数实例化的元数据实例
312
+ * @param application 全局application对象
313
+ * @param field 被装饰的field名
314
+ * @returns
315
+ */
316
+ componentPostConstruct?: ComponentPostConstruct;
317
+ }
318
+
319
+ /**
320
+ * 创建一个未绑定元数据的装饰器表达式,后续通过表达式的第二个参数来绑定
321
+ * 适用于装饰器装饰自己元数据类的场景
322
+ * @public
323
+ */
324
+ export declare function createPlaceholderDecoratorExp<T>(option?: CreateDecoratorExpOption): DecoratorExpWithDecoratorSelf<T>;
325
+
326
+ /**
327
+ * @public
328
+ */
329
+ export declare type Decorator<C> = (value: any, context: C) => any;
330
+
331
+ /**
332
+ * @public
333
+ */
334
+ declare type Decorator_2<C> = (value: any, context: C) => any;
335
+
336
+ /**
337
+ * @public
338
+ */
339
+ declare type Decorator_3<C> = (value: any, context: C) => any;
340
+
341
+ declare interface DecoratorExp {
342
+ (userParam?: any): Decorator<DecoratorContext>;
343
+ }
344
+
345
+ declare interface DecoratorExpWithDecoratorSelf<T extends any> {
346
+ (userParam?: T): Decorator<DecoratorContext>;
347
+ decorateSelf: (userParam?: T) => Decorator<DecoratorContext>;
348
+ }
349
+
350
+ declare interface Diagnose {
351
+ code: DiagnoseCode;
352
+ args: any[];
353
+ }
354
+
355
+ declare interface Diagnose_2 {
356
+ code: DiagnoseCode_2;
357
+ args: any[];
358
+ }
359
+
360
+ declare interface Diagnose_3 {
361
+ code: DiagnoseCode_3;
362
+ args: any[];
363
+ }
364
+
365
+ declare enum DiagnoseCode {
366
+ 'CO10001' = 'CO10001',
367
+ 'CO10002' = 'CO10002', // 元数据类必须要添加@target
368
+ 'CO10003' = 'CO10003',
369
+ 'CO10004' = 'CO10004',
370
+ 'CO10005' = 'CO10005',
371
+ 'CO10006' = 'CO10006',
372
+ 'CO10007' = 'CO10007', // 业务类不需要添加@target
373
+ 'CO10008' = 'CO10008', // 只有配置类内部才可以使用component注入第三方组件。
374
+ 'CO10009' = 'CO10009', // autowired注入的类存在多个子类,但是没有使用@qualifier装饰器
375
+ 'CO10010' = 'CO10010', // autowired注入的类存在多个子类,但@qualifier装饰器指定了一个不存在的子类id
376
+ 'CO10011' = 'CO10011', // 要实例化的类没有注册为ioc组件
377
+ 'CO10012' = 'CO10012', // 通过autowired注入的依赖不能是自己
378
+ 'CO10013' = 'CO10013', // 实例化过程中发现循环依赖
379
+ 'CO10014' = 'CO10014', // 一个元数据类创建了不止一个装饰器
380
+ 'CO10015' = 'CO10015', // 元数据类本身存在id属性,且不能修改
381
+ 'CO10016' = 'CO10016', // 元数据类没有id属性或者id属性不是字符串
382
+ 'CO10017' = 'CO10017', // 元数据类id属性存在重复
383
+ 'CO10018' = 'CO10018', // createDecoratorExp的第一个参数不是类,或者不是Metadata的子类
384
+ 'CO10019' = 'CO10019', // 装饰器暂时不是支持装饰 setter getter accessor 类型。
385
+ 'CO10020' = 'CO10020', // [warn]占位的元数据类没有使用decorateSelf函数,但装饰器也没有被使用
386
+ 'CO10021' = 'CO10021', // 占位的元数据类没有使用decorateSelf函数
387
+ 'CO10022' = 'CO10022', // 元数据类不能有字段装饰器
388
+ 'CO10023' = 'CO10023', // 元数据类不能有方法装饰器
389
+ 'CO10024' = 'CO10024', // 元数据类存在多个组件装饰器
390
+ }
391
+
392
+ declare enum DiagnoseCode_2 {
393
+ 'CO10001' = 'CO10001',
394
+ 'CO10002' = 'CO10002', // 元数据类必须要添加@target
395
+ 'CO10003' = 'CO10003',
396
+ 'CO10004' = 'CO10004',
397
+ 'CO10005' = 'CO10005',
398
+ 'CO10006' = 'CO10006',
399
+ 'CO10007' = 'CO10007', // 业务类不需要添加@target
400
+ 'CO10008' = 'CO10008', // 只有配置类内部才可以使用component注入第三方组件。
401
+ 'CO10009' = 'CO10009', // autowired注入的类存在多个子类,但是没有使用@qualifier装饰器
402
+ 'CO10010' = 'CO10010', // autowired注入的类存在多个子类,但@qualifier装饰器指定了一个不存在的子类id
403
+ 'CO10011' = 'CO10011', // 要实例化的类没有注册为ioc组件
404
+ 'CO10012' = 'CO10012', // 通过autowired注入的依赖不能是自己
405
+ 'CO10013' = 'CO10013', // 实例化过程中发现循环依赖
406
+ 'CO10014' = 'CO10014', // 一个元数据类创建了不止一个装饰器
407
+ 'CO10015' = 'CO10015', // 元数据类本身存在id属性,且不能修改
408
+ 'CO10016' = 'CO10016', // 元数据类没有id属性或者id属性不是字符串
409
+ 'CO10017' = 'CO10017', // 元数据类id属性存在重复
410
+ 'CO10018' = 'CO10018', // createDecoratorExp的第一个参数不是类,或者不是Metadata的子类
411
+ 'CO10019' = 'CO10019', // 装饰器暂时不是支持装饰 setter getter accessor 类型。
412
+ 'CO10020' = 'CO10020', // [warn]占位的元数据类没有使用decorateSelf函数,但装饰器也没有被使用
413
+ 'CO10021' = 'CO10021', // 占位的元数据类没有使用decorateSelf函数
414
+ 'CO10022' = 'CO10022', // 元数据类不能有字段装饰器
415
+ 'CO10023' = 'CO10023', // 元数据类不能有方法装饰器
416
+ 'CO10024' = 'CO10024', // 元数据类存在多个组件装饰器
417
+ }
418
+
419
+ declare enum DiagnoseCode_3 {
420
+ 'CO10001' = 'CO10001',
421
+ 'CO10002' = 'CO10002', // 元数据类必须要添加@target
422
+ 'CO10003' = 'CO10003',
423
+ 'CO10004' = 'CO10004',
424
+ 'CO10005' = 'CO10005',
425
+ 'CO10006' = 'CO10006',
426
+ 'CO10007' = 'CO10007', // 业务类不需要添加@target
427
+ 'CO10008' = 'CO10008', // 只有配置类内部才可以使用component注入第三方组件。
428
+ 'CO10009' = 'CO10009', // autowired注入的类存在多个子类,但是没有使用@qualifier装饰器
429
+ 'CO10010' = 'CO10010', // autowired注入的类存在多个子类,但@qualifier装饰器指定了一个不存在的子类id
430
+ 'CO10011' = 'CO10011', // 要实例化的类没有注册为ioc组件
431
+ 'CO10012' = 'CO10012', // 通过autowired注入的依赖不能是自己
432
+ 'CO10013' = 'CO10013', // 实例化过程中发现循环依赖
433
+ 'CO10014' = 'CO10014', // 一个元数据类创建了不止一个装饰器
434
+ 'CO10015' = 'CO10015', // 元数据类本身存在id属性,且不能修改
435
+ 'CO10016' = 'CO10016', // 元数据类没有id属性或者id属性不是字符串
436
+ 'CO10017' = 'CO10017', // 元数据类id属性存在重复
437
+ 'CO10018' = 'CO10018', // createDecoratorExp的第一个参数不是类,或者不是Metadata的子类
438
+ 'CO10019' = 'CO10019', // 装饰器暂时不是支持装饰 setter getter accessor 类型。
439
+ 'CO10020' = 'CO10020', // [warn]占位的元数据类没有使用decorateSelf函数,但装饰器也没有被使用
440
+ 'CO10021' = 'CO10021', // 占位的元数据类没有使用decorateSelf函数
441
+ 'CO10022' = 'CO10022', // 元数据类不能有字段装饰器
442
+ 'CO10023' = 'CO10023', // 元数据类不能有方法装饰器
443
+ 'CO10024' = 'CO10024', // 元数据类存在多个组件装饰器
444
+ }
445
+
446
+ declare class DynamicRoute {
447
+ regExp: RegExp;
448
+ paths: string[];
449
+ constructor(url: string);
450
+ match(url: string): {};
451
+ }
452
+
453
+ /**
454
+ * @public
455
+ */
456
+ export declare type Field = string;
457
+
458
+ /**
459
+ * @public
460
+ */
461
+ declare type Field_2 = string;
462
+
463
+ /**
464
+ * @public
465
+ */
466
+ declare type Field_3 = string;
467
+
468
+ /**
469
+ * @public
470
+ */
471
+ export declare class Flow extends Metadata {
472
+ }
473
+
474
+ export declare const flow: () => Decorator<ClassDecoratorContext>;
475
+
476
+ /**
477
+ * @public
478
+ */
479
+ export declare class GlobalData extends Metadata {
480
+ }
481
+
482
+ export declare const globalData: () => Decorator<ClassDecoratorContext>;
483
+
484
+ /**
485
+ * @public
486
+ */
487
+ export declare class HistoryRouter extends Router {
488
+ constructor(render: Render_2);
489
+ handleRouteChange: () => void;
490
+ init(application: Application_3): void;
491
+ start(): void;
492
+ removeListener(): void;
493
+ navigateTo(url: string): void;
494
+ }
495
+
496
+ /**
497
+ * @public
498
+ */
499
+ export declare class Id extends Metadata {
500
+ value: string;
501
+ }
502
+
503
+ /**
504
+ * @public
505
+ * @id()装饰器
506
+ * 用于为元数据类或者组件类设置id,id的作用是可以根据id返回元数据类,也可以根据id实例化组件,所以id必须要唯一。
507
+ * 如果一个组件不添加id装饰器,那么组件或者元数据类的id就是class.name(webpack目前打包不会压缩class关键字,TODO: rollup打包会压缩class关键字,要么强制添加id装饰器,要么强制不压缩class关键字)
508
+ * 如果用户显式设置了id装饰器,那么会使用用户设置的id
509
+ */
510
+ export declare const id: DecoratorExpWithDecoratorSelf<string>;
511
+
512
+ declare class IdClassMap {
513
+ private idClassMap;
514
+ /**
515
+ * * 保存元数据类本身,方便运行是通过id获取元数据类
516
+ * * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
517
+ */
518
+ constructor(metaMetadataMap: Map<Class<Metadata>, MetaMetadata>);
519
+ /**
520
+ * * 根据id获取元数据类
521
+ * * @param id 元数据类id
522
+ * * @returns 元数据类
523
+ */
524
+ getMetaClassById(id: string): Class<Metadata>;
525
+ destructor(): void;
526
+ }
527
+
528
+ declare class IdClassMap_2 {
529
+ private idClassMap;
530
+ /**
531
+ * * 保存元数据类本身,方便运行是通过id获取元数据类
532
+ * * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
533
+ */
534
+ constructor(metaMetadataMap: Map<Class<Metadata_2>, MetaMetadata_2>);
535
+ /**
536
+ * * 根据id获取元数据类
537
+ * * @param id 元数据类id
538
+ * * @returns 元数据类
539
+ */
540
+ getMetaClassById(id: string): Class<Metadata_2>;
541
+ destructor(): void;
542
+ }
543
+
544
+ declare class IdClassMap_3 {
545
+ private idClassMap;
546
+ /**
547
+ * * 保存元数据类本身,方便运行是通过id获取元数据类
548
+ * * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
549
+ */
550
+ constructor(metaMetadataMap: Map<Class<Metadata_4>, MetaMetadata_3>);
551
+ /**
552
+ * * 根据id获取元数据类
553
+ * * @param id 元数据类id
554
+ * * @returns 元数据类
555
+ */
556
+ getMetaClassById(id: string): Class<Metadata_4>;
557
+ destructor(): void;
558
+ }
559
+
560
+ declare function jsx(component: any, config: any, maybeKey?: any): {
561
+ $$typeof: any;
562
+ type: any;
563
+ key: any;
564
+ ref: any;
565
+ props: any;
566
+ };
567
+ export { jsx }
568
+ export { jsx as jsxs }
569
+
570
+ declare type Kind = typeof KindClass | typeof KindField | typeof KindMethod;
571
+
572
+ declare type Kind_2 = typeof KindClass_2 | typeof KindField_2 | typeof KindMethod_2;
573
+
574
+ declare type Kind_3 = typeof KindClass_3 | typeof KindField_3 | typeof KindMethod_3;
575
+
576
+ export declare const KindClass = "class";
577
+
578
+ declare const KindClass_2 = "class";
579
+
580
+ declare const KindClass_3 = "class";
581
+
582
+ export declare const KindField = "field";
583
+
584
+ declare const KindField_2 = "field";
585
+
586
+ declare const KindField_3 = "field";
587
+
588
+ export declare const KindMethod = "method";
589
+
590
+ declare const KindMethod_2 = "method";
591
+
592
+ declare const KindMethod_3 = "method";
593
+
594
+ /**
595
+ * @public
596
+ */
597
+ export declare class Layout extends Metadata_3 {
598
+ }
599
+
600
+ export declare const layout: () => Decorator_2<ClassDecoratorContext>;
601
+
602
+ /**
603
+ * @public
604
+ */
605
+ export declare class LocalStorage extends Metadata_3 {
606
+ }
607
+
608
+ declare const localStorage_2: () => Decorator_2<ClassDecoratorContext>;
609
+ export { localStorage_2 as localStorage }
610
+
611
+ /**
612
+ * @public
613
+ */
614
+ export declare class Memoized extends Metadata_3 {
615
+ }
616
+
617
+ export declare const memoized: () => Decorator_2<ClassMethodDecoratorContext>;
618
+
619
+ /**
620
+ * 元信息基类
621
+ * @public
622
+ */
623
+ export declare abstract class Metadata {
624
+ }
625
+
626
+ /**
627
+ * 元信息基类
628
+ * @public
629
+ */
630
+ declare abstract class Metadata_2 {
631
+ }
632
+
633
+ /**
634
+ * 元信息基类
635
+ * @public
636
+ */
637
+ declare abstract class Metadata_3 {
638
+ }
639
+
640
+ /**
641
+ * 元信息基类
642
+ * @public
643
+ */
644
+ declare abstract class Metadata_4 {
645
+ }
646
+
647
+ declare class MetadataRepository {
648
+ private metaMetadataMap;
649
+ private bizMetadataMap;
650
+ constructor(decoratorMap: Map<Class<any>, Params[]>);
651
+ getAll(): [Map<Class<Metadata>, MetaMetadata>, Map<Class<Metadata>, BizMetadata>];
652
+ destructor(): void;
653
+ getMetadataByClass(Cls: Class<any>): {
654
+ classMetadata: Metadata[];
655
+ fieldMetadata?: Map<Field, Metadata[]>;
656
+ methodMetadata?: Map<Field, Metadata[]>;
657
+ };
658
+ private addToMap;
659
+ addClassKindMetadata(cls: Class<any>, MetadataCls?: Class<Metadata>, args?: any): void;
660
+ addFieldKindMetadata(Cls: Class<any>, fieldName: Field, MetadataCls: Class<Metadata>, args?: any): void;
661
+ addMethodKindMetadata(Cls: Class<any>, fieldName: Field, MetadataCls: Class<Metadata>, args?: any): void;
662
+ /**
663
+ * 获取指定类的类类型的元数据
664
+ * @param beDecoratedCls 指定类
665
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
666
+ */
667
+ listClassKindMetadata(beDecoratedCls: Class<any>, findMetadataCls?: Class<any>): Metadata[];
668
+ /**
669
+ * 获取指定类的字段类型的元数据
670
+ * @param beDecoratedCls 指定类
671
+ * @param field 指定field名
672
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
673
+ */
674
+ listFieldKindMetadata(beDecoratedCls: Class<any>, field: Field, findMetadataCls?: Class<any>): Metadata[];
675
+ /**
676
+ * 获取指定类的方法类型的元数据
677
+ * @param beDecoratedCls 指定类
678
+ * @param field 指定method名
679
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
680
+ */
681
+ listMethodKindMetadata(beDecoratedCls: Class<any>, field: Field, findMetadataCls?: Class<any>): Metadata[];
682
+ /**
683
+ * 在类的所有类类型的元数据中递归查找某个元数据类实例,找到就直接返回
684
+ * TODO: 因为现在组件装饰器的层数没有限制了,那么upward这个参数是否还有必要存在
685
+ */
686
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
687
+ /**
688
+ * 返回包含指定元数据类的所有field
689
+ * @param beDecoratedCls 指定类
690
+ * @param MetadataCls 指定元数据类
691
+ */
692
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field[];
693
+ /**
694
+ * 返回包含指定元数据类的所有method
695
+ * @param beDecoratedCls 指定类
696
+ * @param MetadataCls 指定元数据类
697
+ */
698
+ listMethodByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field[];
699
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata>;
700
+ }
701
+
702
+ declare class MetadataRepository_2 {
703
+ private metaMetadataMap;
704
+ private bizMetadataMap;
705
+ constructor(decoratorMap: Map<Class<any>, Params_2[]>);
706
+ getAll(): [Map<Class<Metadata_2>, MetaMetadata_2>, Map<Class<Metadata_2>, BizMetadata_2>];
707
+ destructor(): void;
708
+ getMetadataByClass(Cls: Class<any>): {
709
+ classMetadata: Metadata_2[];
710
+ fieldMetadata?: Map<Field_2, Metadata_2[]>;
711
+ methodMetadata?: Map<Field_2, Metadata_2[]>;
712
+ };
713
+ private addToMap;
714
+ addClassKindMetadata(cls: Class<any>, MetadataCls?: Class<Metadata_2>, args?: any): void;
715
+ addFieldKindMetadata(Cls: Class<any>, fieldName: Field_2, MetadataCls: Class<Metadata_2>, args?: any): void;
716
+ addMethodKindMetadata(Cls: Class<any>, fieldName: Field_2, MetadataCls: Class<Metadata_2>, args?: any): void;
717
+ /**
718
+ * 获取指定类的类类型的元数据
719
+ * @param beDecoratedCls 指定类
720
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
721
+ */
722
+ listClassKindMetadata(beDecoratedCls: Class<any>, findMetadataCls?: Class<any>): Metadata_2[];
723
+ /**
724
+ * 获取指定类的字段类型的元数据
725
+ * @param beDecoratedCls 指定类
726
+ * @param field 指定field名
727
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
728
+ */
729
+ listFieldKindMetadata(beDecoratedCls: Class<any>, field: Field_2, findMetadataCls?: Class<any>): Metadata_2[];
730
+ /**
731
+ * 获取指定类的方法类型的元数据
732
+ * @param beDecoratedCls 指定类
733
+ * @param field 指定method名
734
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
735
+ */
736
+ listMethodKindMetadata(beDecoratedCls: Class<any>, field: Field_2, findMetadataCls?: Class<any>): Metadata_2[];
737
+ /**
738
+ * 在类的所有类类型的元数据中递归查找某个元数据类实例,找到就直接返回
739
+ * TODO: 因为现在组件装饰器的层数没有限制了,那么upward这个参数是否还有必要存在
740
+ */
741
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
742
+ /**
743
+ * 返回包含指定元数据类的所有field
744
+ * @param beDecoratedCls 指定类
745
+ * @param MetadataCls 指定元数据类
746
+ */
747
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field_2[];
748
+ /**
749
+ * 返回包含指定元数据类的所有method
750
+ * @param beDecoratedCls 指定类
751
+ * @param MetadataCls 指定元数据类
752
+ */
753
+ listMethodByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field_2[];
754
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata_2>;
755
+ }
756
+
757
+ declare class MetadataRepository_3 {
758
+ private metaMetadataMap;
759
+ private bizMetadataMap;
760
+ constructor(decoratorMap: Map<Class<any>, Params_3[]>);
761
+ getAll(): [Map<Class<Metadata_4>, MetaMetadata_3>, Map<Class<Metadata_4>, BizMetadata_3>];
762
+ destructor(): void;
763
+ getMetadataByClass(Cls: Class<any>): {
764
+ classMetadata: Metadata_4[];
765
+ fieldMetadata?: Map<Field_3, Metadata_4[]>;
766
+ methodMetadata?: Map<Field_3, Metadata_4[]>;
767
+ };
768
+ private addToMap;
769
+ addClassKindMetadata(cls: Class<any>, MetadataCls?: Class<Metadata_4>, args?: any): void;
770
+ addFieldKindMetadata(Cls: Class<any>, fieldName: Field_3, MetadataCls: Class<Metadata_4>, args?: any): void;
771
+ addMethodKindMetadata(Cls: Class<any>, fieldName: Field_3, MetadataCls: Class<Metadata_4>, args?: any): void;
772
+ /**
773
+ * 获取指定类的类类型的元数据
774
+ * @param beDecoratedCls 指定类
775
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
776
+ */
777
+ listClassKindMetadata(beDecoratedCls: Class<any>, findMetadataCls?: Class<any>): Metadata_4[];
778
+ /**
779
+ * 获取指定类的字段类型的元数据
780
+ * @param beDecoratedCls 指定类
781
+ * @param field 指定field名
782
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
783
+ */
784
+ listFieldKindMetadata(beDecoratedCls: Class<any>, field: Field_3, findMetadataCls?: Class<any>): Metadata_4[];
785
+ /**
786
+ * 获取指定类的方法类型的元数据
787
+ * @param beDecoratedCls 指定类
788
+ * @param field 指定method名
789
+ * @param findMetadataCls 如果不指定,返回全部;否则进行列表过滤
790
+ */
791
+ listMethodKindMetadata(beDecoratedCls: Class<any>, field: Field_3, findMetadataCls?: Class<any>): Metadata_4[];
792
+ /**
793
+ * 在类的所有类类型的元数据中递归查找某个元数据类实例,找到就直接返回
794
+ * TODO: 因为现在组件装饰器的层数没有限制了,那么upward这个参数是否还有必要存在
795
+ */
796
+ findClassKindMetadataRecursively(beDecoratedCls: Class<any>, TargetCls: Class<any>, upward?: number): any;
797
+ /**
798
+ * 返回包含指定元数据类的所有field
799
+ * @param beDecoratedCls 指定类
800
+ * @param MetadataCls 指定元数据类
801
+ */
802
+ listFieldByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field_3[];
803
+ /**
804
+ * 返回包含指定元数据类的所有method
805
+ * @param beDecoratedCls 指定类
806
+ * @param MetadataCls 指定元数据类
807
+ */
808
+ listMethodByMetadataCls(beDecoratedCls: Class<any>, MetadataCls: Class<any>): Field_3[];
809
+ listBeDecoratedClsByClassKindMetadata(MetadataCls: Class<any>): Map<Class<any>, Metadata_4>;
810
+ }
811
+
812
+ declare interface MetaMetadata {
813
+ classMetadata: Metadata[];
814
+ fieldMetadata: Map<Field, Metadata[]>;
815
+ methodMetadata: Map<Field, Metadata[]>;
816
+ }
817
+
818
+ declare interface MetaMetadata_2 {
819
+ classMetadata: Metadata_2[];
820
+ fieldMetadata: Map<Field_2, Metadata_2[]>;
821
+ methodMetadata: Map<Field_2, Metadata_2[]>;
822
+ }
823
+
824
+ declare interface MetaMetadata_3 {
825
+ classMetadata: Metadata_4[];
826
+ fieldMetadata: Map<Field_3, Metadata_4[]>;
827
+ methodMetadata: Map<Field_3, Metadata_4[]>;
828
+ }
829
+
830
+ /**
831
+ * @public
832
+ */
833
+ export declare class Page extends Metadata_3 {
834
+ }
835
+
836
+ export declare const page: () => Decorator_2<ClassDecoratorContext>;
837
+
838
+ declare type Params = {
839
+ metadataKind: Kind;
840
+ metadataClass: Class<any>;
841
+ placeholderMetadataClass?: Class<any>;
842
+ metadataParam: any;
843
+ /**
844
+ * 如果metadataKind是'class',field是undefined
845
+ * 如果metadataKind是'method'\'field',field就是对应的prop名字
846
+ * todo 测试是否支持Symbol类型
847
+ */
848
+ field?: Field;
849
+ };
850
+
851
+ declare type Params_2 = {
852
+ metadataKind: Kind_2;
853
+ metadataClass: Class<any>;
854
+ placeholderMetadataClass?: Class<any>;
855
+ metadataParam: any;
856
+ /**
857
+ * 如果metadataKind是'class',field是undefined
858
+ * 如果metadataKind是'method'\'field',field就是对应的prop名字
859
+ * todo 测试是否支持Symbol类型
860
+ */
861
+ field?: Field_2;
862
+ };
863
+
864
+ declare type Params_3 = {
865
+ metadataKind: Kind_3;
866
+ metadataClass: Class<any>;
867
+ placeholderMetadataClass?: Class<any>;
868
+ metadataParam: any;
869
+ /**
870
+ * 如果metadataKind是'class',field是undefined
871
+ * 如果metadataKind是'method'\'field',field就是对应的prop名字
872
+ * todo 测试是否支持Symbol类型
873
+ */
874
+ field?: Field_3;
875
+ };
876
+
877
+ /**
878
+ * 动态配置操作类
879
+ * @public
880
+ */
881
+ export declare class PropertiesConfig {
882
+ static bootComponentKey: string;
883
+ beanConfig: Record<string, any>;
884
+ constructor(jsonConfig?: Record<string, any>);
885
+ getValue(path: string): any;
886
+ getAllBootComponents(): string[];
887
+ }
888
+
889
+ /**
890
+ * 动态配置操作类
891
+ * @public
892
+ */
893
+ declare class PropertiesConfig_2 {
894
+ static bootComponentKey: string;
895
+ beanConfig: Record<string, any>;
896
+ constructor(jsonConfig?: Record<string, any>);
897
+ getValue(path: string): any;
898
+ getAllBootComponents(): string[];
899
+ }
900
+
901
+ /**
902
+ * 动态配置操作类
903
+ * @public
904
+ */
905
+ declare class PropertiesConfig_3 {
906
+ static bootComponentKey: string;
907
+ beanConfig: Record<string, any>;
908
+ constructor(jsonConfig?: Record<string, any>);
909
+ getValue(path: string): any;
910
+ getAllBootComponents(): string[];
911
+ }
912
+
913
+ export declare class Publisher {
914
+ private readonly name;
915
+ private subscribers;
916
+ constructor(name?: string);
917
+ addListener(subscriber: Subscriber): void;
918
+ removeListener(subscriber: Subscriber): void;
919
+ notify(): void;
920
+ }
921
+
922
+ /**
923
+ * @public
924
+ */
925
+ export declare class Qualifier extends Metadata {
926
+ value: string;
927
+ }
928
+
929
+ export declare const qualifier: (clsId: string) => Decorator<ClassFieldDecoratorContext>;
930
+
931
+ /**
932
+ * 加在field表明是响应式
933
+ * 加在metadata上用于自定义reactive元数据
934
+ * @public
935
+ */
936
+ export declare class Reactive extends Metadata_3 {
937
+ }
938
+
939
+ export declare const reactive: () => Decorator_2<ClassFieldDecoratorContext | ClassDecoratorContext>;
940
+
941
+ export declare namespace ReactNoopUpdateQueue {
942
+ export function isMounted(): boolean;
943
+ export function enqueueForceUpdate(publicInstance: any, callback: any, callerName: any): void;
944
+ export function enqueueSetState(publicInstance: any, partialState: any, callback: any, callerName: any): void;
945
+ }
946
+
947
+ /**
948
+ * @public
949
+ */
950
+ export declare class Ref extends Metadata_3 {
951
+ }
952
+
953
+ export declare const ref: () => Decorator_2<ClassFieldDecoratorContext>;
954
+
955
+ /**
956
+ * @public
957
+ */
958
+ export declare class Refs extends Metadata_3 {
959
+ }
960
+
961
+ export declare const refs: () => Decorator_2<ClassFieldDecoratorContext>;
962
+
963
+ /**
964
+ * @public
965
+ */
966
+ export declare abstract class Render {
967
+ abstract render(component: Class<any>): any;
968
+ }
969
+
970
+ /**
971
+ * @public
972
+ */
973
+ declare abstract class Render_2 {
974
+ abstract render(component: Class<any>): any;
975
+ }
976
+
977
+ export declare class Route {
978
+ pathname: string;
979
+ params: Record<string, string>;
980
+ }
981
+
982
+ export declare const route: (url: string) => Decorator_3<ClassDecoratorContext>;
983
+
984
+ declare type Route_2 = string | DynamicRoute;
985
+
986
+ /**
987
+ * @public
988
+ */
989
+ export declare class RouteComponentMapper {
990
+ mapper: Map<Route_2, Class<any>>;
991
+ init(map: Map<Class<any>, RouteMeta>): void;
992
+ private add;
993
+ match(url: string): any;
994
+ }
995
+
996
+ /**
997
+ * @public
998
+ */
999
+ export declare class RouteMeta extends Metadata_4 {
1000
+ value: string;
1001
+ }
1002
+
1003
+ /**
1004
+ * @public
1005
+ */
1006
+ export declare abstract class Router {
1007
+ protected route: Route;
1008
+ protected render: Render_2;
1009
+ protected routeComponentMapper: RouteComponentMapper;
1010
+ abstract navigateTo(url: string): void;
1011
+ }
1012
+
1013
+ export declare class RouterMeta extends Metadata_4 {
1014
+ }
1015
+
1016
+ declare interface Runner {
1017
+ exec: () => void;
1018
+ }
1019
+
1020
+ /**
1021
+ * @public
1022
+ */
1023
+ export declare enum SCOPE {
1024
+ Singleton = 0,
1025
+ Prototype = 1
1026
+ }
1027
+
1028
+ /**
1029
+ * @public
1030
+ */
1031
+ export declare class Scope extends Metadata {
1032
+ value: SCOPE;
1033
+ }
1034
+
1035
+ export declare const scope: (scope?: SCOPE) => Decorator<ClassDecoratorContext | ClassMethodDecoratorContext>;
1036
+
1037
+ /**
1038
+ * @public
1039
+ */
1040
+ export declare class SessionStorage extends Metadata_3 {
1041
+ }
1042
+
1043
+ declare const sessionStorage_2: () => Decorator_2<ClassDecoratorContext>;
1044
+ export { sessionStorage_2 as sessionStorage }
1045
+
1046
+ /**
1047
+ * @public
1048
+ */
1049
+ export declare class Store extends Metadata_3 {
1050
+ }
1051
+
1052
+ export declare const store: () => Decorator_2<ClassDecoratorContext>;
1053
+
1054
+ export declare class StorePublisher {
1055
+ private id;
1056
+ private subscribers;
1057
+ constructor();
1058
+ addListener(subscriber: StoreSubscriber): void;
1059
+ removeListener(subscriber: StoreSubscriber): void;
1060
+ broadcast(): void;
1061
+ getSubscribers(): StoreSubscriber[];
1062
+ }
1063
+
1064
+ export declare class StoreSubscriber {
1065
+ private id;
1066
+ private publishers;
1067
+ private runner;
1068
+ constructor(runner: Runner);
1069
+ connect(publisher: StorePublisher): void;
1070
+ disconnectAll(): void;
1071
+ exec(): void;
1072
+ }
1073
+
1074
+ export declare class Subscriber {
1075
+ static Executing: Subscriber;
1076
+ private isDirty;
1077
+ private publishers;
1078
+ private readonly fn;
1079
+ private value;
1080
+ constructor(bindThisFn: Function);
1081
+ subscribe: (publisher: Publisher) => void;
1082
+ memoizedFn: () => any;
1083
+ dirty(): void;
1084
+ }
1085
+
1086
+ /**
1087
+ * @public
1088
+ */
1089
+ export declare class Target extends Metadata {
1090
+ static Type: typeof Type;
1091
+ value: Type[];
1092
+ }
1093
+
1094
+ /**
1095
+ * @public
1096
+ */
1097
+ export declare const target: DecoratorExpWithDecoratorSelf<Type[]>;
1098
+
1099
+ /**
1100
+ * @public
1101
+ */
1102
+ export declare enum Type {
1103
+ Class = "class",
1104
+ Field = "field",
1105
+ Method = "method"
1106
+ }
1107
+
1108
+ /**
1109
+ * @public
1110
+ */
1111
+ export declare class Util extends Metadata {
1112
+ }
1113
+
1114
+ export declare const util: () => Decorator<ClassDecoratorContext>;
1115
+
1116
+ /**
1117
+ * @public
1118
+ */
1119
+ export declare class Value extends Metadata {
1120
+ value: string;
1121
+ }
1122
+
1123
+ export declare const value: (path: string) => Decorator<ClassFieldDecoratorContext>;
1124
+
1125
+ /**
1126
+ * @public
1127
+ */
1128
+ export declare class View extends Metadata_3 {
1129
+ static classDecoratorModifyPrototype(prototype: any): void;
1130
+ }
1131
+
1132
+ export declare const view: () => Decorator_2<ClassDecoratorContext>;
1133
+
1134
+ /**
1135
+ * @public
1136
+ */
1137
+ export declare class WebApplication extends Metadata {
1138
+ }
1139
+
1140
+ export declare const webApplication: () => Decorator<ClassDecoratorContext>;
1141
+
1142
+ /**
1143
+ * @public
1144
+ */
1145
+ export declare class WebRender extends Render {
1146
+ container: HTMLElement;
1147
+ init(application: Application_2): void;
1148
+ render(component: any): any;
1149
+ }
1150
+
1151
+ export { }