@fox-js/fox 3.0.1-3 → 3.0.1-4

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.
@@ -1,1880 +1,1404 @@
1
- import { Ref, ComponentInternalInstance, InjectionKey, App, ComponentPublicInstance } from 'vue';
2
-
3
- declare const idKey: unique symbol;
4
- declare const valueKey: unique symbol;
5
- declare const childrenKey: unique symbol;
6
- declare const growKey: unique symbol;
7
- /**
8
- * tree node
9
- */
10
- interface TreeNode {
11
- [propName: string]: any;
12
- [idKey]: string;
13
- [valueKey]: any;
14
- [growKey]: boolean;
15
- [childrenKey]: Map<string, TreeNode>;
16
- }
17
- /**
18
- * tree接口
19
- */
20
- interface Tree extends TreeNode {
21
- /**
22
- * 加入数据
23
- * @param args
24
- * @returns {boolean}
25
- */
26
- put(...args: any[]): boolean;
27
- /**
28
- * 获取内容
29
- * @param args
30
- * @returns {any}
31
- */
32
- get(...args: any[]): any | undefined;
33
- /**
34
- * 移除数据
35
- * @param args
36
- * @returns {boolean}
37
- */
38
- remove(...args: any[]): boolean;
39
- /**
40
- * 判断是否包含数据
41
- * @param args
42
- * @returns {boolean}
43
- */
44
- contains(...args: any[]): boolean;
45
- /**
46
- * 清空所以数据
47
- */
48
- clear(): void;
49
- }
50
- /**
51
- * 导出Bus
52
- */
53
- declare let Bus: any;
54
-
55
- /**
56
- * 更新类型
57
- */
58
- declare enum UpdateType {
59
- /**
60
- * 部分替换
61
- */
62
- Part = 0,
63
- /**
64
- * 整体替换
65
- */
66
- All = 1
67
- }
68
-
69
- /**
70
- * 操作类型
71
- * @type {Enum}
72
- */
73
- declare enum OperationType {
74
- /**
75
- * Push策略(生产历史记录)
76
- */
77
- Push = 0,
78
- /**
79
- * 替换策略(替换当前历史记录)
80
- */
81
- Replace = 1,
82
- /**
83
- * 修改策略(不影响历史记录)
84
- */
85
- Put = 2,
86
- /**
87
- * 增加策略(生成历史记录)
88
- */
89
- Append = 3,
90
- /**
91
- * 打开策略,如果不存在则打开,否则切换(生成历史记录)
92
- */
93
- Open = 4
94
- }
95
-
96
- /**
97
- * 路由配置
98
- */
99
- interface RouteConfig {
100
- /**
101
- * 路径
102
- */
103
- path?: string;
104
- /**
105
- * 名称
106
- */
107
- name?: string;
108
- /**
109
- * 转发路径
110
- */
111
- redirect?: string;
112
- /**
113
- * 组件
114
- */
115
- component?: any;
116
- /**
117
- * 组件映射
118
- */
119
- components?: {
120
- [propName: string]: any;
121
- };
122
- /**
123
- * 孩子节点
124
- */
125
- children?: any[];
126
- /**
127
- * 属性
128
- */
129
- props?: Record<string | number | symbol, any> | boolean | {
130
- (route: Route): any;
131
- };
132
- /**
133
- * 元数据
134
- */
135
- meta?: Record<string | number | symbol, any>;
136
- }
137
- /**
138
- * 插槽
139
- */
140
- declare class Slot {
141
- /**
142
- * 插槽名称
143
- */
144
- name: string;
145
- /**
146
- * 层次
147
- */
148
- level: number;
149
- /**
150
- * root插槽节点名称
151
- */
152
- rootName: string | undefined;
153
- /**
154
- * root插槽节点index
155
- */
156
- rootIndex: number;
157
- /**
158
- * 构造函数
159
- * @param name
160
- * @param level
161
- * @param rootName
162
- */
163
- constructor(name: string, level: number, rootName: string | undefined, rootIndex: number);
164
- }
165
- declare class Session {
166
- /**
167
- * 目标路由
168
- */
169
- to?: Route;
170
- /**
171
- * 目标路由
172
- */
173
- routeModel?: RouteModel;
174
- /**
175
- * 来源路由
176
- */
177
- from?: Route;
178
- /**
179
- * 流程数据
180
- */
181
- data: {
182
- [propName: string]: any;
183
- };
184
- /**
185
- * 构造函数
186
- * @param to
187
- * @param from
188
- */
189
- constructor(to?: Route, from?: Route);
190
- /**
191
- * 转换为session
192
- * @param src
193
- * @returns
194
- */
195
- static from(src: {
196
- [propName: string]: any;
197
- }): Session;
198
- }
199
- /**
200
- * 路由(跳转目标)
201
- */
202
- declare class Route {
203
- /**
204
- * 路径
205
- */
206
- path?: string;
207
- /**
208
- * 返回full path
209
- */
210
- get fullPath(): string;
211
- /**
212
- * 名称
213
- */
214
- name?: string;
215
- /**
216
- * 嵌入root节点
217
- */
218
- root?: string;
219
- /**
220
- * 参数
221
- */
222
- params?: Record<string | number | symbol, any>;
223
- /**
224
- * 查询
225
- */
226
- query?: any;
227
- /**
228
- * 获取匹配的元数组列表
229
- */
230
- matched?: {
231
- meta: Record<string | number | symbol, any>;
232
- }[];
233
- /**
234
- * route本身的元数据
235
- */
236
- meta?: Record<string | number | symbol, any>;
237
- /**
238
- * 成功回调函数
239
- */
240
- success?: {
241
- (...arg: any[]): void;
242
- };
243
- /**
244
- * 失败回调函数
245
- */
246
- error?: {
247
- (...arg: any[]): void;
248
- };
249
- /**
250
- * 页面销毁回答函数
251
- */
252
- destroy?: {
253
- (...arg: any[]): void;
254
- };
255
- /**
256
- * 操作类型(Push, Replace, Put, Append)
257
- */
258
- opsType?: OperationType;
259
- /**
260
- * 更新类型(All,Part)
261
- */
262
- updateType?: UpdateType;
263
- /**
264
- * view属性集合(用于multi view的tab view属性)
265
- */
266
- viewTagAttrs?: any;
267
- /**
268
- * 索引(用于opsType为Append的情况下,可以精确卸载的需求)
269
- */
270
- index?: number;
271
- /**
272
- * 是否激活状态(用于多视图,Open操作的情况下,标志view是否为激活状态)
273
- */
274
- active?: boolean;
275
- /**
276
- * 插槽(用于历史还原)
277
- */
278
- slot?: Slot;
279
- /**
280
- * session(router执行链路session)
281
- */
282
- session?: Session;
283
- /**
284
- * 克隆
285
- * @param target
286
- * @param plain 是否只克隆plain对象
287
- */
288
- static clone(target: Route, plain: boolean): Route;
289
- /**
290
- * 判断路由是否相同
291
- * @param x
292
- * @param y
293
- * @returns
294
- */
295
- static isSame(x: Route, y: Route): boolean;
296
- /**
297
- * 判断路由对应的route model是否一致
298
- * @param x
299
- * @param y
300
- * @returns
301
- */
302
- static isSameForRouteModel(x: Route, y: Route): boolean;
303
- /**
304
- * 由对象生成路由
305
- * @param obj
306
- * @returns
307
- */
308
- static from(obj: any): Route;
309
- }
310
- /**
311
- * model (RouteModel > ModelLayer > Model)
312
- */
313
- declare class Model {
314
- /**
315
- * 唯一ID(用于区分model)
316
- */
317
- id: number;
318
- /**
319
- * 名称
320
- */
321
- name: string;
322
- /**
323
- * 属性
324
- */
325
- props: Record<string | number | symbol, any> | boolean | {
326
- (route: Route): any;
327
- } | undefined;
328
- /**
329
- * 元数据
330
- */
331
- meta?: Record<string | number | symbol, any>;
332
- /**
333
- * 原始组件数据
334
- */
335
- src: any;
336
- /**
337
- * 组件(解析后组件)
338
- */
339
- component: any;
340
- /**
341
- * 构造函数
342
- *
343
- * @param name
344
- * @param src
345
- * @param props
346
- * @param meta
347
- */
348
- constructor(name: string, src: any, props?: Record<string | number | symbol, any> | {
349
- (route: Route): any;
350
- } | boolean, meta?: Record<string | number | symbol, any>);
351
- /**
352
- * 是否已经解析完成
353
- */
354
- get isResolved(): boolean;
355
- /**
356
- * 解析组件
357
- */
358
- resolve(): Promise<void>;
359
- }
360
- /**
361
- * 层(RouteModel > ModelLayer > Model)
362
- */
363
- declare class ModelLayer {
364
- /**
365
- * 节点
366
- */
367
- models: Model[];
368
- }
369
- /**
370
- * Route Model(RouteModel > ModelLayer > Model)
371
- */
372
- declare class RouteModel {
373
- /**
374
- * 路径
375
- */
376
- path?: string;
377
- /**
378
- * 路径match
379
- */
380
- match: any;
381
- /**
382
- * 转发路径
383
- */
384
- redirect?: string;
385
- /**
386
- * 名称
387
- */
388
- name?: string;
389
- /**
390
- * layer集合
391
- */
392
- layers: ModelLayer[];
393
- }
394
-
395
- declare const rootKey: unique symbol;
396
- declare const rootNodeKey: unique symbol;
397
- declare const parentNodeKey: unique symbol;
398
- declare const nameKey: unique symbol;
399
- /**
400
- * model插槽
401
- */
402
- declare class ModelSlot {
403
- /**
404
- * 实例
405
- */
406
- instance: ComponentInternalInstance | null;
407
- /**
408
- * model
409
- */
410
- model: Model;
411
- /**
412
- * route
413
- */
414
- route: Route | null;
415
- /**
416
- * 是否激活状态
417
- */
418
- active: boolean;
419
- /**
420
- * 索引
421
- */
422
- index: number;
423
- /**
424
- * 构造函数
425
- * @param route
426
- * @param model
427
- * @param index
428
- * @param active
429
- */
430
- constructor(route: Route | null, model: Model, index?: number, active?: boolean);
431
- }
432
- /**
433
- * 视图
434
- */
435
- declare class View {
436
- private scope;
437
- /**
438
- * 设置补偿函数
439
- */
440
- set compensation(func: {
441
- (): boolean;
442
- });
443
- /**
444
- * model slots列表
445
- */
446
- private _slots?;
447
- /**
448
- * getter for models
449
- */
450
- get slots(): Ref<ModelSlot[]>;
451
- /**
452
- * 是否为空视图
453
- */
454
- get empty(): boolean;
455
- /**
456
- * name
457
- */
458
- [nameKey]: string;
459
- /**
460
- * 是否分支根节点标志(true/false)
461
- */
462
- [rootKey]: boolean;
463
- /**
464
- * view的所在的root(最近一个)
465
- */
466
- [rootNodeKey]: ViewPlace | null;
467
- /**
468
- * view的父亲记得引用(会在router的[sync]方法中建立关系)
469
- */
470
- [parentNodeKey]: ViewPlace | null;
471
- /**
472
- * 名称
473
- */
474
- get name(): string;
475
- /**
476
- * 构造函数
477
- * @param name
478
- * @param isRoot
479
- * @param rootNodeRef
480
- */
481
- constructor(name: string, isRoot: boolean, rootNodeRef?: ViewPlace | null);
482
- }
483
- /**
484
- * view place
485
- */
486
- declare class ViewPlace {
487
- /**
488
- * view
489
- */
490
- view: View;
491
- /**
492
- * 索引
493
- */
494
- index: number;
495
- /**
496
- * 层次
497
- */
498
- level: number;
499
- /**
500
- * 构造函数
501
- * @param view
502
- * @param index
503
- * @param level
504
- */
505
- constructor(view: View, index: number, level: number);
506
- /**
507
- * 判断是否在队列中
508
- * @param list
509
- * @param view
510
- */
511
- static include(list: ViewPlace[], viewPlace: ViewPlace): boolean;
512
- }
513
- /**
514
- *
515
- */
516
- declare class Layer {
517
- /**
518
- * 节点(view集合)
519
- */
520
- views: View[];
521
- }
522
- /**
523
- * page
524
- */
525
- declare class Page {
526
- /**
527
- * 层
528
- */
529
- layers: Layer[];
530
- }
531
-
532
- /**
533
- * 操作类型
534
- * @type {Enum}
535
- */
536
- declare enum ModuleStatus {
537
- /**
538
- * 加载中
539
- */
540
- Loading = 0,
541
- /**
542
- * 加载完成
543
- */
544
- Loaded = 1,
545
- /**
546
- * 定义中状态
547
- */
548
- Defining = 2,
549
- /**
550
- * 定义完成状态
551
- */
552
- Defined = 3
553
- }
554
-
555
- /**
556
- * Session类型
557
- */
558
- interface EventChainSession {
559
- [propName: string]: any;
560
- }
561
- /**
562
- * event chain 上下文
563
- */
564
- interface EventChainContext {
565
- /**
566
- * 任务跳转
567
- */
568
- go: {
569
- (step: number, ...args: any[]): void;
570
- };
571
- /**
572
- * 触发链路
573
- */
574
- resolve: {
575
- (...args: any[]): void;
576
- };
577
- /**
578
- * 中断链路
579
- */
580
- reject: {
581
- (...args: any[]): void;
582
- };
583
- /**
584
- * 插入任务
585
- */
586
- insert: {
587
- (...args: any[]): void;
588
- };
589
- /**
590
- * chain session
591
- */
592
- session: EventChainSession;
593
- }
594
- /**
595
- * Task类型
596
- */
597
- interface Task {
598
- (context: EventChainContext, ...args: any[]): void;
599
- }
600
- /**
601
- * 完成Task类型(Exception,Finish, Wait)
602
- */
603
- interface EndTask {
604
- (context: {
605
- session: EventChainSession;
606
- }, ...args: any[]): void;
607
- }
608
- declare const chainKey: unique symbol;
609
- declare const cursorKey: unique symbol;
610
- declare const persistentModeKey: unique symbol;
611
- declare const statusKey: unique symbol;
612
- declare const argsKey: unique symbol;
613
- declare const exArgsKey: unique symbol;
614
- declare const successFnsKey: unique symbol;
615
- declare const errorFnsKey: unique symbol;
616
- declare const sessionKey: unique symbol;
617
- declare const _go: unique symbol;
618
- /**
619
- * 任务链路
620
- */
621
- declare class EventChain {
622
- /**
623
- * 事件链路
624
- */
625
- private [chainKey];
626
- /**
627
- * 游标
628
- */
629
- private [cursorKey];
630
- /**
631
- * 是否持久模式(该状态为true的情况,已经执行的任务会继续保存在队列中)
632
- */
633
- private [persistentModeKey];
634
- /**
635
- * 状态
636
- */
637
- private [statusKey];
638
- /**
639
- * 参数
640
- */
641
- private [argsKey];
642
- /**
643
- * 异常参数
644
- */
645
- private [exArgsKey];
646
- /**
647
- * 移除函数
648
- */
649
- private [successFnsKey];
650
- /**
651
- * 错误函数
652
- */
653
- private [errorFnsKey];
654
- /**
655
- * 链路session
656
- */
657
- private [sessionKey]?;
658
- /**
659
- * 获取session
660
- */
661
- get session(): EventChainSession | undefined;
662
- /**
663
- * 构造函数
664
- *
665
- * @param session
666
- * @param persistentMode
667
- */
668
- constructor(session?: EventChainSession, persistentMode?: boolean);
669
- /**
670
- * 触发链路的下一个任务
671
- * @param step
672
- * @param params
673
- */
674
- private [_go];
675
- /**
676
- * 跳转
677
- * @param step
678
- * @param params
679
- */
680
- go(step: number, ...params: any[]): EventChain;
681
- /**
682
- * 结束事件链调用,直接触发wait函数(success方法)
683
- * @param params
684
- */
685
- finish(...params: any[]): EventChain;
686
- /**
687
- * 结束事件链调用,直接触发wait函数(error方法)
688
- * @param params
689
- */
690
- reject(...params: any[]): EventChain;
691
- /**
692
- * 结束事件链调用,直接触发error函数
693
- * @param params
694
- */
695
- throw(...params: any[]): EventChain;
696
- /**
697
- * 重置事件链,直接触发wait函数
698
- * @param params
699
- */
700
- reset(...params: any[]): EventChain;
701
- /**
702
- * 加入任务
703
- * @param task
704
- * @returns {EventChain}
705
- */
706
- post(task: Task): EventChain;
707
- /**
708
- * 加入等待任务
709
- * @param successFn
710
- * @param errorFn
711
- * @returns
712
- */
713
- wait(successFn: EndTask, errorFn: EndTask): EventChain;
714
- /**
715
- * 加入异常处理任务
716
- * @param errorFn
717
- * @returns
718
- */
719
- exception(errorFn: EndTask): EventChain;
720
- /**
721
- * 判断事件链是否已经执行完成
722
- * @returns {boolean}
723
- */
724
- isFinish(): boolean;
725
- }
726
-
727
- /**
728
- * AMD加载器
729
- */
730
- declare class Require {
731
- /**
732
- * head对象
733
- */
734
- private head;
735
- /**
736
- * 是否为老的webkit浏览器
737
- */
738
- private isOldWebKit;
739
- /**
740
- * moudel manager
741
- * @type {ModuleManager}
742
- */
743
- private moduleManager;
744
- /**
745
- * resource
746
- */
747
- private resource;
748
- /**
749
- * 参数配置
750
- */
751
- private options;
752
- /**
753
- * 设置query
754
- */
755
- private _query?;
756
- /**
757
- * 设置query
758
- */
759
- set query(val: Record<string, string | number> | undefined);
760
- /**
761
- * 获取query
762
- */
763
- get query(): Record<string, string | number> | undefined;
764
- /**
765
- * 构造函数
766
- */
767
- constructor(options?: any);
768
- /**
769
- * 加载
770
- */
771
- ensure(...args: any[]): Require;
772
- /**
773
- * 卸载
774
- */
775
- remove(...args: any): Require;
776
- /**
777
- * 加载
778
- *
779
- * @param chain
780
- * @param taskNode
781
- */
782
- mount(chain: EventChain, taskNode: TaskNode): void;
783
- /**
784
- * 加载html
785
- *
786
- * @param chain
787
- * @param task
788
- * @param point
789
- */
790
- private mountHTML;
791
- /**
792
- * 加载css
793
- * @param chain
794
- * @param task
795
- * @param point
796
- */
797
- private mountCSS;
798
- /**
799
- * 加载js
800
- *
801
- * @param chain
802
- * @param task
803
- * @param point
804
- */
805
- private mountJS;
806
- /**
807
- * 卸载资源
808
- */
809
- unmount(path: string, options?: any): void;
810
- /**
811
- * 去掉空元素
812
- */
813
- private trimEmptyElement;
814
- /**
815
- * 创建define函数
816
- * @param module
817
- * @param task
818
- * @returns {Function}
819
- */
820
- private createDefine;
821
- /**
822
- * 解析路径
823
- * @param uri
824
- * @returns {string}
825
- */
826
- private resolvePath;
827
- /**
828
- * 创建search字符串
829
- */
830
- private createSearch;
831
- /**
832
- * 获取文件名后缀
833
- * @param name
834
- * @returns {string}
835
- */
836
- getFileNamePostfix(name: string): string;
837
- /**
838
- * 是否为不处理的路径
839
- * @param uri
840
- * @param type
841
- * @returns {boolean}
842
- */
843
- private isNaturePath;
844
- /**
845
- * 解析路径
846
- * @param uri
847
- * @param replace
848
- */
849
- private parserPath;
850
- }
851
- /**
852
- * 进程
853
- */
854
- declare class Progress {
855
- /**
856
- * 回调函数
857
- */
858
- private callback;
859
- /**
860
- * values
861
- */
862
- private values;
863
- /**
864
- * 状态
865
- */
866
- private status;
867
- /**
868
- * 工作量
869
- */
870
- private size;
871
- /**
872
- * 最新的index
873
- */
874
- private lastIndex;
875
- /**
876
- * 构造函数
877
- */
878
- constructor(size: number, callback: {
879
- (status: ModuleStatus, values: any[]): void;
880
- });
881
- /**
882
- * work
883
- * @param status 工作状态(true/false)
884
- * @param index
885
- * @param value
886
- */
887
- work(status: boolean, index: number, value: any): void;
888
- /**
889
- * 判断进程是否为正常状态
890
- */
891
- isOK(): boolean;
892
- }
893
- /**
894
- * 任务节点
895
- */
896
- declare class TaskNode {
897
- /**
898
- * 索引
899
- */
900
- index: number;
901
- /**
902
- * 来源
903
- */
904
- src: string;
905
- /**
906
- * 参数
907
- */
908
- params: any;
909
- /**
910
- * 进程
911
- */
912
- progress: Progress;
913
- /**
914
- * 构造函数
915
- * @param index
916
- * @param src
917
- * @param params
918
- * @param progress
919
- */
920
- constructor(index: number, src: string, params: any, progress: Progress);
921
- }
922
-
923
- declare class MarkRecord {
924
- currentRoute: Route;
925
- routes: Array<Route>;
926
- /**
927
- * 构造函数
928
- * @param currentRoute
929
- * @param routes
930
- */
931
- constructor(currentRoute: Route, routes: Array<Route>);
932
- }
933
- /**
934
- * history change handler
935
- */
936
- interface HistoryChangeHandler {
937
- (args: Array<Route> | string): void;
938
- }
939
- /**
940
- * Router History
941
- */
942
- interface RouterHistory {
943
- /**
944
- * 基础路径
945
- */
946
- base: string;
947
- /**
948
- * 是否监听history change
949
- */
950
- historyMonitor: boolean;
951
- /**
952
- * 是否支持无痕模式
953
- */
954
- traceless: boolean;
955
- /**
956
- * 初始化
957
- * @param firstNavigate
958
- * @returns
959
- */
960
- init(firstNavigate: boolean): Promise<void>;
961
- /**
962
- * 销毁
963
- */
964
- destroy(): void;
965
- /**
966
- * 监听历史记录改变
967
- * @param handler
968
- */
969
- listen(handler: HistoryChangeHandler): void;
970
- /**
971
- * 跳转
972
- * @param n
973
- */
974
- go(n: number): void;
975
- /**
976
- * 加入记录
977
- * @param record
978
- */
979
- push(record: MarkRecord): void;
980
- /**
981
- * 替换当前记录
982
- * @param record
983
- */
984
- replace(record: MarkRecord): void;
985
- }
986
-
987
- declare const sync: unique symbol;
988
- declare const resolveRoute: unique symbol;
989
-
990
- /**
991
- * router options
992
- */
993
- interface RouterOptions {
994
- /**
995
- * 默认操作类型
996
- */
997
- defaultOperationType?: OperationType;
998
- /**
999
- * 模块路径解释
1000
- */
1001
- modulePathResolve?: {
1002
- (route: Route): string;
1003
- };
1004
- /**
1005
- * router history
1006
- */
1007
- history?: RouterHistory;
1008
- /**
1009
- * 路由配置列表
1010
- */
1011
- routes?: RouteConfig[];
1012
- /**
1013
- * not found 路由
1014
- */
1015
- notFound?: RouteConfig;
1016
- /**
1017
- * not found 路由路径
1018
- */
1019
- notFoundPath?: string;
1020
- }
1021
- /**
1022
- * before route update filter
1023
- */
1024
- interface BeforeRouteFilter {
1025
- (to: Route, from: Route, next: {
1026
- (pass?: boolean | Route): void;
1027
- }, session: Record<string | number | symbol, any>): void;
1028
- }
1029
- /**
1030
- * after route update filter
1031
- */
1032
- interface AfterRouteFilter {
1033
- (to: Route, from: Route, session: Record<string | number | symbol, any>): void;
1034
- }
1035
- /**
1036
- * destroy route update filter
1037
- */
1038
- interface DestroyRouteFilter {
1039
- (to: Route, session: Record<string | number | symbol, any>): void;
1040
- }
1041
- declare const _constructRouteModel: unique symbol;
1042
- declare const _findRouteModel: unique symbol;
1043
- declare const _findRootView: unique symbol;
1044
- declare const _getFirstView: unique symbol;
1045
- declare const _removeView: unique symbol;
1046
- declare const _buildPage: unique symbol;
1047
- declare const _resolveComponent: unique symbol;
1048
- declare const _update: unique symbol;
1049
- declare const _merge: unique symbol;
1050
- declare const ignoreHistoryChangeOnceKey: unique symbol;
1051
- declare const _handleHistoryChange: unique symbol;
1052
- declare const _handleRouteUpated: unique symbol;
1053
- declare const routeUpdatedCallback: unique symbol;
1054
- declare const currentRoutes: unique symbol;
1055
- declare const currentKey: unique symbol;
1056
- declare const _addRouteRecorder: unique symbol;
1057
- declare const _removeRouteRecorder: unique symbol;
1058
- declare const _cloneRouteRecorder: unique symbol;
1059
- declare const _handleError: unique symbol;
1060
- declare const errorCallback: unique symbol;
1061
- declare const registerKey$1: unique symbol;
1062
- declare const notFoundKey: unique symbol;
1063
- declare const notFoundPathKey: unique symbol;
1064
- declare const forestKey: unique symbol;
1065
- declare const historyKey: unique symbol;
1066
- declare const beforeFiltersKey: unique symbol;
1067
- declare const afterFiltersKey: unique symbol;
1068
- declare const destroyFiltersKey: unique symbol;
1069
- declare const mainDispatcherKey: unique symbol;
1070
- declare const initKey: unique symbol;
1071
- declare const requireKey: unique symbol;
1072
- declare const readyKey: unique symbol;
1073
- declare const readyHandlersKey: unique symbol;
1074
- declare const _markReady: unique symbol;
1075
- declare const _createNextFn: unique symbol;
1076
- declare const _start: unique symbol;
1077
- declare const _before: unique symbol;
1078
- declare const _after: unique symbol;
1079
- declare const _destroy: unique symbol;
1080
- declare const _load: unique symbol;
1081
- declare const _unload: unique symbol;
1082
- declare const _loadDependency: unique symbol;
1083
- declare const resolvedModulesKey: unique symbol;
1084
- declare const resolveDependencyKey: unique symbol;
1085
- declare const routerGuardKey: unique symbol;
1086
- declare class Router {
1087
- /**
1088
- * 注册表
1089
- */
1090
- private [registerKey$1];
1091
- /**
1092
- * not found route
1093
- */
1094
- private [notFoundKey]?;
1095
- /**
1096
- * not found route path
1097
- */
1098
- private [notFoundPathKey];
1099
- /**
1100
- * ready
1101
- */
1102
- private [readyKey];
1103
- /**
1104
- * ready handlers
1105
- */
1106
- private [readyHandlersKey];
1107
- /**
1108
- * 页面根节点
1109
- */
1110
- private [forestKey];
1111
- /**
1112
- * 历史记录控制器
1113
- */
1114
- private [historyKey]?;
1115
- /**
1116
- * 当前路由集合
1117
- */
1118
- private [currentRoutes];
1119
- /**
1120
- * 错误回调
1121
- */
1122
- private [errorCallback];
1123
- /**
1124
- * 全局route更新监听器
1125
- */
1126
- private [routeUpdatedCallback];
1127
- /**
1128
- * before过滤器队列
1129
- */
1130
- private [beforeFiltersKey];
1131
- /**
1132
- * after过滤器队列
1133
- */
1134
- private [afterFiltersKey];
1135
- /**
1136
- * destroy过滤器队列
1137
- */
1138
- private [destroyFiltersKey];
1139
- /**
1140
- * 主任务分发器
1141
- */
1142
- private [mainDispatcherKey];
1143
- /**
1144
- * 已解析模块集合
1145
- */
1146
- private [resolvedModulesKey];
1147
- /**
1148
- * 解析依赖函数
1149
- */
1150
- private [resolveDependencyKey];
1151
- /**
1152
- * 路由守护者
1153
- */
1154
- private [routerGuardKey];
1155
- /**
1156
- * 是否初始化
1157
- */
1158
- private [initKey];
1159
- /**
1160
- * 当前最新路由
1161
- */
1162
- private [currentKey];
1163
- /**
1164
- * 创建require
1165
- */
1166
- private [requireKey];
1167
- get require(): Require | null;
1168
- /**
1169
- * 获取当前最新route
1170
- */
1171
- get current(): Route | null;
1172
- private options;
1173
- /**
1174
- * 构造函数
1175
- * @param options
1176
- */
1177
- constructor(options: RouterOptions);
1178
- /**
1179
- * 记录错误日志
1180
- * @param error
1181
- * @param route
1182
- */
1183
- private [_handleError];
1184
- /**
1185
- * 初始化
1186
- */
1187
- init(): void;
1188
- /**
1189
- * 第一次导航是否完成
1190
- */
1191
- isReady(): Promise<void>;
1192
- /**
1193
- * 设置第一导航完成
1194
- */
1195
- private [_markReady];
1196
- /**
1197
- * 是否忽略历史记录改变
1198
- * @type {boolean}
1199
- */
1200
- private [ignoreHistoryChangeOnceKey];
1201
- /**
1202
- * 处理历史记录
1203
- * @param record
1204
- */
1205
- private [_handleHistoryChange];
1206
- /**
1207
- * 处理route updated事件
1208
- * @param route
1209
- */
1210
- private [_handleRouteUpated];
1211
- /**
1212
- * 加入路由记录
1213
- * @param route
1214
- */
1215
- private [_addRouteRecorder];
1216
- /**
1217
- * 克隆路由记录
1218
- * @returns
1219
- */
1220
- private [_cloneRouteRecorder];
1221
- /**
1222
- * 移除路由记录
1223
- *
1224
- * @param route
1225
- */
1226
- private [_removeRouteRecorder];
1227
- /**
1228
- * 设置history monitor是否启动
1229
- */
1230
- set hisotryMonitor(val: boolean);
1231
- /**
1232
- * 获取history minitor
1233
- */
1234
- get historyMonitor(): boolean;
1235
- /**
1236
- * 设置无痕模式,不改变历史记录
1237
- */
1238
- set traceless(val: boolean);
1239
- /**
1240
- * 获取无痕模式(不改变历史记录)
1241
- */
1242
- get traceless(): boolean;
1243
- /**
1244
- * 注册route updated处理函数
1245
- * @param callback
1246
- */
1247
- onRouteUpdated(callback: {
1248
- (route?: Route | null): void;
1249
- } | null): void;
1250
- /**
1251
- * 注册全局异常处理函数
1252
- * @param callback
1253
- */
1254
- onError(callback: {
1255
- (...args: any[]): void;
1256
- } | null): void;
1257
- /**
1258
- * 添加before filter
1259
- * @param filter
1260
- */
1261
- beforeEach(filter: BeforeRouteFilter): void;
1262
- /**
1263
- * 移除before filter
1264
- * @param filter
1265
- */
1266
- removeBeforeEach(filter: BeforeRouteFilter): boolean;
1267
- /**
1268
- * 添加after filter
1269
- * @param filter
1270
- */
1271
- afterEach(filter: AfterRouteFilter): void;
1272
- /**
1273
- * 移除after filter
1274
- * @param filter
1275
- * @returns
1276
- */
1277
- removeAfterEach(filter: AfterRouteFilter): boolean;
1278
- /**
1279
- * 添加destroy filter
1280
- * @param filter
1281
- */
1282
- destroyEach(filter: DestroyRouteFilter): void;
1283
- /**
1284
- * 移除after filter
1285
- * @param filter
1286
- * @returns
1287
- */
1288
- removeDestroyEach(filter: DestroyRouteFilter): boolean;
1289
- /**
1290
- * 设置依赖模块解释函数
1291
- * @param resolveDependency
1292
- */
1293
- setResolveDependency(resolveDependency: {
1294
- (route: Route): string;
1295
- }): void;
1296
- /**
1297
- * 加入路由配置列表
1298
- * @param routeConfigs
1299
- */
1300
- addRoutes(routeConfigs: RouteConfig[]): void;
1301
- /**
1302
- * 加入路由配置
1303
- * @param routeConfig
1304
- * @param index
1305
- */
1306
- addRoute(routeConfig: RouteConfig, index?: number): void;
1307
- /**
1308
- * 移除路由
1309
- *
1310
- * @param route
1311
- */
1312
- removeRoute(route: Route | string): boolean;
1313
- /**
1314
- * 判断路由是否存在
1315
- *
1316
- * @param route
1317
- */
1318
- hasRoute(route: Route | string): boolean;
1319
- /**
1320
- * 配置not found路由路径
1321
- * @param path
1322
- */
1323
- setNotFoundPath(path: string): void;
1324
- /**
1325
- * 配置not found路由配置
1326
- * @param routeConfig
1327
- */
1328
- setNotFoundRoute(routeConfig: RouteConfig): void;
1329
- /**
1330
- * 返回目前加载的routes
1331
- */
1332
- getRoutes(): RouteModel[];
1333
- /**
1334
- * 根据路由构建route model
1335
- *
1336
- * @param routeConfig
1337
- */
1338
- private [_constructRouteModel];
1339
- /**
1340
- * 查找route model
1341
- * @param cite
1342
- */
1343
- private [_findRouteModel];
1344
- /**
1345
- * 解释路由
1346
- * @param args
1347
- * @returns
1348
- */
1349
- [resolveRoute](args: any): Route | null;
1350
- /**
1351
- * 路由跳转(operation类型为Push)
1352
- * @param args
1353
- */
1354
- push(...args: any[]): Router;
1355
- /**
1356
- * 路由跳转(operation类型为Put)
1357
- * @param args
1358
- */
1359
- put(...args: any[]): Router;
1360
- /**
1361
- * 路由跳转(operation类型为Replace)
1362
- * @param args
1363
- */
1364
- replace(...args: any[]): Router;
1365
- /**
1366
- * 路由跳转(operation类型为Append)
1367
- * @param args
1368
- */
1369
- append(...args: any[]): Router;
1370
- /**
1371
- * 移除
1372
- * @param term
1373
- */
1374
- remove(term?: any): Promise<boolean>;
1375
- /**
1376
- * 路由跳转(operation类型为Open)
1377
- * @param args
1378
- */
1379
- open(...args: any[]): Router;
1380
- /**
1381
- * 关闭路由跳转的页面
1382
- * @param args
1383
- */
1384
- close(args: any): Router;
1385
- /**
1386
- * 路由跳转
1387
- * @param args
1388
- */
1389
- to(...args: any[]): Router;
1390
- /**
1391
- * 历史回退
1392
- * @param n
1393
- */
1394
- back(n?: number): void;
1395
- /**
1396
- * 创建next函数
1397
- */
1398
- private [_createNextFn];
1399
- /**
1400
- * 开始链路
1401
- * @param route
1402
- * @returns {EventChain}
1403
- */
1404
- private [_start];
1405
- /**
1406
- * 执行before事件
1407
- * @param chain
1408
- */
1409
- private [_before];
1410
- /**
1411
- * 执行after事件
1412
- * @param chain
1413
- */
1414
- private [_after];
1415
- /**
1416
- * 执行销毁事件
1417
- */
1418
- private [_destroy];
1419
- /**
1420
- * 加载依赖模块
1421
- * @param chain
1422
- * @param depencies
1423
- */
1424
- private [_loadDependency];
1425
- /**
1426
- * 加载路由
1427
- * @param route
1428
- */
1429
- private [_load];
1430
- /**
1431
- * 卸载(只能用于卸载多视图上的view)
1432
- *
1433
- * @param routes
1434
- */
1435
- private [_unload];
1436
- /**
1437
- * 查找root view索引
1438
- * @param route
1439
- */
1440
- private [_findRootView];
1441
- /**
1442
- * 查找first view
1443
- * @param route
1444
- */
1445
- private [_getFirstView];
1446
- /**
1447
- * 移除view
1448
- * @param page
1449
- * @param pos
1450
- * @param indexs
1451
- * @param under
1452
- */
1453
- private [_removeView];
1454
- /**
1455
- * 恢复
1456
- * @param routes
1457
- *
1458
- * @returns
1459
- */
1460
- restore(routes?: Route[]): Promise<void>;
1461
- /**
1462
- * build page
1463
- * @param route
1464
- * @param routeModel
1465
- * @returns
1466
- */
1467
- private [_buildPage];
1468
- /**
1469
- * 解析组件
1470
- */
1471
- private [_resolveComponent];
1472
- /**
1473
- * 更新页面
1474
- * @param routeModel
1475
- * @param route
1476
- * @param session
1477
- * @param updateType
1478
- * @returns
1479
- */
1480
- private [_update];
1481
- /**
1482
- * 合并view
1483
- * @param page
1484
- * @param startViewLevel
1485
- * @param routeModel
1486
- * @param startModelLevel
1487
- * @param rootNodeRef
1488
- */
1489
- [_merge](page: Page, startViewLevel: number, routeModel: RouteModel, startModelLevel: number, rootNodeRef: ViewPlace): void;
1490
- /**
1491
- * router view与view同步数据
1492
- * @param name
1493
- * @param level
1494
- * @param rootView
1495
- * @param rootViewIndex
1496
- * @param parentView
1497
- * @param parentViewIndex
1498
- * @returns
1499
- */
1500
- [sync](name: string, level: number, rootView: View | null, rootViewIndex: number, parentView: View | null, parentViewIndex: number): View | null;
1501
- }
1502
-
1503
- declare const registerKey: unique symbol;
1504
- /**
1505
- * callback function
1506
- */
1507
- interface Callback {
1508
- (...args: any[]): void;
1509
- }
1510
- /**
1511
- * 事件代理
1512
- */
1513
- declare class EventProxy {
1514
- /**
1515
- * 注册表
1516
- */
1517
- private [registerKey];
1518
- /**
1519
- * 构造函数
1520
- */
1521
- constructor();
1522
- /**
1523
- * 绑定事件
1524
- * @param key
1525
- * @param callback
1526
- * @param once
1527
- * @returns
1528
- */
1529
- on(key: string, callback: Callback, once?: boolean): EventProxy;
1530
- /**
1531
- * 解除绑定
1532
- * @param key
1533
- * @param callback
1534
- * @returns
1535
- */
1536
- off(key: string, callback: Callback): EventProxy;
1537
- /**
1538
- * 绑定事件
1539
- * @param key
1540
- * @param callback
1541
- * @param once
1542
- * @returns
1543
- */
1544
- bind(key: string, callback: Callback, once?: boolean): EventProxy;
1545
- /**
1546
- * 解除绑定
1547
- * @param key
1548
- * @param callback
1549
- * @returns
1550
- */
1551
- unbind(key: string, callback: Callback): EventProxy;
1552
- /**
1553
- * 绑定一次性触发函数
1554
- * @param key
1555
- * @param callback
1556
- * @returns
1557
- */
1558
- once(key: string, callback: Callback): EventProxy;
1559
- /**
1560
- * 绑定多条件触发函数
1561
- * @param args
1562
- */
1563
- all(...args: any[]): this;
1564
- /**
1565
- * 触发函数
1566
- * @param key
1567
- * @param value
1568
- */
1569
- emit(key: string, ...value: any[]): this;
1570
- /**
1571
- * 触发函数
1572
- * @param key
1573
- * @param value
1574
- * @returns
1575
- */
1576
- trigger(key: string, ...value: any[]): EventProxy;
1577
- }
1578
-
1579
- /**
1580
- * 是否数组
1581
- */
1582
- declare const isArray: (arg: any) => arg is any[];
1583
- /**
1584
- * 是否为Map
1585
- * @param val
1586
- * @returns
1587
- */
1588
- declare const isMap: (val: unknown) => val is Map<any, any>;
1589
- /**
1590
- * 是否为Set
1591
- * @param val
1592
- * @returns
1593
- */
1594
- declare const isSet: (val: unknown) => val is Set<any>;
1595
- /**
1596
- * 是否为Date
1597
- * @param val
1598
- * @returns
1599
- */
1600
- declare const isDate: (val: unknown) => val is Date;
1601
- /**
1602
- * 是否为函数
1603
- * @param val
1604
- * @returns
1605
- */
1606
- declare const isFunction: (val: unknown) => val is Function;
1607
- /**
1608
- * 是否为字符串
1609
- * @param val
1610
- * @returns
1611
- */
1612
- declare const isString: (val: unknown) => val is string;
1613
- /**
1614
- * 是否为symbol
1615
- * @param val
1616
- * @returns
1617
- */
1618
- declare const isSymbol: (val: unknown) => val is symbol;
1619
- /**
1620
- * 是否为object
1621
- */
1622
- declare const isObject: (val: unknown) => val is Record<any, any>;
1623
- /**
1624
- * 是否为promise
1625
- * @param val
1626
- * @returns
1627
- */
1628
- declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
1629
- declare const toTypeString: (value: unknown) => string;
1630
- /**
1631
- * 是否为plain对象
1632
- * @param val
1633
- * @returns
1634
- */
1635
- declare const isPlainObject: (val: unknown) => val is object;
1636
- /**
1637
- * 是否为es module
1638
- * @param obj
1639
- * @returns
1640
- */
1641
- declare function isESModule(obj: any): obj is Object;
1642
- /**
1643
- * 继承(是否深度拷贝,dest,src1,src2,src3...)
1644
- *
1645
- * @returns
1646
- */
1647
- declare function extend(...args: any[]): any;
1648
- /**
1649
- * 克隆对象
1650
- * @param target
1651
- * @param source
1652
- * @param plain
1653
- *
1654
- * @returns
1655
- */
1656
- declare function clone(target: any, source: any, plain?: boolean): any;
1657
- /**
1658
- * 转换为boolean值
1659
- * @param val
1660
- * @returns
1661
- */
1662
- declare function toBoolean(val: unknown): boolean;
1663
- /**
1664
- * 转换为number值
1665
- * @param val
1666
- * @returns
1667
- */
1668
- declare function toNumber(val: unknown): number;
1669
- /**
1670
- * 判断两个对象是否一致
1671
- * @param x
1672
- * @param y
1673
- * @returns {boolean}
1674
- */
1675
- declare function isEqual(x: any, y: any): boolean;
1676
-
1677
- /**
1678
- * 发起请求
1679
- * @param args
1680
- * @returns
1681
- */
1682
- declare function request(args: any): Promise<any>;
1683
- /**
1684
- * 取消ajax请求
1685
- * @param id
1686
- */
1687
- declare function cancel(id: any): boolean;
1688
-
1689
- interface GenericFunction {
1690
- (...args: any[]): any;
1691
- }
1692
-
1693
- declare let onFoxActivated: (hook: GenericFunction) => void;
1694
- declare let onFoxDeactivated: (hook: GenericFunction) => void;
1695
-
1696
- /**
1697
- * Tool工具集合接口
1698
- */
1699
- interface Tools {
1700
- get each(): Function;
1701
- get type(): Function;
1702
- get isFunction(): Function;
1703
- get isArray(): Function;
1704
- get isArrayLike(): Function;
1705
- get makeArray(): Function;
1706
- get merge(): Function;
1707
- get isWindow(): Function;
1708
- get isPlainObject(): Function;
1709
- get isEqual(): Function;
1710
- }
1711
-
1712
- /**
1713
- * storage
1714
- */
1715
- interface Storage {
1716
- /**
1717
- * 获取item
1718
- * @param key
1719
- */
1720
- getItem(key: string): string | null;
1721
- /**
1722
- * 设置item
1723
- * @param key
1724
- * @param value
1725
- */
1726
- setItem(key: string, value: string): void;
1727
- /**
1728
- * remove item
1729
- * @param key
1730
- */
1731
- removeItem(key: string): void;
1732
- }
1733
- /**
1734
- * 创建web history
1735
- * @param navigateFirstRoute
1736
- * @param base
1737
- * @param query
1738
- * @param historyMonitor
1739
- * @param traceless
1740
- * @param storage
1741
- * @returns
1742
- */
1743
- declare function createWebHistory(navigateFirstRoute?: boolean, base?: string | null, query?: string, historyMonitor?: boolean, traceless?: boolean, storage?: Storage): RouterHistory;
1744
- /**
1745
- * 创建web hash history
1746
- * @param navigateFirstRoute
1747
- * @param query
1748
- * @param historyMonitor
1749
- * @param traceless
1750
- * @param storage
1751
- * @returns
1752
- */
1753
- declare function createWebHashHistory(navigateFirstRoute?: boolean, query?: string, historyMonitor?: boolean, traceless?: boolean, storage?: Storage): RouterHistory;
1754
-
1755
- /**
1756
- * 创建memory history
1757
- * @param base
1758
- * @param maxHistoryRecorderSize
1759
- * @returns
1760
- */
1761
- declare function createMemoryHistory(base?: string, maxHistoryRecorderSize?: number): RouterHistory;
1762
-
1763
- /**
1764
- * 全局Fox
1765
- */
1766
- declare const foxKey: InjectionKey<Fox>;
1767
- /**
1768
- * 全局Bus
1769
- */
1770
- declare const foxBusKey: InjectionKey<Tree>;
1771
- /**
1772
- * 全局Event Proxy
1773
- */
1774
- declare const foxEventProxyKey: InjectionKey<EventProxy>;
1775
- /**
1776
- * 参数
1777
- */
1778
- interface FoxOptions extends RouterOptions {
1779
- }
1780
- /**
1781
- * Fox接口
1782
- */
1783
- interface Fox extends Tools {
1784
- /**
1785
- * 返回router
1786
- */
1787
- get router(): Router;
1788
- /**
1789
- * 返回全局Bus
1790
- */
1791
- get bus(): Tree;
1792
- /**
1793
- * 返回Bus类型
1794
- */
1795
- get Bus(): typeof Bus;
1796
- /**
1797
- * 返回全局event proxy
1798
- */
1799
- get eventproxy(): EventProxy;
1800
- /**
1801
- * 返回全局event proxy
1802
- */
1803
- get EventProxy(): typeof EventProxy;
1804
- /**
1805
- * 返回event chain类型
1806
- */
1807
- get EventChain(): typeof EventChain;
1808
- /**
1809
- * 返回require
1810
- */
1811
- get require(): Require | null;
1812
- /**
1813
- * 返回fectch
1814
- */
1815
- get request(): Function;
1816
- /**
1817
- * 返回extend
1818
- */
1819
- get extend(): Function;
1820
- /**
1821
- * 返回clone
1822
- */
1823
- get clone(): Function;
1824
- /**
1825
- * 安装
1826
- * @param app
1827
- */
1828
- install(app: App): void;
1829
- }
1830
- /**
1831
- * 创建Fox
1832
- * @param options
1833
- * @returns
1834
- */
1835
- declare function createFox(options?: FoxOptions): Fox;
1836
- /**
1837
- * Returns the current router
1838
- * @returns
1839
- */
1840
- declare function useRouter(proxy?: ComponentPublicInstance): Router;
1841
- /**
1842
- * Returns the current route
1843
- * @param proxy
1844
- * @returns
1845
- */
1846
- declare function useRoute(proxy?: ComponentPublicInstance): Route | null;
1847
- /**
1848
- * Returns the current fox
1849
- * @param proxy
1850
- * @returns
1851
- */
1852
- declare function useFox(proxy?: ComponentPublicInstance): Fox;
1853
- /**
1854
- * Returns the global bus
1855
- * @param proxy
1856
- * @returns
1857
- */
1858
- declare function useBus(proxy?: ComponentPublicInstance): Tree;
1859
- /**
1860
- * Returns the global event proxy
1861
- * @param proxy
1862
- * @returns
1863
- */
1864
- declare function useEventProxy(proxy?: ComponentPublicInstance): EventProxy;
1865
- /**
1866
- * 路由更新前执行
1867
- * @param callback
1868
- */
1869
- declare function onBeforeRouteUpdate(callback: {
1870
- (to: Route, from?: Route): void;
1871
- }): void;
1872
- /**
1873
- * 路由更新后执行
1874
- * @param callback
1875
- */
1876
- declare function onAfterRouteUpdate(callback: {
1877
- (to: Route, from?: Route): void;
1878
- }): void;
1879
-
1880
- export { Bus, EventChain, EventProxy, Route, Router, cancel, clone, createFox, createMemoryHistory, createWebHashHistory, createWebHistory, extend, foxBusKey, foxEventProxyKey, foxKey, isArray, isDate, isESModule, isEqual, isFunction, isMap, isObject, isPlainObject, isPromise, isSet, isString, isSymbol, onAfterRouteUpdate, onBeforeRouteUpdate, onFoxActivated, onFoxDeactivated, request, toBoolean, toNumber, toTypeString, useBus, useEventProxy, useFox, useRoute, useRouter };
1
+ import { App } from 'vue';
2
+ import { clone } from './util/commons';
3
+ import { ComponentPublicInstance } from 'vue';
4
+ import { extend } from './util/commons';
5
+ import { InjectionKey } from 'vue';
6
+ import { isArray } from './util/commons';
7
+ import { isDate } from './util/commons';
8
+ import { isEqual } from './util/commons';
9
+ import { isESModule } from './util/commons';
10
+ import { isFunction } from './util/commons';
11
+ import { isMap } from './util/commons';
12
+ import { isObject } from './util/commons';
13
+ import { isPlainObject } from './util/commons';
14
+ import { isPromise } from './util/commons';
15
+ import { isSet } from './util/commons';
16
+ import { isString } from './util/commons';
17
+ import { isSymbol } from './util/commons';
18
+ import { toBoolean } from './util/commons';
19
+ import { toNumber } from './util/commons';
20
+ import { toTypeString } from './util/commons';
21
+
22
+ /**
23
+ * after route update filter
24
+ */
25
+ declare interface AfterRouteFilter {
26
+ (to: Route, from: Route, session: Record<string | number | symbol, any>): void;
27
+ }
28
+
29
+ /**
30
+ * before route update filter
31
+ */
32
+ declare interface BeforeRouteFilter {
33
+ (to: Route, from: Route, next: {
34
+ (pass?: boolean | Route): void;
35
+ }, session: Record<string | number | symbol, any>): void;
36
+ }
37
+
38
+ /**
39
+ * 导出Bus
40
+ */
41
+ export declare let Bus: any;
42
+
43
+ /**
44
+ * callback function
45
+ */
46
+ declare interface Callback {
47
+ (...args: any[]): void;
48
+ }
49
+
50
+ /**
51
+ * 取消ajax请求
52
+ * @param id
53
+ */
54
+ export declare function cancel(id: any): boolean;
55
+
56
+ export { clone }
57
+
58
+ /**
59
+ * 创建Fox
60
+ * @param options
61
+ * @returns
62
+ */
63
+ export declare function createFox(options?: FoxOptions): Fox;
64
+
65
+ /**
66
+ * 创建memory history
67
+ * @param base
68
+ * @param maxHistoryRecorderSize
69
+ * @returns
70
+ */
71
+ export declare function createMemoryHistory(base?: string, maxHistoryRecorderSize?: number): RouterHistory;
72
+
73
+ /**
74
+ * 创建web hash history
75
+ * @param navigateFirstRoute
76
+ * @param query
77
+ * @param historyMonitor
78
+ * @param traceless
79
+ * @param storage
80
+ * @returns
81
+ */
82
+ export declare function createWebHashHistory(navigateFirstRoute?: boolean, query?: string, historyMonitor?: boolean | IfFunction, traceless?: boolean | IfFunction, storage?: Storage_2): RouterHistory;
83
+
84
+ /**
85
+ * 创建web history
86
+ * @param navigateFirstRoute
87
+ * @param base
88
+ * @param query
89
+ * @param historyMonitor
90
+ * @param traceless
91
+ * @param storage
92
+ * @returns
93
+ */
94
+ export declare function createWebHistory(navigateFirstRoute?: boolean, base?: string | null, query?: string, historyMonitor?: boolean | IfFunction, traceless?: boolean | IfFunction, storage?: Storage_2): RouterHistory;
95
+
96
+ /**
97
+ * destroy route update filter
98
+ */
99
+ declare interface DestroyRouteFilter {
100
+ (to: Route, session: Record<string | number | symbol, any>): void;
101
+ }
102
+
103
+ /**
104
+ * 完成Task类型(Exception,Finish, Wait)
105
+ */
106
+ declare interface EndTask {
107
+ (context: {
108
+ session: EventChainSession;
109
+ }, ...args: any[]): void;
110
+ }
111
+
112
+ /**
113
+ * 任务链路
114
+ */
115
+ export declare class EventChain {
116
+ /**
117
+ * 获取session
118
+ */
119
+ get session(): EventChainSession | undefined;
120
+ /**
121
+ * 构造函数
122
+ *
123
+ * @param session
124
+ * @param persistentMode
125
+ */
126
+ constructor(session?: EventChainSession, persistentMode?: boolean);
127
+ /**
128
+ * 跳转
129
+ * @param step
130
+ * @param params
131
+ */
132
+ go(step: number, ...params: any[]): EventChain;
133
+ /**
134
+ * 结束事件链调用,直接触发wait函数(success方法)
135
+ * @param params
136
+ */
137
+ finish(...params: any[]): EventChain;
138
+ /**
139
+ * 结束事件链调用,直接触发wait函数(error方法)
140
+ * @param params
141
+ */
142
+ reject(...params: any[]): EventChain;
143
+ /**
144
+ * 结束事件链调用,直接触发error函数
145
+ * @param params
146
+ */
147
+ throw(...params: any[]): EventChain;
148
+ /**
149
+ * 重置事件链,直接触发wait函数
150
+ * @param params
151
+ */
152
+ reset(...params: any[]): EventChain;
153
+ /**
154
+ * 加入任务
155
+ * @param task
156
+ * @returns {EventChain}
157
+ */
158
+ post(task: Task): EventChain;
159
+ /**
160
+ * 加入等待任务
161
+ * @param successFn
162
+ * @param errorFn
163
+ * @returns
164
+ */
165
+ wait(successFn: EndTask, errorFn: EndTask): EventChain;
166
+ /**
167
+ * 加入异常处理任务
168
+ * @param errorFn
169
+ * @returns
170
+ */
171
+ exception(errorFn: EndTask): EventChain;
172
+ /**
173
+ * 判断事件链是否已经执行完成
174
+ * @returns {boolean}
175
+ */
176
+ isFinish(): boolean;
177
+ }
178
+
179
+ /**
180
+ * event chain 上下文
181
+ */
182
+ declare interface EventChainContext {
183
+ /**
184
+ * 任务跳转
185
+ */
186
+ go: {
187
+ (step: number, ...args: any[]): void;
188
+ };
189
+ /**
190
+ * 触发链路
191
+ */
192
+ resolve: {
193
+ (...args: any[]): void;
194
+ };
195
+ /**
196
+ * 中断链路
197
+ */
198
+ reject: {
199
+ (...args: any[]): void;
200
+ };
201
+ /**
202
+ * 插入任务
203
+ */
204
+ insert: {
205
+ (...args: any[]): void;
206
+ };
207
+ /**
208
+ * chain session
209
+ */
210
+ session: EventChainSession;
211
+ }
212
+
213
+ /**
214
+ * Session类型
215
+ */
216
+ declare interface EventChainSession {
217
+ [propName: string]: any;
218
+ }
219
+
220
+ /**
221
+ * 事件代理
222
+ */
223
+ export declare class EventProxy {
224
+ /**
225
+ * 构造函数
226
+ */
227
+ constructor();
228
+ /**
229
+ * 绑定事件
230
+ * @param key
231
+ * @param callback
232
+ * @param once
233
+ * @returns
234
+ */
235
+ on(key: string, callback: Callback, once?: boolean): EventProxy;
236
+ /**
237
+ * 解除绑定
238
+ * @param key
239
+ * @param callback
240
+ * @returns
241
+ */
242
+ off(key: string, callback: Callback): EventProxy;
243
+ /**
244
+ * 绑定事件
245
+ * @param key
246
+ * @param callback
247
+ * @param once
248
+ * @returns
249
+ */
250
+ bind(key: string, callback: Callback, once?: boolean): EventProxy;
251
+ /**
252
+ * 解除绑定
253
+ * @param key
254
+ * @param callback
255
+ * @returns
256
+ */
257
+ unbind(key: string, callback: Callback): EventProxy;
258
+ /**
259
+ * 绑定一次性触发函数
260
+ * @param key
261
+ * @param callback
262
+ * @returns
263
+ */
264
+ once(key: string, callback: Callback): EventProxy;
265
+ /**
266
+ * 绑定多条件触发函数
267
+ * @param args
268
+ */
269
+ all(...args: any[]): this;
270
+ /**
271
+ * 触发函数
272
+ * @param key
273
+ * @param value
274
+ */
275
+ emit(key: string, ...value: any[]): this;
276
+ /**
277
+ * 触发函数
278
+ * @param key
279
+ * @param value
280
+ * @returns
281
+ */
282
+ trigger(key: string, ...value: any[]): EventProxy;
283
+ }
284
+
285
+ export { extend }
286
+
287
+ /**
288
+ * Fox接口
289
+ */
290
+ declare interface Fox extends Tools {
291
+ /**
292
+ * 返回router
293
+ */
294
+ get router(): Router;
295
+ /**
296
+ * 返回全局Bus
297
+ */
298
+ get bus(): Tree;
299
+ /**
300
+ * 返回Bus类型
301
+ */
302
+ get Bus(): typeof Bus;
303
+ /**
304
+ * 返回全局event proxy
305
+ */
306
+ get eventproxy(): EventProxy;
307
+ /**
308
+ * 返回全局event proxy
309
+ */
310
+ get EventProxy(): typeof EventProxy;
311
+ /**
312
+ * 返回event chain类型
313
+ */
314
+ get EventChain(): typeof EventChain;
315
+ /**
316
+ * 返回require
317
+ */
318
+ get require(): Require | null;
319
+ /**
320
+ * 返回fectch
321
+ */
322
+ get request(): Function;
323
+ /**
324
+ * 返回extend
325
+ */
326
+ get extend(): Function;
327
+ /**
328
+ * 返回clone
329
+ */
330
+ get clone(): Function;
331
+ /**
332
+ * 安装
333
+ * @param app
334
+ */
335
+ install(app: App): void;
336
+ }
337
+
338
+ /**
339
+ * 全局Bus
340
+ */
341
+ export declare const foxBusKey: InjectionKey<Tree>;
342
+
343
+ /**
344
+ * 全局Event Proxy
345
+ */
346
+ export declare const foxEventProxyKey: InjectionKey<EventProxy>;
347
+
348
+ /**
349
+ * 全局Fox
350
+ */
351
+ export declare const foxKey: InjectionKey<Fox>;
352
+
353
+ /**
354
+ * 参数
355
+ */
356
+ declare interface FoxOptions extends RouterOptions {
357
+ }
358
+
359
+ declare interface GenericFunction {
360
+ (...args: any[]): any;
361
+ }
362
+
363
+ /**
364
+ * history change handler
365
+ */
366
+ declare interface HistoryChangeHandler {
367
+ (args: Array<Route> | string): void;
368
+ }
369
+
370
+ /**
371
+ * If Function
372
+ */
373
+ declare interface IfFunction {
374
+ (...args: any[]): boolean;
375
+ }
376
+
377
+ export { isArray }
378
+
379
+ export { isDate }
380
+
381
+ export { isEqual }
382
+
383
+ export { isESModule }
384
+
385
+ export { isFunction }
386
+
387
+ export { isMap }
388
+
389
+ export { isObject }
390
+
391
+ export { isPlainObject }
392
+
393
+ export { isPromise }
394
+
395
+ export { isSet }
396
+
397
+ export { isString }
398
+
399
+ export { isSymbol }
400
+
401
+ declare class MarkRecord {
402
+ currentRoute: Route;
403
+ routes: Array<Route>;
404
+ /**
405
+ * 构造函数
406
+ * @param currentRoute
407
+ * @param routes
408
+ */
409
+ constructor(currentRoute: Route, routes: Array<Route>);
410
+ }
411
+
412
+ /**
413
+ * model (RouteModel > ModelLayer > Model)
414
+ */
415
+ declare class Model {
416
+ /**
417
+ * 唯一ID(用于区分model)
418
+ */
419
+ id: number;
420
+ /**
421
+ * 名称
422
+ */
423
+ name: string;
424
+ /**
425
+ * 属性
426
+ */
427
+ props: Record<string | number | symbol, any> | boolean | {
428
+ (route: Route): any;
429
+ } | undefined;
430
+ /**
431
+ * 元数据
432
+ */
433
+ meta?: Record<string | number | symbol, any>;
434
+ /**
435
+ * 原始组件数据
436
+ */
437
+ src: any;
438
+ /**
439
+ * 组件(解析后组件)
440
+ */
441
+ component: any;
442
+ /**
443
+ * 构造函数
444
+ *
445
+ * @param name
446
+ * @param src
447
+ * @param props
448
+ * @param meta
449
+ */
450
+ constructor(name: string, src: any, props?: Record<string | number | symbol, any> | {
451
+ (route: Route): any;
452
+ } | boolean, meta?: Record<string | number | symbol, any>);
453
+ /**
454
+ * 是否已经解析完成
455
+ */
456
+ get isResolved(): boolean;
457
+ /**
458
+ * 解析组件
459
+ */
460
+ resolve(): Promise<void>;
461
+ }
462
+
463
+ /**
464
+ * (RouteModel > ModelLayer > Model)
465
+ */
466
+ declare class ModelLayer {
467
+ /**
468
+ * 节点
469
+ */
470
+ models: Model[];
471
+ }
472
+
473
+ /**
474
+ * 操作类型
475
+ * @type {Enum}
476
+ */
477
+ declare enum ModuleStatus {
478
+ /**
479
+ * 加载中
480
+ */
481
+ Loading = 0,
482
+ /**
483
+ * 加载完成
484
+ */
485
+ Loaded = 1,
486
+ /**
487
+ * 定义中状态
488
+ */
489
+ Defining = 2,
490
+ /**
491
+ * 定义完成状态
492
+ */
493
+ Defined = 3
494
+ }
495
+
496
+ /**
497
+ * 路由更新后执行
498
+ * @param callback
499
+ */
500
+ export declare function onAfterRouteUpdate(callback: {
501
+ (to: Route, from?: Route): void;
502
+ }): void;
503
+
504
+ /**
505
+ * 路由更新前执行
506
+ * @param callback
507
+ */
508
+ export declare function onBeforeRouteUpdate(callback: {
509
+ (to: Route, from?: Route): void;
510
+ }): void;
511
+
512
+ export declare let onFoxActivated: (hook: GenericFunction) => void;
513
+
514
+ export declare let onFoxDeactivated: (hook: GenericFunction) => void;
515
+
516
+ /**
517
+ * 操作类型
518
+ * @type {Enum}
519
+ */
520
+ declare enum OperationType {
521
+ /**
522
+ * Push策略(生产历史记录)
523
+ */
524
+ Push = 0,
525
+ /**
526
+ * 替换策略(替换当前历史记录)
527
+ */
528
+ Replace = 1,
529
+ /**
530
+ * 修改策略(不影响历史记录)
531
+ */
532
+ Put = 2,
533
+ /**
534
+ * 增加策略(生成历史记录)
535
+ */
536
+ Append = 3,
537
+ /**
538
+ * 打开策略,如果不存在则打开,否则切换(生成历史记录)
539
+ */
540
+ Open = 4
541
+ }
542
+
543
+ /**
544
+ * 进程
545
+ */
546
+ declare class Progress {
547
+ /**
548
+ * 回调函数
549
+ */
550
+ private callback;
551
+ /**
552
+ * values
553
+ */
554
+ private values;
555
+ /**
556
+ * 状态
557
+ */
558
+ private status;
559
+ /**
560
+ * 工作量
561
+ */
562
+ private size;
563
+ /**
564
+ * 最新的index
565
+ */
566
+ private lastIndex;
567
+ /**
568
+ * 构造函数
569
+ */
570
+ constructor(size: number, callback: {
571
+ (status: ModuleStatus, values: any[]): void;
572
+ });
573
+ /**
574
+ * work
575
+ * @param status 工作状态(true/false)
576
+ * @param index
577
+ * @param value
578
+ */
579
+ work(status: boolean, index: number, value: any): void;
580
+ /**
581
+ * 判断进程是否为正常状态
582
+ */
583
+ isOK(): boolean;
584
+ }
585
+
586
+ /**
587
+ * 发起请求
588
+ * @param args
589
+ * @returns
590
+ */
591
+ export declare function request(args: any): Promise<any>;
592
+
593
+ /**
594
+ * AMD加载器
595
+ */
596
+ declare class Require {
597
+ /**
598
+ * head对象
599
+ */
600
+ private head;
601
+ /**
602
+ * 是否为老的webkit浏览器
603
+ */
604
+ private isOldWebKit;
605
+ /**
606
+ * moudel manager
607
+ * @type {ModuleManager}
608
+ */
609
+ private moduleManager;
610
+ /**
611
+ * resource
612
+ */
613
+ private resource;
614
+ /**
615
+ * 参数配置
616
+ */
617
+ private options;
618
+ /**
619
+ * 设置query
620
+ */
621
+ private _query?;
622
+ /**
623
+ * 设置query
624
+ */
625
+ set query(val: Record<string, string | number> | undefined);
626
+ /**
627
+ * 获取query
628
+ */
629
+ get query(): Record<string, string | number> | undefined;
630
+ /**
631
+ * 构造函数
632
+ */
633
+ constructor(options?: any);
634
+ /**
635
+ * 加载
636
+ */
637
+ ensure(...args: any[]): Require;
638
+ /**
639
+ * 卸载
640
+ */
641
+ remove(...args: any): Require;
642
+ /**
643
+ * 加载
644
+ *
645
+ * @param chain
646
+ * @param taskNode
647
+ */
648
+ mount(chain: EventChain, taskNode: TaskNode): void;
649
+ /**
650
+ * 加载html
651
+ *
652
+ * @param chain
653
+ * @param task
654
+ * @param point
655
+ */
656
+ private mountHTML;
657
+ /**
658
+ * 加载css
659
+ * @param chain
660
+ * @param task
661
+ * @param point
662
+ */
663
+ private mountCSS;
664
+ /**
665
+ * 加载js
666
+ *
667
+ * @param chain
668
+ * @param task
669
+ * @param point
670
+ */
671
+ private mountJS;
672
+ /**
673
+ * 卸载资源
674
+ */
675
+ unmount(path: string, options?: any): void;
676
+ /**
677
+ * 去掉空元素
678
+ */
679
+ private trimEmptyElement;
680
+ /**
681
+ * 创建define函数
682
+ * @param module
683
+ * @param task
684
+ * @returns {Function}
685
+ */
686
+ private createDefine;
687
+ /**
688
+ * 解析路径
689
+ * @param uri
690
+ * @returns {string}
691
+ */
692
+ private resolvePath;
693
+ /**
694
+ * 创建search字符串
695
+ */
696
+ private createSearch;
697
+ /**
698
+ * 获取文件名后缀
699
+ * @param name
700
+ * @returns {string}
701
+ */
702
+ getFileNamePostfix(name: string): string;
703
+ /**
704
+ * 是否为不处理的路径
705
+ * @param uri
706
+ * @param type
707
+ * @returns {boolean}
708
+ */
709
+ private isNaturePath;
710
+ /**
711
+ * 解析路径
712
+ * @param uri
713
+ * @param replace
714
+ */
715
+ private parserPath;
716
+ }
717
+
718
+ /**
719
+ * 路由(跳转目标)
720
+ */
721
+ export declare class Route {
722
+ /**
723
+ * 路径
724
+ */
725
+ path?: string;
726
+ /**
727
+ * 返回full path
728
+ */
729
+ get fullPath(): string;
730
+ /**
731
+ * 名称
732
+ */
733
+ name?: string;
734
+ /**
735
+ * 嵌入root节点
736
+ */
737
+ root?: string;
738
+ /**
739
+ * 参数
740
+ */
741
+ params?: Record<string | number | symbol, any>;
742
+ /**
743
+ * 查询
744
+ */
745
+ query?: any;
746
+ /**
747
+ * 获取匹配的元数组列表
748
+ */
749
+ matched?: {
750
+ meta: Record<string | number | symbol, any>;
751
+ }[];
752
+ /**
753
+ * route本身的元数据
754
+ */
755
+ meta?: Record<string | number | symbol, any>;
756
+ /**
757
+ * 成功回调函数
758
+ */
759
+ success?: {
760
+ (...arg: any[]): void;
761
+ };
762
+ /**
763
+ * 失败回调函数
764
+ */
765
+ error?: {
766
+ (...arg: any[]): void;
767
+ };
768
+ /**
769
+ * 页面销毁回答函数
770
+ */
771
+ destroy?: {
772
+ (...arg: any[]): void;
773
+ };
774
+ /**
775
+ * 操作类型(Push, Replace, Put, Append)
776
+ */
777
+ opsType?: OperationType;
778
+ /**
779
+ * 更新类型(All,Part)
780
+ */
781
+ updateType?: UpdateType;
782
+ /**
783
+ * view属性集合(用于multi view的tab view属性)
784
+ */
785
+ viewTagAttrs?: any;
786
+ /**
787
+ * 索引(用于opsType为Append的情况下,可以精确卸载的需求)
788
+ */
789
+ index?: number;
790
+ /**
791
+ * 是否激活状态(用于多视图,Open操作的情况下,标志view是否为激活状态)
792
+ */
793
+ active?: boolean;
794
+ /**
795
+ * 插槽(用于历史还原)
796
+ */
797
+ slot?: Slot;
798
+ /**
799
+ * session(router执行链路session)
800
+ */
801
+ session?: Session;
802
+ /**
803
+ * 克隆
804
+ * @param target
805
+ * @param plain 是否只克隆plain对象
806
+ */
807
+ static clone(target: Route, plain: boolean): Route;
808
+ /**
809
+ * 判断路由是否相同
810
+ * @param x
811
+ * @param y
812
+ * @returns
813
+ */
814
+ static isSame(x: Route, y: Route): boolean;
815
+ /**
816
+ * 判断路由对应的route model是否一致
817
+ * @param x
818
+ * @param y
819
+ * @returns
820
+ */
821
+ static isSameForRouteModel(x: Route, y: Route): boolean;
822
+ /**
823
+ * 由对象生成路由
824
+ * @param obj
825
+ * @returns
826
+ */
827
+ static from(obj: any): Route;
828
+ }
829
+
830
+ /**
831
+ * 路由配置
832
+ */
833
+ declare interface RouteConfig {
834
+ /**
835
+ * 路径
836
+ */
837
+ path?: string;
838
+ /**
839
+ * 名称
840
+ */
841
+ name?: string;
842
+ /**
843
+ * 转发路径
844
+ */
845
+ redirect?: string;
846
+ /**
847
+ * 组件
848
+ */
849
+ component?: any;
850
+ /**
851
+ * 组件映射
852
+ */
853
+ components?: {
854
+ [propName: string]: any;
855
+ };
856
+ /**
857
+ * 孩子节点
858
+ */
859
+ children?: any[];
860
+ /**
861
+ * 属性
862
+ */
863
+ props?: Record<string | number | symbol, any> | boolean | {
864
+ (route: Route): any;
865
+ };
866
+ /**
867
+ * 元数据
868
+ */
869
+ meta?: Record<string | number | symbol, any>;
870
+ }
871
+
872
+ /**
873
+ * Route Model(RouteModel > ModelLayer > Model)
874
+ */
875
+ declare class RouteModel {
876
+ /**
877
+ * 路径
878
+ */
879
+ path?: string;
880
+ /**
881
+ * 路径match
882
+ */
883
+ match: any;
884
+ /**
885
+ * 转发路径
886
+ */
887
+ redirect?: string;
888
+ /**
889
+ * 名称
890
+ */
891
+ name?: string;
892
+ /**
893
+ * layer集合
894
+ */
895
+ layers: ModelLayer[];
896
+ }
897
+
898
+ export declare class Router {
899
+ get require(): any;
900
+ /**
901
+ * 获取当前最新route
902
+ */
903
+ get current(): Route | null;
904
+ private options;
905
+ /**
906
+ * 构造函数
907
+ * @param options
908
+ */
909
+ constructor(options: RouterOptions);
910
+ /**
911
+ * 初始化
912
+ */
913
+ init(): void;
914
+ /**
915
+ * 第一次导航是否完成
916
+ */
917
+ isReady(): Promise<void>;
918
+ /**
919
+ * 设置history monitor是否启动
920
+ */
921
+ set historyMonitor(val: boolean | IfFunction);
922
+ /**
923
+ * 获取history monitor
924
+ */
925
+ get historyMonitor(): boolean | IfFunction;
926
+ /**
927
+ * 设置无痕模式,不改变历史记录
928
+ */
929
+ set traceless(val: boolean | IfFunction);
930
+ /**
931
+ * 获取无痕模式(不改变历史记录)
932
+ */
933
+ get traceless(): boolean | IfFunction;
934
+ /**
935
+ * 设置还原点
936
+ *
937
+ */
938
+ setRestorePoint(): void;
939
+ /**
940
+ * 注册route updated处理函数
941
+ * @param callback
942
+ */
943
+ onRouteUpdated(callback: {
944
+ (route?: Route | null): void;
945
+ } | null): void;
946
+ /**
947
+ * 注册全局异常处理函数
948
+ * @param callback
949
+ */
950
+ onError(callback: {
951
+ (...args: any[]): void;
952
+ } | null): void;
953
+ /**
954
+ * 添加before filter
955
+ * @param filter
956
+ */
957
+ beforeEach(filter: BeforeRouteFilter): void;
958
+ /**
959
+ * 移除before filter
960
+ * @param filter
961
+ */
962
+ removeBeforeEach(filter: BeforeRouteFilter): boolean;
963
+ /**
964
+ * 添加after filter
965
+ * @param filter
966
+ */
967
+ afterEach(filter: AfterRouteFilter): void;
968
+ /**
969
+ * 移除after filter
970
+ * @param filter
971
+ * @returns
972
+ */
973
+ removeAfterEach(filter: AfterRouteFilter): boolean;
974
+ /**
975
+ * 添加destroy filter
976
+ * @param filter
977
+ */
978
+ destroyEach(filter: DestroyRouteFilter): void;
979
+ /**
980
+ * 移除after filter
981
+ * @param filter
982
+ * @returns
983
+ */
984
+ removeDestroyEach(filter: DestroyRouteFilter): boolean;
985
+ /**
986
+ * 设置依赖模块解释函数
987
+ * @param resolveDependency
988
+ */
989
+ setResolveDependency(resolveDependency: {
990
+ (route: Route): string;
991
+ }): void;
992
+ /**
993
+ * 加入路由配置列表
994
+ * @param routeConfigs
995
+ */
996
+ addRoutes(routeConfigs: RouteConfig[]): void;
997
+ /**
998
+ * 加入路由配置
999
+ * @param routeConfig
1000
+ * @param index
1001
+ */
1002
+ addRoute(routeConfig: RouteConfig, index?: number): void;
1003
+ /**
1004
+ * 移除路由
1005
+ *
1006
+ * @param route
1007
+ */
1008
+ removeRoute(route: Route | string): boolean;
1009
+ /**
1010
+ * 判断路由是否存在
1011
+ *
1012
+ * @param route
1013
+ */
1014
+ hasRoute(route: Route | string): boolean;
1015
+ /**
1016
+ * 配置not found路由路径
1017
+ * @param path
1018
+ */
1019
+ setNotFoundPath(path: string): void;
1020
+ /**
1021
+ * 配置not found路由配置
1022
+ * @param routeConfig
1023
+ */
1024
+ setNotFoundRoute(routeConfig: RouteConfig): void;
1025
+ /**
1026
+ * 返回目前加载的routes
1027
+ */
1028
+ getRoutes(): RouteModel[];
1029
+ /**
1030
+ * 路由跳转(operation类型为Push)
1031
+ * @param args
1032
+ */
1033
+ push(...args: any[]): Router;
1034
+ /**
1035
+ * 路由跳转(operation类型为Put)
1036
+ * @param args
1037
+ */
1038
+ put(...args: any[]): Router;
1039
+ /**
1040
+ * 路由跳转(operation类型为Replace)
1041
+ * @param args
1042
+ */
1043
+ replace(...args: any[]): Router;
1044
+ /**
1045
+ * 路由跳转(operation类型为Append)
1046
+ * @param args
1047
+ */
1048
+ append(...args: any[]): Router;
1049
+ /**
1050
+ * 移除
1051
+ * @param term
1052
+ */
1053
+ remove(term?: any): Promise<boolean>;
1054
+ /**
1055
+ * 路由跳转(operation类型为Open)
1056
+ * @param args
1057
+ */
1058
+ open(...args: any[]): Router;
1059
+ /**
1060
+ * 关闭路由跳转的页面
1061
+ * @param args
1062
+ */
1063
+ close(args: any): Router;
1064
+ /**
1065
+ * 路由跳转
1066
+ * @param args
1067
+ */
1068
+ to(...args: any[]): Router;
1069
+ /**
1070
+ * 历史回退
1071
+ * @param delta
1072
+ */
1073
+ back(delta?: number): void;
1074
+ /**
1075
+ * 恢复
1076
+ * @param routes
1077
+ *
1078
+ * @returns
1079
+ */
1080
+ restore(routes?: Route[]): Promise<void>;
1081
+ }
1082
+
1083
+ /**
1084
+ * Router History
1085
+ */
1086
+ declare interface RouterHistory {
1087
+ /**
1088
+ * 基础路径
1089
+ */
1090
+ base: string;
1091
+ /**
1092
+ * 是否监听history change
1093
+ */
1094
+ historyMonitor: boolean | IfFunction;
1095
+ /**
1096
+ * 是否支持无痕模式
1097
+ */
1098
+ traceless: boolean | IfFunction;
1099
+ /**
1100
+ * 初始化
1101
+ * @param firstNavigate
1102
+ * @returns
1103
+ */
1104
+ init(firstNavigate: boolean): Promise<void>;
1105
+ /**
1106
+ * 销毁
1107
+ */
1108
+ destroy(): void;
1109
+ /**
1110
+ * 监听历史记录改变
1111
+ * @param handler
1112
+ */
1113
+ listen(handler: HistoryChangeHandler): void;
1114
+ /**
1115
+ * 跳转
1116
+ * @param delta
1117
+ * @param triggerEvent
1118
+ */
1119
+ go(delta: number, triggerEvent?: boolean): void;
1120
+ /**
1121
+ * 加入记录
1122
+ * @param record
1123
+ */
1124
+ push(record: MarkRecord): void;
1125
+ /**
1126
+ * 替换当前记录
1127
+ * @param record
1128
+ */
1129
+ replace(record: MarkRecord): void;
1130
+ /**
1131
+ * 设置还原点
1132
+ *
1133
+ * @param routes 路由记录
1134
+ */
1135
+ setRestorePoint(routes?: Array<Route>): void;
1136
+ }
1137
+
1138
+ /**
1139
+ * router options
1140
+ */
1141
+ declare interface RouterOptions {
1142
+ /**
1143
+ * 默认操作类型
1144
+ */
1145
+ defaultOperationType?: OperationType;
1146
+ /**
1147
+ * 模块路径解释
1148
+ */
1149
+ modulePathResolve?: {
1150
+ (route: Route): string;
1151
+ };
1152
+ /**
1153
+ * router history
1154
+ */
1155
+ history?: RouterHistory;
1156
+ /**
1157
+ * 路由配置列表
1158
+ */
1159
+ routes?: RouteConfig[];
1160
+ /**
1161
+ * not found 路由
1162
+ */
1163
+ notFound?: RouteConfig;
1164
+ /**
1165
+ * not found 路由路径
1166
+ */
1167
+ notFoundPath?: string;
1168
+ }
1169
+
1170
+ declare class Session {
1171
+ /**
1172
+ * 目标路由
1173
+ */
1174
+ to?: Route;
1175
+ /**
1176
+ * 目标路由
1177
+ */
1178
+ routeModel?: RouteModel;
1179
+ /**
1180
+ * 来源路由
1181
+ */
1182
+ from?: Route;
1183
+ /**
1184
+ * 流程数据
1185
+ */
1186
+ data: {
1187
+ [propName: string]: any;
1188
+ };
1189
+ /**
1190
+ * 构造函数
1191
+ * @param to
1192
+ * @param from
1193
+ */
1194
+ constructor(to?: Route, from?: Route);
1195
+ /**
1196
+ * 转换为session
1197
+ * @param src
1198
+ * @returns
1199
+ */
1200
+ static from(src: {
1201
+ [propName: string]: any;
1202
+ }): Session;
1203
+ }
1204
+
1205
+ /**
1206
+ * 插槽
1207
+ */
1208
+ declare class Slot {
1209
+ /**
1210
+ * 插槽名称
1211
+ */
1212
+ name: string;
1213
+ /**
1214
+ * 层次
1215
+ */
1216
+ level: number;
1217
+ /**
1218
+ * root插槽节点名称
1219
+ */
1220
+ rootName: string | undefined;
1221
+ /**
1222
+ * root插槽节点index
1223
+ */
1224
+ rootIndex: number;
1225
+ /**
1226
+ * 构造函数
1227
+ * @param name
1228
+ * @param level
1229
+ * @param rootName
1230
+ */
1231
+ constructor(name: string, level: number, rootName: string | undefined, rootIndex: number);
1232
+ }
1233
+
1234
+ /**
1235
+ * storage
1236
+ */
1237
+ declare interface Storage_2 {
1238
+ /**
1239
+ * 获取item
1240
+ * @param key
1241
+ */
1242
+ getItem(key: string): string | null;
1243
+ /**
1244
+ * 设置item
1245
+ * @param key
1246
+ * @param value
1247
+ */
1248
+ setItem(key: string, value: string): void;
1249
+ /**
1250
+ * remove item
1251
+ * @param key
1252
+ */
1253
+ removeItem(key: string): void;
1254
+ }
1255
+
1256
+ /**
1257
+ * Task类型
1258
+ */
1259
+ declare interface Task {
1260
+ (context: EventChainContext, ...args: any[]): void;
1261
+ }
1262
+
1263
+ /**
1264
+ * 任务节点
1265
+ */
1266
+ declare class TaskNode {
1267
+ /**
1268
+ * 索引
1269
+ */
1270
+ index: number;
1271
+ /**
1272
+ * 来源
1273
+ */
1274
+ src: string;
1275
+ /**
1276
+ * 参数
1277
+ */
1278
+ params: any;
1279
+ /**
1280
+ * 进程
1281
+ */
1282
+ progress: Progress;
1283
+ /**
1284
+ * 构造函数
1285
+ * @param index
1286
+ * @param src
1287
+ * @param params
1288
+ * @param progress
1289
+ */
1290
+ constructor(index: number, src: string, params: any, progress: Progress);
1291
+ }
1292
+
1293
+ export { toBoolean }
1294
+
1295
+ export { toNumber }
1296
+
1297
+ /**
1298
+ * Tool工具集合接口
1299
+ */
1300
+ declare interface Tools {
1301
+ get each(): Function;
1302
+ get type(): Function;
1303
+ get isFunction(): Function;
1304
+ get isArray(): Function;
1305
+ get isArrayLike(): Function;
1306
+ get makeArray(): Function;
1307
+ get merge(): Function;
1308
+ get isWindow(): Function;
1309
+ get isPlainObject(): Function;
1310
+ get isEqual(): Function;
1311
+ }
1312
+
1313
+ export { toTypeString }
1314
+
1315
+ /**
1316
+ * tree接口
1317
+ */
1318
+ declare interface Tree extends TreeNode {
1319
+ /**
1320
+ * 加入数据
1321
+ * @param args
1322
+ * @returns {boolean}
1323
+ */
1324
+ put(...args: any[]): boolean;
1325
+ /**
1326
+ * 获取内容
1327
+ * @param args
1328
+ * @returns {any}
1329
+ */
1330
+ get(...args: any[]): any | undefined;
1331
+ /**
1332
+ * 移除数据
1333
+ * @param args
1334
+ * @returns {boolean}
1335
+ */
1336
+ remove(...args: any[]): boolean;
1337
+ /**
1338
+ * 判断是否包含数据
1339
+ * @param args
1340
+ * @returns {boolean}
1341
+ */
1342
+ contains(...args: any[]): boolean;
1343
+ /**
1344
+ * 清空所以数据
1345
+ */
1346
+ clear(): void;
1347
+ }
1348
+
1349
+ /**
1350
+ * tree node
1351
+ */
1352
+ declare interface TreeNode {
1353
+ [propName: string]: any;
1354
+ }
1355
+
1356
+ /**
1357
+ * 更新类型
1358
+ */
1359
+ declare enum UpdateType {
1360
+ /**
1361
+ * 部分替换
1362
+ */
1363
+ Part = 0,
1364
+ /**
1365
+ * 整体替换
1366
+ */
1367
+ All = 1
1368
+ }
1369
+
1370
+ /**
1371
+ * Returns the global bus
1372
+ * @param proxy
1373
+ * @returns
1374
+ */
1375
+ export declare function useBus(proxy?: ComponentPublicInstance): Tree;
1376
+
1377
+ /**
1378
+ * Returns the global event proxy
1379
+ * @param proxy
1380
+ * @returns
1381
+ */
1382
+ export declare function useEventProxy(proxy?: ComponentPublicInstance): EventProxy;
1383
+
1384
+ /**
1385
+ * Returns the current fox
1386
+ * @param proxy
1387
+ * @returns
1388
+ */
1389
+ export declare function useFox(proxy?: ComponentPublicInstance): Fox;
1390
+
1391
+ /**
1392
+ * Returns the current route
1393
+ * @param proxy
1394
+ * @returns
1395
+ */
1396
+ export declare function useRoute(proxy?: ComponentPublicInstance): Route | null;
1397
+
1398
+ /**
1399
+ * Returns the current router
1400
+ * @returns
1401
+ */
1402
+ export declare function useRouter(proxy?: ComponentPublicInstance): Router;
1403
+
1404
+ export { }