-
Notifications
You must be signed in to change notification settings - Fork 2
/
typescript.api.d.ts
191 lines (157 loc) · 6.26 KB
/
typescript.api.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
/*--------------------------------------------------------------------------
Copyright (c) 2013 haydn paterson (sinclair). All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------------*/
declare module typescript.api
{
class Diagnostic
{
public type : string;
public path : string;
public text : string;
public message : string;
public line_index : number;
public char_index : number;
public toString() : string;
}
class Import
{
public name : string;
public alias : string;
public limChar : number;
public minChar : number;
}
class ReflectedType
{
public identifier : string;
public name : string;
public scope : string [];
}
class Parameter extends ReflectedType
{
public type : typescript.api.Type;
public isOptional : boolean;
}
class Method extends ReflectedType
{
public parameters : Array<typescript.api.Parameter>;
public returns : typescript.api.Type;
public isPublic : boolean;
public isExported : boolean;
public isStatic : boolean;
public isAccessor : boolean;
public isSignature : boolean;
public isConstructor : boolean;
public isCallMember : boolean;
public isDeclaration : boolean;
public isExpression : boolean;
public isGetAccessor : boolean;
public isSetAccessor : boolean;
public isIndexer : boolean;
public comments : string[];
}
class Type extends ReflectedType
{
public arguments : Array<Type>;
public signature : Method;
public arrayCount : number;
}
class Variable extends ReflectedType
{
public fullname : string;
public type : typescript.api.Type;
public isPublic : boolean;
public isExported : boolean;
public isProperty : boolean;
public isStatic : boolean;
public isStatement : boolean;
public isExpression : boolean;
public isStatementOrExpression : boolean;
public isOptional : boolean;
public comments : string[];
}
class Interface extends ReflectedType
{
public methods : Array<typescript.api.Method>;
public variables : Array<typescript.api.Variable>;
public parameters : Array<string>;
public extends : Array<typescript.api.Type>;
public isExported : boolean;
public comments : string[];
}
class Class extends ReflectedType
{
public methods : Array<typescript.api.Method>;
public variables : Array<typescript.api.Variable>;
public parameters : Array<string>;
public extends : Array<typescript.api.Type>;
public implements : Array<typescript.api.Type>;
public isExported : boolean;
public comments : string[];
}
class Module extends ReflectedType
{
public imports : Array<typescript.api.Import>;
public modules : Array<typescript.api.Module>;
public interfaces : Array<typescript.api.Interface>;
public classes : Array<typescript.api.Class>;
public methods : Array<typescript.api.Method>;
public variables : Array<typescript.api.Variable>;
public isExported : boolean;
}
class Script extends ReflectedType
{
public modules : Array<typescript.api.Module>;
public interfaces : Array<typescript.api.Interface>;
public classes : Array<typescript.api.Class>;
public methods : Array<typescript.api.Method>;
public variables : Array<typescript.api.Variable>;
}
class Unit
{
public path : string;
public content : string;
public diagnostics : Array<typescript.api.Diagnostic>;
public hasError() : boolean;
}
class SourceUnit extends typescript.api.Unit
{
public remote : boolean;
public syntaxChecked : boolean;
public typeChecked : boolean;
}
class CompiledUnit extends typescript.api.Unit
{
public ast : any;
public sourcemap : string;
public declaration : string;
public script : typescript.api.Script;
public references : string[];
}
interface ICompilerOptions {
languageVersion : string;
moduleGenTarget : string;
generateDeclarationFiles : boolean;
mapSourceFiles : boolean;
removeComments : boolean;
noImplicitAny : boolean;
allowBool : boolean;
outputMany : boolean;
}
export function reset (options?:ICompilerOptions) : void;
export function register () : void;
export function check (units : Array<typescript.api.Unit>) : boolean;
export function create (path:string, content:string) : typescript.api.SourceUnit
export function resolve (sources:Array<string>, callback : (units : Array<typescript.api.SourceUnit> ) => void) : void;
export function sort (sourceUnits: Array<typescript.api.SourceUnit>) : Array<typescript.api.SourceUnit>;
export function compile (sourceUnits: Array<typescript.api.SourceUnit>, callback : (compiledUnit:Array<typescript.api.CompiledUnit> )=> void) : void;
export function run (compiledUnits:Array<typescript.api.CompiledUnit>, sandbox:any, callback :{ (context:any): void; }) : void;
}