@fox-js/fox 3.0.1-2 → 3.0.1-21

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