@fox-js/fox 3.1.1-9 → 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
 
@@ -39,6 +45,12 @@ declare interface BeforeRouteFilter {
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;
@@ -127,15 +129,15 @@ declare const cursorKey: unique symbol;
127
129
  /**
128
130
  * 自定义过渡
129
131
  */
130
- export declare type CustomTransition = 'custom';
132
+ declare type CustomTransition = 'custom';
131
133
 
132
134
  /**
133
135
  * 删除 context value
134
- * @param proxy
136
+ * @param contextRelationKey 上下文关联key
135
137
  * @param key
136
138
  *
137
139
  */
138
- export declare function deleteContextValue(proxy: ComponentPublicInstance, key: KeyType_2): void;
140
+ export declare function deleteContextValue(contextRelationKey: FoxContextRelationKey | null, key: KeyType_2, route?: Route): void;
139
141
 
140
142
  declare const _destroy: unique symbol;
141
143
 
@@ -148,6 +150,12 @@ declare interface DestroyRouteFilter {
148
150
  (to: Route, session: Record<string | number | symbol, any>): void;
149
151
  }
150
152
 
153
+ /**
154
+ * 销毁state
155
+ * @param state
156
+ */
157
+ export declare function destroyState(state: Object): void;
158
+
151
159
  /**
152
160
  * 完成Task类型(Exception,Finish, Wait)
153
161
  */
@@ -431,23 +439,18 @@ export declare interface Fox {
431
439
  * 获取require
432
440
  */
433
441
  get require(): Require;
434
- /**
435
- * 返回extend
436
- */
437
- get extend(): Function;
438
- /**
439
- * 返回clone
440
- */
441
- get clone(): Function;
442
442
  /**
443
443
  * 判断是否为es模块
444
444
  */
445
- get isESModule(): Function;
445
+ get isESModule(): {
446
+ (mod: any): boolean;
447
+ };
446
448
  /**
447
449
  * 安装
448
450
  * @param app
451
+ * @param options
449
452
  */
450
- install(app: App<Element>): void;
453
+ install(app: App<Element>, options?: FoxInstallOptions): void;
451
454
  }
452
455
 
453
456
  /**
@@ -461,9 +464,10 @@ export declare const FoxBeforeEnter = "FoxBeforeEnter";
461
464
  export declare const FoxBeforeLeave = "FoxLeave";
462
465
 
463
466
  /**
464
- * 全局Bus
467
+ * FoxContextRelationKey
468
+ * 上下文关联key
465
469
  */
466
- export declare const foxBusKey: FoxInjectionKey<BusInterface>;
470
+ declare type FoxContextRelationKey = Object;
467
471
 
468
472
  /**
469
473
  * Fox过渡进入事件
@@ -471,16 +475,12 @@ export declare const foxBusKey: FoxInjectionKey<BusInterface>;
471
475
  export declare const FoxEnter = "FoxEnter";
472
476
 
473
477
  /**
474
- * 全局Event Proxy
478
+ * Fox安装参数
475
479
  */
476
- export declare const foxEventProxyKey: FoxInjectionKey<EventProxy>;
477
-
478
- declare type FoxInjectionKey<T> = InjectionKey<T>;
479
-
480
- /**
481
- * 全局Fox
482
- */
483
- export declare const foxKey: FoxInjectionKey<Fox>;
480
+ declare interface FoxInstallOptions {
481
+ install?: boolean;
482
+ optionsApi?: boolean;
483
+ }
484
484
 
485
485
  /**
486
486
  * Fox过渡离开事件
@@ -494,15 +494,15 @@ export declare const FoxLeave = "FoxLeave";
494
494
  export declare const FoxLeaveEnd = "FoxLeaveEnd";
495
495
 
496
496
  /**
497
- * 参数
497
+ * Fox参数
498
498
  */
499
- export declare interface FoxOptions extends RouterOptions {
499
+ declare interface FoxOptions extends RouterOptions {
500
500
  }
501
501
 
502
502
  /**
503
503
  * 通用函数接口
504
504
  */
505
- export declare interface GenericFunction {
505
+ declare interface GenericFunction {
506
506
  (...args: any[]): any;
507
507
  }
508
508
 
@@ -545,10 +545,17 @@ declare const initKey: unique symbol;
545
545
 
546
546
  /**
547
547
  * inject context value
548
- * @param proxy
548
+ * @param contextRelationKey 上下文关联key
549
+ * @param key
549
550
  * @returns
550
551
  */
551
- 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;
552
559
 
553
560
  /**
554
561
  * 是否数组
@@ -600,6 +607,8 @@ export declare const isNil: (val: unknown) => val is null | undefined;
600
607
 
601
608
  /**
602
609
  * 是否为object
610
+ * @param val
611
+ * @returns
603
612
  */
604
613
  export declare const isObject: (val: unknown) => val is Record<any, any>;
605
614
 
@@ -638,6 +647,9 @@ export declare const isString: (val: unknown) => val is string;
638
647
  */
639
648
  export declare const isSymbol: (val: unknown) => val is symbol;
640
649
 
650
+ /**
651
+ * 数据类型key
652
+ */
641
653
  declare type KeyType_2 = string | number | Symbol;
642
654
 
643
655
  /**
@@ -650,6 +662,56 @@ declare class Layer {
650
662
  views: View[];
651
663
  }
652
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
+
653
715
  declare const _load: unique symbol;
654
716
 
655
717
  declare const mainDispatcherKey: unique symbol;
@@ -687,10 +749,6 @@ declare class Model {
687
749
  props: Record<string | number | symbol, any> | boolean | {
688
750
  (route: Route): any;
689
751
  } | undefined;
690
- /**
691
- * 元数据
692
- */
693
- meta?: Record<string | number | symbol, any>;
694
752
  /**
695
753
  * 原始组件数据
696
754
  */
@@ -705,11 +763,10 @@ declare class Model {
705
763
  * @param name
706
764
  * @param src
707
765
  * @param props
708
- * @param meta
709
766
  */
710
767
  constructor(name: string, src: any, props?: Record<string | number | symbol, any> | {
711
768
  (route: Route): any;
712
- } | boolean, meta?: Record<string | number | symbol, any>);
769
+ } | boolean);
713
770
  /**
714
771
  * 是否已经解析完成
715
772
  */
@@ -734,10 +791,6 @@ declare class ModelLayer {
734
791
  * model插槽
735
792
  */
736
793
  declare class ModelSlot {
737
- /**
738
- * 实例
739
- */
740
- instance: ComponentInternalInstance | null;
741
794
  /**
742
795
  * model
743
796
  */
@@ -788,8 +841,14 @@ export declare function onBeforeRouteUpdate(callback: {
788
841
  (to: Route, from?: Route): void;
789
842
  }): void;
790
843
 
844
+ /**
845
+ * 导出注册Fox Activated方法
846
+ */
791
847
  export declare const onFoxActivated: (hook: GenericFunction) => void;
792
848
 
849
+ /**
850
+ * 导出注册Fox Inactivated方法
851
+ */
793
852
  export declare const onFoxInactivated: (hook: GenericFunction) => void;
794
853
 
795
854
  /**
@@ -829,6 +888,11 @@ declare class Page {
829
888
  layers: Layer[];
830
889
  }
831
890
 
891
+ /**
892
+ * parent key
893
+ */
894
+ declare const parentKey: unique symbol;
895
+
832
896
  declare const parentNodeKey: unique symbol;
833
897
 
834
898
  declare const persistentModeKey: unique symbol;
@@ -850,7 +914,7 @@ declare type PersistPolicy = 'memory' | 'session' | 'local' | 'custom';
850
914
  /**
851
915
  * 属性函数
852
916
  */
853
- export declare type PropFunction = {
917
+ declare type PropFunction = {
854
918
  (route: Route, index: number): any;
855
919
  };
856
920
 
@@ -865,13 +929,11 @@ declare const propsFilterKey: unique symbol;
865
929
 
866
930
  /**
867
931
  * provide context value
868
- * @param proxy
932
+ * @param contextRelationKey 上下文关联key
869
933
  * @param key
870
934
  * @param value
871
935
  */
872
- export declare function provideContextValue(proxy: ComponentPublicInstance, key: KeyType_2, value: any): void;
873
-
874
- declare type Proxy_2 = ComponentPublicInstance | null;
936
+ export declare function provideContextValue(contextRelationKey: FoxContextRelationKey | null, key: KeyType_2, value: any): void;
875
937
 
876
938
  /**
877
939
  * raw state
@@ -897,12 +959,28 @@ declare const registerKey: unique symbol;
897
959
 
898
960
  declare const registerKey_2: unique symbol;
899
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
+
900
977
  declare const _removeRouteRecorder: unique symbol;
901
978
 
902
979
  declare const _removeView: unique symbol;
903
980
 
904
981
  /**
905
- * AMD加载器
982
+ * 依赖加载器
983
+ * 支持js(amd、esm格式) 和 css
906
984
  */
907
985
  declare class Require {
908
986
  /**
@@ -910,78 +988,82 @@ declare class Require {
910
988
  */
911
989
  private moduleManager;
912
990
  /**
913
- * 参数配置
914
- */
915
- private options;
916
- /**
917
- * 设置路径映射
918
- */
919
- set paths(paths: Record<string, string>);
920
- /**
921
- * 获取路径映射
922
- */
923
- get paths(): Record<string, string>;
924
- /**
925
- * 设置路径别名
991
+ * 路径别名
926
992
  */
993
+ private _alias;
927
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;
928
999
  /**
929
- * 获取路径别名
1000
+ * 设置超时时间
930
1001
  */
931
- get alias(): Record<string, string>;
1002
+ private _timeout?;
1003
+ set timeout(time: number);
1004
+ get timeout(): number | undefined;
932
1005
  /**
933
- * 设置不需要解析路径或判断函数
1006
+ * 设置query
934
1007
  */
935
- set naturePaths(nature: string[] | {
936
- (path: string): boolean;
937
- });
1008
+ private _query?;
1009
+ set query(val: Record<string, string>);
1010
+ get query(): Record<string, string> | undefined;
938
1011
  /**
939
- * 获取不需要解析路径或判断函数
1012
+ * 获取document head
940
1013
  */
941
- get naturePaths(): string[] | {
942
- (path: string): boolean;
943
- };
1014
+ get head(): any;
944
1015
  /**
945
- * 设置超时时间
1016
+ * css挂载点
946
1017
  */
947
- set timeout(t: number);
1018
+ private _cssMountPoint;
1019
+ set cssMountPoint(point: any);
1020
+ get cssMountPoint(): any;
948
1021
  /**
949
- * 获取超时时间
1022
+ * js挂载点
950
1023
  */
951
- get timeout(): number;
1024
+ private _jsMountPoint;
1025
+ set jsMountPoint(point: any);
1026
+ get jsMountPoint(): any;
952
1027
  /**
953
- * 设置query
1028
+ * 设置module
1029
+ * @param id
1030
+ * @param exports
954
1031
  */
955
- private _query?;
956
- set query(val: Record<string, string | number> | undefined);
957
- get query(): Record<string, string | number> | undefined;
1032
+ setModule(id: string | RegExp, exports: any | {
1033
+ (): any;
1034
+ }): void;
958
1035
  /**
959
- * 获取document head
1036
+ * 移除module
1037
+ * @param id
960
1038
  */
961
- get head(): any;
1039
+ removeModule(id: string | RegExp): void;
962
1040
  /**
963
- * 构造函数
1041
+ * 获取module exports
1042
+ * @param id
1043
+ * @returns
964
1044
  */
965
- constructor();
1045
+ getModuleExports(id: string): any;
966
1046
  /**
967
- * 安装module
1047
+ * expose require方法
1048
+ * @param name
1049
+ * @param global
1050
+ * @param debug
1051
+ * @returns
968
1052
  */
969
- setModule(id: string, exports: Record<string, any> | {
970
- (): Record<string, any>;
971
- }): void;
1053
+ exposeRequire(name?: string, global?: any, debug?: boolean): boolean;
972
1054
  /**
973
- * 移除module
1055
+ * reslove resource
974
1056
  */
975
- removeModule(id: string): void;
1057
+ private resloveResource;
976
1058
  /**
977
1059
  * 加载
978
1060
  * @params args
979
1061
  */
980
- ensure(...args: any[]): Require;
1062
+ ensure(...args: [...any[]] | [...any[], RequireMountedCallback]): Promise<any[]>;
981
1063
  /**
982
1064
  * 卸载
983
1065
  */
984
- remove(...args: any): Require;
1066
+ remove(...args: [...any[]] | [...any[], RequireUnMountedCallback]): Promise<boolean>;
985
1067
  /**
986
1068
  * 加载
987
1069
  *
@@ -1004,6 +1086,13 @@ declare class Require {
1004
1086
  * @param point
1005
1087
  */
1006
1088
  private mountJS;
1089
+ /**
1090
+ * 加载cjs
1091
+ *
1092
+ * @param chain
1093
+ * @param task
1094
+ */
1095
+ private mountCJS;
1007
1096
  /**
1008
1097
  * 卸载资源
1009
1098
  */
@@ -1015,38 +1104,72 @@ declare class Require {
1015
1104
  /**
1016
1105
  * 创建define函数
1017
1106
  * @param module
1107
+ * @param requireLoad
1018
1108
  * @param task
1019
1109
  * @returns
1020
1110
  */
1021
1111
  private createDefine;
1022
1112
  /**
1023
- * 解析路径
1113
+ * 创建require 加载函数
1114
+ * @returns
1115
+ */
1116
+ private createRequireLoad;
1117
+ /**
1118
+ * 构建资源uri
1024
1119
  * @param uri
1025
1120
  * @returns
1026
1121
  */
1027
- private resolvePath;
1122
+ private constructResourceUri;
1028
1123
  /**
1029
1124
  * 创建search字符串
1030
1125
  */
1031
1126
  private createSearch;
1032
1127
  /**
1033
- * 获取文件名后缀
1128
+ * 获取资源路径的后缀
1034
1129
  * @param name
1035
- * @returns {string}
1036
- */
1037
- private getFileNamePostfix;
1038
- /**
1039
- * 是否为不处理的路径
1040
- * @param uri
1041
- * @return
1042
- */
1043
- private isNaturePath;
1044
- /**
1045
- * 解析路径
1046
- * @param uri
1047
- * @param replace
1130
+ * @returns
1048
1131
  */
1049
- private parserPath;
1132
+ private getResourcePathSuffix;
1133
+ }
1134
+
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
+ }
1162
+
1163
+ /**
1164
+ * 资源类型
1165
+ */
1166
+ declare type RequireResourceType = 'js' | 'css';
1167
+
1168
+ /**
1169
+ * require unmount callback
1170
+ */
1171
+ declare interface RequireUnMountedCallback {
1172
+ (): void;
1050
1173
  }
1051
1174
 
1052
1175
  declare const _resolveComponent: unique symbol;
@@ -1098,9 +1221,7 @@ export declare class Route {
1098
1221
  /**
1099
1222
  * 获取匹配的元数组列表
1100
1223
  */
1101
- matched?: {
1102
- meta: Record<string | number | symbol, any>;
1103
- }[];
1224
+ matched?: Array<Route>;
1104
1225
  /**
1105
1226
  * route本身的元数据
1106
1227
  */
@@ -1165,12 +1286,13 @@ export declare class Route {
1165
1286
  */
1166
1287
  static isSame(x: Route, y: Route): boolean;
1167
1288
  /**
1168
- * 判断路由对应的route model是否一致
1289
+ * 判断路由路径是一致
1290
+ * route.name 一致 or route.path一致
1169
1291
  * @param x
1170
1292
  * @param y
1171
1293
  * @returns
1172
1294
  */
1173
- static isSameForRouteModel(x: Route, y: Route): boolean;
1295
+ static isSamePathForRoute(x: Route | null, y: Route | null): boolean;
1174
1296
  /**
1175
1297
  * 由对象生成路由
1176
1298
  * @param obj
@@ -1241,6 +1363,14 @@ declare class RouteModel {
1241
1363
  * 名称
1242
1364
  */
1243
1365
  name?: string;
1366
+ /**
1367
+ * 元数据
1368
+ */
1369
+ meta?: Record<string | number | symbol, any>;
1370
+ /**
1371
+ * matched routes 当前路由及其所有父路由的匹配记录
1372
+ */
1373
+ matchedRoutes?: Array<Route>;
1244
1374
  /**
1245
1375
  * layer集合
1246
1376
  */
@@ -1327,9 +1457,9 @@ export declare class Router {
1327
1457
  /**
1328
1458
  * 获取当前最新route
1329
1459
  */
1330
- get currentRoute(): Readonly<Ref<{
1460
+ get currentRoute(): Readonly< Ref<{
1331
1461
  readonly path?: string | undefined;
1332
- readonly fullPath?: string;
1462
+ readonly fullPath?: string | undefined;
1333
1463
  readonly alias?: string | undefined;
1334
1464
  readonly name?: string | undefined;
1335
1465
  readonly root?: string | undefined;
@@ -1342,11 +1472,46 @@ export declare class Router {
1342
1472
  readonly traceless?: boolean | undefined;
1343
1473
  readonly template?: string | undefined;
1344
1474
  readonly matched?: readonly {
1345
- readonly meta: {
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?: {
1346
1490
  readonly [x: string]: any;
1347
1491
  readonly [x: number]: any;
1348
1492
  readonly [x: symbol]: any;
1349
- };
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;
1350
1515
  }[] | undefined;
1351
1516
  readonly meta?: {
1352
1517
  readonly [x: string]: any;
@@ -1376,7 +1541,7 @@ export declare class Router {
1376
1541
  } | undefined;
1377
1542
  } | null, {
1378
1543
  readonly path?: string | undefined;
1379
- readonly fullPath?: string;
1544
+ readonly fullPath?: string | undefined;
1380
1545
  readonly alias?: string | undefined;
1381
1546
  readonly name?: string | undefined;
1382
1547
  readonly root?: string | undefined;
@@ -1389,11 +1554,46 @@ export declare class Router {
1389
1554
  readonly traceless?: boolean | undefined;
1390
1555
  readonly template?: string | undefined;
1391
1556
  readonly matched?: readonly {
1392
- readonly meta: {
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?: {
1393
1563
  readonly [x: string]: any;
1394
1564
  readonly [x: number]: any;
1395
1565
  readonly [x: symbol]: any;
1396
- };
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;
1397
1597
  }[] | undefined;
1398
1598
  readonly meta?: {
1399
1599
  readonly [x: string]: any;
@@ -1438,6 +1638,10 @@ export declare class Router {
1438
1638
  * 初始化
1439
1639
  */
1440
1640
  init(): void;
1641
+ /**
1642
+ * 销毁
1643
+ */
1644
+ destroy(): void;
1441
1645
  /**
1442
1646
  * 第一次导航是否完成
1443
1647
  */
@@ -1637,7 +1841,7 @@ export declare class Router {
1637
1841
  * @param term
1638
1842
  * @param changeHistory
1639
1843
  */
1640
- remove(term?: any, changeHistory?: boolean): Promise<boolean>;
1844
+ remove(term?: RemoveRouteCondition, changeHistory?: boolean): Promise<boolean>;
1641
1845
  /**
1642
1846
  * 路由跳转(operation类型为Open)
1643
1847
  * @param args
@@ -1844,6 +2048,82 @@ declare interface RouterHistory {
1844
2048
  setRestorePoint(routes?: Array<Route>): void;
1845
2049
  }
1846
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
+
1847
2127
  /**
1848
2128
  * router options
1849
2129
  */
@@ -1876,11 +2156,371 @@ export declare interface RouterOptions {
1876
2156
  notFoundPath?: string;
1877
2157
  }
1878
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
+
1879
2519
  declare const routeSessionCacheKey: unique symbol;
1880
2520
 
1881
2521
  declare const routeUpdatedCallback: unique symbol;
1882
2522
 
1883
- export declare const sessionKey: unique symbol;
2523
+ declare const sessionKey: unique symbol;
1884
2524
 
1885
2525
  /**
1886
2526
  * shallow reactive state
@@ -1960,7 +2600,6 @@ declare interface Storage_2 {
1960
2600
  */
1961
2601
  removeItem(key: string): void;
1962
2602
  }
1963
- export { Storage_2 as Storage }
1964
2603
 
1965
2604
  declare const successFnsKey: unique symbol;
1966
2605
 
@@ -1992,7 +2631,7 @@ export declare const toTypeString: (value: unknown) => string;
1992
2631
  /**
1993
2632
  * 过渡属性
1994
2633
  */
1995
- export declare type TransitionProp = {
2634
+ declare type TransitionProp = {
1996
2635
  (route: Route, index: number): CustomTransition | boolean;
1997
2636
  } | CustomTransition | boolean;
1998
2637
 
@@ -2140,37 +2779,38 @@ declare enum UpdateType {
2140
2779
 
2141
2780
  /**
2142
2781
  * Returns the global bus
2143
- * @param proxy
2782
+ * @param contextRelationKey 上下文关联key
2144
2783
  * @returns
2145
2784
  */
2146
- export declare function useBus(proxy?: Proxy_2): BusInterface;
2785
+ export declare function useBus(contextRelationKey?: FoxContextRelationKey): BusInterface | null;
2147
2786
 
2148
2787
  /**
2149
2788
  * Returns the global event proxy
2150
- * @param proxy
2151
2789
  * @returns
2152
2790
  */
2153
- export declare function useEventProxy(proxy?: Proxy_2): EventProxy;
2791
+ export declare function useEventProxy(contextRelationKey?: FoxContextRelationKey): EventProxy | null;
2154
2792
 
2155
2793
  /**
2156
2794
  * Returns the current fox
2157
- * @param proxy
2795
+ * @param contextRelationKey 上下文关联key
2796
+ *
2158
2797
  * @returns
2159
2798
  */
2160
- export declare function useFox(proxy?: Proxy_2): Fox;
2799
+ export declare function useFox(contextRelationKey?: FoxContextRelationKey): Fox | null;
2161
2800
 
2162
2801
  /**
2163
2802
  * Returns the current route
2164
- * @param proxy
2803
+ * @param 上下文关联key
2165
2804
  * @returns
2166
2805
  */
2167
- export declare function useRoute(proxy?: Proxy_2): Route | null;
2806
+ export declare function useRoute(contextRelationKey?: FoxContextRelationKey): Route | null;
2168
2807
 
2169
2808
  /**
2170
2809
  * Returns the current router
2810
+ * @param 上下文关联key
2171
2811
  * @returns
2172
2812
  */
2173
- export declare function useRouter(proxy?: Proxy_2): Router;
2813
+ export declare function useRouter(contextRelationKey?: FoxContextRelationKey): Router | null;
2174
2814
 
2175
2815
  declare const valueKey: unique symbol;
2176
2816
 
@@ -2250,4 +2890,14 @@ declare class ViewPlace {
2250
2890
  static include(list: ViewPlace[], viewPlace: ViewPlace): boolean;
2251
2891
  }
2252
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
+
2253
2903
  export { }