@fox-js/fox 3.1.1-8 → 3.1.1

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,8 +1,14 @@
1
1
  import { App } from 'vue';
2
- import { ComponentInternalInstance } from 'vue';
3
- import { ComponentPublicInstance } from 'vue';
4
- import { InjectionKey } from 'vue';
2
+ import { ComponentOptionsMixin } from 'vue';
3
+ import { ComponentProvideOptions } from 'vue';
4
+ import { DefineComponent } from 'vue';
5
+ import { ExtractPropTypes } from 'vue';
6
+ import { PropType } from 'vue';
7
+ import { PublicProps } from 'vue';
5
8
  import { Ref } from 'vue';
9
+ import { RendererElement } from 'vue';
10
+ import { RendererNode } from 'vue';
11
+ import { VNode } from 'vue';
6
12
 
7
13
  declare const _addRouteRecorder: unique symbol;
8
14
 
@@ -14,7 +20,7 @@ declare const afterFiltersKey: unique symbol;
14
20
  * after route update filter
15
21
  */
16
22
  declare interface AfterRouteFilter {
17
- (to: Route, from: Route, session: Record<string | number | symbol, any>): void;
23
+ (to: Route, from: Route | null, session: Record<string | number | symbol, any>): void;
18
24
  }
19
25
 
20
26
  declare const argsKey: unique symbol;
@@ -34,11 +40,17 @@ declare interface BeforeResotreFilter {
34
40
  * before route update filter
35
41
  */
36
42
  declare interface BeforeRouteFilter {
37
- (to: Route, from: Route, next: {
43
+ (to: Route, from: Route | null, next: {
38
44
  (pass?: boolean | Route): void;
39
45
  }, session: Record<string | number | symbol, any>): void;
40
46
  }
41
47
 
48
+ /**
49
+ * 在当前scope中绑定Lifecycle context
50
+ * @params 扩展范围引用
51
+ */
52
+ export declare function bindLifecycleContextToCurrentScope(extScopeRefs?: Array<Object>): boolean;
53
+
42
54
  declare const _buildPage: unique symbol;
43
55
 
44
56
  /**
@@ -57,23 +69,13 @@ export declare interface BusInterface extends Tree {
57
69
  * callback function
58
70
  */
59
71
  declare interface Callback {
60
- (...args: any[]): void;
72
+ (...args: any[]): void | Promise<void>;
61
73
  }
62
74
 
63
75
  declare const chainKey: unique symbol;
64
76
 
65
77
  declare const childrenKey: unique symbol;
66
78
 
67
- /**
68
- * 克隆对象
69
- * @param target
70
- * @param source
71
- * @param plain
72
- *
73
- * @returns
74
- */
75
- export declare function clone(target: any, source: any, plain?: boolean): any;
76
-
77
79
  declare const _cloneRouteRecorder: unique symbol;
78
80
 
79
81
  declare const _constructRouteModel: unique symbol;
@@ -118,6 +120,8 @@ export declare function createWebHashHistory(navigateFirstRoute?: boolean, query
118
120
  */
119
121
  export declare function createWebHistory(navigateFirstRoute?: boolean, base?: string | null, query?: string, historyMonitor?: boolean | IfFunction, traceless?: boolean | IfFunction, storage?: Storage_2): RouterHistory;
120
122
 
123
+ declare const currentRoute: unique symbol;
124
+
121
125
  declare const currentRoutes: unique symbol;
122
126
 
123
127
  declare const cursorKey: unique symbol;
@@ -125,15 +129,15 @@ declare const cursorKey: unique symbol;
125
129
  /**
126
130
  * 自定义过渡
127
131
  */
128
- export declare type CustomTransition = 'custom';
132
+ declare type CustomTransition = 'custom';
129
133
 
130
134
  /**
131
135
  * 删除 context value
132
- * @param proxy
136
+ * @param contextRelationKey 上下文关联key
133
137
  * @param key
134
138
  *
135
139
  */
136
- export declare function deleteContextValue(proxy: ComponentPublicInstance, key: KeyType_2): void;
140
+ export declare function deleteContextValue(contextRelationKey: FoxContextRelationKey | null, key: KeyType_2, route?: Route): void;
137
141
 
138
142
  declare const _destroy: unique symbol;
139
143
 
@@ -146,6 +150,12 @@ declare interface DestroyRouteFilter {
146
150
  (to: Route, session: Record<string | number | symbol, any>): void;
147
151
  }
148
152
 
153
+ /**
154
+ * 销毁state
155
+ * @param state
156
+ */
157
+ export declare function destroyState(state: Object): void;
158
+
149
159
  /**
150
160
  * 完成Task类型(Exception,Finish, Wait)
151
161
  */
@@ -429,23 +439,18 @@ export declare interface Fox {
429
439
  * 获取require
430
440
  */
431
441
  get require(): Require;
432
- /**
433
- * 返回extend
434
- */
435
- get extend(): Function;
436
- /**
437
- * 返回clone
438
- */
439
- get clone(): Function;
440
442
  /**
441
443
  * 判断是否为es模块
442
444
  */
443
- get isESModule(): Function;
445
+ get isESModule(): {
446
+ (mod: any): boolean;
447
+ };
444
448
  /**
445
449
  * 安装
446
450
  * @param app
451
+ * @param options
447
452
  */
448
- install(app: App<Element>): void;
453
+ install(app: App<Element>, options?: FoxInstallOptions): void;
449
454
  }
450
455
 
451
456
  /**
@@ -459,9 +464,10 @@ export declare const FoxBeforeEnter = "FoxBeforeEnter";
459
464
  export declare const FoxBeforeLeave = "FoxLeave";
460
465
 
461
466
  /**
462
- * 全局Bus
467
+ * FoxContextRelationKey
468
+ * 上下文关联key
463
469
  */
464
- export declare const foxBusKey: FoxInjectionKey<BusInterface>;
470
+ declare type FoxContextRelationKey = Object;
465
471
 
466
472
  /**
467
473
  * Fox过渡进入事件
@@ -469,16 +475,12 @@ export declare const foxBusKey: FoxInjectionKey<BusInterface>;
469
475
  export declare const FoxEnter = "FoxEnter";
470
476
 
471
477
  /**
472
- * 全局Event Proxy
473
- */
474
- export declare const foxEventProxyKey: FoxInjectionKey<EventProxy>;
475
-
476
- declare type FoxInjectionKey<T> = InjectionKey<T>;
477
-
478
- /**
479
- * 全局Fox
478
+ * Fox安装参数
480
479
  */
481
- export declare const foxKey: FoxInjectionKey<Fox>;
480
+ declare interface FoxInstallOptions {
481
+ install?: boolean;
482
+ optionsApi?: boolean;
483
+ }
482
484
 
483
485
  /**
484
486
  * Fox过渡离开事件
@@ -492,15 +494,15 @@ export declare const FoxLeave = "FoxLeave";
492
494
  export declare const FoxLeaveEnd = "FoxLeaveEnd";
493
495
 
494
496
  /**
495
- * 参数
497
+ * Fox参数
496
498
  */
497
- export declare interface FoxOptions extends RouterOptions {
499
+ declare interface FoxOptions extends RouterOptions {
498
500
  }
499
501
 
500
502
  /**
501
503
  * 通用函数接口
502
504
  */
503
- export declare interface GenericFunction {
505
+ declare interface GenericFunction {
504
506
  (...args: any[]): any;
505
507
  }
506
508
 
@@ -543,10 +545,17 @@ declare const initKey: unique symbol;
543
545
 
544
546
  /**
545
547
  * inject context value
546
- * @param proxy
548
+ * @param contextRelationKey 上下文关联key
549
+ * @param key
547
550
  * @returns
548
551
  */
549
- export declare function injectContextValue(proxy: ComponentPublicInstance, key: KeyType_2): unknown;
552
+ export declare function injectContextValue<T extends unknown>(contextRelationKey: FoxContextRelationKey | null, key: KeyType_2): T | null;
553
+
554
+ /**
555
+ * inject Lifecycle context
556
+ * @param contextRelationKey 上下文关联key
557
+ */
558
+ export declare function injectLifecycleContext(contextRelationKey?: FoxContextRelationKey | null): LifecycleContext | null;
550
559
 
551
560
  /**
552
561
  * 是否数组
@@ -598,6 +607,8 @@ export declare const isNil: (val: unknown) => val is null | undefined;
598
607
 
599
608
  /**
600
609
  * 是否为object
610
+ * @param val
611
+ * @returns
601
612
  */
602
613
  export declare const isObject: (val: unknown) => val is Record<any, any>;
603
614
 
@@ -636,6 +647,9 @@ export declare const isString: (val: unknown) => val is string;
636
647
  */
637
648
  export declare const isSymbol: (val: unknown) => val is symbol;
638
649
 
650
+ /**
651
+ * 数据类型key
652
+ */
639
653
  declare type KeyType_2 = string | number | Symbol;
640
654
 
641
655
  /**
@@ -648,6 +662,56 @@ declare class Layer {
648
662
  views: View[];
649
663
  }
650
664
 
665
+ /**
666
+ * 生命周期上下文
667
+ */
668
+ declare class LifecycleContext {
669
+ /**
670
+ * 数据列表
671
+ */
672
+ private [registerKey_3];
673
+ /**
674
+ * parent ref
675
+ */
676
+ private [parentKey];
677
+ /**
678
+ * get parent
679
+ */
680
+ get parent(): LifecycleContext | null;
681
+ /**
682
+ * set parent
683
+ */
684
+ set parent(value: LifecycleContext | null);
685
+ /**
686
+ * 构造函数
687
+ */
688
+ constructor();
689
+ /**
690
+ * 设置value
691
+ * @param key
692
+ * @param value
693
+ */
694
+ set(key: KeyType_2, value: any): void;
695
+ /**
696
+ * 获取数据
697
+ * @param key
698
+ * @returns
699
+ */
700
+ get(key: KeyType_2): any;
701
+ /**
702
+ * 是否有对应的数据
703
+ * @param key
704
+ * @returns
705
+ */
706
+ has(key: KeyType_2): boolean;
707
+ /**
708
+ * 删除数据
709
+ * @param key
710
+ * @returns
711
+ */
712
+ delete(key: KeyType_2): boolean;
713
+ }
714
+
651
715
  declare const _load: unique symbol;
652
716
 
653
717
  declare const mainDispatcherKey: unique symbol;
@@ -685,10 +749,6 @@ declare class Model {
685
749
  props: Record<string | number | symbol, any> | boolean | {
686
750
  (route: Route): any;
687
751
  } | undefined;
688
- /**
689
- * 元数据
690
- */
691
- meta?: Record<string | number | symbol, any>;
692
752
  /**
693
753
  * 原始组件数据
694
754
  */
@@ -703,11 +763,10 @@ declare class Model {
703
763
  * @param name
704
764
  * @param src
705
765
  * @param props
706
- * @param meta
707
766
  */
708
767
  constructor(name: string, src: any, props?: Record<string | number | symbol, any> | {
709
768
  (route: Route): any;
710
- } | boolean, meta?: Record<string | number | symbol, any>);
769
+ } | boolean);
711
770
  /**
712
771
  * 是否已经解析完成
713
772
  */
@@ -732,10 +791,6 @@ declare class ModelLayer {
732
791
  * model插槽
733
792
  */
734
793
  declare class ModelSlot {
735
- /**
736
- * 实例
737
- */
738
- instance: ComponentInternalInstance | null;
739
794
  /**
740
795
  * model
741
796
  */
@@ -764,6 +819,8 @@ declare class ModelSlot {
764
819
 
765
820
  declare const nameKey: unique symbol;
766
821
 
822
+ declare const normalizeRoute: unique symbol;
823
+
767
824
  declare const notFoundKey: unique symbol;
768
825
 
769
826
  declare const notFoundPathKey: unique symbol;
@@ -784,8 +841,14 @@ export declare function onBeforeRouteUpdate(callback: {
784
841
  (to: Route, from?: Route): void;
785
842
  }): void;
786
843
 
844
+ /**
845
+ * 导出注册Fox Activated方法
846
+ */
787
847
  export declare const onFoxActivated: (hook: GenericFunction) => void;
788
848
 
849
+ /**
850
+ * 导出注册Fox Inactivated方法
851
+ */
789
852
  export declare const onFoxInactivated: (hook: GenericFunction) => void;
790
853
 
791
854
  /**
@@ -825,6 +888,11 @@ declare class Page {
825
888
  layers: Layer[];
826
889
  }
827
890
 
891
+ /**
892
+ * parent key
893
+ */
894
+ declare const parentKey: unique symbol;
895
+
828
896
  declare const parentNodeKey: unique symbol;
829
897
 
830
898
  declare const persistentModeKey: unique symbol;
@@ -846,7 +914,7 @@ declare type PersistPolicy = 'memory' | 'session' | 'local' | 'custom';
846
914
  /**
847
915
  * 属性函数
848
916
  */
849
- export declare type PropFunction = {
917
+ declare type PropFunction = {
850
918
  (route: Route, index: number): any;
851
919
  };
852
920
 
@@ -861,13 +929,11 @@ declare const propsFilterKey: unique symbol;
861
929
 
862
930
  /**
863
931
  * provide context value
864
- * @param proxy
932
+ * @param contextRelationKey 上下文关联key
865
933
  * @param key
866
934
  * @param value
867
935
  */
868
- export declare function provideContextValue(proxy: ComponentPublicInstance, key: KeyType_2, value: any): void;
869
-
870
- declare type Proxy_2 = ComponentPublicInstance | null;
936
+ export declare function provideContextValue(contextRelationKey: FoxContextRelationKey | null, key: KeyType_2, value: any): void;
871
937
 
872
938
  /**
873
939
  * raw state
@@ -893,12 +959,28 @@ declare const registerKey: unique symbol;
893
959
 
894
960
  declare const registerKey_2: unique symbol;
895
961
 
962
+ /**
963
+ * 注册表key
964
+ */
965
+ declare const registerKey_3: unique symbol;
966
+
967
+ /**
968
+ * remove route 条件
969
+ */
970
+ declare interface RemoveRouteCondition {
971
+ all?: boolean;
972
+ until?: string;
973
+ to?: string;
974
+ root?: string;
975
+ }
976
+
896
977
  declare const _removeRouteRecorder: unique symbol;
897
978
 
898
979
  declare const _removeView: unique symbol;
899
980
 
900
981
  /**
901
- * AMD加载器
982
+ * 依赖加载器
983
+ * 支持js(amd、esm格式) 和 css
902
984
  */
903
985
  declare class Require {
904
986
  /**
@@ -906,78 +988,82 @@ declare class Require {
906
988
  */
907
989
  private moduleManager;
908
990
  /**
909
- * 参数配置
910
- */
911
- private options;
912
- /**
913
- * 设置路径映射
914
- */
915
- set paths(paths: Record<string, string>);
916
- /**
917
- * 获取路径映射
918
- */
919
- get paths(): Record<string, string>;
920
- /**
921
- * 设置路径别名
991
+ * 路径别名
922
992
  */
993
+ private _alias;
923
994
  set alias(alias: Record<string, string>);
995
+ get alias(): Record<string, string>;
996
+ private _resourceParser?;
997
+ set resourceParser(parser: RequireResourceParser);
998
+ get resourceParser(): RequireResourceParser | undefined;
924
999
  /**
925
- * 获取路径别名
1000
+ * 设置超时时间
926
1001
  */
927
- get alias(): Record<string, string>;
1002
+ private _timeout?;
1003
+ set timeout(time: number);
1004
+ get timeout(): number | undefined;
928
1005
  /**
929
- * 设置不需要解析路径或判断函数
1006
+ * 设置query
930
1007
  */
931
- set naturePaths(nature: string[] | {
932
- (path: string): boolean;
933
- });
1008
+ private _query?;
1009
+ set query(val: Record<string, string>);
1010
+ get query(): Record<string, string> | undefined;
934
1011
  /**
935
- * 获取不需要解析路径或判断函数
1012
+ * 获取document head
936
1013
  */
937
- get naturePaths(): string[] | {
938
- (path: string): boolean;
939
- };
1014
+ get head(): any;
940
1015
  /**
941
- * 设置超时时间
1016
+ * css挂载点
942
1017
  */
943
- set timeout(t: number);
1018
+ private _cssMountPoint;
1019
+ set cssMountPoint(point: any);
1020
+ get cssMountPoint(): any;
944
1021
  /**
945
- * 获取超时时间
1022
+ * js挂载点
946
1023
  */
947
- get timeout(): number;
1024
+ private _jsMountPoint;
1025
+ set jsMountPoint(point: any);
1026
+ get jsMountPoint(): any;
948
1027
  /**
949
- * 设置query
1028
+ * 设置module
1029
+ * @param id
1030
+ * @param exports
950
1031
  */
951
- private _query?;
952
- set query(val: Record<string, string | number> | undefined);
953
- get query(): Record<string, string | number> | undefined;
1032
+ setModule(id: string | RegExp, exports: any | {
1033
+ (): any;
1034
+ }): void;
954
1035
  /**
955
- * 获取document head
1036
+ * 移除module
1037
+ * @param id
956
1038
  */
957
- get head(): any;
1039
+ removeModule(id: string | RegExp): void;
958
1040
  /**
959
- * 构造函数
1041
+ * 获取module exports
1042
+ * @param id
1043
+ * @returns
960
1044
  */
961
- constructor();
1045
+ getModuleExports(id: string): any;
962
1046
  /**
963
- * 安装module
1047
+ * expose require方法
1048
+ * @param name
1049
+ * @param global
1050
+ * @param debug
1051
+ * @returns
964
1052
  */
965
- setModule(id: string, exports: Record<string, any> | {
966
- (): Record<string, any>;
967
- }): void;
1053
+ exposeRequire(name?: string, global?: any, debug?: boolean): boolean;
968
1054
  /**
969
- * 移除module
1055
+ * reslove resource
970
1056
  */
971
- removeModule(id: string): void;
1057
+ private resloveResource;
972
1058
  /**
973
1059
  * 加载
974
1060
  * @params args
975
1061
  */
976
- ensure(...args: any[]): Require;
1062
+ ensure(...args: [...any[]] | [...any[], RequireMountedCallback]): Promise<any[]>;
977
1063
  /**
978
1064
  * 卸载
979
1065
  */
980
- remove(...args: any): Require;
1066
+ remove(...args: [...any[]] | [...any[], RequireUnMountedCallback]): Promise<boolean>;
981
1067
  /**
982
1068
  * 加载
983
1069
  *
@@ -1000,6 +1086,13 @@ declare class Require {
1000
1086
  * @param point
1001
1087
  */
1002
1088
  private mountJS;
1089
+ /**
1090
+ * 加载cjs
1091
+ *
1092
+ * @param chain
1093
+ * @param task
1094
+ */
1095
+ private mountCJS;
1003
1096
  /**
1004
1097
  * 卸载资源
1005
1098
  */
@@ -1011,43 +1104,75 @@ declare class Require {
1011
1104
  /**
1012
1105
  * 创建define函数
1013
1106
  * @param module
1107
+ * @param requireLoad
1014
1108
  * @param task
1015
1109
  * @returns
1016
1110
  */
1017
1111
  private createDefine;
1018
1112
  /**
1019
- * 解析路径
1113
+ * 创建require 加载函数
1114
+ * @returns
1115
+ */
1116
+ private createRequireLoad;
1117
+ /**
1118
+ * 构建资源uri
1020
1119
  * @param uri
1021
1120
  * @returns
1022
1121
  */
1023
- private resolvePath;
1122
+ private constructResourceUri;
1024
1123
  /**
1025
1124
  * 创建search字符串
1026
1125
  */
1027
1126
  private createSearch;
1028
1127
  /**
1029
- * 获取文件名后缀
1128
+ * 获取资源路径的后缀
1030
1129
  * @param name
1031
- * @returns {string}
1032
- */
1033
- private getFileNamePostfix;
1034
- /**
1035
- * 是否为不处理的路径
1036
- * @param uri
1037
- * @return
1038
- */
1039
- private isNaturePath;
1040
- /**
1041
- * 解析路径
1042
- * @param uri
1043
- * @param replace
1130
+ * @returns
1044
1131
  */
1045
- private parserPath;
1132
+ private getResourcePathSuffix;
1046
1133
  }
1047
1134
 
1048
- declare const _resolveComponent: unique symbol;
1135
+ /**
1136
+ * require mount callback
1137
+ */
1138
+ declare interface RequireMountedCallback {
1139
+ (ret: boolean): void;
1140
+ }
1141
+
1142
+ /**
1143
+ * 资源
1144
+ */
1145
+ declare interface RequireResource {
1146
+ path: string;
1147
+ type?: RequireResourceType;
1148
+ format?: RequireResourceFormat;
1149
+ }
1150
+
1151
+ /**
1152
+ * 资源类型
1153
+ */
1154
+ declare type RequireResourceFormat = 'es' | 'umd';
1155
+
1156
+ /**
1157
+ * 资源解析
1158
+ */
1159
+ declare interface RequireResourceParser {
1160
+ (path: string): RequireResource | null;
1161
+ }
1049
1162
 
1050
- declare const resolveRoute: unique symbol;
1163
+ /**
1164
+ * 资源类型
1165
+ */
1166
+ declare type RequireResourceType = 'js' | 'css';
1167
+
1168
+ /**
1169
+ * require unmount callback
1170
+ */
1171
+ declare interface RequireUnMountedCallback {
1172
+ (): void;
1173
+ }
1174
+
1175
+ declare const _resolveComponent: unique symbol;
1051
1176
 
1052
1177
  declare const rootKey: unique symbol;
1053
1178
 
@@ -1096,9 +1221,7 @@ export declare class Route {
1096
1221
  /**
1097
1222
  * 获取匹配的元数组列表
1098
1223
  */
1099
- matched?: {
1100
- meta: Record<string | number | symbol, any>;
1101
- }[];
1224
+ matched?: Array<Route>;
1102
1225
  /**
1103
1226
  * route本身的元数据
1104
1227
  */
@@ -1163,12 +1286,13 @@ export declare class Route {
1163
1286
  */
1164
1287
  static isSame(x: Route, y: Route): boolean;
1165
1288
  /**
1166
- * 判断路由对应的route model是否一致
1289
+ * 判断路由路径是一致
1290
+ * route.name 一致 or route.path一致
1167
1291
  * @param x
1168
1292
  * @param y
1169
1293
  * @returns
1170
1294
  */
1171
- static isSameForRouteModel(x: Route, y: Route): boolean;
1295
+ static isSamePathForRoute(x: Route | null, y: Route | null): boolean;
1172
1296
  /**
1173
1297
  * 由对象生成路由
1174
1298
  * @param obj
@@ -1239,6 +1363,14 @@ declare class RouteModel {
1239
1363
  * 名称
1240
1364
  */
1241
1365
  name?: string;
1366
+ /**
1367
+ * 元数据
1368
+ */
1369
+ meta?: Record<string | number | symbol, any>;
1370
+ /**
1371
+ * matched routes 当前路由及其所有父路由的匹配记录
1372
+ */
1373
+ matchedRoutes?: Array<Route>;
1242
1374
  /**
1243
1375
  * layer集合
1244
1376
  */
@@ -1278,6 +1410,10 @@ export declare class Router {
1278
1410
  * 当前路由集合
1279
1411
  */
1280
1412
  private [currentRoutes];
1413
+ /**
1414
+ * 当前路由
1415
+ */
1416
+ private [currentRoute];
1281
1417
  /**
1282
1418
  * route sessin key
1283
1419
  */
@@ -1321,7 +1457,171 @@ export declare class Router {
1321
1457
  /**
1322
1458
  * 获取当前最新route
1323
1459
  */
1324
- get current(): Route | null;
1460
+ get currentRoute(): Readonly< Ref<{
1461
+ readonly path?: string | undefined;
1462
+ readonly fullPath?: string | undefined;
1463
+ readonly alias?: string | undefined;
1464
+ readonly name?: string | undefined;
1465
+ readonly root?: string | undefined;
1466
+ readonly params?: {
1467
+ readonly [x: string]: any;
1468
+ readonly [x: number]: any;
1469
+ readonly [x: symbol]: any;
1470
+ } | undefined;
1471
+ readonly query?: any;
1472
+ readonly traceless?: boolean | undefined;
1473
+ readonly template?: string | undefined;
1474
+ readonly matched?: readonly {
1475
+ readonly path?: string | undefined;
1476
+ readonly fullPath: string;
1477
+ readonly alias?: string | undefined;
1478
+ readonly name?: string | undefined;
1479
+ readonly root?: string | undefined;
1480
+ readonly params?: {
1481
+ readonly [x: string]: any;
1482
+ readonly [x: number]: any;
1483
+ readonly [x: symbol]: any;
1484
+ } | undefined;
1485
+ readonly query?: any;
1486
+ readonly traceless?: boolean | undefined;
1487
+ readonly template?: string | undefined;
1488
+ readonly matched?: readonly /*elided*/ any[] | undefined;
1489
+ readonly meta?: {
1490
+ readonly [x: string]: any;
1491
+ readonly [x: number]: any;
1492
+ readonly [x: symbol]: any;
1493
+ } | undefined;
1494
+ readonly success?: {
1495
+ (...arg: any[]): void;
1496
+ } | undefined;
1497
+ readonly error?: {
1498
+ (...arg: any[]): void;
1499
+ } | undefined;
1500
+ readonly destroy?: {
1501
+ (...arg: any[]): void;
1502
+ } | undefined;
1503
+ readonly opsType?: OperationType | undefined;
1504
+ readonly updateType?: UpdateType | undefined;
1505
+ readonly historyUpdatePolicy?: HistoryUpdatePolicy | undefined;
1506
+ readonly viewTagAttrs?: any;
1507
+ readonly index?: number | undefined;
1508
+ readonly active?: boolean | undefined;
1509
+ readonly slot?: {
1510
+ readonly name: string;
1511
+ readonly level: number;
1512
+ readonly rootName: string | undefined;
1513
+ readonly rootIndex: number;
1514
+ } | undefined;
1515
+ }[] | undefined;
1516
+ readonly meta?: {
1517
+ readonly [x: string]: any;
1518
+ readonly [x: number]: any;
1519
+ readonly [x: symbol]: any;
1520
+ } | undefined;
1521
+ readonly success?: {
1522
+ (...arg: any[]): void;
1523
+ } | undefined;
1524
+ readonly error?: {
1525
+ (...arg: any[]): void;
1526
+ } | undefined;
1527
+ readonly destroy?: {
1528
+ (...arg: any[]): void;
1529
+ } | undefined;
1530
+ readonly opsType?: OperationType | undefined;
1531
+ readonly updateType?: UpdateType | undefined;
1532
+ readonly historyUpdatePolicy?: HistoryUpdatePolicy | undefined;
1533
+ readonly viewTagAttrs?: any;
1534
+ readonly index?: number | undefined;
1535
+ readonly active?: boolean | undefined;
1536
+ readonly slot?: {
1537
+ readonly name: string;
1538
+ readonly level: number;
1539
+ readonly rootName: string | undefined;
1540
+ readonly rootIndex: number;
1541
+ } | undefined;
1542
+ } | null, {
1543
+ readonly path?: string | undefined;
1544
+ readonly fullPath?: string | undefined;
1545
+ readonly alias?: string | undefined;
1546
+ readonly name?: string | undefined;
1547
+ readonly root?: string | undefined;
1548
+ readonly params?: {
1549
+ readonly [x: string]: any;
1550
+ readonly [x: number]: any;
1551
+ readonly [x: symbol]: any;
1552
+ } | undefined;
1553
+ readonly query?: any;
1554
+ readonly traceless?: boolean | undefined;
1555
+ readonly template?: string | undefined;
1556
+ readonly matched?: readonly {
1557
+ readonly path?: string | undefined;
1558
+ readonly fullPath: string;
1559
+ readonly alias?: string | undefined;
1560
+ readonly name?: string | undefined;
1561
+ readonly root?: string | undefined;
1562
+ readonly params?: {
1563
+ readonly [x: string]: any;
1564
+ readonly [x: number]: any;
1565
+ readonly [x: symbol]: any;
1566
+ } | undefined;
1567
+ readonly query?: any;
1568
+ readonly traceless?: boolean | undefined;
1569
+ readonly template?: string | undefined;
1570
+ readonly matched?: readonly /*elided*/ any[] | undefined;
1571
+ readonly meta?: {
1572
+ readonly [x: string]: any;
1573
+ readonly [x: number]: any;
1574
+ readonly [x: symbol]: any;
1575
+ } | undefined;
1576
+ readonly success?: {
1577
+ (...arg: any[]): void;
1578
+ } | undefined;
1579
+ readonly error?: {
1580
+ (...arg: any[]): void;
1581
+ } | undefined;
1582
+ readonly destroy?: {
1583
+ (...arg: any[]): void;
1584
+ } | undefined;
1585
+ readonly opsType?: OperationType | undefined;
1586
+ readonly updateType?: UpdateType | undefined;
1587
+ readonly historyUpdatePolicy?: HistoryUpdatePolicy | undefined;
1588
+ readonly viewTagAttrs?: any;
1589
+ readonly index?: number | undefined;
1590
+ readonly active?: boolean | undefined;
1591
+ readonly slot?: {
1592
+ readonly name: string;
1593
+ readonly level: number;
1594
+ readonly rootName: string | undefined;
1595
+ readonly rootIndex: number;
1596
+ } | undefined;
1597
+ }[] | undefined;
1598
+ readonly meta?: {
1599
+ readonly [x: string]: any;
1600
+ readonly [x: number]: any;
1601
+ readonly [x: symbol]: any;
1602
+ } | undefined;
1603
+ readonly success?: {
1604
+ (...arg: any[]): void;
1605
+ } | undefined;
1606
+ readonly error?: {
1607
+ (...arg: any[]): void;
1608
+ } | undefined;
1609
+ readonly destroy?: {
1610
+ (...arg: any[]): void;
1611
+ } | undefined;
1612
+ readonly opsType?: OperationType | undefined;
1613
+ readonly updateType?: UpdateType | undefined;
1614
+ readonly historyUpdatePolicy?: HistoryUpdatePolicy | undefined;
1615
+ readonly viewTagAttrs?: any;
1616
+ readonly index?: number | undefined;
1617
+ readonly active?: boolean | undefined;
1618
+ readonly slot?: {
1619
+ readonly name: string;
1620
+ readonly level: number;
1621
+ readonly rootName: string | undefined;
1622
+ readonly rootIndex: number;
1623
+ } | undefined;
1624
+ } | null>>;
1325
1625
  private options;
1326
1626
  /**
1327
1627
  * 构造函数
@@ -1338,6 +1638,10 @@ export declare class Router {
1338
1638
  * 初始化
1339
1639
  */
1340
1640
  init(): void;
1641
+ /**
1642
+ * 销毁
1643
+ */
1644
+ destroy(): void;
1341
1645
  /**
1342
1646
  * 第一次导航是否完成
1343
1647
  */
@@ -1507,11 +1811,11 @@ export declare class Router {
1507
1811
  */
1508
1812
  private [_findRouteModel];
1509
1813
  /**
1510
- * 解释路由
1814
+ * 解析并格式化路由
1511
1815
  * @param args
1512
1816
  * @returns
1513
1817
  */
1514
- [resolveRoute](args: any): Route | null;
1818
+ [normalizeRoute](args: any): Route | null;
1515
1819
  /**
1516
1820
  * 路由跳转(operation类型为Push)
1517
1821
  * @param args
@@ -1537,7 +1841,7 @@ export declare class Router {
1537
1841
  * @param term
1538
1842
  * @param changeHistory
1539
1843
  */
1540
- remove(term?: any, changeHistory?: boolean): Promise<boolean>;
1844
+ remove(term?: RemoveRouteCondition, changeHistory?: boolean): Promise<boolean>;
1541
1845
  /**
1542
1846
  * 路由跳转(operation类型为Open)
1543
1847
  * @param args
@@ -1744,6 +2048,82 @@ declare interface RouterHistory {
1744
2048
  setRestorePoint(routes?: Array<Route>): void;
1745
2049
  }
1746
2050
 
2051
+ /**
2052
+ * router link
2053
+ */
2054
+ export declare let RouterLink: DefineComponent<ExtractPropTypes<{
2055
+ tag: {
2056
+ type: PropType<string | unknown | GenericFunction>;
2057
+ required: false;
2058
+ default: string;
2059
+ };
2060
+ to: {
2061
+ type: PropType<string | unknown | GenericFunction>;
2062
+ required: true;
2063
+ };
2064
+ root: {
2065
+ type: PropType<string>;
2066
+ };
2067
+ activeClass: {
2068
+ type: PropType<string | GenericFunction>;
2069
+ required: false;
2070
+ default: string;
2071
+ };
2072
+ exact: {
2073
+ type: PropType<string | boolean | GenericFunction>;
2074
+ required: false;
2075
+ };
2076
+ exactActiveClass: {
2077
+ type: PropType<string | GenericFunction>;
2078
+ required: false;
2079
+ default: string;
2080
+ };
2081
+ event: {
2082
+ type: PropType<string | GenericFunction>;
2083
+ required: false;
2084
+ default: string;
2085
+ };
2086
+ }>, () => VNode<RendererNode, RendererElement, {
2087
+ [key: string]: any;
2088
+ }> | undefined, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
2089
+ tag: {
2090
+ type: PropType<string | unknown | GenericFunction>;
2091
+ required: false;
2092
+ default: string;
2093
+ };
2094
+ to: {
2095
+ type: PropType<string | unknown | GenericFunction>;
2096
+ required: true;
2097
+ };
2098
+ root: {
2099
+ type: PropType<string>;
2100
+ };
2101
+ activeClass: {
2102
+ type: PropType<string | GenericFunction>;
2103
+ required: false;
2104
+ default: string;
2105
+ };
2106
+ exact: {
2107
+ type: PropType<string | boolean | GenericFunction>;
2108
+ required: false;
2109
+ };
2110
+ exactActiveClass: {
2111
+ type: PropType<string | GenericFunction>;
2112
+ required: false;
2113
+ default: string;
2114
+ };
2115
+ event: {
2116
+ type: PropType<string | GenericFunction>;
2117
+ required: false;
2118
+ default: string;
2119
+ };
2120
+ }>> & Readonly<{}>, {
2121
+ tag: string;
2122
+ activeClass: string | GenericFunction;
2123
+ exactActiveClass: string | GenericFunction;
2124
+ event: string | GenericFunction;
2125
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2126
+
1747
2127
  /**
1748
2128
  * router options
1749
2129
  */
@@ -1776,11 +2156,371 @@ export declare interface RouterOptions {
1776
2156
  notFoundPath?: string;
1777
2157
  }
1778
2158
 
2159
+ /**
2160
+ * router view
2161
+ */
2162
+ export declare const RouterView: DefineComponent<ExtractPropTypes<{
2163
+ name: {
2164
+ type: PropType<string>;
2165
+ required: false;
2166
+ default: string;
2167
+ };
2168
+ modelSlot: {
2169
+ type: PropType<ModelSlot>;
2170
+ required: false;
2171
+ };
2172
+ multi: {
2173
+ type: PropType<boolean>;
2174
+ required: false;
2175
+ default: boolean;
2176
+ };
2177
+ tag: {
2178
+ type: PropType<string | unknown | PropFunction>;
2179
+ required: false;
2180
+ default: string;
2181
+ };
2182
+ viewTag: {
2183
+ type: PropType<string | unknown | PropFunction>;
2184
+ required: false;
2185
+ default: string;
2186
+ };
2187
+ viewTagProps: {
2188
+ type: PropType<unknown | PropFunction>;
2189
+ required: false;
2190
+ default(): {};
2191
+ };
2192
+ viewClass: {
2193
+ type: PropType<string | PropFunction>;
2194
+ required: false;
2195
+ };
2196
+ viewActiveClass: {
2197
+ type: PropType<string | PropFunction>;
2198
+ required: false;
2199
+ };
2200
+ viewInactiveClass: {
2201
+ type: PropType<string | PropFunction>;
2202
+ required: false;
2203
+ };
2204
+ transition: {
2205
+ type: PropType<TransitionProp>;
2206
+ required: false;
2207
+ default: boolean;
2208
+ };
2209
+ transitionName: {
2210
+ type: PropType<string>;
2211
+ required: false;
2212
+ };
2213
+ transitionDuration: {
2214
+ type: PropType<string | number | {
2215
+ enter: number;
2216
+ leave: number;
2217
+ show: number;
2218
+ hide: number;
2219
+ }>;
2220
+ required: false;
2221
+ };
2222
+ enterFromClass: {
2223
+ type: PropType<string>;
2224
+ required: false;
2225
+ };
2226
+ enterActiveClass: {
2227
+ type: PropType<string>;
2228
+ required: false;
2229
+ };
2230
+ enterToClass: {
2231
+ type: PropType<string>;
2232
+ required: false;
2233
+ };
2234
+ leaveFromClass: {
2235
+ type: PropType<string>;
2236
+ required: false;
2237
+ };
2238
+ leaveActiveClass: {
2239
+ type: PropType<string>;
2240
+ required: false;
2241
+ };
2242
+ leaveToClass: {
2243
+ type: PropType<string>;
2244
+ required: false;
2245
+ };
2246
+ showFromClass: {
2247
+ type: PropType<string>;
2248
+ required: false;
2249
+ };
2250
+ showActiveClass: {
2251
+ type: PropType<string>;
2252
+ required: false;
2253
+ };
2254
+ showToClass: {
2255
+ type: PropType<string>;
2256
+ required: false;
2257
+ };
2258
+ hideFromClass: {
2259
+ type: PropType<string>;
2260
+ required: false;
2261
+ };
2262
+ hideActiveClass: {
2263
+ type: PropType<string>;
2264
+ required: false;
2265
+ };
2266
+ hideToClass: {
2267
+ type: PropType<string>;
2268
+ required: false;
2269
+ };
2270
+ beforeEnter: {
2271
+ type: PropType<PropFunction>;
2272
+ required: false;
2273
+ };
2274
+ enter: {
2275
+ type: PropType<PropFunction>;
2276
+ required: false;
2277
+ };
2278
+ afterEnter: {
2279
+ type: PropType<PropFunction>;
2280
+ required: false;
2281
+ };
2282
+ enterCancelled: {
2283
+ type: PropType<PropFunction>;
2284
+ required: false;
2285
+ };
2286
+ beforeLeave: {
2287
+ type: PropType<PropFunction>;
2288
+ required: false;
2289
+ };
2290
+ leave: {
2291
+ type: PropType<PropFunction>;
2292
+ required: false;
2293
+ };
2294
+ afterLeave: {
2295
+ type: PropType<PropFunction>;
2296
+ required: false;
2297
+ };
2298
+ leaveCancelled: {
2299
+ type: PropType<PropFunction>;
2300
+ required: false;
2301
+ };
2302
+ beforeShow: {
2303
+ type: PropType<PropFunction>;
2304
+ required: false;
2305
+ };
2306
+ show: {
2307
+ type: PropType<PropFunction>;
2308
+ required: false;
2309
+ };
2310
+ afterShow: {
2311
+ type: PropType<PropFunction>;
2312
+ required: false;
2313
+ };
2314
+ showCancelled: {
2315
+ type: PropType<PropFunction>;
2316
+ required: false;
2317
+ };
2318
+ beforeHide: {
2319
+ type: PropType<PropFunction>;
2320
+ required: false;
2321
+ };
2322
+ hide: {
2323
+ type: PropType<PropFunction>;
2324
+ required: false;
2325
+ };
2326
+ afterHide: {
2327
+ type: PropType<PropFunction>;
2328
+ required: false;
2329
+ };
2330
+ hideCancelled: {
2331
+ type: PropType<PropFunction>;
2332
+ required: false;
2333
+ };
2334
+ }>, (() => VNode< RendererNode, RendererElement, {
2335
+ [key: string]: any;
2336
+ }> | VNode< RendererNode, RendererElement, {
2337
+ [key: string]: any;
2338
+ }>[] | null) | undefined, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
2339
+ name: {
2340
+ type: PropType<string>;
2341
+ required: false;
2342
+ default: string;
2343
+ };
2344
+ modelSlot: {
2345
+ type: PropType<ModelSlot>;
2346
+ required: false;
2347
+ };
2348
+ multi: {
2349
+ type: PropType<boolean>;
2350
+ required: false;
2351
+ default: boolean;
2352
+ };
2353
+ tag: {
2354
+ type: PropType<string | unknown | PropFunction>;
2355
+ required: false;
2356
+ default: string;
2357
+ };
2358
+ viewTag: {
2359
+ type: PropType<string | unknown | PropFunction>;
2360
+ required: false;
2361
+ default: string;
2362
+ };
2363
+ viewTagProps: {
2364
+ type: PropType<unknown | PropFunction>;
2365
+ required: false;
2366
+ default(): {};
2367
+ };
2368
+ viewClass: {
2369
+ type: PropType<string | PropFunction>;
2370
+ required: false;
2371
+ };
2372
+ viewActiveClass: {
2373
+ type: PropType<string | PropFunction>;
2374
+ required: false;
2375
+ };
2376
+ viewInactiveClass: {
2377
+ type: PropType<string | PropFunction>;
2378
+ required: false;
2379
+ };
2380
+ transition: {
2381
+ type: PropType<TransitionProp>;
2382
+ required: false;
2383
+ default: boolean;
2384
+ };
2385
+ transitionName: {
2386
+ type: PropType<string>;
2387
+ required: false;
2388
+ };
2389
+ transitionDuration: {
2390
+ type: PropType<string | number | {
2391
+ enter: number;
2392
+ leave: number;
2393
+ show: number;
2394
+ hide: number;
2395
+ }>;
2396
+ required: false;
2397
+ };
2398
+ enterFromClass: {
2399
+ type: PropType<string>;
2400
+ required: false;
2401
+ };
2402
+ enterActiveClass: {
2403
+ type: PropType<string>;
2404
+ required: false;
2405
+ };
2406
+ enterToClass: {
2407
+ type: PropType<string>;
2408
+ required: false;
2409
+ };
2410
+ leaveFromClass: {
2411
+ type: PropType<string>;
2412
+ required: false;
2413
+ };
2414
+ leaveActiveClass: {
2415
+ type: PropType<string>;
2416
+ required: false;
2417
+ };
2418
+ leaveToClass: {
2419
+ type: PropType<string>;
2420
+ required: false;
2421
+ };
2422
+ showFromClass: {
2423
+ type: PropType<string>;
2424
+ required: false;
2425
+ };
2426
+ showActiveClass: {
2427
+ type: PropType<string>;
2428
+ required: false;
2429
+ };
2430
+ showToClass: {
2431
+ type: PropType<string>;
2432
+ required: false;
2433
+ };
2434
+ hideFromClass: {
2435
+ type: PropType<string>;
2436
+ required: false;
2437
+ };
2438
+ hideActiveClass: {
2439
+ type: PropType<string>;
2440
+ required: false;
2441
+ };
2442
+ hideToClass: {
2443
+ type: PropType<string>;
2444
+ required: false;
2445
+ };
2446
+ beforeEnter: {
2447
+ type: PropType<PropFunction>;
2448
+ required: false;
2449
+ };
2450
+ enter: {
2451
+ type: PropType<PropFunction>;
2452
+ required: false;
2453
+ };
2454
+ afterEnter: {
2455
+ type: PropType<PropFunction>;
2456
+ required: false;
2457
+ };
2458
+ enterCancelled: {
2459
+ type: PropType<PropFunction>;
2460
+ required: false;
2461
+ };
2462
+ beforeLeave: {
2463
+ type: PropType<PropFunction>;
2464
+ required: false;
2465
+ };
2466
+ leave: {
2467
+ type: PropType<PropFunction>;
2468
+ required: false;
2469
+ };
2470
+ afterLeave: {
2471
+ type: PropType<PropFunction>;
2472
+ required: false;
2473
+ };
2474
+ leaveCancelled: {
2475
+ type: PropType<PropFunction>;
2476
+ required: false;
2477
+ };
2478
+ beforeShow: {
2479
+ type: PropType<PropFunction>;
2480
+ required: false;
2481
+ };
2482
+ show: {
2483
+ type: PropType<PropFunction>;
2484
+ required: false;
2485
+ };
2486
+ afterShow: {
2487
+ type: PropType<PropFunction>;
2488
+ required: false;
2489
+ };
2490
+ showCancelled: {
2491
+ type: PropType<PropFunction>;
2492
+ required: false;
2493
+ };
2494
+ beforeHide: {
2495
+ type: PropType<PropFunction>;
2496
+ required: false;
2497
+ };
2498
+ hide: {
2499
+ type: PropType<PropFunction>;
2500
+ required: false;
2501
+ };
2502
+ afterHide: {
2503
+ type: PropType<PropFunction>;
2504
+ required: false;
2505
+ };
2506
+ hideCancelled: {
2507
+ type: PropType<PropFunction>;
2508
+ required: false;
2509
+ };
2510
+ }>> & Readonly<{}>, {
2511
+ name: string;
2512
+ multi: boolean;
2513
+ tag: string;
2514
+ viewTag: string;
2515
+ viewTagProps: {};
2516
+ transition: TransitionProp;
2517
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2518
+
1779
2519
  declare const routeSessionCacheKey: unique symbol;
1780
2520
 
1781
2521
  declare const routeUpdatedCallback: unique symbol;
1782
2522
 
1783
- export declare const sessionKey: unique symbol;
2523
+ declare const sessionKey: unique symbol;
1784
2524
 
1785
2525
  /**
1786
2526
  * shallow reactive state
@@ -1860,7 +2600,6 @@ declare interface Storage_2 {
1860
2600
  */
1861
2601
  removeItem(key: string): void;
1862
2602
  }
1863
- export { Storage_2 as Storage }
1864
2603
 
1865
2604
  declare const successFnsKey: unique symbol;
1866
2605
 
@@ -1892,7 +2631,7 @@ export declare const toTypeString: (value: unknown) => string;
1892
2631
  /**
1893
2632
  * 过渡属性
1894
2633
  */
1895
- export declare type TransitionProp = {
2634
+ declare type TransitionProp = {
1896
2635
  (route: Route, index: number): CustomTransition | boolean;
1897
2636
  } | CustomTransition | boolean;
1898
2637
 
@@ -2040,37 +2779,38 @@ declare enum UpdateType {
2040
2779
 
2041
2780
  /**
2042
2781
  * Returns the global bus
2043
- * @param proxy
2782
+ * @param contextRelationKey 上下文关联key
2044
2783
  * @returns
2045
2784
  */
2046
- export declare function useBus(proxy?: Proxy_2): BusInterface;
2785
+ export declare function useBus(contextRelationKey?: FoxContextRelationKey): BusInterface | null;
2047
2786
 
2048
2787
  /**
2049
2788
  * Returns the global event proxy
2050
- * @param proxy
2051
2789
  * @returns
2052
2790
  */
2053
- export declare function useEventProxy(proxy?: Proxy_2): EventProxy;
2791
+ export declare function useEventProxy(contextRelationKey?: FoxContextRelationKey): EventProxy | null;
2054
2792
 
2055
2793
  /**
2056
2794
  * Returns the current fox
2057
- * @param proxy
2795
+ * @param contextRelationKey 上下文关联key
2796
+ *
2058
2797
  * @returns
2059
2798
  */
2060
- export declare function useFox(proxy?: Proxy_2): Fox;
2799
+ export declare function useFox(contextRelationKey?: FoxContextRelationKey): Fox | null;
2061
2800
 
2062
2801
  /**
2063
2802
  * Returns the current route
2064
- * @param proxy
2803
+ * @param 上下文关联key
2065
2804
  * @returns
2066
2805
  */
2067
- export declare function useRoute(proxy?: Proxy_2): Route | null;
2806
+ export declare function useRoute(contextRelationKey?: FoxContextRelationKey): Route | null;
2068
2807
 
2069
2808
  /**
2070
2809
  * Returns the current router
2810
+ * @param 上下文关联key
2071
2811
  * @returns
2072
2812
  */
2073
- export declare function useRouter(proxy?: Proxy_2): Router;
2813
+ export declare function useRouter(contextRelationKey?: FoxContextRelationKey): Router | null;
2074
2814
 
2075
2815
  declare const valueKey: unique symbol;
2076
2816
 
@@ -2150,4 +2890,14 @@ declare class ViewPlace {
2150
2890
  static include(list: ViewPlace[], viewPlace: ViewPlace): boolean;
2151
2891
  }
2152
2892
 
2893
+ /**
2894
+ * 在绑定LifecycleContext上下文中中执行函数
2895
+ *
2896
+ * currentScope(effectScope)为空的情况的替代方案
2897
+ * @param ctx
2898
+ * @param fn
2899
+ * @returns
2900
+ */
2901
+ export declare function withLifecycleContext<T>(ctx: LifecycleContext, fn: () => Promise<T> | T): Promise<T>;
2902
+
2153
2903
  export { }