-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQLoader.d.ts
346 lines (346 loc) · 11 KB
/
QLoader.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
declare var enumProperty: RegExp;
declare var enumPropertyEs6: string;
declare var QReqConfig: any;
declare enum ModuleType {
folder = 9007199254740991,
uknown = -1,
code = 0,
json = 1,
xml = 2,
html = 3,
Image = 4,
template = 5,
style = 6,
none = 7
}
declare enum ModuleExt {
js = 0,
json = 1,
xml = 2,
html = 3,
img = 4,
template = 5,
svg = 6,
ico = 6,
css = 6,
none = 7
}
declare enum ModuleStat {
New = 0,
Downloading = 1,
Downloaded = 2,
Defining = 3,
Defined = 4,
Executing = 5,
Executed = 6,
Failed = 7
}
declare class Map {
public delete(key);
public get(key):any;
public set(key, value);
}
declare namespace System {
interface IRef<T> {
value: T;
}
type IPluginEventCallback = (e: PluginsEvent) => void;
interface PluginsEvent {
exports: any;
url: System.basics.IUrl;
data: any;
}
namespace basics {
interface IUrl extends Url {
moduleType: ModuleType;
IsExternal: boolean;
host: string;
path: string[];
moduleName: string;
ext: string;
isAsset: boolean;
params: string;
getEName(defaultExt?: string): string;
IsInternal: boolean;
FullPath: string;
}
class Url implements IUrl {
IsEquals(url: Url): boolean;
private _directory;
readonly Directory: Url;
readonly ParentDirectory: Url;
PluginName: string;
private _path;
getmoduleType(_default?: ModuleType): ModuleType;
readonly moduleType: ModuleType;
host: string;
moduleName: string;
ext: string;
getEName(defaultExt?: string): string;
setDefaultExt(ext: string): this;
setDefaultType(type: ModuleType): this;
params: string;
IsFolder: boolean;
readonly IsPlugin: boolean;
constructor(url?: string);
toString(): string;
getDirectory(): any;
private fragment;
private _isContextual;
readonly IsContextual: boolean;
private getUrl;
private init;
readonly IsRooted: boolean;
getHost(url: string): void;
getFullHost(url: string): void;
Combine(path: string | Url): Url;
readonly IsExternal: boolean;
readonly isAsset: boolean;
path: string[];
readonly FullPath: string;
SameHostAs(url: Url): boolean;
static RevalidatePath(ary: string[], isFullPath?: boolean): void;
intersect(url: Url): Url;
readonly IsInternal: boolean;
static rootUrl: Url;
}
}
namespace net {
class Header {
private _key;
private _value;
constructor(_key: string, _value: number | string | boolean);
readonly key: string;
readonly value: string;
}
class EventListener {
private key;
private _deleagtes;
private _store;
constructor(key: any);
On: Function;
Off: Function;
private call;
PInvoke(key: any, _this: any, array: any[]): void;
Invok(key: any, callBack: (d: Function) => void): void;
Add(delegate: Function, key: any): void;
Remove(key: any): void;
}
enum ResponseType {
json = 0,
Document = 1,
Text = 2,
ArrayBuffer = 3,
Blob = 4,
"" = 8
}
enum WebRequestMethod {
Get = 0,
Post = 1,
Head = 2,
Put = 3,
Delete = 4,
Options = 5,
Connect = 6
}
class WebRequest {
http: XMLHttpRequest;
_method: WebRequestMethod;
_responseType: ResponseType;
key: Object;
OnComplete: EventListener;
constructor();
method: 0 | WebRequestMethod.Post | WebRequestMethod.Head | WebRequestMethod.Put | WebRequestMethod.Delete | WebRequestMethod.Options | WebRequestMethod.Connect;
ResponseType: ResponseType.Document | ResponseType.Text | ResponseType.ArrayBuffer | ResponseType.Blob | ResponseType.json;
_onprogress(e: any): void;
readonly IsSuccess: boolean;
Download<T>(url: basics.IUrl, data: downloadCallback<T>): void;
readonly Response: any;
}
class downloadCallback<T> {
callback: (http: Downloader, data: downloadCallback<T>) => void;
data: T;
isPrivate?: any;
IsSuccess: boolean;
constructor(callback: (http: Downloader, data: downloadCallback<T>) => void, data: T, isPrivate?: any);
}
class __data<T> {
url: basics.IUrl;
data: downloadCallback<T>;
constructor(url: basics.IUrl, data: downloadCallback<T>);
}
class Downloader {
webr: WebRequest;
quee: __data<any>[];
current: __data<any>;
isRunning: boolean;
isDownloading: boolean;
success: any[];
fails: any[];
OnSuccess: EventListener;
OnFail: EventListener;
OnFinish: EventListener;
constructor();
readonly Request: WebRequest;
DownloadComplete(xmlRequest: any): void;
Push<T>(url: basics.IUrl, data: downloadCallback<T>): void;
Start(): void;
Next(): void;
Restart(): void;
}
}
function checkOverFlow(): any[];
function checkStat(): any[];
function getUnExecuted(): any;
function getUnUnSuccessed(): any;
function getUExecuted(): any;
function collectAssets(): any;
function getCmdCopy(dest: string): any;
}
declare function ValidateImport(...styles: any[]): void;
declare var __extends: any;
declare var exports: any;
declare var __global: {
https: boolean;
supportTemplate: boolean;
useListenerOrMutation: boolean;
ApiServer?: System.basics.Url;
CaseSensitive: boolean;
GetApiAddress(url: string): string;
};
declare var envirenment: {
isBrowser: boolean;
isWebWorker: boolean;
isOpera: boolean;
};
declare function clone<T>(obj: T): T;
declare var $: (selector: any, context: any) => void;
declare var $defineProperty: (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>, onError?: (o: any, p: string, attributes: PropertyDescriptor & ThisType<any>) => any) => any;
declare var $bench: (f: () => any, timeSpan: number) => number;
declare var w: Window;
interface IContext {
context: IContext;
CanAccessToMe(type: string, folder: string, name: string): any;
GetPath(path: string): string;
NameOf(type: Function): string;
GetType(path: string): Function;
GetEnum(path: string): IEnum;
GetStat(): ModuleStat;
OnStat(target: string, stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
OnGStat(stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
Assemblies: any;
}
interface IEnum {
[n: string]: number;
}
declare module "define" {
var define: $define;
}
declare module "context" {
var context: IContext;
function CanAccessToMe(type: string, folder: string, name: string): any;
function GetPath(path: string): string;
function NameOf(type: Function): string;
function GetType(path: string): Function;
function GetEnum(path: string): IEnum;
function GetStat(): ModuleStat;
function OnStat(target: string, stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
function OnGStat(stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
var Assemblies: any;
}
declare interface ITemplateModule {
get(name: string): HTMLTemplateElement;
get(i: number): ITemplateModule;
}
interface ilib {
require: $require;
define: $define;
entryPoint: any;
}
declare module "lib:*" {
var require: $require;
var define: $define;
var entryPoint: any;
}
declare module "json|*" {
function require(path: string, callback: (e: any) => void, onError: () => void): any;
var value: any;
}
declare module "html|*" {
const value: any;
export default value;
function Validate(): any;
var context: IContext;
}
declare module "style|*" {
function require(path: string, callback: (e: any) => void, onError: () => void): any;
var style: StyleSheet;
function Validate(): any;
}
declare module "template|*" {
function require(path: string, callback: (e: any) => void, onError: () => void): any;
var template: ITemplateModule;
function Validate(): any;
var context: IContext;
}
declare module "plugin|*" {
var moduleType: ModuleType;
function addEventListener(stat: string | number, callback: IPluginEventCallback, data: any): any;
function removeEventlistenr(stat: string | number, callback: IPluginEventCallback): any;
}
declare module "xml|*" {
function require(path: string, callback: (e: any) => void, onError: () => void): any;
var xml: XMLDocument;
function Validate(): any;
}
declare module "code|*" {
var s: any;
}
declare module "|*" {
var s: any;
}
declare module "*|?" {
var moduleType: ModuleType;
function addEventListener(stat: string, callback: IPluginEventCallback, data: any): any;
function removeEventlistenr(stat: string, callback: IPluginEventCallback): any;
}
declare interface PluginsEvent {
exports: any;
url: IUrl;
data: any;
}
declare interface IEvent {
moduleType: ModuleType;
addEventListener(stat: string, callback: IPluginEventCallback, data: any): any;
removeEventlistenr(stat: string, callback: IPluginEventCallback): any;
}
declare interface IUrl {
moduleType: ModuleType;
IsExternal: boolean;
host: string;
path: string[];
moduleName: string;
ext: string;
isAsset: boolean;
params: string;
getEName(defaultExt?: string): string;
IsInternal: boolean;
FullPath: string;
toString(): string;
}
declare type IPluginEventCallback = (e: PluginsEvent) => void;
declare interface ITemplateExport {
require: (m: any) => void;
template: ITemplateModule;
html: HTMLElement;
context: IContext;
}
declare type $define = (path: string, dependencies: string[], module: (...args: string[]) => void) => void;
declare type $require = (modules: string, onsuccss?: (result: any) => void, onerror?: (result: any) => void, context?: any) => any;
declare var require: $require;
interface ITemplatePlugin {
require(path: string, callback: (e: any) => void, onError: () => void): any;
template: ITemplateModule;
Validate(): any;
context: IContext;
}