typescript-src 1.0.1.2 → 1.4.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +21 -21
  3. data/CHANGES.md +14 -11
  4. data/Gemfile +7 -7
  5. data/README.md +38 -35
  6. data/Rakefile +24 -21
  7. data/lib/typescript-src.rb +64 -52
  8. data/lib/typescript-src/support/typescript/.npmignore +7 -12
  9. data/lib/typescript-src/support/typescript/CONTRIBUTING.md +74 -0
  10. data/lib/typescript-src/support/typescript/README.md +78 -0
  11. data/lib/typescript-src/support/typescript/ThirdPartyNoticeText.txt +10 -60
  12. data/lib/typescript-src/support/typescript/bin/lib.core.d.ts +1164 -0
  13. data/lib/typescript-src/support/typescript/bin/lib.core.es6.d.ts +4801 -0
  14. data/lib/typescript-src/support/typescript/bin/lib.d.ts +12097 -12836
  15. data/lib/typescript-src/support/typescript/bin/lib.dom.d.ts +13043 -0
  16. data/lib/typescript-src/support/typescript/bin/lib.es6.d.ts +17195 -0
  17. data/lib/typescript-src/support/typescript/bin/lib.scriptHost.d.ts +38 -0
  18. data/lib/typescript-src/support/typescript/bin/lib.webworker.d.ts +1652 -0
  19. data/lib/typescript-src/support/typescript/bin/tsc +2 -2
  20. data/lib/typescript-src/support/typescript/bin/tsc.js +17276 -61916
  21. data/lib/typescript-src/support/typescript/bin/typescript.d.ts +1849 -0
  22. data/lib/typescript-src/support/typescript/bin/typescriptServices.d.ts +1849 -0
  23. data/lib/typescript-src/support/typescript/bin/typescriptServices.js +26273 -0
  24. data/lib/typescript-src/support/typescript/bin/typescriptServices_internal.d.ts +258 -0
  25. data/lib/typescript-src/support/typescript/bin/typescript_internal.d.ts +258 -0
  26. data/lib/typescript-src/support/typescript/package.json +69 -61
  27. data/lib/typescript-src/version.rb +4 -4
  28. data/test/test_type_script_src.rb +35 -35
  29. data/typescript-src.gemspec +22 -22
  30. metadata +16 -26
  31. data/lib/typescript-src/support/typescript/README.txt +0 -27
  32. data/lib/typescript-src/support/typescript/bin/resources/cs/cz/diagnosticMessages.generated.json +0 -374
  33. data/lib/typescript-src/support/typescript/bin/resources/cs/diagnosticMessages.generated.json +0 -374
  34. data/lib/typescript-src/support/typescript/bin/resources/cz/diagnosticMessages.generated.json +0 -374
  35. data/lib/typescript-src/support/typescript/bin/resources/de/diagnosticMessages.generated.json +0 -374
  36. data/lib/typescript-src/support/typescript/bin/resources/diagnosticMessages.generated.json +0 -374
  37. data/lib/typescript-src/support/typescript/bin/resources/en/diagnosticMessages.generated.json +0 -374
  38. data/lib/typescript-src/support/typescript/bin/resources/en/us/diagnosticMessages.generated.json +0 -374
  39. data/lib/typescript-src/support/typescript/bin/resources/es/diagnosticMessages.generated.json +0 -374
  40. data/lib/typescript-src/support/typescript/bin/resources/fr/diagnosticMessages.generated.json +0 -374
  41. data/lib/typescript-src/support/typescript/bin/resources/it/diagnosticMessages.generated.json +0 -374
  42. data/lib/typescript-src/support/typescript/bin/resources/ja/diagnosticMessages.generated.json +0 -374
  43. data/lib/typescript-src/support/typescript/bin/resources/ja/jp/diagnosticMessages.generated.json +0 -374
  44. data/lib/typescript-src/support/typescript/bin/resources/ko/diagnosticMessages.generated.json +0 -374
  45. data/lib/typescript-src/support/typescript/bin/resources/ko/kr/diagnosticMessages.generated.json +0 -374
  46. data/lib/typescript-src/support/typescript/bin/resources/pl/diagnosticMessages.generated.json +0 -374
  47. data/lib/typescript-src/support/typescript/bin/resources/pt/br/diagnosticMessages.generated.json +0 -374
  48. data/lib/typescript-src/support/typescript/bin/resources/pt/diagnosticMessages.generated.json +0 -374
  49. data/lib/typescript-src/support/typescript/bin/resources/ru/diagnosticMessages.generated.json +0 -374
  50. data/lib/typescript-src/support/typescript/bin/resources/tr/diagnosticMessages.generated.json +0 -374
  51. data/lib/typescript-src/support/typescript/bin/resources/zh/cn/diagnosticMessages.generated.json +0 -373
  52. data/lib/typescript-src/support/typescript/bin/resources/zh/tw/diagnosticMessages.generated.json +0 -373
  53. data/lib/typescript-src/support/typescript/bin/typescript.js +0 -61516
@@ -0,0 +1,1849 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+ declare module ts {
17
+ interface Map<T> {
18
+ [index: string]: T;
19
+ }
20
+ interface TextRange {
21
+ pos: number;
22
+ end: number;
23
+ }
24
+ const enum SyntaxKind {
25
+ Unknown = 0,
26
+ EndOfFileToken = 1,
27
+ SingleLineCommentTrivia = 2,
28
+ MultiLineCommentTrivia = 3,
29
+ NewLineTrivia = 4,
30
+ WhitespaceTrivia = 5,
31
+ NumericLiteral = 6,
32
+ StringLiteral = 7,
33
+ RegularExpressionLiteral = 8,
34
+ NoSubstitutionTemplateLiteral = 9,
35
+ TemplateHead = 10,
36
+ TemplateMiddle = 11,
37
+ TemplateTail = 12,
38
+ OpenBraceToken = 13,
39
+ CloseBraceToken = 14,
40
+ OpenParenToken = 15,
41
+ CloseParenToken = 16,
42
+ OpenBracketToken = 17,
43
+ CloseBracketToken = 18,
44
+ DotToken = 19,
45
+ DotDotDotToken = 20,
46
+ SemicolonToken = 21,
47
+ CommaToken = 22,
48
+ LessThanToken = 23,
49
+ GreaterThanToken = 24,
50
+ LessThanEqualsToken = 25,
51
+ GreaterThanEqualsToken = 26,
52
+ EqualsEqualsToken = 27,
53
+ ExclamationEqualsToken = 28,
54
+ EqualsEqualsEqualsToken = 29,
55
+ ExclamationEqualsEqualsToken = 30,
56
+ EqualsGreaterThanToken = 31,
57
+ PlusToken = 32,
58
+ MinusToken = 33,
59
+ AsteriskToken = 34,
60
+ SlashToken = 35,
61
+ PercentToken = 36,
62
+ PlusPlusToken = 37,
63
+ MinusMinusToken = 38,
64
+ LessThanLessThanToken = 39,
65
+ GreaterThanGreaterThanToken = 40,
66
+ GreaterThanGreaterThanGreaterThanToken = 41,
67
+ AmpersandToken = 42,
68
+ BarToken = 43,
69
+ CaretToken = 44,
70
+ ExclamationToken = 45,
71
+ TildeToken = 46,
72
+ AmpersandAmpersandToken = 47,
73
+ BarBarToken = 48,
74
+ QuestionToken = 49,
75
+ ColonToken = 50,
76
+ EqualsToken = 51,
77
+ PlusEqualsToken = 52,
78
+ MinusEqualsToken = 53,
79
+ AsteriskEqualsToken = 54,
80
+ SlashEqualsToken = 55,
81
+ PercentEqualsToken = 56,
82
+ LessThanLessThanEqualsToken = 57,
83
+ GreaterThanGreaterThanEqualsToken = 58,
84
+ GreaterThanGreaterThanGreaterThanEqualsToken = 59,
85
+ AmpersandEqualsToken = 60,
86
+ BarEqualsToken = 61,
87
+ CaretEqualsToken = 62,
88
+ Identifier = 63,
89
+ BreakKeyword = 64,
90
+ CaseKeyword = 65,
91
+ CatchKeyword = 66,
92
+ ClassKeyword = 67,
93
+ ConstKeyword = 68,
94
+ ContinueKeyword = 69,
95
+ DebuggerKeyword = 70,
96
+ DefaultKeyword = 71,
97
+ DeleteKeyword = 72,
98
+ DoKeyword = 73,
99
+ ElseKeyword = 74,
100
+ EnumKeyword = 75,
101
+ ExportKeyword = 76,
102
+ ExtendsKeyword = 77,
103
+ FalseKeyword = 78,
104
+ FinallyKeyword = 79,
105
+ ForKeyword = 80,
106
+ FunctionKeyword = 81,
107
+ IfKeyword = 82,
108
+ ImportKeyword = 83,
109
+ InKeyword = 84,
110
+ InstanceOfKeyword = 85,
111
+ NewKeyword = 86,
112
+ NullKeyword = 87,
113
+ ReturnKeyword = 88,
114
+ SuperKeyword = 89,
115
+ SwitchKeyword = 90,
116
+ ThisKeyword = 91,
117
+ ThrowKeyword = 92,
118
+ TrueKeyword = 93,
119
+ TryKeyword = 94,
120
+ TypeOfKeyword = 95,
121
+ VarKeyword = 96,
122
+ VoidKeyword = 97,
123
+ WhileKeyword = 98,
124
+ WithKeyword = 99,
125
+ ImplementsKeyword = 100,
126
+ InterfaceKeyword = 101,
127
+ LetKeyword = 102,
128
+ PackageKeyword = 103,
129
+ PrivateKeyword = 104,
130
+ ProtectedKeyword = 105,
131
+ PublicKeyword = 106,
132
+ StaticKeyword = 107,
133
+ YieldKeyword = 108,
134
+ AnyKeyword = 109,
135
+ BooleanKeyword = 110,
136
+ ConstructorKeyword = 111,
137
+ DeclareKeyword = 112,
138
+ GetKeyword = 113,
139
+ ModuleKeyword = 114,
140
+ RequireKeyword = 115,
141
+ NumberKeyword = 116,
142
+ SetKeyword = 117,
143
+ StringKeyword = 118,
144
+ TypeKeyword = 119,
145
+ QualifiedName = 120,
146
+ ComputedPropertyName = 121,
147
+ TypeParameter = 122,
148
+ Parameter = 123,
149
+ Property = 124,
150
+ Method = 125,
151
+ Constructor = 126,
152
+ GetAccessor = 127,
153
+ SetAccessor = 128,
154
+ CallSignature = 129,
155
+ ConstructSignature = 130,
156
+ IndexSignature = 131,
157
+ TypeReference = 132,
158
+ FunctionType = 133,
159
+ ConstructorType = 134,
160
+ TypeQuery = 135,
161
+ TypeLiteral = 136,
162
+ ArrayType = 137,
163
+ TupleType = 138,
164
+ UnionType = 139,
165
+ ParenthesizedType = 140,
166
+ ArrayLiteralExpression = 141,
167
+ ObjectLiteralExpression = 142,
168
+ PropertyAccessExpression = 143,
169
+ ElementAccessExpression = 144,
170
+ CallExpression = 145,
171
+ NewExpression = 146,
172
+ TaggedTemplateExpression = 147,
173
+ TypeAssertionExpression = 148,
174
+ ParenthesizedExpression = 149,
175
+ FunctionExpression = 150,
176
+ ArrowFunction = 151,
177
+ DeleteExpression = 152,
178
+ TypeOfExpression = 153,
179
+ VoidExpression = 154,
180
+ PrefixUnaryExpression = 155,
181
+ PostfixUnaryExpression = 156,
182
+ BinaryExpression = 157,
183
+ ConditionalExpression = 158,
184
+ TemplateExpression = 159,
185
+ YieldExpression = 160,
186
+ OmittedExpression = 161,
187
+ TemplateSpan = 162,
188
+ Block = 163,
189
+ VariableStatement = 164,
190
+ EmptyStatement = 165,
191
+ ExpressionStatement = 166,
192
+ IfStatement = 167,
193
+ DoStatement = 168,
194
+ WhileStatement = 169,
195
+ ForStatement = 170,
196
+ ForInStatement = 171,
197
+ ContinueStatement = 172,
198
+ BreakStatement = 173,
199
+ ReturnStatement = 174,
200
+ WithStatement = 175,
201
+ SwitchStatement = 176,
202
+ LabeledStatement = 177,
203
+ ThrowStatement = 178,
204
+ TryStatement = 179,
205
+ TryBlock = 180,
206
+ FinallyBlock = 181,
207
+ DebuggerStatement = 182,
208
+ VariableDeclaration = 183,
209
+ FunctionDeclaration = 184,
210
+ ClassDeclaration = 185,
211
+ InterfaceDeclaration = 186,
212
+ TypeAliasDeclaration = 187,
213
+ EnumDeclaration = 188,
214
+ ModuleDeclaration = 189,
215
+ ModuleBlock = 190,
216
+ ImportDeclaration = 191,
217
+ ExportAssignment = 192,
218
+ ExternalModuleReference = 193,
219
+ CaseClause = 194,
220
+ DefaultClause = 195,
221
+ HeritageClause = 196,
222
+ CatchClause = 197,
223
+ PropertyAssignment = 198,
224
+ ShorthandPropertyAssignment = 199,
225
+ EnumMember = 200,
226
+ SourceFile = 201,
227
+ Program = 202,
228
+ SyntaxList = 203,
229
+ Count = 204,
230
+ FirstAssignment = 51,
231
+ LastAssignment = 62,
232
+ FirstReservedWord = 64,
233
+ LastReservedWord = 99,
234
+ FirstKeyword = 64,
235
+ LastKeyword = 119,
236
+ FirstFutureReservedWord = 100,
237
+ LastFutureReservedWord = 108,
238
+ FirstTypeNode = 132,
239
+ LastTypeNode = 140,
240
+ FirstPunctuation = 13,
241
+ LastPunctuation = 62,
242
+ FirstToken = 0,
243
+ LastToken = 119,
244
+ FirstTriviaToken = 2,
245
+ LastTriviaToken = 5,
246
+ FirstLiteralToken = 6,
247
+ LastLiteralToken = 9,
248
+ FirstTemplateToken = 9,
249
+ LastTemplateToken = 12,
250
+ FirstOperator = 21,
251
+ LastOperator = 62,
252
+ FirstBinaryOperator = 23,
253
+ LastBinaryOperator = 62,
254
+ FirstNode = 120,
255
+ }
256
+ const enum NodeFlags {
257
+ Export = 1,
258
+ Ambient = 2,
259
+ Public = 16,
260
+ Private = 32,
261
+ Protected = 64,
262
+ Static = 128,
263
+ MultiLine = 256,
264
+ Synthetic = 512,
265
+ DeclarationFile = 1024,
266
+ Let = 2048,
267
+ Const = 4096,
268
+ OctalLiteral = 8192,
269
+ Modifier = 243,
270
+ AccessibilityModifier = 112,
271
+ BlockScoped = 6144,
272
+ }
273
+ const enum ParserContextFlags {
274
+ StrictMode = 1,
275
+ DisallowIn = 2,
276
+ Yield = 4,
277
+ GeneratorParameter = 8,
278
+ ContainsError = 16,
279
+ HasPropagatedChildContainsErrorFlag = 32,
280
+ }
281
+ interface Node extends TextRange {
282
+ kind: SyntaxKind;
283
+ flags: NodeFlags;
284
+ parserContextFlags?: ParserContextFlags;
285
+ id?: number;
286
+ parent?: Node;
287
+ symbol?: Symbol;
288
+ locals?: SymbolTable;
289
+ nextContainer?: Node;
290
+ localSymbol?: Symbol;
291
+ modifiers?: ModifiersArray;
292
+ }
293
+ interface NodeArray<T> extends Array<T>, TextRange {
294
+ hasTrailingComma?: boolean;
295
+ }
296
+ interface ModifiersArray extends NodeArray<Node> {
297
+ flags: number;
298
+ }
299
+ interface Identifier extends PrimaryExpression {
300
+ text: string;
301
+ }
302
+ interface QualifiedName extends Node {
303
+ left: EntityName;
304
+ right: Identifier;
305
+ }
306
+ type EntityName = Identifier | QualifiedName;
307
+ type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName;
308
+ interface Declaration extends Node {
309
+ _declarationBrand: any;
310
+ name?: DeclarationName;
311
+ }
312
+ interface ComputedPropertyName extends Node {
313
+ expression: Expression;
314
+ }
315
+ interface TypeParameterDeclaration extends Declaration {
316
+ name: Identifier;
317
+ constraint?: TypeNode;
318
+ expression?: Expression;
319
+ }
320
+ interface SignatureDeclaration extends Declaration {
321
+ typeParameters?: NodeArray<TypeParameterDeclaration>;
322
+ parameters: NodeArray<ParameterDeclaration>;
323
+ type?: TypeNode;
324
+ }
325
+ interface VariableDeclaration extends Declaration {
326
+ name: Identifier;
327
+ type?: TypeNode;
328
+ initializer?: Expression;
329
+ }
330
+ interface ParameterDeclaration extends Declaration {
331
+ dotDotDotToken?: Node;
332
+ name: Identifier;
333
+ questionToken?: Node;
334
+ type?: TypeNode | StringLiteralExpression;
335
+ initializer?: Expression;
336
+ }
337
+ interface PropertyDeclaration extends Declaration, ClassElement {
338
+ _propertyDeclarationBrand: any;
339
+ questionToken?: Node;
340
+ type?: TypeNode;
341
+ initializer?: Expression;
342
+ }
343
+ type VariableOrParameterDeclaration = VariableDeclaration | ParameterDeclaration;
344
+ type VariableOrParameterOrPropertyDeclaration = VariableOrParameterDeclaration | PropertyDeclaration;
345
+ interface ObjectLiteralElement extends Declaration {
346
+ _objectLiteralBrandBrand: any;
347
+ }
348
+ interface ShorthandPropertyAssignment extends ObjectLiteralElement {
349
+ name: Identifier;
350
+ questionToken?: Node;
351
+ }
352
+ interface PropertyAssignment extends ObjectLiteralElement {
353
+ _propertyAssignmentBrand: any;
354
+ name: DeclarationName;
355
+ questionToken?: Node;
356
+ initializer: Expression;
357
+ }
358
+ /**
359
+ * Several node kinds share function-like features such as a signature,
360
+ * a name, and a body. These nodes should extend FunctionLikeDeclaration.
361
+ * Examples:
362
+ * FunctionDeclaration
363
+ * MethodDeclaration
364
+ * AccessorDeclaration
365
+ */
366
+ interface FunctionLikeDeclaration extends SignatureDeclaration {
367
+ _functionLikeDeclarationBrand: any;
368
+ asteriskToken?: Node;
369
+ questionToken?: Node;
370
+ body?: Block | Expression;
371
+ }
372
+ interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
373
+ name: Identifier;
374
+ body?: Block;
375
+ }
376
+ interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
377
+ body?: Block;
378
+ }
379
+ interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement {
380
+ body?: Block;
381
+ }
382
+ interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
383
+ _accessorDeclarationBrand: any;
384
+ body: Block;
385
+ }
386
+ interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement {
387
+ _indexSignatureDeclarationBrand: any;
388
+ }
389
+ interface TypeNode extends Node {
390
+ _typeNodeBrand: any;
391
+ }
392
+ interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration {
393
+ _functionOrConstructorTypeNodeBrand: any;
394
+ }
395
+ interface TypeReferenceNode extends TypeNode {
396
+ typeName: EntityName;
397
+ typeArguments?: NodeArray<TypeNode>;
398
+ }
399
+ interface TypeQueryNode extends TypeNode {
400
+ exprName: EntityName;
401
+ }
402
+ interface TypeLiteralNode extends TypeNode, Declaration {
403
+ members: NodeArray<Node>;
404
+ }
405
+ interface ArrayTypeNode extends TypeNode {
406
+ elementType: TypeNode;
407
+ }
408
+ interface TupleTypeNode extends TypeNode {
409
+ elementTypes: NodeArray<TypeNode>;
410
+ }
411
+ interface UnionTypeNode extends TypeNode {
412
+ types: NodeArray<TypeNode>;
413
+ }
414
+ interface ParenthesizedTypeNode extends TypeNode {
415
+ type: TypeNode;
416
+ }
417
+ interface Expression extends Node {
418
+ _expressionBrand: any;
419
+ contextualType?: Type;
420
+ }
421
+ interface UnaryExpression extends Expression {
422
+ _unaryExpressionBrand: any;
423
+ }
424
+ interface PrefixUnaryExpression extends UnaryExpression {
425
+ operator: SyntaxKind;
426
+ operand: UnaryExpression;
427
+ }
428
+ interface PostfixUnaryExpression extends PostfixExpression {
429
+ operand: LeftHandSideExpression;
430
+ operator: SyntaxKind;
431
+ }
432
+ interface PostfixExpression extends UnaryExpression {
433
+ _postfixExpressionBrand: any;
434
+ }
435
+ interface LeftHandSideExpression extends PostfixExpression {
436
+ _leftHandSideExpressionBrand: any;
437
+ }
438
+ interface MemberExpression extends LeftHandSideExpression {
439
+ _memberExpressionBrand: any;
440
+ }
441
+ interface PrimaryExpression extends MemberExpression {
442
+ _primaryExpressionBrand: any;
443
+ }
444
+ interface DeleteExpression extends UnaryExpression {
445
+ expression: UnaryExpression;
446
+ }
447
+ interface TypeOfExpression extends UnaryExpression {
448
+ expression: UnaryExpression;
449
+ }
450
+ interface VoidExpression extends UnaryExpression {
451
+ expression: UnaryExpression;
452
+ }
453
+ interface YieldExpression extends Expression {
454
+ asteriskToken?: Node;
455
+ expression: Expression;
456
+ }
457
+ interface BinaryExpression extends Expression {
458
+ left: Expression;
459
+ operator: SyntaxKind;
460
+ right: Expression;
461
+ }
462
+ interface ConditionalExpression extends Expression {
463
+ condition: Expression;
464
+ whenTrue: Expression;
465
+ whenFalse: Expression;
466
+ }
467
+ interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
468
+ name?: Identifier;
469
+ body: Block | Expression;
470
+ }
471
+ interface LiteralExpression extends PrimaryExpression {
472
+ text: string;
473
+ isUnterminated?: boolean;
474
+ }
475
+ interface StringLiteralExpression extends LiteralExpression {
476
+ _stringLiteralExpressionBrand: any;
477
+ }
478
+ interface TemplateExpression extends PrimaryExpression {
479
+ head: LiteralExpression;
480
+ templateSpans: NodeArray<TemplateSpan>;
481
+ }
482
+ interface TemplateSpan extends Node {
483
+ expression: Expression;
484
+ literal: LiteralExpression;
485
+ }
486
+ interface ParenthesizedExpression extends PrimaryExpression {
487
+ expression: Expression;
488
+ }
489
+ interface ArrayLiteralExpression extends PrimaryExpression {
490
+ elements: NodeArray<Expression>;
491
+ }
492
+ interface ObjectLiteralExpression extends PrimaryExpression, Declaration {
493
+ properties: NodeArray<ObjectLiteralElement>;
494
+ }
495
+ interface PropertyAccessExpression extends MemberExpression {
496
+ expression: LeftHandSideExpression;
497
+ name: Identifier;
498
+ }
499
+ interface ElementAccessExpression extends MemberExpression {
500
+ expression: LeftHandSideExpression;
501
+ argumentExpression?: Expression;
502
+ }
503
+ interface CallExpression extends LeftHandSideExpression {
504
+ expression: LeftHandSideExpression;
505
+ typeArguments?: NodeArray<TypeNode>;
506
+ arguments: NodeArray<Expression>;
507
+ }
508
+ interface NewExpression extends CallExpression, PrimaryExpression {
509
+ }
510
+ interface TaggedTemplateExpression extends MemberExpression {
511
+ tag: LeftHandSideExpression;
512
+ template: LiteralExpression | TemplateExpression;
513
+ }
514
+ type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression;
515
+ interface TypeAssertion extends UnaryExpression {
516
+ type: TypeNode;
517
+ expression: UnaryExpression;
518
+ }
519
+ interface Statement extends Node, ModuleElement {
520
+ _statementBrand: any;
521
+ }
522
+ interface Block extends Statement {
523
+ statements: NodeArray<Statement>;
524
+ }
525
+ interface VariableStatement extends Statement {
526
+ declarations: NodeArray<VariableDeclaration>;
527
+ }
528
+ interface ExpressionStatement extends Statement {
529
+ expression: Expression;
530
+ }
531
+ interface IfStatement extends Statement {
532
+ expression: Expression;
533
+ thenStatement: Statement;
534
+ elseStatement?: Statement;
535
+ }
536
+ interface IterationStatement extends Statement {
537
+ statement: Statement;
538
+ }
539
+ interface DoStatement extends IterationStatement {
540
+ expression: Expression;
541
+ }
542
+ interface WhileStatement extends IterationStatement {
543
+ expression: Expression;
544
+ }
545
+ interface ForStatement extends IterationStatement {
546
+ declarations?: NodeArray<VariableDeclaration>;
547
+ initializer?: Expression;
548
+ condition?: Expression;
549
+ iterator?: Expression;
550
+ }
551
+ interface ForInStatement extends IterationStatement {
552
+ declarations?: NodeArray<VariableDeclaration>;
553
+ variable?: Expression;
554
+ expression: Expression;
555
+ }
556
+ interface BreakOrContinueStatement extends Statement {
557
+ label?: Identifier;
558
+ }
559
+ interface ReturnStatement extends Statement {
560
+ expression?: Expression;
561
+ }
562
+ interface WithStatement extends Statement {
563
+ expression: Expression;
564
+ statement: Statement;
565
+ }
566
+ interface SwitchStatement extends Statement {
567
+ expression: Expression;
568
+ clauses: NodeArray<CaseOrDefaultClause>;
569
+ }
570
+ interface CaseClause extends Node {
571
+ expression?: Expression;
572
+ statements: NodeArray<Statement>;
573
+ }
574
+ interface DefaultClause extends Node {
575
+ statements: NodeArray<Statement>;
576
+ }
577
+ type CaseOrDefaultClause = CaseClause | DefaultClause;
578
+ interface LabeledStatement extends Statement {
579
+ label: Identifier;
580
+ statement: Statement;
581
+ }
582
+ interface ThrowStatement extends Statement {
583
+ expression: Expression;
584
+ }
585
+ interface TryStatement extends Statement {
586
+ tryBlock: Block;
587
+ catchClause?: CatchClause;
588
+ finallyBlock?: Block;
589
+ }
590
+ interface CatchClause extends Declaration {
591
+ name: Identifier;
592
+ type?: TypeNode;
593
+ block: Block;
594
+ }
595
+ interface ModuleElement extends Node {
596
+ _moduleElementBrand: any;
597
+ }
598
+ interface ClassDeclaration extends Declaration, ModuleElement {
599
+ name: Identifier;
600
+ typeParameters?: NodeArray<TypeParameterDeclaration>;
601
+ heritageClauses?: NodeArray<HeritageClause>;
602
+ members: NodeArray<ClassElement>;
603
+ }
604
+ interface ClassElement extends Declaration {
605
+ _classElementBrand: any;
606
+ }
607
+ interface InterfaceDeclaration extends Declaration, ModuleElement {
608
+ name: Identifier;
609
+ typeParameters?: NodeArray<TypeParameterDeclaration>;
610
+ heritageClauses?: NodeArray<HeritageClause>;
611
+ members: NodeArray<Declaration>;
612
+ }
613
+ interface HeritageClause extends Node {
614
+ token: SyntaxKind;
615
+ types?: NodeArray<TypeReferenceNode>;
616
+ }
617
+ interface TypeAliasDeclaration extends Declaration, ModuleElement {
618
+ name: Identifier;
619
+ type: TypeNode;
620
+ }
621
+ interface EnumMember extends Declaration {
622
+ name: DeclarationName;
623
+ initializer?: Expression;
624
+ }
625
+ interface EnumDeclaration extends Declaration, ModuleElement {
626
+ name: Identifier;
627
+ members: NodeArray<EnumMember>;
628
+ }
629
+ interface ModuleDeclaration extends Declaration, ModuleElement {
630
+ name: Identifier | LiteralExpression;
631
+ body: ModuleBlock | ModuleDeclaration;
632
+ }
633
+ interface ModuleBlock extends Node, ModuleElement {
634
+ statements: NodeArray<ModuleElement>;
635
+ }
636
+ interface ImportDeclaration extends Declaration, ModuleElement {
637
+ name: Identifier;
638
+ moduleReference: EntityName | ExternalModuleReference;
639
+ }
640
+ interface ExternalModuleReference extends Node {
641
+ expression?: Expression;
642
+ }
643
+ interface ExportAssignment extends Statement, ModuleElement {
644
+ exportName: Identifier;
645
+ }
646
+ interface FileReference extends TextRange {
647
+ filename: string;
648
+ }
649
+ interface CommentRange extends TextRange {
650
+ hasTrailingNewLine?: boolean;
651
+ }
652
+ interface SourceFile extends Declaration {
653
+ statements: NodeArray<ModuleElement>;
654
+ endOfFileToken: Node;
655
+ filename: string;
656
+ text: string;
657
+ getLineAndCharacterFromPosition(position: number): LineAndCharacter;
658
+ getPositionFromLineAndCharacter(line: number, character: number): number;
659
+ getLineStarts(): number[];
660
+ amdDependencies: string[];
661
+ amdModuleName: string;
662
+ referencedFiles: FileReference[];
663
+ referenceDiagnostics: Diagnostic[];
664
+ parseDiagnostics: Diagnostic[];
665
+ grammarDiagnostics: Diagnostic[];
666
+ getSyntacticDiagnostics(): Diagnostic[];
667
+ semanticDiagnostics: Diagnostic[];
668
+ hasNoDefaultLib: boolean;
669
+ externalModuleIndicator: Node;
670
+ nodeCount: number;
671
+ identifierCount: number;
672
+ symbolCount: number;
673
+ isOpen: boolean;
674
+ version: string;
675
+ languageVersion: ScriptTarget;
676
+ identifiers: Map<string>;
677
+ }
678
+ interface Program {
679
+ getSourceFile(filename: string): SourceFile;
680
+ getSourceFiles(): SourceFile[];
681
+ getCompilerOptions(): CompilerOptions;
682
+ getCompilerHost(): CompilerHost;
683
+ getDiagnostics(sourceFile?: SourceFile): Diagnostic[];
684
+ getGlobalDiagnostics(): Diagnostic[];
685
+ getTypeChecker(fullTypeCheckMode: boolean): TypeChecker;
686
+ getCommonSourceDirectory(): string;
687
+ }
688
+ interface SourceMapSpan {
689
+ emittedLine: number;
690
+ emittedColumn: number;
691
+ sourceLine: number;
692
+ sourceColumn: number;
693
+ nameIndex?: number;
694
+ sourceIndex: number;
695
+ }
696
+ interface SourceMapData {
697
+ sourceMapFilePath: string;
698
+ jsSourceMappingURL: string;
699
+ sourceMapFile: string;
700
+ sourceMapSourceRoot: string;
701
+ sourceMapSources: string[];
702
+ inputSourceFileNames: string[];
703
+ sourceMapNames?: string[];
704
+ sourceMapMappings: string;
705
+ sourceMapDecodedMappings: SourceMapSpan[];
706
+ }
707
+ enum EmitReturnStatus {
708
+ Succeeded = 0,
709
+ AllOutputGenerationSkipped = 1,
710
+ JSGeneratedWithSemanticErrors = 2,
711
+ DeclarationGenerationSkipped = 3,
712
+ EmitErrorsEncountered = 4,
713
+ CompilerOptionsErrors = 5,
714
+ }
715
+ interface EmitResult {
716
+ emitResultStatus: EmitReturnStatus;
717
+ diagnostics: Diagnostic[];
718
+ sourceMaps: SourceMapData[];
719
+ }
720
+ interface TypeChecker {
721
+ getProgram(): Program;
722
+ getDiagnostics(sourceFile?: SourceFile): Diagnostic[];
723
+ getDeclarationDiagnostics(sourceFile: SourceFile): Diagnostic[];
724
+ getGlobalDiagnostics(): Diagnostic[];
725
+ getNodeCount(): number;
726
+ getIdentifierCount(): number;
727
+ getSymbolCount(): number;
728
+ getTypeCount(): number;
729
+ emitFiles(targetSourceFile?: SourceFile): EmitResult;
730
+ getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
731
+ getDeclaredTypeOfSymbol(symbol: Symbol): Type;
732
+ getPropertiesOfType(type: Type): Symbol[];
733
+ getPropertyOfType(type: Type, propertyName: string): Symbol;
734
+ getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
735
+ getIndexTypeOfType(type: Type, kind: IndexKind): Type;
736
+ getReturnTypeOfSignature(signature: Signature): Type;
737
+ getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
738
+ getSymbolAtLocation(node: Node): Symbol;
739
+ getShorthandAssignmentValueSymbol(location: Node): Symbol;
740
+ getTypeAtLocation(node: Node): Type;
741
+ typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
742
+ symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string;
743
+ getSymbolDisplayBuilder(): SymbolDisplayBuilder;
744
+ getFullyQualifiedName(symbol: Symbol): string;
745
+ getAugmentedPropertiesOfType(type: Type): Symbol[];
746
+ getRootSymbols(symbol: Symbol): Symbol[];
747
+ getContextualType(node: Expression): Type;
748
+ getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature;
749
+ getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature;
750
+ isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
751
+ isUndefinedSymbol(symbol: Symbol): boolean;
752
+ isArgumentsSymbol(symbol: Symbol): boolean;
753
+ isEmitBlocked(sourceFile?: SourceFile): boolean;
754
+ getEnumMemberValue(node: EnumMember): number;
755
+ isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
756
+ getAliasedSymbol(symbol: Symbol): Symbol;
757
+ }
758
+ interface SymbolDisplayBuilder {
759
+ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
760
+ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void;
761
+ buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
762
+ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
763
+ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
764
+ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void;
765
+ buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
766
+ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
767
+ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
768
+ }
769
+ interface SymbolWriter {
770
+ writeKeyword(text: string): void;
771
+ writeOperator(text: string): void;
772
+ writePunctuation(text: string): void;
773
+ writeSpace(text: string): void;
774
+ writeStringLiteral(text: string): void;
775
+ writeParameter(text: string): void;
776
+ writeSymbol(text: string, symbol: Symbol): void;
777
+ writeLine(): void;
778
+ increaseIndent(): void;
779
+ decreaseIndent(): void;
780
+ clear(): void;
781
+ trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
782
+ }
783
+ const enum TypeFormatFlags {
784
+ None = 0,
785
+ WriteArrayAsGenericType = 1,
786
+ UseTypeOfFunction = 2,
787
+ NoTruncation = 4,
788
+ WriteArrowStyleSignature = 8,
789
+ WriteOwnNameForAnyLike = 16,
790
+ WriteTypeArgumentsOfSignature = 32,
791
+ InElementType = 64,
792
+ }
793
+ const enum SymbolFormatFlags {
794
+ None = 0,
795
+ WriteTypeParametersOrArguments = 1,
796
+ UseOnlyExternalAliasing = 2,
797
+ }
798
+ const enum SymbolAccessibility {
799
+ Accessible = 0,
800
+ NotAccessible = 1,
801
+ CannotBeNamed = 2,
802
+ }
803
+ interface SymbolVisibilityResult {
804
+ accessibility: SymbolAccessibility;
805
+ aliasesToMakeVisible?: ImportDeclaration[];
806
+ errorSymbolName?: string;
807
+ errorNode?: Node;
808
+ }
809
+ interface SymbolAccessiblityResult extends SymbolVisibilityResult {
810
+ errorModuleName?: string;
811
+ }
812
+ interface EmitResolver {
813
+ getProgram(): Program;
814
+ getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
815
+ getExpressionNamePrefix(node: Identifier): string;
816
+ getExportAssignmentName(node: SourceFile): string;
817
+ isReferencedImportDeclaration(node: ImportDeclaration): boolean;
818
+ isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
819
+ getNodeCheckFlags(node: Node): NodeCheckFlags;
820
+ getEnumMemberValue(node: EnumMember): number;
821
+ hasSemanticErrors(sourceFile?: SourceFile): boolean;
822
+ isDeclarationVisible(node: Declaration): boolean;
823
+ isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
824
+ writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableOrParameterDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
825
+ writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
826
+ isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
827
+ isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
828
+ getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number;
829
+ isEmitBlocked(sourceFile?: SourceFile): boolean;
830
+ }
831
+ const enum SymbolFlags {
832
+ FunctionScopedVariable = 1,
833
+ BlockScopedVariable = 2,
834
+ Property = 4,
835
+ EnumMember = 8,
836
+ Function = 16,
837
+ Class = 32,
838
+ Interface = 64,
839
+ ConstEnum = 128,
840
+ RegularEnum = 256,
841
+ ValueModule = 512,
842
+ NamespaceModule = 1024,
843
+ TypeLiteral = 2048,
844
+ ObjectLiteral = 4096,
845
+ Method = 8192,
846
+ Constructor = 16384,
847
+ GetAccessor = 32768,
848
+ SetAccessor = 65536,
849
+ CallSignature = 131072,
850
+ ConstructSignature = 262144,
851
+ IndexSignature = 524288,
852
+ TypeParameter = 1048576,
853
+ TypeAlias = 2097152,
854
+ ExportValue = 4194304,
855
+ ExportType = 8388608,
856
+ ExportNamespace = 16777216,
857
+ Import = 33554432,
858
+ Instantiated = 67108864,
859
+ Merged = 134217728,
860
+ Transient = 268435456,
861
+ Prototype = 536870912,
862
+ UnionProperty = 1073741824,
863
+ Enum = 384,
864
+ Variable = 3,
865
+ Value = 107455,
866
+ Type = 3152352,
867
+ Namespace = 1536,
868
+ Module = 1536,
869
+ Accessor = 98304,
870
+ Signature = 917504,
871
+ FunctionScopedVariableExcludes = 107454,
872
+ BlockScopedVariableExcludes = 107455,
873
+ ParameterExcludes = 107455,
874
+ PropertyExcludes = 107455,
875
+ EnumMemberExcludes = 107455,
876
+ FunctionExcludes = 106927,
877
+ ClassExcludes = 3258879,
878
+ InterfaceExcludes = 3152288,
879
+ RegularEnumExcludes = 3258623,
880
+ ConstEnumExcludes = 3259263,
881
+ ValueModuleExcludes = 106639,
882
+ NamespaceModuleExcludes = 0,
883
+ MethodExcludes = 99263,
884
+ GetAccessorExcludes = 41919,
885
+ SetAccessorExcludes = 74687,
886
+ TypeParameterExcludes = 2103776,
887
+ TypeAliasExcludes = 3152352,
888
+ ImportExcludes = 33554432,
889
+ ModuleMember = 35653619,
890
+ ExportHasLocal = 944,
891
+ HasLocals = 1041936,
892
+ HasExports = 1952,
893
+ HasMembers = 6240,
894
+ IsContainer = 1048560,
895
+ PropertyOrAccessor = 98308,
896
+ Export = 29360128,
897
+ }
898
+ interface Symbol {
899
+ flags: SymbolFlags;
900
+ name: string;
901
+ id?: number;
902
+ mergeId?: number;
903
+ declarations?: Declaration[];
904
+ parent?: Symbol;
905
+ members?: SymbolTable;
906
+ exports?: SymbolTable;
907
+ exportSymbol?: Symbol;
908
+ valueDeclaration?: Declaration;
909
+ constEnumOnlyModule?: boolean;
910
+ }
911
+ interface SymbolLinks {
912
+ target?: Symbol;
913
+ type?: Type;
914
+ declaredType?: Type;
915
+ mapper?: TypeMapper;
916
+ referenced?: boolean;
917
+ exportAssignSymbol?: Symbol;
918
+ unionType?: UnionType;
919
+ }
920
+ interface TransientSymbol extends Symbol, SymbolLinks {
921
+ }
922
+ interface SymbolTable {
923
+ [index: string]: Symbol;
924
+ }
925
+ const enum NodeCheckFlags {
926
+ TypeChecked = 1,
927
+ LexicalThis = 2,
928
+ CaptureThis = 4,
929
+ EmitExtends = 8,
930
+ SuperInstance = 16,
931
+ SuperStatic = 32,
932
+ ContextChecked = 64,
933
+ EnumValuesComputed = 128,
934
+ }
935
+ interface NodeLinks {
936
+ resolvedType?: Type;
937
+ resolvedSignature?: Signature;
938
+ resolvedSymbol?: Symbol;
939
+ flags?: NodeCheckFlags;
940
+ enumMemberValue?: number;
941
+ isIllegalTypeReferenceInConstraint?: boolean;
942
+ isVisible?: boolean;
943
+ localModuleName?: string;
944
+ assignmentChecks?: Map<boolean>;
945
+ }
946
+ const enum TypeFlags {
947
+ Any = 1,
948
+ String = 2,
949
+ Number = 4,
950
+ Boolean = 8,
951
+ Void = 16,
952
+ Undefined = 32,
953
+ Null = 64,
954
+ Enum = 128,
955
+ StringLiteral = 256,
956
+ TypeParameter = 512,
957
+ Class = 1024,
958
+ Interface = 2048,
959
+ Reference = 4096,
960
+ Tuple = 8192,
961
+ Union = 16384,
962
+ Anonymous = 32768,
963
+ FromSignature = 65536,
964
+ Intrinsic = 127,
965
+ StringLike = 258,
966
+ NumberLike = 132,
967
+ ObjectType = 48128,
968
+ }
969
+ interface Type {
970
+ flags: TypeFlags;
971
+ id: number;
972
+ symbol?: Symbol;
973
+ }
974
+ interface IntrinsicType extends Type {
975
+ intrinsicName: string;
976
+ }
977
+ interface StringLiteralType extends Type {
978
+ text: string;
979
+ }
980
+ interface ObjectType extends Type {
981
+ }
982
+ interface InterfaceType extends ObjectType {
983
+ typeParameters: TypeParameter[];
984
+ baseTypes: ObjectType[];
985
+ declaredProperties: Symbol[];
986
+ declaredCallSignatures: Signature[];
987
+ declaredConstructSignatures: Signature[];
988
+ declaredStringIndexType: Type;
989
+ declaredNumberIndexType: Type;
990
+ }
991
+ interface TypeReference extends ObjectType {
992
+ target: GenericType;
993
+ typeArguments: Type[];
994
+ }
995
+ interface GenericType extends InterfaceType, TypeReference {
996
+ instantiations: Map<TypeReference>;
997
+ openReferenceTargets: GenericType[];
998
+ openReferenceChecks: Map<boolean>;
999
+ }
1000
+ interface TupleType extends ObjectType {
1001
+ elementTypes: Type[];
1002
+ baseArrayType: TypeReference;
1003
+ }
1004
+ interface UnionType extends Type {
1005
+ types: Type[];
1006
+ resolvedProperties: SymbolTable;
1007
+ }
1008
+ interface ResolvedType extends ObjectType, UnionType {
1009
+ members: SymbolTable;
1010
+ properties: Symbol[];
1011
+ callSignatures: Signature[];
1012
+ constructSignatures: Signature[];
1013
+ stringIndexType: Type;
1014
+ numberIndexType: Type;
1015
+ }
1016
+ interface TypeParameter extends Type {
1017
+ constraint: Type;
1018
+ target?: TypeParameter;
1019
+ mapper?: TypeMapper;
1020
+ }
1021
+ const enum SignatureKind {
1022
+ Call = 0,
1023
+ Construct = 1,
1024
+ }
1025
+ interface Signature {
1026
+ declaration: SignatureDeclaration;
1027
+ typeParameters: TypeParameter[];
1028
+ parameters: Symbol[];
1029
+ resolvedReturnType: Type;
1030
+ minArgumentCount: number;
1031
+ hasRestParameter: boolean;
1032
+ hasStringLiterals: boolean;
1033
+ target?: Signature;
1034
+ mapper?: TypeMapper;
1035
+ unionSignatures?: Signature[];
1036
+ erasedSignatureCache?: Signature;
1037
+ isolatedSignatureType?: ObjectType;
1038
+ }
1039
+ const enum IndexKind {
1040
+ String = 0,
1041
+ Number = 1,
1042
+ }
1043
+ interface TypeMapper {
1044
+ (t: Type): Type;
1045
+ }
1046
+ interface TypeInferences {
1047
+ primary: Type[];
1048
+ secondary: Type[];
1049
+ }
1050
+ interface InferenceContext {
1051
+ typeParameters: TypeParameter[];
1052
+ inferUnionTypes: boolean;
1053
+ inferences: TypeInferences[];
1054
+ inferredTypes: Type[];
1055
+ failedTypeParameterIndex?: number;
1056
+ }
1057
+ interface DiagnosticMessage {
1058
+ key: string;
1059
+ category: DiagnosticCategory;
1060
+ code: number;
1061
+ isEarly?: boolean;
1062
+ }
1063
+ interface DiagnosticMessageChain {
1064
+ messageText: string;
1065
+ category: DiagnosticCategory;
1066
+ code: number;
1067
+ next?: DiagnosticMessageChain;
1068
+ }
1069
+ interface Diagnostic {
1070
+ file: SourceFile;
1071
+ start: number;
1072
+ length: number;
1073
+ messageText: string;
1074
+ category: DiagnosticCategory;
1075
+ code: number;
1076
+ /**
1077
+ * Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit
1078
+ */
1079
+ isEarly?: boolean;
1080
+ }
1081
+ enum DiagnosticCategory {
1082
+ Warning = 0,
1083
+ Error = 1,
1084
+ Message = 2,
1085
+ }
1086
+ interface CompilerOptions {
1087
+ allowNonTsExtensions?: boolean;
1088
+ charset?: string;
1089
+ codepage?: number;
1090
+ declaration?: boolean;
1091
+ diagnostics?: boolean;
1092
+ emitBOM?: boolean;
1093
+ help?: boolean;
1094
+ locale?: string;
1095
+ mapRoot?: string;
1096
+ module?: ModuleKind;
1097
+ noEmitOnError?: boolean;
1098
+ noErrorTruncation?: boolean;
1099
+ noImplicitAny?: boolean;
1100
+ noLib?: boolean;
1101
+ noLibCheck?: boolean;
1102
+ noResolve?: boolean;
1103
+ out?: string;
1104
+ outDir?: string;
1105
+ preserveConstEnums?: boolean;
1106
+ removeComments?: boolean;
1107
+ sourceMap?: boolean;
1108
+ sourceRoot?: string;
1109
+ suppressImplicitAnyIndexErrors?: boolean;
1110
+ target?: ScriptTarget;
1111
+ version?: boolean;
1112
+ watch?: boolean;
1113
+ [option: string]: string | number | boolean;
1114
+ }
1115
+ const enum ModuleKind {
1116
+ None = 0,
1117
+ CommonJS = 1,
1118
+ AMD = 2,
1119
+ }
1120
+ interface LineAndCharacter {
1121
+ line: number;
1122
+ character: number;
1123
+ }
1124
+ const enum ScriptTarget {
1125
+ ES3 = 0,
1126
+ ES5 = 1,
1127
+ ES6 = 2,
1128
+ Latest = 2,
1129
+ }
1130
+ interface ParsedCommandLine {
1131
+ options: CompilerOptions;
1132
+ filenames: string[];
1133
+ errors: Diagnostic[];
1134
+ }
1135
+ interface CommandLineOption {
1136
+ name: string;
1137
+ type: string | Map<number>;
1138
+ shortName?: string;
1139
+ description?: DiagnosticMessage;
1140
+ paramType?: DiagnosticMessage;
1141
+ error?: DiagnosticMessage;
1142
+ }
1143
+ const enum CharacterCodes {
1144
+ nullCharacter = 0,
1145
+ maxAsciiCharacter = 127,
1146
+ lineFeed = 10,
1147
+ carriageReturn = 13,
1148
+ lineSeparator = 8232,
1149
+ paragraphSeparator = 8233,
1150
+ nextLine = 133,
1151
+ space = 32,
1152
+ nonBreakingSpace = 160,
1153
+ enQuad = 8192,
1154
+ emQuad = 8193,
1155
+ enSpace = 8194,
1156
+ emSpace = 8195,
1157
+ threePerEmSpace = 8196,
1158
+ fourPerEmSpace = 8197,
1159
+ sixPerEmSpace = 8198,
1160
+ figureSpace = 8199,
1161
+ punctuationSpace = 8200,
1162
+ thinSpace = 8201,
1163
+ hairSpace = 8202,
1164
+ zeroWidthSpace = 8203,
1165
+ narrowNoBreakSpace = 8239,
1166
+ ideographicSpace = 12288,
1167
+ mathematicalSpace = 8287,
1168
+ ogham = 5760,
1169
+ _ = 95,
1170
+ $ = 36,
1171
+ _0 = 48,
1172
+ _1 = 49,
1173
+ _2 = 50,
1174
+ _3 = 51,
1175
+ _4 = 52,
1176
+ _5 = 53,
1177
+ _6 = 54,
1178
+ _7 = 55,
1179
+ _8 = 56,
1180
+ _9 = 57,
1181
+ a = 97,
1182
+ b = 98,
1183
+ c = 99,
1184
+ d = 100,
1185
+ e = 101,
1186
+ f = 102,
1187
+ g = 103,
1188
+ h = 104,
1189
+ i = 105,
1190
+ j = 106,
1191
+ k = 107,
1192
+ l = 108,
1193
+ m = 109,
1194
+ n = 110,
1195
+ o = 111,
1196
+ p = 112,
1197
+ q = 113,
1198
+ r = 114,
1199
+ s = 115,
1200
+ t = 116,
1201
+ u = 117,
1202
+ v = 118,
1203
+ w = 119,
1204
+ x = 120,
1205
+ y = 121,
1206
+ z = 122,
1207
+ A = 65,
1208
+ B = 66,
1209
+ C = 67,
1210
+ D = 68,
1211
+ E = 69,
1212
+ F = 70,
1213
+ G = 71,
1214
+ H = 72,
1215
+ I = 73,
1216
+ J = 74,
1217
+ K = 75,
1218
+ L = 76,
1219
+ M = 77,
1220
+ N = 78,
1221
+ O = 79,
1222
+ P = 80,
1223
+ Q = 81,
1224
+ R = 82,
1225
+ S = 83,
1226
+ T = 84,
1227
+ U = 85,
1228
+ V = 86,
1229
+ W = 87,
1230
+ X = 88,
1231
+ Y = 89,
1232
+ Z = 90,
1233
+ ampersand = 38,
1234
+ asterisk = 42,
1235
+ at = 64,
1236
+ backslash = 92,
1237
+ backtick = 96,
1238
+ bar = 124,
1239
+ caret = 94,
1240
+ closeBrace = 125,
1241
+ closeBracket = 93,
1242
+ closeParen = 41,
1243
+ colon = 58,
1244
+ comma = 44,
1245
+ dot = 46,
1246
+ doubleQuote = 34,
1247
+ equals = 61,
1248
+ exclamation = 33,
1249
+ greaterThan = 62,
1250
+ lessThan = 60,
1251
+ minus = 45,
1252
+ openBrace = 123,
1253
+ openBracket = 91,
1254
+ openParen = 40,
1255
+ percent = 37,
1256
+ plus = 43,
1257
+ question = 63,
1258
+ semicolon = 59,
1259
+ singleQuote = 39,
1260
+ slash = 47,
1261
+ tilde = 126,
1262
+ backspace = 8,
1263
+ formFeed = 12,
1264
+ byteOrderMark = 65279,
1265
+ tab = 9,
1266
+ verticalTab = 11,
1267
+ }
1268
+ interface CancellationToken {
1269
+ isCancellationRequested(): boolean;
1270
+ }
1271
+ interface CompilerHost {
1272
+ getSourceFile(filename: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
1273
+ getDefaultLibFilename(options: CompilerOptions): string;
1274
+ getCancellationToken?(): CancellationToken;
1275
+ writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
1276
+ getCurrentDirectory(): string;
1277
+ getCanonicalFileName(fileName: string): string;
1278
+ useCaseSensitiveFileNames(): boolean;
1279
+ getNewLine(): string;
1280
+ }
1281
+ }
1282
+ declare module ts {
1283
+ interface ErrorCallback {
1284
+ (message: DiagnosticMessage): void;
1285
+ }
1286
+ interface CommentCallback {
1287
+ (pos: number, end: number): void;
1288
+ }
1289
+ interface Scanner {
1290
+ getStartPos(): number;
1291
+ getToken(): SyntaxKind;
1292
+ getTextPos(): number;
1293
+ getTokenPos(): number;
1294
+ getTokenText(): string;
1295
+ getTokenValue(): string;
1296
+ hasPrecedingLineBreak(): boolean;
1297
+ isIdentifier(): boolean;
1298
+ isReservedWord(): boolean;
1299
+ isUnterminated(): boolean;
1300
+ reScanGreaterToken(): SyntaxKind;
1301
+ reScanSlashToken(): SyntaxKind;
1302
+ reScanTemplateToken(): SyntaxKind;
1303
+ scan(): SyntaxKind;
1304
+ setText(text: string): void;
1305
+ setTextPos(textPos: number): void;
1306
+ lookAhead<T>(callback: () => T): T;
1307
+ tryScan<T>(callback: () => T): T;
1308
+ }
1309
+ function tokenToString(t: SyntaxKind): string;
1310
+ function computeLineStarts(text: string): number[];
1311
+ function getPositionFromLineAndCharacter(lineStarts: number[], line: number, character: number): number;
1312
+ function getLineAndCharacterOfPosition(lineStarts: number[], position: number): {
1313
+ line: number;
1314
+ character: number;
1315
+ };
1316
+ function positionToLineAndCharacter(text: string, pos: number): {
1317
+ line: number;
1318
+ character: number;
1319
+ };
1320
+ function isWhiteSpace(ch: number): boolean;
1321
+ function isLineBreak(ch: number): boolean;
1322
+ function isOctalDigit(ch: number): boolean;
1323
+ function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number;
1324
+ function getLeadingCommentRanges(text: string, pos: number): CommentRange[];
1325
+ function getTrailingCommentRanges(text: string, pos: number): CommentRange[];
1326
+ function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
1327
+ function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
1328
+ function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner;
1329
+ }
1330
+ declare module ts {
1331
+ function getNodeConstructor(kind: SyntaxKind): new () => Node;
1332
+ function forEachChild<T>(node: Node, cbNode: (node: Node) => T, cbNodes?: (nodes: Node[]) => T): T;
1333
+ function createCompilerHost(options: CompilerOptions): CompilerHost;
1334
+ function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: string, isOpen?: boolean): SourceFile;
1335
+ function createProgram(rootNames: string[], options: CompilerOptions, host: CompilerHost): Program;
1336
+ }
1337
+ declare module ts {
1338
+ function createTypeChecker(program: Program, fullTypeCheck: boolean): TypeChecker;
1339
+ }
1340
+ declare module ts {
1341
+ var servicesVersion: string;
1342
+ interface Node {
1343
+ getSourceFile(): SourceFile;
1344
+ getChildCount(sourceFile?: SourceFile): number;
1345
+ getChildAt(index: number, sourceFile?: SourceFile): Node;
1346
+ getChildren(sourceFile?: SourceFile): Node[];
1347
+ getStart(sourceFile?: SourceFile): number;
1348
+ getFullStart(): number;
1349
+ getEnd(): number;
1350
+ getWidth(sourceFile?: SourceFile): number;
1351
+ getFullWidth(): number;
1352
+ getLeadingTriviaWidth(sourceFile?: SourceFile): number;
1353
+ getFullText(sourceFile?: SourceFile): string;
1354
+ getText(sourceFile?: SourceFile): string;
1355
+ getFirstToken(sourceFile?: SourceFile): Node;
1356
+ getLastToken(sourceFile?: SourceFile): Node;
1357
+ }
1358
+ interface Symbol {
1359
+ getFlags(): SymbolFlags;
1360
+ getName(): string;
1361
+ getDeclarations(): Declaration[];
1362
+ getDocumentationComment(): SymbolDisplayPart[];
1363
+ }
1364
+ interface Type {
1365
+ getFlags(): TypeFlags;
1366
+ getSymbol(): Symbol;
1367
+ getProperties(): Symbol[];
1368
+ getProperty(propertyName: string): Symbol;
1369
+ getApparentProperties(): Symbol[];
1370
+ getCallSignatures(): Signature[];
1371
+ getConstructSignatures(): Signature[];
1372
+ getStringIndexType(): Type;
1373
+ getNumberIndexType(): Type;
1374
+ }
1375
+ interface Signature {
1376
+ getDeclaration(): SignatureDeclaration;
1377
+ getTypeParameters(): Type[];
1378
+ getParameters(): Symbol[];
1379
+ getReturnType(): Type;
1380
+ getDocumentationComment(): SymbolDisplayPart[];
1381
+ }
1382
+ interface SourceFile {
1383
+ getScriptSnapshot(): IScriptSnapshot;
1384
+ getNamedDeclarations(): Declaration[];
1385
+ update(scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile;
1386
+ }
1387
+ /**
1388
+ * Represents an immutable snapshot of a script at a specified time.Once acquired, the
1389
+ * snapshot is observably immutable. i.e. the same calls with the same parameters will return
1390
+ * the same values.
1391
+ */
1392
+ interface IScriptSnapshot {
1393
+ /** Gets a portion of the script snapshot specified by [start, end). */
1394
+ getText(start: number, end: number): string;
1395
+ /** Gets the length of this script snapshot. */
1396
+ getLength(): number;
1397
+ /**
1398
+ * This call returns the array containing the start position of every line.
1399
+ * i.e."[0, 10, 55]". TODO: consider making this optional. The language service could
1400
+ * always determine this (albeit in a more expensive manner).
1401
+ */
1402
+ getLineStartPositions(): number[];
1403
+ /**
1404
+ * Gets the TextChangeRange that describe how the text changed between this text and
1405
+ * an older version. This information is used by the incremental parser to determine
1406
+ * what sections of the script need to be re-parsed. 'undefined' can be returned if the
1407
+ * change range cannot be determined. However, in that case, incremental parsing will
1408
+ * not happen and the entire document will be re - parsed.
1409
+ */
1410
+ getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
1411
+ }
1412
+ module ScriptSnapshot {
1413
+ function fromString(text: string): IScriptSnapshot;
1414
+ }
1415
+ interface PreProcessedFileInfo {
1416
+ referencedFiles: FileReference[];
1417
+ importedFiles: FileReference[];
1418
+ isLibFile: boolean;
1419
+ }
1420
+ interface Logger {
1421
+ log(s: string): void;
1422
+ }
1423
+ interface LanguageServiceHost extends Logger {
1424
+ getCompilationSettings(): CompilerOptions;
1425
+ getScriptFileNames(): string[];
1426
+ getScriptVersion(fileName: string): string;
1427
+ getScriptIsOpen(fileName: string): boolean;
1428
+ getScriptSnapshot(fileName: string): IScriptSnapshot;
1429
+ getLocalizedDiagnosticMessages?(): any;
1430
+ getCancellationToken?(): CancellationToken;
1431
+ getCurrentDirectory(): string;
1432
+ getDefaultLibFilename(options: CompilerOptions): string;
1433
+ }
1434
+ interface LanguageService {
1435
+ cleanupSemanticCache(): void;
1436
+ getSyntacticDiagnostics(fileName: string): Diagnostic[];
1437
+ getSemanticDiagnostics(fileName: string): Diagnostic[];
1438
+ getCompilerOptionsDiagnostics(): Diagnostic[];
1439
+ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
1440
+ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
1441
+ getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
1442
+ getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
1443
+ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo;
1444
+ getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan;
1445
+ getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan;
1446
+ getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems;
1447
+ getRenameInfo(fileName: string, position: number): RenameInfo;
1448
+ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[];
1449
+ getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[];
1450
+ getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[];
1451
+ getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[];
1452
+ getNavigateToItems(searchValue: string): NavigateToItem[];
1453
+ getNavigationBarItems(fileName: string): NavigationBarItem[];
1454
+ getOutliningSpans(fileName: string): OutliningSpan[];
1455
+ getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
1456
+ getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
1457
+ getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number;
1458
+ getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[];
1459
+ getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[];
1460
+ getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[];
1461
+ getEmitOutput(fileName: string): EmitOutput;
1462
+ getSourceFile(filename: string): SourceFile;
1463
+ dispose(): void;
1464
+ }
1465
+ class TextSpan {
1466
+ private _start;
1467
+ private _length;
1468
+ /**
1469
+ * Creates a TextSpan instance beginning with the position Start and having the Length
1470
+ * specified with length.
1471
+ */
1472
+ constructor(start: number, length: number);
1473
+ toJSON(key: any): any;
1474
+ start(): number;
1475
+ length(): number;
1476
+ end(): number;
1477
+ isEmpty(): boolean;
1478
+ /**
1479
+ * Determines whether the position lies within the span. Returns true if the position is greater than or equal to Start and strictly less
1480
+ * than End, otherwise false.
1481
+ * @param position The position to check.
1482
+ */
1483
+ containsPosition(position: number): boolean;
1484
+ /**
1485
+ * Determines whether span falls completely within this span. Returns true if the specified span falls completely within this span, otherwise false.
1486
+ * @param span The span to check.
1487
+ */
1488
+ containsTextSpan(span: TextSpan): boolean;
1489
+ /**
1490
+ * Determines whether the given span overlaps this span. Two spans are considered to overlap
1491
+ * if they have positions in common and neither is empty. Empty spans do not overlap with any
1492
+ * other span. Returns true if the spans overlap, false otherwise.
1493
+ * @param span The span to check.
1494
+ */
1495
+ overlapsWith(span: TextSpan): boolean;
1496
+ /**
1497
+ * Returns the overlap with the given span, or undefined if there is no overlap.
1498
+ * @param span The span to check.
1499
+ */
1500
+ overlap(span: TextSpan): TextSpan;
1501
+ /**
1502
+ * Determines whether span intersects this span. Two spans are considered to
1503
+ * intersect if they have positions in common or the end of one span
1504
+ * coincides with the start of the other span. Returns true if the spans intersect, false otherwise.
1505
+ * @param The span to check.
1506
+ */
1507
+ intersectsWithTextSpan(span: TextSpan): boolean;
1508
+ intersectsWith(start: number, length: number): boolean;
1509
+ /**
1510
+ * Determines whether the given position intersects this span.
1511
+ * A position is considered to intersect if it is between the start and
1512
+ * end positions (inclusive) of this span. Returns true if the position intersects, false otherwise.
1513
+ * @param position The position to check.
1514
+ */
1515
+ intersectsWithPosition(position: number): boolean;
1516
+ /**
1517
+ * Returns the intersection with the given span, or undefined if there is no intersection.
1518
+ * @param span The span to check.
1519
+ */
1520
+ intersection(span: TextSpan): TextSpan;
1521
+ /**
1522
+ * Creates a new TextSpan from the given start and end positions
1523
+ * as opposed to a position and length.
1524
+ */
1525
+ static fromBounds(start: number, end: number): TextSpan;
1526
+ }
1527
+ class TextChangeRange {
1528
+ static unchanged: TextChangeRange;
1529
+ private _span;
1530
+ private _newLength;
1531
+ /**
1532
+ * Initializes a new instance of TextChangeRange.
1533
+ */
1534
+ constructor(span: TextSpan, newLength: number);
1535
+ /**
1536
+ * The span of text before the edit which is being changed
1537
+ */
1538
+ span(): TextSpan;
1539
+ /**
1540
+ * Width of the span after the edit. A 0 here would represent a delete
1541
+ */
1542
+ newLength(): number;
1543
+ newSpan(): TextSpan;
1544
+ isUnchanged(): boolean;
1545
+ /**
1546
+ * Called to merge all the changes that occurred across several versions of a script snapshot
1547
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
1548
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
1549
+ *
1550
+ * This function will then merge those changes into a single change range valid between V1 and
1551
+ * Vn.
1552
+ */
1553
+ static collapseChangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
1554
+ }
1555
+ interface ClassifiedSpan {
1556
+ textSpan: TextSpan;
1557
+ classificationType: string;
1558
+ }
1559
+ interface NavigationBarItem {
1560
+ text: string;
1561
+ kind: string;
1562
+ kindModifiers: string;
1563
+ spans: TextSpan[];
1564
+ childItems: NavigationBarItem[];
1565
+ indent: number;
1566
+ bolded: boolean;
1567
+ grayed: boolean;
1568
+ }
1569
+ interface TodoCommentDescriptor {
1570
+ text: string;
1571
+ priority: number;
1572
+ }
1573
+ interface TodoComment {
1574
+ descriptor: TodoCommentDescriptor;
1575
+ message: string;
1576
+ position: number;
1577
+ }
1578
+ class TextChange {
1579
+ span: TextSpan;
1580
+ newText: string;
1581
+ }
1582
+ interface RenameLocation {
1583
+ textSpan: TextSpan;
1584
+ fileName: string;
1585
+ }
1586
+ interface ReferenceEntry {
1587
+ textSpan: TextSpan;
1588
+ fileName: string;
1589
+ isWriteAccess: boolean;
1590
+ }
1591
+ interface NavigateToItem {
1592
+ name: string;
1593
+ kind: string;
1594
+ kindModifiers: string;
1595
+ matchKind: string;
1596
+ fileName: string;
1597
+ textSpan: TextSpan;
1598
+ containerName: string;
1599
+ containerKind: string;
1600
+ }
1601
+ interface EditorOptions {
1602
+ IndentSize: number;
1603
+ TabSize: number;
1604
+ NewLineCharacter: string;
1605
+ ConvertTabsToSpaces: boolean;
1606
+ }
1607
+ interface FormatCodeOptions extends EditorOptions {
1608
+ InsertSpaceAfterCommaDelimiter: boolean;
1609
+ InsertSpaceAfterSemicolonInForStatements: boolean;
1610
+ InsertSpaceBeforeAndAfterBinaryOperators: boolean;
1611
+ InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
1612
+ InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
1613
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
1614
+ PlaceOpenBraceOnNewLineForFunctions: boolean;
1615
+ PlaceOpenBraceOnNewLineForControlBlocks: boolean;
1616
+ }
1617
+ interface DefinitionInfo {
1618
+ fileName: string;
1619
+ textSpan: TextSpan;
1620
+ kind: string;
1621
+ name: string;
1622
+ containerKind: string;
1623
+ containerName: string;
1624
+ }
1625
+ enum SymbolDisplayPartKind {
1626
+ aliasName = 0,
1627
+ className = 1,
1628
+ enumName = 2,
1629
+ fieldName = 3,
1630
+ interfaceName = 4,
1631
+ keyword = 5,
1632
+ lineBreak = 6,
1633
+ numericLiteral = 7,
1634
+ stringLiteral = 8,
1635
+ localName = 9,
1636
+ methodName = 10,
1637
+ moduleName = 11,
1638
+ operator = 12,
1639
+ parameterName = 13,
1640
+ propertyName = 14,
1641
+ punctuation = 15,
1642
+ space = 16,
1643
+ text = 17,
1644
+ typeParameterName = 18,
1645
+ enumMemberName = 19,
1646
+ functionName = 20,
1647
+ regularExpressionLiteral = 21,
1648
+ }
1649
+ interface SymbolDisplayPart {
1650
+ text: string;
1651
+ kind: string;
1652
+ }
1653
+ interface QuickInfo {
1654
+ kind: string;
1655
+ kindModifiers: string;
1656
+ textSpan: TextSpan;
1657
+ displayParts: SymbolDisplayPart[];
1658
+ documentation: SymbolDisplayPart[];
1659
+ }
1660
+ interface RenameInfo {
1661
+ canRename: boolean;
1662
+ localizedErrorMessage: string;
1663
+ displayName: string;
1664
+ fullDisplayName: string;
1665
+ kind: string;
1666
+ kindModifiers: string;
1667
+ triggerSpan: TextSpan;
1668
+ }
1669
+ interface SignatureHelpParameter {
1670
+ name: string;
1671
+ documentation: SymbolDisplayPart[];
1672
+ displayParts: SymbolDisplayPart[];
1673
+ isOptional: boolean;
1674
+ }
1675
+ /**
1676
+ * Represents a single signature to show in signature help.
1677
+ * The id is used for subsequent calls into the language service to ask questions about the
1678
+ * signature help item in the context of any documents that have been updated. i.e. after
1679
+ * an edit has happened, while signature help is still active, the host can ask important
1680
+ * questions like 'what parameter is the user currently contained within?'.
1681
+ */
1682
+ interface SignatureHelpItem {
1683
+ isVariadic: boolean;
1684
+ prefixDisplayParts: SymbolDisplayPart[];
1685
+ suffixDisplayParts: SymbolDisplayPart[];
1686
+ separatorDisplayParts: SymbolDisplayPart[];
1687
+ parameters: SignatureHelpParameter[];
1688
+ documentation: SymbolDisplayPart[];
1689
+ }
1690
+ /**
1691
+ * Represents a set of signature help items, and the preferred item that should be selected.
1692
+ */
1693
+ interface SignatureHelpItems {
1694
+ items: SignatureHelpItem[];
1695
+ applicableSpan: TextSpan;
1696
+ selectedItemIndex: number;
1697
+ argumentIndex: number;
1698
+ argumentCount: number;
1699
+ }
1700
+ interface CompletionInfo {
1701
+ isMemberCompletion: boolean;
1702
+ entries: CompletionEntry[];
1703
+ }
1704
+ interface CompletionEntry {
1705
+ name: string;
1706
+ kind: string;
1707
+ kindModifiers: string;
1708
+ }
1709
+ interface CompletionEntryDetails {
1710
+ name: string;
1711
+ kind: string;
1712
+ kindModifiers: string;
1713
+ displayParts: SymbolDisplayPart[];
1714
+ documentation: SymbolDisplayPart[];
1715
+ }
1716
+ interface OutliningSpan {
1717
+ /** The span of the document to actually collapse. */
1718
+ textSpan: TextSpan;
1719
+ /** The span of the document to display when the user hovers over the collapsed span. */
1720
+ hintSpan: TextSpan;
1721
+ /** The text to display in the editor for the collapsed region. */
1722
+ bannerText: string;
1723
+ /**
1724
+ * Whether or not this region should be automatically collapsed when
1725
+ * the 'Collapse to Definitions' command is invoked.
1726
+ */
1727
+ autoCollapse: boolean;
1728
+ }
1729
+ interface EmitOutput {
1730
+ outputFiles: OutputFile[];
1731
+ emitOutputStatus: EmitReturnStatus;
1732
+ }
1733
+ const enum OutputFileType {
1734
+ JavaScript = 0,
1735
+ SourceMap = 1,
1736
+ Declaration = 2,
1737
+ }
1738
+ interface OutputFile {
1739
+ name: string;
1740
+ writeByteOrderMark: boolean;
1741
+ text: string;
1742
+ }
1743
+ const enum EndOfLineState {
1744
+ Start = 0,
1745
+ InMultiLineCommentTrivia = 1,
1746
+ InSingleQuoteStringLiteral = 2,
1747
+ InDoubleQuoteStringLiteral = 3,
1748
+ }
1749
+ enum TokenClass {
1750
+ Punctuation = 0,
1751
+ Keyword = 1,
1752
+ Operator = 2,
1753
+ Comment = 3,
1754
+ Whitespace = 4,
1755
+ Identifier = 5,
1756
+ NumberLiteral = 6,
1757
+ StringLiteral = 7,
1758
+ RegExpLiteral = 8,
1759
+ }
1760
+ interface ClassificationResult {
1761
+ finalLexState: EndOfLineState;
1762
+ entries: ClassificationInfo[];
1763
+ }
1764
+ interface ClassificationInfo {
1765
+ length: number;
1766
+ classification: TokenClass;
1767
+ }
1768
+ interface Classifier {
1769
+ getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult;
1770
+ }
1771
+ interface DocumentRegistry {
1772
+ acquireDocument(filename: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean): SourceFile;
1773
+ updateDocument(sourceFile: SourceFile, filename: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile;
1774
+ releaseDocument(filename: string, compilationSettings: CompilerOptions): void;
1775
+ }
1776
+ class ScriptElementKind {
1777
+ static unknown: string;
1778
+ static keyword: string;
1779
+ static scriptElement: string;
1780
+ static moduleElement: string;
1781
+ static classElement: string;
1782
+ static interfaceElement: string;
1783
+ static typeElement: string;
1784
+ static enumElement: string;
1785
+ static variableElement: string;
1786
+ static localVariableElement: string;
1787
+ static functionElement: string;
1788
+ static localFunctionElement: string;
1789
+ static memberFunctionElement: string;
1790
+ static memberGetAccessorElement: string;
1791
+ static memberSetAccessorElement: string;
1792
+ static memberVariableElement: string;
1793
+ static constructorImplementationElement: string;
1794
+ static callSignatureElement: string;
1795
+ static indexSignatureElement: string;
1796
+ static constructSignatureElement: string;
1797
+ static parameterElement: string;
1798
+ static typeParameterElement: string;
1799
+ static primitiveType: string;
1800
+ static label: string;
1801
+ static alias: string;
1802
+ static constElement: string;
1803
+ static letElement: string;
1804
+ }
1805
+ class ScriptElementKindModifier {
1806
+ static none: string;
1807
+ static publicMemberModifier: string;
1808
+ static privateMemberModifier: string;
1809
+ static protectedMemberModifier: string;
1810
+ static exportedModifier: string;
1811
+ static ambientModifier: string;
1812
+ static staticModifier: string;
1813
+ }
1814
+ class ClassificationTypeNames {
1815
+ static comment: string;
1816
+ static identifier: string;
1817
+ static keyword: string;
1818
+ static numericLiteral: string;
1819
+ static operator: string;
1820
+ static stringLiteral: string;
1821
+ static whiteSpace: string;
1822
+ static text: string;
1823
+ static punctuation: string;
1824
+ static className: string;
1825
+ static enumName: string;
1826
+ static interfaceName: string;
1827
+ static moduleName: string;
1828
+ static typeParameterName: string;
1829
+ static typeAlias: string;
1830
+ }
1831
+ interface DisplayPartsSymbolWriter extends SymbolWriter {
1832
+ displayParts(): SymbolDisplayPart[];
1833
+ }
1834
+ function displayPartsToString(displayParts: SymbolDisplayPart[]): string;
1835
+ function getDefaultCompilerOptions(): CompilerOptions;
1836
+ class OperationCanceledException {
1837
+ }
1838
+ class CancellationTokenObject {
1839
+ private cancellationToken;
1840
+ static None: CancellationTokenObject;
1841
+ constructor(cancellationToken: CancellationToken);
1842
+ isCancellationRequested(): boolean;
1843
+ throwIfCancellationRequested(): void;
1844
+ }
1845
+ function createDocumentRegistry(): DocumentRegistry;
1846
+ function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
1847
+ function createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry): LanguageService;
1848
+ function createClassifier(host: Logger): Classifier;
1849
+ }