-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
447 lines (280 loc) · 9.87 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
/** Declaration file generated by dts-gen */
import { Model } from "ui-data";
import JQuery from 'jquery';
type mainFn = (scope: any, view: fn.View) => void;
type registerFn = (scope: any) => void;
export const config: {
singlePageBaseUrl: string;
singlePageViewParent: string;
tabIndexAttributeName: string;
uiNameAttributeName: string;
viewIndexAttributeName: string;
viewStatusAttributeName: string;
viewUrlAttributeName: string;
viewTitleAttributeName: string;
viewLoadedAttributeName: string;
viewNameAttributeName: string;
};
export const messages: {
notFoundFullUrl: string;
notFoundUrlPattern: string;
notFoundviewName: string;
unknownError: string;
};
export const constants: {
VIEW_LOADED_TRUE: string;
VIEW_LOADED_FALSE: string;
VIEW_LOADED_ERROR: string;
VIEW_STATUS_INIT: string;
VIEW_STATUS_READY: string;
VIEW_STATUS_SHOW: string;
VIEW_STATUS_HIDDEN: string;
VIEW_STATUS_DESTROY: string;
};
export function app(): void;
export function utils(): void;
export namespace app {
/**
* @description 加载视图
* @param {string} url URL字符串
*/
function loadView(url: any): void;
/**
* @description 替换视图
* @param {string} url URL字符串
*/
function replaceView(url: any): void;
/**
* @description 返回到之前的视图
* @param {string} url URL字符串
*/
function popView(url: any): void;
/**
* @description 加载视图并添加到堆栈顶部
* @param {string} url URL字符串
*/
function pushView(url: any): void;
/**
* @description 显示错误信息
* @param {string} message
*/
function showError(message: any): void;
/**
* @description 显示信息
* @param {string} message
*/
function showMessage(message: any): void;
/**
* @description 注册视图主函数
* @param {string} viewName
* @param {function} mainFn
*/
function viewMain(viewName: any, mainFn: mainFn): void;
/**
* @description 初始视图作用域
* @param {string} viewName
* @param {function} registerFn
*/
function viewScope(viewName: any, registerFn: registerFn): void;
}
export namespace fn {
class AjaxCallService {
constructor(sourceElement: any);
beforeSend(jqXHR: any, settings: any): void;
callService(url: any, data: any, opts: any): AjaxResult;
convertData(data: any, opts: any): any;
}
class AjaxResult {
constructor(deferred: any, sourceElement: any);
doHandleResult(doneFn: any, failFn: any, showMask: any): AjaxResult;
thenResult(doneFn: any, failFn: any): AjaxResult;
waitResult(doneFn: any, failFn: any): AjaxResult;
static handleAjaxError(sourceElement: any, jqXHR: any, textStatus: any, errorThrown: any): void;
}
class SequenceGenerator {
constructor(initValue: any, ...args: any[]);
nextValue(): any;
}
class View {
constructor(viewElement: any, viewInfo: any, viewScope: any);
$find(...args: any[]): JQuery;
$ui(name: any): JQuery;
callService(url: any, data: any, opts: any): AjaxResult;
getDataModel(): Model;
getUrlParam(name: any): any;
getUrlParams(): any;
getViewElement(): any;
getViewInfo(): ViewInfo;
getViewScope(): any;
}
class ViewInfo {
constructor();
getFullUrl(): any;
getUrlPattern(): any;
getViewName(): any;
setFullUrl(fullUrl: any): void;
setUrlPattern(urlPattern: any): void;
setViewName(viewName: any): void;
}
class LoadedViewHolder {
constructor(loadedView: any);
getViewObject(): View;
getViewScope(): any;
setViewToShow(): void;
setViewToHide(): void;
getViewScopePropValue(propName: any): any;
setViewScopePropValue(propName: any, propValue: any): void;
getDomElementAttrValue(attrName: any): any;
setDomElementAttrValue(attrName: any, attrValue: any): void;
}
class ViewLoader {
constructor(targetElement: any, callbackFn: any);
initViewAfterRender(): void;
loadView(url: any): void;
preRenderView(url: any, data: any, textStatus: any, jqXHR: any): boolean;
renderView(url: any, data: any, textStatus: any, jqXHR: any): void;
static lastViewInfo: {
};
}
class ViewMask {
constructor(viewElement: any);
hiddenMask(): void;
showMask(): void;
}
class ViewResponse {
constructor(url: any, jqXHR: any);
getViewInfo(): ViewInfo;
}
function Ajax(): void;
function App(): void;
function AppAlertMessages(): void;
function BrowserUrl(): void;
function BrowserTitle(): void;
function Global(): void;
function UrlParser(): void;
function Utils(): void;
function ViewManager(): void;
function ViewScopeManager(): void;
namespace Ajax {
function callService(url: any, data: any, opts: any): AjaxResult;
}
namespace App {
function loadView(url: any): void;
function replaceView(url: any): void;
function popView(url: any): void;
function pushView(url: any): void;
function showError(message: any): void;
function showMessage(message: any): void;
function viewMain(viewName: any, mainFn: mainFn): void;
function viewScope(viewName: any, registerFn: registerFn): void;
}
namespace AppAlertMessages {
function showError(message: any): void;
function showMessage(message: any): void;
}
namespace BrowserUrl {
function getBrowserUrl(viewUrl: any): any;
function getFullUrl(relativeUrl: any): any;
function setBrowserUrl(viewUrl: any): void;
function setLocationUrl(newUrl: any): void;
}
namespace BrowserUrl {
function setBrowserTitle(viewTitle: any): void;
}
namespace Global {
const config: {
singlePageBaseUrl: string;
singlePageViewParent: string;
tabIndexAttributeName: string;
uiNameAttributeName: string;
viewIndexAttributeName: string;
viewStatusAttributeName: string;
viewUrlAttributeName: string;
viewTitleAttributeName: string;
viewLoadedAttributeName: string;
viewNameAttributeName: string;
};
const messages: {
notFoundFullUrl: string;
notFoundUrlPattern: string;
notFoundviewName: string;
unknownError: string;
};
const constants: {
VIEW_LOADED_TRUE: string;
VIEW_LOADED_FALSE: string;
VIEW_LOADED_ERROR: string;
VIEW_STATUS_INIT: string;
VIEW_STATUS_READY: string;
VIEW_STATUS_SHOW: string;
VIEW_STATUS_HIDDEN: string;
VIEW_STATUS_DESTROY: string;
};
}
namespace UrlParser {
function parseAllParams(fullUrl: any, urlPattern: any): any;
function parsePathParams(fullUrl: any, urlPattern: any): any;
function parseQueryParams(fullUrl: any): any;
}
namespace Utils {
function concatObjects(...objectArray: any[]): any;
function concatObjectsWithOption(skipUndefinedProperties: boolean, ...objectArray: any[]): any;
function convertToString(arg: any): any;
function emptyArrayIfNullOrUndefined(arg: any): any;
function emptyObjectIfNullOrUndefined(arg: any): any;
function emptyStringIfNullOrUndefined(arg: any): any;
function formatString(format: any, ...objectArray: any[]): any;
function isFunction(arg: any): any;
function isNotEmptyObject(arg: any): any;
function isNotEmptyString(arg: any): any;
function isNullOrUndefined(arg: any): any;
function isNumber(arg: any): any;
function isObject(arg: any): any;
function isString(arg: any): any;
}
namespace ViewLoader {
namespace elementIdSuffixGenerator {
function nextValue(): any;
}
namespace viewIndexSuffixGenerator {
function nextValue(): any;
}
}
namespace ViewManager {
const currentTab: {
tabIndex: string;
};
function stopViewLifecycle(viewElement: any): void;
function doRenderView(url: any, afterRenderFn: any): void;
function startViewLifecycle(viewElement: any): void;
function loadView(url: any): void;
function replaceView(url: any): void;
function hiddenView(viewElement: any): void;
function popView(url: any): void;
function pushView(url: any): void;
function showView(viewElement: any): void;
}
namespace ViewScopeManager {
const viewScopes: {
};
function getViewScope(viewName: any, allowCreate: boolean): any;
function removeViewScope(viewName: any): void;
function setViewScope(viewName: any, viewScope: any): void;
}
}
export namespace utils {
function concatObjects(...objectArray: any[]): any;
function concatObjectsWithOption(skipUndefinedProperties: boolean, ...objectArray: any[]): any;
function convertToString(arg: any): any;
function emptyArrayIfNullOrUndefined(arg: any): any;
function emptyObjectIfNullOrUndefined(arg: any): any;
function emptyStringIfNullOrUndefined(arg: any): any;
function formatString(format: any, ...objectArray: any[]): any;
function isFunction(arg: any): any;
function isNotEmptyObject(arg: any): any;
function isNotEmptyString(arg: any): any;
function isNullOrUndefined(arg: any): any;
function isNumber(arg: any): any;
function isObject(arg: any): any;
function isString(arg: any): any;
}