knight-web 2.0.15 → 2.0.16

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.
@@ -33,5 +33,4 @@ export declare class Knight {
33
33
  private _navgation;
34
34
  /** 构造函数 */
35
35
  private constructor();
36
- private OnRenderer;
37
36
  }
@@ -7,17 +7,23 @@ export declare class Navgation {
7
7
  /** 注册导航
8
8
  * @param option 导航配置
9
9
  */
10
- static OnRegist(path: string): Function;
10
+ static OnRegist(path: string, authority?: boolean): Function;
11
11
  /** 根容器 */
12
12
  private htmlRoot;
13
13
  /** 渲染器 */
14
14
  private renderer;
15
- /** 当前元素 */
16
- private curElement;
15
+ /** 鉴权函数 */
16
+ private Evt_AuthorityFunction;
17
17
  /** 构造函数 */
18
18
  constructor();
19
+ /** 获取默认配置 */
20
+ private OnGetDefaultOption;
21
+ /** 设置鉴权函数 */
22
+ OnSetAuthority(authorityFunction: () => Promise<boolean>): void;
19
23
  /** 导航变更 */
20
24
  private OnChange;
25
+ /** 性能分析 */
26
+ private OnProfilerRender;
21
27
  /** 整合路由 */
22
28
  private OnConcat;
23
29
  /** 导航 */
@@ -46,16 +52,13 @@ export interface ISearchParams {
46
52
  }
47
53
  /** 导航配置 */
48
54
  export interface NavgationOption {
49
- /** 路径(格式:aaa/bbb/ccc) */
55
+ /** 路径
56
+ * 格式:/main/login
57
+ * 注意必须加/
58
+ */
50
59
  path?: string;
60
+ /** 路由鉴权 */
61
+ authority: boolean;
51
62
  /** 组件类型 */
52
63
  type?: InterfaceUtility.IType<AbstractObject>;
53
64
  }
54
- export interface NavgationConfig {
55
- /** 配置 */
56
- option?: NavgationOption;
57
- /** 参数 */
58
- params?: {
59
- [key: string]: any;
60
- };
61
- }
@@ -69,95 +69,6 @@ export declare namespace BrowserUtility {
69
69
  /** 替换状态 */
70
70
  replaceState(_state: any, _title: string, _url?: string | URL | null): void;
71
71
  }
72
- /** 路由Search参数 */
73
- export interface ISearchParams {
74
- key: string;
75
- value: string;
76
- }
77
- /** 历史事件池 */
78
- export class HistoryEventsPool {
79
- /** 处理函数 */
80
- private _handlers;
81
- constructor();
82
- Push(_fn: Function): Function;
83
- Call(_location: Location): void;
84
- }
85
- /** 历史记录刷新模式 */
86
- export enum E_HistoryUpdateType {
87
- /** 只要路由变更刷新 */
88
- All = 0,
89
- /** PathName变更刷新 */
90
- PathName = 1,
91
- /** PathName|Search变更刷新 */
92
- PathNameOrSearch = 2,
93
- /** PathName|Hash变更刷新 */
94
- PathNameOrHash = 3
95
- }
96
- /** 浏览器历史记录设置 */
97
- export class BrowserHistory {
98
- /** 监听事件池 */
99
- private _listeners;
100
- /** 历史记录刷新模式 */
101
- HistoryUpdateType: E_HistoryUpdateType;
102
- /** 记录上一个路径 */
103
- private _recordPath;
104
- /** 构造函数 */
105
- constructor();
106
- /** 监听路由变化 */
107
- Listen(_listener: Function): Function;
108
- /** 刷新当前路由 */
109
- Update(): void;
110
- /** 前进 */
111
- Forward(): void;
112
- /** 后退 */
113
- Back(): void;
114
- /** 执行 */
115
- Go(_delta?: number): void;
116
- /**
117
- * 设置路由
118
- * @param _url 设置路由路径(注意:路径前+‘/’)
119
- * @param _searchParams 路径透传参数(key:value数组形式)
120
- * @returns 是否设置成功
121
- */
122
- SetState(_url: string, _searchParams?: Array<{
123
- key: string;
124
- value: any;
125
- }>): boolean;
126
- /** 路由鉴权 */
127
- CheckAuthorityValid(_url: string, _authentications: Array<string>): boolean;
128
- /**
129
- * 设置路由并刷新
130
- * @param _url 设置路由路径(注意:路径前+‘/’)
131
- * @param _keepAlive 是否路径持久储存
132
- * @param _searchParams 路径透传参数(key:value数组形式)
133
- * @returns 是否设置并刷新成功
134
- */
135
- SetStateUpdate(_url: string, _searchParams?: Array<{
136
- key: string;
137
- value: any;
138
- }>): boolean;
139
- /** 获取当前路由路径名 */
140
- GetCurPathName(): string;
141
- /** 获取路由中的参数值 */
142
- Search<T extends object = object>(): T;
143
- }
144
- /** 浏览器本地设置 */
145
- export class BrowserLocation {
146
- /** 本地记录 */
147
- private _location;
148
- /** 构造函数 */
149
- constructor();
150
- /** 整合路由 */
151
- private concat;
152
- /** 打开新窗口 */
153
- open(_url?: string | URL, target?: string, features?: string): boolean;
154
- /** 导航到URL */
155
- assign(_url: string, ..._params: Array<ISearchParams>): void;
156
- /** 重新加载当前页面 */
157
- reload(): void;
158
- /** 从会话历史中删除当前页面并导航到给定的URL */
159
- replace(_url: string, ..._params: Array<ISearchParams>): void;
160
- }
161
72
  /** 路径参数接口 */
162
73
  export interface IPathOptions {
163
74
  /** 路径 */