@fox-js/fox 3.0.1-9 → 3.1.0

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,24 +1,15 @@
1
1
  import { App } from 'vue';
2
- import { clone } from './util/commons';
2
+ import { ComponentInternalInstance } from 'vue';
3
3
  import { ComponentPublicInstance } from 'vue';
4
- import { extend } from './util/commons';
5
4
  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
- import { typeOf } from './util/commons';
5
+ import { Ref } from 'vue';
6
+ import { Require } from './require';
7
+
8
+ declare const _addRouteRecorder: unique symbol;
9
+
10
+ declare const _after: unique symbol;
11
+
12
+ declare const afterFiltersKey: unique symbol;
22
13
 
23
14
  /**
24
15
  * after route update filter
@@ -27,6 +18,19 @@ declare interface AfterRouteFilter {
27
18
  (to: Route, from: Route, session: Record<string | number | symbol, any>): void;
28
19
  }
29
20
 
21
+ declare const argsKey: unique symbol;
22
+
23
+ declare const _before: unique symbol;
24
+
25
+ declare const beforeFiltersKey: unique symbol;
26
+
27
+ /**
28
+ * before route restore filter(用于刷新还原)
29
+ */
30
+ declare interface BeforeResotreFilter {
31
+ (route: Route, index: number, mark: string, routes: Route[]): boolean;
32
+ }
33
+
30
34
  /**
31
35
  * before route update filter
32
36
  */
@@ -36,10 +40,19 @@ declare interface BeforeRouteFilter {
36
40
  }, session: Record<string | number | symbol, any>): void;
37
41
  }
38
42
 
43
+ declare const _buildPage: unique symbol;
44
+
39
45
  /**
40
46
  * 导出Bus
41
47
  */
42
- export declare let Bus: any;
48
+ export declare const Bus: any;
49
+
50
+ /**
51
+ * Bus Interface
52
+ */
53
+ export declare interface BusInterface extends Tree {
54
+ [propName: string | symbol | number]: any;
55
+ }
43
56
 
44
57
  /**
45
58
  * callback function
@@ -48,13 +61,23 @@ declare interface Callback {
48
61
  (...args: any[]): void;
49
62
  }
50
63
 
64
+ declare const chainKey: unique symbol;
65
+
66
+ declare const childrenKey: unique symbol;
67
+
51
68
  /**
52
- * 取消ajax请求
53
- * @param id
69
+ * 克隆对象
70
+ * @param target
71
+ * @param source
72
+ * @param plain
73
+ *
74
+ * @returns
54
75
  */
55
- export declare function cancel(id: any): boolean;
76
+ export declare function clone(target: any, source: any, plain?: boolean): any;
77
+
78
+ declare const _cloneRouteRecorder: unique symbol;
56
79
 
57
- export { clone }
80
+ declare const _constructRouteModel: unique symbol;
58
81
 
59
82
  /**
60
83
  * 创建Fox
@@ -71,6 +94,8 @@ export declare function createFox(options?: FoxOptions): Fox;
71
94
  */
72
95
  export declare function createMemoryHistory(base?: string, maxHistoryRecorderSize?: number): RouterHistory;
73
96
 
97
+ declare const _createNextFn: unique symbol;
98
+
74
99
  /**
75
100
  * 创建web hash history
76
101
  * @param navigateFirstRoute
@@ -94,6 +119,24 @@ export declare function createWebHashHistory(navigateFirstRoute?: boolean, query
94
119
  */
95
120
  export declare function createWebHistory(navigateFirstRoute?: boolean, base?: string | null, query?: string, historyMonitor?: boolean | IfFunction, traceless?: boolean | IfFunction, storage?: Storage_2): RouterHistory;
96
121
 
122
+ declare const currentKey: unique symbol;
123
+
124
+ declare const currentRoutes: unique symbol;
125
+
126
+ declare const cursorKey: unique symbol;
127
+
128
+ /**
129
+ * 删除 context value
130
+ * @param proxy
131
+ * @param key
132
+ *
133
+ */
134
+ export declare function deleteContextValue(proxy: ComponentPublicInstance, key: KeyType_2): void;
135
+
136
+ declare const _destroy: unique symbol;
137
+
138
+ declare const destroyFiltersKey: unique symbol;
139
+
97
140
  /**
98
141
  * destroy route update filter
99
142
  */
@@ -110,10 +153,50 @@ declare interface EndTask {
110
153
  }, ...args: any[]): void;
111
154
  }
112
155
 
156
+ declare const errorCallback: unique symbol;
157
+
158
+ declare const errorFnsKey: unique symbol;
159
+
113
160
  /**
114
161
  * 任务链路
115
162
  */
116
163
  export declare class EventChain {
164
+ /**
165
+ * 事件链路
166
+ */
167
+ private [chainKey];
168
+ /**
169
+ * 游标
170
+ */
171
+ private [cursorKey];
172
+ /**
173
+ * 是否持久模式(该状态为true的情况,已经执行的任务会继续保存在队列中)
174
+ */
175
+ private [persistentModeKey];
176
+ /**
177
+ * 状态
178
+ */
179
+ private [statusKey];
180
+ /**
181
+ * 参数
182
+ */
183
+ private [argsKey];
184
+ /**
185
+ * 异常参数
186
+ */
187
+ private [exArgsKey];
188
+ /**
189
+ * 移除函数
190
+ */
191
+ private [successFnsKey];
192
+ /**
193
+ * 错误函数
194
+ */
195
+ private [errorFnsKey];
196
+ /**
197
+ * 链路session
198
+ */
199
+ private [sessionKey]?;
117
200
  /**
118
201
  * 获取session
119
202
  */
@@ -125,6 +208,12 @@ export declare class EventChain {
125
208
  * @param persistentMode
126
209
  */
127
210
  constructor(session?: EventChainSession, persistentMode?: boolean);
211
+ /**
212
+ * 触发链路的下一个任务
213
+ * @param step
214
+ * @param params
215
+ */
216
+ private [_go];
128
217
  /**
129
218
  * 跳转
130
219
  * @param step
@@ -222,6 +311,10 @@ export declare interface EventChainSession {
222
311
  * 事件代理
223
312
  */
224
313
  export declare class EventProxy {
314
+ /**
315
+ * 注册表
316
+ */
317
+ private [registerKey_2];
225
318
  /**
226
319
  * 构造函数
227
320
  */
@@ -283,12 +376,25 @@ export declare class EventProxy {
283
376
  trigger(key: string, ...value: any[]): EventProxy;
284
377
  }
285
378
 
286
- export { extend }
379
+ declare const exArgsKey: unique symbol;
380
+
381
+ /**
382
+ * 继承(是否深度拷贝,dest,src1,src2,src3...)
383
+ *
384
+ * @returns
385
+ */
386
+ export declare function extend(...args: any[]): any;
387
+
388
+ declare const _findRootView: unique symbol;
389
+
390
+ declare const _findRouteModel: unique symbol;
391
+
392
+ declare const forestKey: unique symbol;
287
393
 
288
394
  /**
289
395
  * Fox接口
290
396
  */
291
- declare interface Fox extends Tools {
397
+ export declare interface Fox {
292
398
  /**
293
399
  * 返回router
294
400
  */
@@ -296,31 +402,31 @@ declare interface Fox extends Tools {
296
402
  /**
297
403
  * 返回全局Bus
298
404
  */
299
- get bus(): Tree;
405
+ get bus(): BusInterface;
300
406
  /**
301
- * 返回Bus类型
407
+ * 返回Bus构造函数
302
408
  */
303
409
  get Bus(): typeof Bus;
304
410
  /**
305
- * 返回全局event proxy
411
+ * 返回event proxy构造函数
306
412
  */
307
- get eventproxy(): EventProxy;
413
+ get EventProxy(): typeof EventProxy;
308
414
  /**
309
415
  * 返回全局event proxy
310
416
  */
311
- get EventProxy(): typeof EventProxy;
417
+ get eventproxy(): EventProxy;
312
418
  /**
313
- * 返回event chain类型
419
+ * 返回event chain构造函数
314
420
  */
315
421
  get EventChain(): typeof EventChain;
316
422
  /**
317
- * 返回require
423
+ * 获取require构造函数
318
424
  */
319
- get require(): Require | null;
425
+ get Require(): typeof Require;
320
426
  /**
321
- * 返回fectch
427
+ * 获取require
322
428
  */
323
- get request(): Function;
429
+ get require(): Require;
324
430
  /**
325
431
  * 返回extend
326
432
  */
@@ -329,6 +435,10 @@ declare interface Fox extends Tools {
329
435
  * 返回clone
330
436
  */
331
437
  get clone(): Function;
438
+ /**
439
+ * 判断是否为es模块
440
+ */
441
+ get isESModule(): Function;
332
442
  /**
333
443
  * 安装
334
444
  * @param app
@@ -339,28 +449,46 @@ declare interface Fox extends Tools {
339
449
  /**
340
450
  * 全局Bus
341
451
  */
342
- export declare const foxBusKey: InjectionKey<Tree>;
452
+ export declare const foxBusKey: FoxInjectionKey<Tree>;
343
453
 
344
454
  /**
345
455
  * 全局Event Proxy
346
456
  */
347
- export declare const foxEventProxyKey: InjectionKey<EventProxy>;
457
+ export declare const foxEventProxyKey: FoxInjectionKey<EventProxy>;
458
+
459
+ declare interface FoxInjectionKey<T> extends InjectionKey<T> {
460
+ }
348
461
 
349
462
  /**
350
463
  * 全局Fox
351
464
  */
352
- export declare const foxKey: InjectionKey<Fox>;
465
+ export declare const foxKey: FoxInjectionKey<Fox>;
353
466
 
354
467
  /**
355
468
  * 参数
356
469
  */
357
- declare interface FoxOptions extends RouterOptions {
470
+ export declare interface FoxOptions extends RouterOptions {
358
471
  }
359
472
 
360
- declare interface GenericFunction {
473
+ /**
474
+ * 通用函数接口
475
+ */
476
+ export declare interface GenericFunction {
361
477
  (...args: any[]): any;
362
478
  }
363
479
 
480
+ declare const _getFirstView: unique symbol;
481
+
482
+ declare const _go: unique symbol;
483
+
484
+ declare const growKey: unique symbol;
485
+
486
+ declare const _handleError: unique symbol;
487
+
488
+ declare const _handleHistoryChange: unique symbol;
489
+
490
+ declare const _handleRouteUpdated: unique symbol;
491
+
364
492
  /**
365
493
  * history change handler
366
494
  */
@@ -368,6 +496,15 @@ declare interface HistoryChangeHandler {
368
496
  (args: Array<Route> | string): void;
369
497
  }
370
498
 
499
+ declare const historyKey: unique symbol;
500
+
501
+ /**
502
+ * 历史更新策略
503
+ */
504
+ declare type HistoryUpdatePolicy = 'push' | 'replace' | 'traceless';
505
+
506
+ declare const idKey: unique symbol;
507
+
371
508
  /**
372
509
  * If Function
373
510
  */
@@ -375,29 +512,120 @@ declare interface IfFunction {
375
512
  (...args: any[]): boolean;
376
513
  }
377
514
 
378
- export { isArray }
515
+ declare const initKey: unique symbol;
516
+
517
+ /**
518
+ * inject context value
519
+ * @param proxy
520
+ * @returns
521
+ */
522
+ export declare function injectContextValue(proxy: ComponentPublicInstance, key: KeyType_2): unknown;
523
+
524
+ /**
525
+ * 是否数组
526
+ */
527
+ export declare const isArray: (arg: any) => arg is any[];
528
+
529
+ /**
530
+ * 是否为Date
531
+ * @param val
532
+ * @returns
533
+ */
534
+ export declare const isDate: (val: unknown) => val is Date;
535
+
536
+ /**
537
+ * 判断两个对象是否一致
538
+ * @param x
539
+ * @param y
540
+ * @return
541
+ */
542
+ export declare function isEqual(x: any, y: any): boolean;
543
+
544
+ /**
545
+ * 是否为es module
546
+ * @param obj
547
+ * @returns
548
+ */
549
+ export declare function isESModule(obj: any): obj is Object;
550
+
551
+ /**
552
+ * 是否为函数
553
+ * @param val
554
+ * @returns
555
+ */
556
+ export declare const isFunction: (val: unknown) => val is Function;
379
557
 
380
- export { isDate }
558
+ /**
559
+ * 是否为Map
560
+ * @param val
561
+ * @returns
562
+ */
563
+ export declare const isMap: (val: unknown) => val is Map<any, any>;
381
564
 
382
- export { isEqual }
565
+ /**
566
+ * 是否为空对象
567
+ * @param val
568
+ * @returns
569
+ */
570
+ export declare const isNil: (val: unknown) => val is null;
571
+
572
+ /**
573
+ * 是否为object
574
+ */
575
+ export declare const isObject: (val: unknown) => val is Record<any, any>;
576
+
577
+ /**
578
+ * 是否为plain对象
579
+ * @param val
580
+ * @returns
581
+ */
582
+ export declare const isPlainObject: (val: unknown) => val is object;
383
583
 
384
- export { isESModule }
584
+ /**
585
+ * 是否为promise
586
+ * @param val
587
+ * @returns
588
+ */
589
+ export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
385
590
 
386
- export { isFunction }
591
+ /**
592
+ * 是否为Set
593
+ * @param val
594
+ * @returns
595
+ */
596
+ export declare const isSet: (val: unknown) => val is Set<any>;
387
597
 
388
- export { isMap }
598
+ /**
599
+ * 是否为字符串
600
+ * @param val
601
+ * @returns
602
+ */
603
+ export declare const isString: (val: unknown) => val is string;
389
604
 
390
- export { isObject }
605
+ /**
606
+ * 是否为symbol
607
+ * @param val
608
+ * @returns
609
+ */
610
+ export declare const isSymbol: (val: unknown) => val is symbol;
391
611
 
392
- export { isPlainObject }
612
+ declare type KeyType_2 = string | number | Symbol;
393
613
 
394
- export { isPromise }
614
+ /**
615
+ * 层
616
+ */
617
+ declare class Layer {
618
+ /**
619
+ * 节点(view集合)
620
+ */
621
+ views: View[];
622
+ }
395
623
 
396
- export { isSet }
624
+ declare const _load: unique symbol;
397
625
 
398
- export { isString }
626
+ declare const mainDispatcherKey: unique symbol;
399
627
 
400
- export { isSymbol }
628
+ declare const _markReady: unique symbol;
401
629
 
402
630
  declare class MarkRecord {
403
631
  currentRoute: Route;
@@ -410,6 +638,8 @@ declare class MarkRecord {
410
638
  constructor(currentRoute: Route, routes: Array<Route>);
411
639
  }
412
640
 
641
+ declare const _merge: unique symbol;
642
+
413
643
  /**
414
644
  * model (RouteModel > ModelLayer > Model)
415
645
  */
@@ -472,28 +702,45 @@ declare class ModelLayer {
472
702
  }
473
703
 
474
704
  /**
475
- * 操作类型
476
- * @type {Enum}
705
+ * model插槽
477
706
  */
478
- declare enum ModuleStatus {
707
+ declare class ModelSlot {
708
+ /**
709
+ * 实例
710
+ */
711
+ instance: ComponentInternalInstance | null;
479
712
  /**
480
- * 加载中
713
+ * model
481
714
  */
482
- Loading = 0,
715
+ model: Model;
483
716
  /**
484
- * 加载完成
717
+ * route
485
718
  */
486
- Loaded = 1,
719
+ route: Route | null;
487
720
  /**
488
- * 定义中状态
721
+ * 是否激活状态
489
722
  */
490
- Defining = 2,
723
+ active: boolean;
491
724
  /**
492
- * 定义完成状态
725
+ * 索引
726
+ */
727
+ index: number;
728
+ /**
729
+ * 构造函数
730
+ * @param route
731
+ * @param model
732
+ * @param index
733
+ * @param active
493
734
  */
494
- Defined = 3
735
+ constructor(route: Route | null, model: Model, index?: number, active?: boolean);
495
736
  }
496
737
 
738
+ declare const nameKey: unique symbol;
739
+
740
+ declare const notFoundKey: unique symbol;
741
+
742
+ declare const notFoundPathKey: unique symbol;
743
+
497
744
  /**
498
745
  * 路由更新后执行
499
746
  * @param callback
@@ -510,15 +757,15 @@ export declare function onBeforeRouteUpdate(callback: {
510
757
  (to: Route, from?: Route): void;
511
758
  }): void;
512
759
 
513
- export declare let onFoxActivated: (hook: GenericFunction) => void;
760
+ export declare const onFoxActivated: (hook: GenericFunction) => void;
514
761
 
515
- export declare let onFoxDeactivated: (hook: GenericFunction) => void;
762
+ export declare const onFoxInactivated: (hook: GenericFunction) => void;
516
763
 
517
764
  /**
518
765
  * 操作类型
519
- * @type {Enum}
766
+ * @type Enum
520
767
  */
521
- declare enum OperationType {
768
+ export declare enum OperationType {
522
769
  /**
523
770
  * Push策略(生产历史记录)
524
771
  */
@@ -542,179 +789,57 @@ declare enum OperationType {
542
789
  }
543
790
 
544
791
  /**
545
- * 进程
792
+ * page
546
793
  */
547
- declare class Progress {
548
- /**
549
- * 回调函数
550
- */
551
- private callback;
552
- /**
553
- * values
554
- */
555
- private values;
556
- /**
557
- * 状态
558
- */
559
- private status;
560
- /**
561
- * 工作量
562
- */
563
- private size;
564
- /**
565
- * 最新的index
566
- */
567
- private lastIndex;
568
- /**
569
- * 构造函数
570
- */
571
- constructor(size: number, callback: {
572
- (status: ModuleStatus, values: any[]): void;
573
- });
574
- /**
575
- * work
576
- * @param status 工作状态(true/false)
577
- * @param index
578
- * @param value
579
- */
580
- work(status: boolean, index: number, value: any): void;
794
+ declare class Page {
581
795
  /**
582
- * 判断进程是否为正常状态
796
+ *
583
797
  */
584
- isOK(): boolean;
798
+ layers: Layer[];
585
799
  }
586
800
 
801
+ declare const parentNodeKey: unique symbol;
802
+
803
+ declare const persistentModeKey: unique symbol;
804
+
587
805
  /**
588
- * 发起请求
589
- * @param args
590
- * @returns
806
+ * 属性过滤器
591
807
  */
592
- export declare function request(args: any): Promise<any>;
808
+ declare interface PropsFilter {
809
+ (props: Record<string | symbol, any>): Record<string | symbol, any>;
810
+ }
811
+
812
+ declare const propsFilterKey: unique symbol;
593
813
 
594
814
  /**
595
- * AMD加载器
815
+ * provide context value
816
+ * @param proxy
817
+ * @param key
818
+ * @param value
596
819
  */
597
- declare class Require {
598
- /**
599
- * head对象
600
- */
601
- private head;
602
- /**
603
- * 是否为老的webkit浏览器
604
- */
605
- private isOldWebKit;
606
- /**
607
- * moudel manager
608
- * @type {ModuleManager}
609
- */
610
- private moduleManager;
611
- /**
612
- * resource
613
- */
614
- private resource;
615
- /**
616
- * 参数配置
617
- */
618
- private options;
619
- /**
620
- * 设置query
621
- */
622
- private _query?;
623
- /**
624
- * 设置query
625
- */
626
- set query(val: Record<string, string | number> | undefined);
627
- /**
628
- * 获取query
629
- */
630
- get query(): Record<string, string | number> | undefined;
631
- /**
632
- * 构造函数
633
- */
634
- constructor(options?: any);
635
- /**
636
- * 加载
637
- */
638
- ensure(...args: any[]): Require;
639
- /**
640
- * 卸载
641
- */
642
- remove(...args: any): Require;
643
- /**
644
- * 加载
645
- *
646
- * @param chain
647
- * @param taskNode
648
- */
649
- mount(chain: EventChain, taskNode: TaskNode): void;
650
- /**
651
- * 加载html
652
- *
653
- * @param chain
654
- * @param task
655
- * @param point
656
- */
657
- private mountHTML;
658
- /**
659
- * 加载css
660
- * @param chain
661
- * @param task
662
- * @param point
663
- */
664
- private mountCSS;
665
- /**
666
- * 加载js
667
- *
668
- * @param chain
669
- * @param task
670
- * @param point
671
- */
672
- private mountJS;
673
- /**
674
- * 卸载资源
675
- */
676
- unmount(path: string, options?: any): void;
677
- /**
678
- * 去掉空元素
679
- */
680
- private trimEmptyElement;
681
- /**
682
- * 创建define函数
683
- * @param module
684
- * @param task
685
- * @returns {Function}
686
- */
687
- private createDefine;
688
- /**
689
- * 解析路径
690
- * @param uri
691
- * @returns {string}
692
- */
693
- private resolvePath;
694
- /**
695
- * 创建search字符串
696
- */
697
- private createSearch;
698
- /**
699
- * 获取文件名后缀
700
- * @param name
701
- * @returns {string}
702
- */
703
- getFileNamePostfix(name: string): string;
704
- /**
705
- * 是否为不处理的路径
706
- * @param uri
707
- * @param type
708
- * @returns {boolean}
709
- */
710
- private isNaturePath;
711
- /**
712
- * 解析路径
713
- * @param uri
714
- * @param replace
715
- */
716
- private parserPath;
717
- }
820
+ export declare function provideContextValue(proxy: ComponentPublicInstance, key: KeyType_2, value: any): void;
821
+
822
+ declare type Proxy_2 = ComponentPublicInstance | null;
823
+
824
+ declare const readyHandlersKey: unique symbol;
825
+
826
+ declare const readyKey: unique symbol;
827
+
828
+ declare const registerKey: unique symbol;
829
+
830
+ declare const registerKey_2: unique symbol;
831
+
832
+ declare const _removeRouteRecorder: unique symbol;
833
+
834
+ declare const _removeView: unique symbol;
835
+
836
+ declare const _resolveComponent: unique symbol;
837
+
838
+ declare const resolveRoute: unique symbol;
839
+
840
+ declare const rootKey: unique symbol;
841
+
842
+ declare const rootNodeKey: unique symbol;
718
843
 
719
844
  /**
720
845
  * 路由(跳转目标)
@@ -728,6 +853,10 @@ export declare class Route {
728
853
  * 返回full path
729
854
  */
730
855
  get fullPath(): string;
856
+ /**
857
+ * 别名路径(设置了该属性后,url的route mark优先使用别名显示)
858
+ */
859
+ alias?: string;
731
860
  /**
732
861
  * 名称
733
862
  */
@@ -744,6 +873,14 @@ export declare class Route {
744
873
  * 查询
745
874
  */
746
875
  query?: any;
876
+ /**
877
+ * 无痕迹模式
878
+ */
879
+ traceless?: boolean;
880
+ /**
881
+ * 模版path(设置了该属性后,设置了template属性后,会使用template指向的ruteModel作为模版创建新的ruote页面)
882
+ */
883
+ template?: string;
747
884
  /**
748
885
  * 获取匹配的元数组列表
749
886
  */
@@ -780,6 +917,10 @@ export declare class Route {
780
917
  * 更新类型(All,Part)
781
918
  */
782
919
  updateType?: UpdateType;
920
+ /**
921
+ * 历史更新策略
922
+ */
923
+ historyUpdatePolicy?: HistoryUpdatePolicy;
783
924
  /**
784
925
  * view属性集合(用于multi view的tab view属性)
785
926
  */
@@ -897,7 +1038,78 @@ declare class RouteModel {
897
1038
  }
898
1039
 
899
1040
  export declare class Router {
900
- get require(): any;
1041
+ /**
1042
+ * 注册表
1043
+ */
1044
+ private [registerKey];
1045
+ /**
1046
+ * not found route
1047
+ */
1048
+ private [notFoundKey]?;
1049
+ /**
1050
+ * not found route path
1051
+ */
1052
+ private [notFoundPathKey];
1053
+ /**
1054
+ * ready
1055
+ */
1056
+ private [readyKey];
1057
+ /**
1058
+ * ready handlers
1059
+ */
1060
+ private [readyHandlersKey];
1061
+ /**
1062
+ * 页面根节点
1063
+ */
1064
+ private [forestKey];
1065
+ /**
1066
+ * 历史记录控制器
1067
+ */
1068
+ private [historyKey]?;
1069
+ /**
1070
+ * 当前路由集合
1071
+ */
1072
+ private [currentRoutes];
1073
+ /**
1074
+ * 错误回调
1075
+ */
1076
+ private [errorCallback];
1077
+ /**
1078
+ * 全局route更新监听器
1079
+ */
1080
+ private [routeUpdatedCallback];
1081
+ /**
1082
+ * before过滤器队列
1083
+ */
1084
+ private [beforeFiltersKey];
1085
+ /**
1086
+ * after过滤器队列
1087
+ */
1088
+ private [afterFiltersKey];
1089
+ /**
1090
+ * destroy过滤器队列
1091
+ */
1092
+ private [destroyFiltersKey];
1093
+ /**
1094
+ * 属性传递过滤器
1095
+ */
1096
+ private [propsFilterKey];
1097
+ /**
1098
+ * 主任务分发器
1099
+ */
1100
+ private [mainDispatcherKey];
1101
+ /**
1102
+ * 路由守护者
1103
+ */
1104
+ private [routerGuardKey];
1105
+ /**
1106
+ * 是否初始化
1107
+ */
1108
+ private [initKey];
1109
+ /**
1110
+ * 当前最新路由
1111
+ */
1112
+ private [currentKey];
901
1113
  /**
902
1114
  * 获取当前最新route
903
1115
  */
@@ -908,6 +1120,12 @@ export declare class Router {
908
1120
  * @param options
909
1121
  */
910
1122
  constructor(options: RouterOptions);
1123
+ /**
1124
+ * 记录错误日志
1125
+ * @param error
1126
+ * @param route
1127
+ */
1128
+ private [_handleError];
911
1129
  /**
912
1130
  * 初始化
913
1131
  */
@@ -916,6 +1134,36 @@ export declare class Router {
916
1134
  * 第一次导航是否完成
917
1135
  */
918
1136
  isReady(): Promise<void>;
1137
+ /**
1138
+ * 设置第一导航完成
1139
+ */
1140
+ private [_markReady];
1141
+ /**
1142
+ * 处理历史记录
1143
+ * @param record
1144
+ */
1145
+ private [_handleHistoryChange];
1146
+ /**
1147
+ * 处理route updated事件
1148
+ * @param route
1149
+ */
1150
+ private [_handleRouteUpdated];
1151
+ /**
1152
+ * 加入路由记录
1153
+ * @param route
1154
+ */
1155
+ private [_addRouteRecorder];
1156
+ /**
1157
+ * 克隆路由记录
1158
+ * @returns
1159
+ */
1160
+ private [_cloneRouteRecorder];
1161
+ /**
1162
+ * 移除路由记录
1163
+ *
1164
+ * @param route
1165
+ */
1166
+ private [_removeRouteRecorder];
919
1167
  /**
920
1168
  * 设置history monitor是否启动
921
1169
  */
@@ -932,6 +1180,14 @@ export declare class Router {
932
1180
  * 获取无痕模式(不改变历史记录)
933
1181
  */
934
1182
  get traceless(): boolean | IfFunction;
1183
+ /**
1184
+ * 设置属性传递过滤器
1185
+ */
1186
+ set propsFilter(filter: PropsFilter | null);
1187
+ /**
1188
+ * 获取属性传递过滤器
1189
+ */
1190
+ get propsFilter(): PropsFilter | null;
935
1191
  /**
936
1192
  * 设置还原点
937
1193
  *
@@ -984,12 +1240,16 @@ export declare class Router {
984
1240
  */
985
1241
  removeDestroyEach(filter: DestroyRouteFilter): boolean;
986
1242
  /**
987
- * 设置依赖模块解释函数
988
- * @param resolveDependency
1243
+ * 添加before restore filter
1244
+ * @param filter
989
1245
  */
990
- setResolveDependency(resolveDependency: {
991
- (route: Route): string;
992
- }): void;
1246
+ beforeRestoreEach(filter: BeforeResotreFilter): void;
1247
+ /**
1248
+ * 移除before restore filter
1249
+ * @param filter
1250
+ * @returns
1251
+ */
1252
+ removeBeforeRestoreEach(filter: BeforeResotreFilter): boolean;
993
1253
  /**
994
1254
  * 加入路由配置列表
995
1255
  * @param routeConfigs
@@ -1027,6 +1287,23 @@ export declare class Router {
1027
1287
  * 返回目前加载的routes
1028
1288
  */
1029
1289
  getRoutes(): RouteModel[];
1290
+ /**
1291
+ * 根据路由构建route model
1292
+ *
1293
+ * @param routeConfig
1294
+ */
1295
+ private [_constructRouteModel];
1296
+ /**
1297
+ * 查找route model
1298
+ * @param cite
1299
+ */
1300
+ private [_findRouteModel];
1301
+ /**
1302
+ * 解释路由
1303
+ * @param args
1304
+ * @returns
1305
+ */
1306
+ [resolveRoute](args: any): Route | null;
1030
1307
  /**
1031
1308
  * 路由跳转(operation类型为Push)
1032
1309
  * @param args
@@ -1050,8 +1327,9 @@ export declare class Router {
1050
1327
  /**
1051
1328
  * 移除
1052
1329
  * @param term
1330
+ * @param changeHistory
1053
1331
  */
1054
- remove(term?: any): Promise<boolean>;
1332
+ remove(term?: any, changeHistory?: boolean): Promise<boolean>;
1055
1333
  /**
1056
1334
  * 路由跳转(operation类型为Open)
1057
1335
  * @param args
@@ -1072,6 +1350,62 @@ export declare class Router {
1072
1350
  * @param delta
1073
1351
  */
1074
1352
  back(delta?: number): void;
1353
+ /**
1354
+ * 创建next函数
1355
+ */
1356
+ private [_createNextFn];
1357
+ /**
1358
+ * 开始链路
1359
+ * @param route
1360
+ * @returns {EventChain}
1361
+ */
1362
+ private [_start];
1363
+ /**
1364
+ * 执行before事件
1365
+ * @param chain
1366
+ */
1367
+ private [_before];
1368
+ /**
1369
+ * 执行after事件
1370
+ * @param chain
1371
+ */
1372
+ private [_after];
1373
+ /**
1374
+ * 执行销毁事件
1375
+ * @param route
1376
+ * @param session
1377
+ */
1378
+ private [_destroy];
1379
+ /**
1380
+ * 加载路由
1381
+ * @param chain
1382
+ */
1383
+ private [_load];
1384
+ /**
1385
+ * 卸载(只能用于卸载多视图上的view)
1386
+ *
1387
+ * @param routes
1388
+ */
1389
+ private [_unload];
1390
+ /**
1391
+ * 查找root view索引
1392
+ * @param page
1393
+ * @param route
1394
+ */
1395
+ private [_findRootView];
1396
+ /**
1397
+ * 查找first view
1398
+ * @param page
1399
+ */
1400
+ private [_getFirstView];
1401
+ /**
1402
+ * 移除view
1403
+ * @param page
1404
+ * @param pos
1405
+ * @param indexList
1406
+ * @param retainRoot
1407
+ */
1408
+ private [_removeView];
1075
1409
  /**
1076
1410
  * 恢复
1077
1411
  * @param routes
@@ -1079,8 +1413,50 @@ export declare class Router {
1079
1413
  * @returns
1080
1414
  */
1081
1415
  restore(routes?: Route[]): Promise<void>;
1416
+ /**
1417
+ * build page
1418
+ * @param route
1419
+ * @param routeModel
1420
+ * @returns
1421
+ */
1422
+ private [_buildPage];
1423
+ /**
1424
+ * 解析组件
1425
+ */
1426
+ private [_resolveComponent];
1427
+ /**
1428
+ * 更新页面
1429
+ * @param routeModel
1430
+ * @param route
1431
+ * @param session
1432
+ * @param updateType
1433
+ * @returns
1434
+ */
1435
+ private [_update];
1436
+ /**
1437
+ * 合并view
1438
+ * @param page
1439
+ * @param startViewLevel
1440
+ * @param routeModel
1441
+ * @param startModelLevel
1442
+ * @param rootNodeRef
1443
+ */
1444
+ [_merge](page: Page, startViewLevel: number, routeModel: RouteModel, startModelLevel: number, rootNodeRef: ViewPlace): void;
1445
+ /**
1446
+ * router view与view同步数据
1447
+ * @param name
1448
+ * @param level
1449
+ * @param rootView
1450
+ * @param rootViewIndex
1451
+ * @param parentView
1452
+ * @param parentViewIndex
1453
+ * @returns
1454
+ */
1455
+ [sync](name: string, level: number, rootView: View | null, rootViewIndex: number, parentView: View | null, parentViewIndex: number): View | null;
1082
1456
  }
1083
1457
 
1458
+ declare const routerGuardKey: unique symbol;
1459
+
1084
1460
  /**
1085
1461
  * Router History
1086
1462
  */
@@ -1107,6 +1483,17 @@ declare interface RouterHistory {
1107
1483
  * 销毁
1108
1484
  */
1109
1485
  destroy(): void;
1486
+ /**
1487
+ * 添加before restore filter
1488
+ * @param filter
1489
+ */
1490
+ beforeRestoreEach(filter: BeforeResotreFilter): void;
1491
+ /**
1492
+ * 移除before restore filter
1493
+ * @param filter
1494
+ * @returns
1495
+ */
1496
+ removeBeforeRestoreEach(filter: BeforeResotreFilter): boolean;
1110
1497
  /**
1111
1498
  * 监听历史记录改变
1112
1499
  * @param handler
@@ -1115,9 +1502,17 @@ declare interface RouterHistory {
1115
1502
  /**
1116
1503
  * 跳转
1117
1504
  * @param delta
1118
- * @param triggerEvent
1505
+ * @param consume 是否消费事件
1506
+ */
1507
+ go(delta: number, consume?: boolean | {
1508
+ (): boolean;
1509
+ }): void;
1510
+ /**
1511
+ * 回退到指定路由
1512
+ * @param target
1513
+ * @param trigger
1119
1514
  */
1120
- go(delta: number, triggerEvent?: boolean): void;
1515
+ goBack(target: Route | null, trigger: Function): void;
1121
1516
  /**
1122
1517
  * 加入记录
1123
1518
  * @param record
@@ -1128,6 +1523,11 @@ declare interface RouterHistory {
1128
1523
  * @param record
1129
1524
  */
1130
1525
  replace(record: MarkRecord): void;
1526
+ /**
1527
+ * 改变route标识
1528
+ * @param record
1529
+ */
1530
+ setRouteMark(record: MarkRecord): void;
1131
1531
  /**
1132
1532
  * 设置还原点
1133
1533
  *
@@ -1168,6 +1568,8 @@ export declare interface RouterOptions {
1168
1568
  notFoundPath?: string;
1169
1569
  }
1170
1570
 
1571
+ declare const routeUpdatedCallback: unique symbol;
1572
+
1171
1573
  declare class Session {
1172
1574
  /**
1173
1575
  * 目标路由
@@ -1203,7 +1605,7 @@ declare class Session {
1203
1605
  }): Session;
1204
1606
  }
1205
1607
 
1206
- export declare const sessionKey: any;
1608
+ export declare const sessionKey: unique symbol;
1207
1609
 
1208
1610
  /**
1209
1611
  * 插槽
@@ -1234,6 +1636,10 @@ declare class Slot {
1234
1636
  constructor(name: string, level: number, rootName: string | undefined, rootIndex: number);
1235
1637
  }
1236
1638
 
1639
+ declare const _start: unique symbol;
1640
+
1641
+ declare const statusKey: unique symbol;
1642
+
1237
1643
  /**
1238
1644
  * storage
1239
1645
  */
@@ -1255,6 +1661,11 @@ declare interface Storage_2 {
1255
1661
  */
1256
1662
  removeItem(key: string): void;
1257
1663
  }
1664
+ export { Storage_2 as Storage }
1665
+
1666
+ declare const successFnsKey: unique symbol;
1667
+
1668
+ declare const sync: unique symbol;
1258
1669
 
1259
1670
  /**
1260
1671
  * Task类型
@@ -1264,56 +1675,20 @@ export declare interface Task {
1264
1675
  }
1265
1676
 
1266
1677
  /**
1267
- * 任务节点
1678
+ * 转换为boolean值
1679
+ * @param val
1680
+ * @returns
1268
1681
  */
1269
- declare class TaskNode {
1270
- /**
1271
- * 索引
1272
- */
1273
- index: number;
1274
- /**
1275
- * 来源
1276
- */
1277
- src: string;
1278
- /**
1279
- * 参数
1280
- */
1281
- params: any;
1282
- /**
1283
- * 进程
1284
- */
1285
- progress: Progress;
1286
- /**
1287
- * 构造函数
1288
- * @param index
1289
- * @param src
1290
- * @param params
1291
- * @param progress
1292
- */
1293
- constructor(index: number, src: string, params: any, progress: Progress);
1294
- }
1295
-
1296
- export { toBoolean }
1297
-
1298
- export { toNumber }
1682
+ export declare function toBoolean(val: unknown): boolean;
1299
1683
 
1300
1684
  /**
1301
- * Tool工具集合接口
1685
+ * 转换为number值
1686
+ * @param val
1687
+ * @returns
1302
1688
  */
1303
- declare interface Tools {
1304
- get each(): Function;
1305
- get type(): Function;
1306
- get isFunction(): Function;
1307
- get isArray(): Function;
1308
- get isArrayLike(): Function;
1309
- get makeArray(): Function;
1310
- get merge(): Function;
1311
- get isWindow(): Function;
1312
- get isPlainObject(): Function;
1313
- get isEqual(): Function;
1314
- }
1689
+ export declare function toNumber(val: unknown): number;
1315
1690
 
1316
- export { toTypeString }
1691
+ export declare const toTypeString: (value: unknown) => string;
1317
1692
 
1318
1693
  /**
1319
1694
  * tree接口
@@ -1354,9 +1729,22 @@ declare interface Tree extends TreeNode {
1354
1729
  */
1355
1730
  declare interface TreeNode {
1356
1731
  [propName: string]: any;
1732
+ [idKey]: string;
1733
+ [valueKey]: any;
1734
+ [growKey]: boolean;
1735
+ [childrenKey]: Map<string, TreeNode>;
1357
1736
  }
1358
1737
 
1359
- export { typeOf }
1738
+ /**
1739
+ * 判断类型
1740
+ * @param obj
1741
+ * @returns any
1742
+ */
1743
+ export declare function typeOf(obj: any): string;
1744
+
1745
+ declare const _unload: unique symbol;
1746
+
1747
+ declare const _update: unique symbol;
1360
1748
 
1361
1749
  /**
1362
1750
  * 更新类型
@@ -1377,33 +1765,111 @@ declare enum UpdateType {
1377
1765
  * @param proxy
1378
1766
  * @returns
1379
1767
  */
1380
- export declare function useBus(proxy?: ComponentPublicInstance): Tree;
1768
+ export declare function useBus(proxy?: Proxy_2): Tree;
1381
1769
 
1382
1770
  /**
1383
1771
  * Returns the global event proxy
1384
1772
  * @param proxy
1385
1773
  * @returns
1386
1774
  */
1387
- export declare function useEventProxy(proxy?: ComponentPublicInstance): EventProxy;
1775
+ export declare function useEventProxy(proxy?: Proxy_2): EventProxy;
1388
1776
 
1389
1777
  /**
1390
1778
  * Returns the current fox
1391
1779
  * @param proxy
1392
1780
  * @returns
1393
1781
  */
1394
- export declare function useFox(proxy?: ComponentPublicInstance): Fox;
1782
+ export declare function useFox(proxy?: Proxy_2): Fox;
1395
1783
 
1396
1784
  /**
1397
1785
  * Returns the current route
1398
1786
  * @param proxy
1399
1787
  * @returns
1400
1788
  */
1401
- export declare function useRoute(proxy?: ComponentPublicInstance): Route | null;
1789
+ export declare function useRoute(proxy?: Proxy_2): Route | null;
1402
1790
 
1403
1791
  /**
1404
1792
  * Returns the current router
1405
1793
  * @returns
1406
1794
  */
1407
- export declare function useRouter(proxy?: ComponentPublicInstance): Router;
1795
+ export declare function useRouter(proxy?: Proxy_2): Router;
1796
+
1797
+ declare const valueKey: unique symbol;
1798
+
1799
+ /**
1800
+ * 视图
1801
+ */
1802
+ declare class View {
1803
+ /**
1804
+ * model slots列表
1805
+ */
1806
+ private _slots?;
1807
+ /**
1808
+ * getter for models
1809
+ */
1810
+ get slots(): Ref<ModelSlot[]>;
1811
+ /**
1812
+ * 是否为空视图
1813
+ */
1814
+ get empty(): boolean;
1815
+ /**
1816
+ * name
1817
+ */
1818
+ [nameKey]: string;
1819
+ /**
1820
+ * 是否分支根节点标志(true/false)
1821
+ */
1822
+ [rootKey]: boolean;
1823
+ /**
1824
+ * view的所在的root(最近一个)
1825
+ */
1826
+ [rootNodeKey]: ViewPlace | null;
1827
+ /**
1828
+ * view的父亲记得引用(会在router的[sync]方法中建立关系)
1829
+ */
1830
+ [parentNodeKey]: ViewPlace | null;
1831
+ /**
1832
+ * 名称
1833
+ */
1834
+ get name(): string;
1835
+ /**
1836
+ * 构造函数
1837
+ * @param name
1838
+ * @param isRoot
1839
+ * @param rootNodeRef
1840
+ */
1841
+ constructor(name: string, isRoot: boolean, rootNodeRef?: ViewPlace | null);
1842
+ }
1843
+
1844
+ /**
1845
+ * view place
1846
+ */
1847
+ declare class ViewPlace {
1848
+ /**
1849
+ * view
1850
+ */
1851
+ view: View;
1852
+ /**
1853
+ * 索引
1854
+ */
1855
+ index: number;
1856
+ /**
1857
+ * 层次
1858
+ */
1859
+ level: number;
1860
+ /**
1861
+ * 构造函数
1862
+ * @param view
1863
+ * @param index
1864
+ * @param level
1865
+ */
1866
+ constructor(view: View, index: number, level: number);
1867
+ /**
1868
+ * 判断是否在队列中
1869
+ * @param list
1870
+ * @param view
1871
+ */
1872
+ static include(list: ViewPlace[], viewPlace: ViewPlace): boolean;
1873
+ }
1408
1874
 
1409
1875
  export { }