-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.ts
147 lines (133 loc) · 4.68 KB
/
defs.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
/// <reference path="./Module.ts" />
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;
SetSuperVisor(callback: (url: IUrl) => boolean);
Assemblies: any;
ExecuteModule(success: boolean);
HandleExecution();
}
interface IEnum {
[n: string]: number;
}
declare module "define" {
export var define: $define;
}
declare module "context" {
export var context: IContext;
export function CanAccessToMe(type: string, folder: string, name: string): any;
export function GetPath(path: string): string;
export function NameOf(type: Function): string;
export function GetType(path: string): Function;
export function GetEnum(path: string): IEnum;
export function GetStat(): ModuleStat;
export function OnStat(target: string, stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
export function OnGStat(stat: ModuleStat, callback: (me: string, target: string, cstat: ModuleStat, stat: ModuleStat) => void): any;
export function SetSuperVisor(callback: (url: IUrl) => boolean);
export var Assemblies: any;
function ExecuteModule(success: boolean);
function HandleExecution();
}
declare interface ITemplateModule {
get(name: string): HTMLTemplateElement;
get(i: number): ITemplateModule;
}
interface ilib {
require: $require;
define: $define;
entryPoint: any;
}
declare module "lib:*" {
export var require: $require;
export var define: $define;
export var entryPoint: any;
}
declare module "json|*" {
export function require(path: string, callback: (e) => void, onError: () => void): any;
export var value: any;
}
declare module "html|*" {
const value: any;
export default value;
export function Validate();
export var context: IContext;
}
declare module "style|*" {
export function require(path: string, callback: (e) => void, onError: () => void): any;
export var style: StyleSheet;
export function Validate();
}
declare module "template|*" {
export function require(path: string, callback: (e) => void, onError: () => void): any;
export var template: ITemplateModule;
export function Validate();
export var context: IContext;
}
declare module "plugin|*" {
export var moduleType: ModuleType;
export function addEventListener(stat: string | number, callback: IPluginEventCallback, data: any);
export function removeEventlistenr(stat: string | number, callback: IPluginEventCallback);
}
declare module "xml|*" {
export function require(path: string, callback: (e) => void, onError: () => void): any;
export var xml: XMLDocument;
export function Validate();
}
declare module "code|*" {
export var [s]: any;
}
declare module "|*" {
export var [s]: any
}
declare module "*|?" {
export var moduleType: ModuleType;
export function addEventListener(stat: string, callback: IPluginEventCallback, data: any);
export function removeEventlistenr(stat: string, callback: IPluginEventCallback);
}
declare interface PluginsEvent {
exports: any;
url: IUrl;
data: any;
}
declare interface IEvent {
moduleType: ModuleType;
addEventListener(stat: string, callback: IPluginEventCallback, data: any);
removeEventlistenr(stat: string, callback: IPluginEventCallback);
}
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) => void, onError: () => void): any;
template: ITemplateModule;
Validate();
context: IContext;
}