From abe4076417a9232377498a6e113b70ac7c9d2105 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 23 Mar 2015 17:29:01 -0700 Subject: [PATCH 01/69] Change error message to be more general --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticInformationMap.generated.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- tests/baselines/reference/for-of14.errors.txt | 4 ++-- tests/baselines/reference/for-of16.errors.txt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6fdaac79cea..867c9dbabaa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9320,7 +9320,7 @@ module ts { let iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, SignatureKind.Call) : emptyArray; if (iteratorFunctionSignatures.length === 0) { if (expressionForError) { - error(expressionForError, Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + error(expressionForError, Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } @@ -9338,7 +9338,7 @@ module ts { let iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, SignatureKind.Call) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { if (expressionForError) { - error(expressionForError, Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + error(expressionForError, Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 967afd171ba..d19a5a28357 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -340,8 +340,8 @@ module ts { The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6e24afad80c..a54e358be5a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1352,11 +1352,11 @@ "category": "Error", "code": 2487 }, - "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator.": { + "Type must have a '[Symbol.iterator]()' method that returns an iterator.": { "category": "Error", "code": 2488 }, - "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method.": { + "An iterator must have a 'next()' method.": { "category": "Error", "code": 2489 }, diff --git a/tests/baselines/reference/for-of14.errors.txt b/tests/baselines/reference/for-of14.errors.txt index 5e8223381c7..ab95d042689 100644 --- a/tests/baselines/reference/for-of14.errors.txt +++ b/tests/baselines/reference/for-of14.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator. +tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. ==== tests/cases/conformance/es6/for-ofStatements/for-of14.ts (1 errors) ==== var v: string; for (v of new StringIterator) { } // Should fail because the iterator is not iterable ~~~~~~~~~~~~~~~~~~ -!!! error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. class StringIterator { next() { diff --git a/tests/baselines/reference/for-of16.errors.txt b/tests/baselines/reference/for-of16.errors.txt index e3ecca1a256..20e3e876537 100644 --- a/tests/baselines/reference/for-of16.errors.txt +++ b/tests/baselines/reference/for-of16.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of16.ts(2,11): error TS2489: The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method. +tests/cases/conformance/es6/for-ofStatements/for-of16.ts(2,11): error TS2489: An iterator must have a 'next()' method. ==== tests/cases/conformance/es6/for-ofStatements/for-of16.ts (1 errors) ==== var v: string; for (v of new StringIterator) { } // Should fail ~~~~~~~~~~~~~~~~~~ -!!! error TS2489: The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method. +!!! error TS2489: An iterator must have a 'next()' method. class StringIterator { [Symbol.iterator]() { From 3497e27d561214174b9b686b36dae71b44cabad9 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 23 Mar 2015 18:22:43 -0700 Subject: [PATCH 02/69] Add spread to typeWriter --- src/harness/typeWriter.ts | 1 + .../reference/arrayLiteralSpread.types | 22 +++++++++++++++++++ .../reference/callWithSpreadES6.types | 13 +++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 54cdc27e3b3..e645c8b765c 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -53,6 +53,7 @@ class TypeWriterWalker { case ts.SyntaxKind.PostfixUnaryExpression: case ts.SyntaxKind.BinaryExpression: case ts.SyntaxKind.ConditionalExpression: + case ts.SyntaxKind.SpreadElementExpression: this.log(node, this.getTypeOfNode(node)); break; diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 0dae59521bf..3122c0628af 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -9,44 +9,55 @@ function f0() { var a1 = [...a]; >a1 : number[] >[...a] : number[] +>...a : number[] >a : number[] var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] +>...a : number[] >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] +>...a : number[] >a : number[] var a4 = [...a, 1]; >a4 : number[] >[...a, 1] : number[] +>...a : number[] >a : number[] var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] +>...a : number[] >a : number[] var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] +>...a : number[] >a : number[] var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] +>...a : number[] >a : number[] +>...a : number[] >a : number[] var a8 = [...a, ...a, ...a]; >a8 : number[] >[...a, ...a, ...a] : number[] +>...a : number[] >a : number[] +>...a : number[] >a : number[] +>...a : number[] >a : number[] } @@ -60,6 +71,7 @@ function f1() { var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] +>...a : number[] >a : number[] var b: (string | number | boolean)[]; @@ -72,19 +84,29 @@ function f2() { var a = [...[...[...[...[...[]]]]]]; >a : any[] >[...[...[...[...[...[]]]]]] : undefined[] +>...[...[...[...[...[]]]]] : undefined[] >[...[...[...[...[]]]]] : undefined[] +>...[...[...[...[]]]] : undefined[] >[...[...[...[]]]] : undefined[] +>...[...[...[]]] : undefined[] >[...[...[]]] : undefined[] +>...[...[]] : undefined[] >[...[]] : undefined[] +>...[] : undefined[] >[] : undefined[] var b = [...[...[...[...[...[5]]]]]]; >b : number[] >[...[...[...[...[...[5]]]]]] : number[] +>...[...[...[...[...[5]]]]] : number[] >[...[...[...[...[5]]]]] : number[] +>...[...[...[...[5]]]] : number[] >[...[...[...[5]]]] : number[] +>...[...[...[5]]] : number[] >[...[...[5]]] : number[] +>...[...[5]] : number[] >[...[5]] : number[] +>...[5] : number[] >[5] : number[] } diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 8a75d21e4ef..1711926d773 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -38,11 +38,13 @@ foo(1, 2, "abc"); foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void +>...a : string[] >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>...a : string[] >a : string[] obj.foo(1, 2, "abc"); @@ -56,6 +58,7 @@ obj.foo(1, 2, ...a); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] obj.foo(1, 2, ...a, "abc"); @@ -63,6 +66,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] (obj.foo)(1, 2, "abc"); @@ -78,6 +82,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] (obj.foo)(1, 2, ...a, "abc"); @@ -86,6 +91,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] xa[1].foo(1, 2, "abc"); @@ -101,6 +107,7 @@ xa[1].foo(1, 2, ...a); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] xa[1].foo(1, 2, ...a, "abc"); @@ -109,6 +116,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...a : string[] >a : string[] (xa[1].foo)(...[1, 2, "abc"]); @@ -120,6 +128,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...[1, 2, "abc"] : (string | number)[] >[1, 2, "abc"] : (string | number)[] class C { @@ -145,6 +154,7 @@ class C { >foo : (x: number, y: number, ...z: string[]) => void >x : number >y : number +>...z : string[] >z : string[] } foo(x: number, y: number, ...z: string[]) { @@ -167,6 +177,7 @@ class D extends C { super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C +>...a : string[] >a : string[] } foo() { @@ -183,6 +194,7 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>...a : string[] >a : string[] } } @@ -192,5 +204,6 @@ var c = new C(1, 2, ...a); >c : C >new C(1, 2, ...a) : C >C : typeof C +>...a : string[] >a : string[] From b7f2990305d72c2084ad3b6ee67f3b9da878e636 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 23 Mar 2015 19:30:03 -0700 Subject: [PATCH 03/69] Refactor checkSpreadElementExpression to get the element type internally --- src/compiler/checker.ts | 45 +++++++++---------- .../reference/arrayLiteralSpread.types | 44 +++++++++--------- .../reference/callWithSpreadES6.types | 26 +++++------ 3 files changed, 55 insertions(+), 60 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 867c9dbabaa..f095c8574c5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5911,12 +5911,17 @@ module ts { } function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type { - let type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; + let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + if (languageVersion >= ScriptTarget.ES6) { + // Check for iterable, not yet implemented } - return type; + + if (isArrayLikeType(arrayOrIterableType)) { + return getIndexTypeOfType(arrayOrIterableType, IndexKind.Number); + } + + error(node.expression, Diagnostics.Type_0_is_not_an_array_type, typeToString(arrayOrIterableType)); + return unknownType; } function checkArrayLiteral(node: ArrayLiteralExpression, contextualMapper?: TypeMapper): Type { @@ -5924,18 +5929,13 @@ module ts { if (!elements.length) { return createArrayType(undefinedType); } - let hasSpreadElement: boolean = false; + let hasSpreadElement = false; let elementTypes: Type[] = []; - forEach(elements, e => { + for (let e of elements) { let type = checkExpression(e, contextualMapper); - if (e.kind === SyntaxKind.SpreadElementExpression) { - elementTypes.push(getIndexTypeOfType(type, IndexKind.Number) || anyType); - hasSpreadElement = true; - } - else { - elementTypes.push(type); - } - }); + elementTypes.push(type); + hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression; + } if (!hasSpreadElement) { let contextualType = getContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { @@ -6558,7 +6558,7 @@ module ts { for (let i = 0; i < args.length; i++) { let arg = args[i]; if (arg.kind !== SyntaxKind.OmittedExpression) { - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); let argType: Type; if (i === 0 && args[i].parent.kind === SyntaxKind.TaggedTemplateExpression) { argType = globalTemplateStringsArrayType; @@ -6581,7 +6581,7 @@ module ts { // No need to check for omitted args and template expressions, their exlusion value is always undefined if (excludeArgument[i] === false) { let arg = args[i]; - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -6614,7 +6614,7 @@ module ts { let arg = args[i]; if (arg.kind !== SyntaxKind.OmittedExpression) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); // A tagged template expression provides a special first argument, and string literals get string literal types // unless we're reporting errors let argType = i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression ? globalTemplateStringsArrayType : @@ -7088,14 +7088,9 @@ module ts { } function getTypeAtPosition(signature: Signature, pos: number): Type { - if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; - } return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature: Signature, context: Signature, mapper: TypeMapper) { diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 3122c0628af..73d4f6013ed 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -9,55 +9,55 @@ function f0() { var a1 = [...a]; >a1 : number[] >[...a] : number[] ->...a : number[] +>...a : number >a : number[] var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] ->...a : number[] +>...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] ->...a : number[] +>...a : number >a : number[] var a4 = [...a, 1]; >a4 : number[] >[...a, 1] : number[] ->...a : number[] +>...a : number >a : number[] var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] ->...a : number[] +>...a : number >a : number[] var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] ->...a : number[] +>...a : number >a : number[] var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] ->...a : number[] +>...a : number >a : number[] ->...a : number[] +>...a : number >a : number[] var a8 = [...a, ...a, ...a]; >a8 : number[] >[...a, ...a, ...a] : number[] ->...a : number[] +>...a : number >a : number[] ->...a : number[] +>...a : number >a : number[] ->...a : number[] +>...a : number >a : number[] } @@ -71,7 +71,7 @@ function f1() { var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] ->...a : number[] +>...a : number >a : number[] var b: (string | number | boolean)[]; @@ -84,29 +84,29 @@ function f2() { var a = [...[...[...[...[...[]]]]]]; >a : any[] >[...[...[...[...[...[]]]]]] : undefined[] ->...[...[...[...[...[]]]]] : undefined[] +>...[...[...[...[...[]]]]] : undefined >[...[...[...[...[]]]]] : undefined[] ->...[...[...[...[]]]] : undefined[] +>...[...[...[...[]]]] : undefined >[...[...[...[]]]] : undefined[] ->...[...[...[]]] : undefined[] +>...[...[...[]]] : undefined >[...[...[]]] : undefined[] ->...[...[]] : undefined[] +>...[...[]] : undefined >[...[]] : undefined[] ->...[] : undefined[] +>...[] : undefined >[] : undefined[] var b = [...[...[...[...[...[5]]]]]]; >b : number[] >[...[...[...[...[...[5]]]]]] : number[] ->...[...[...[...[...[5]]]]] : number[] +>...[...[...[...[...[5]]]]] : number >[...[...[...[...[5]]]]] : number[] ->...[...[...[...[5]]]] : number[] +>...[...[...[...[5]]]] : number >[...[...[...[5]]]] : number[] ->...[...[...[5]]] : number[] +>...[...[...[5]]] : number >[...[...[5]]] : number[] ->...[...[5]] : number[] +>...[...[5]] : number >[...[5]] : number[] ->...[5] : number[] +>...[5] : number >[5] : number[] } diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 1711926d773..10dd611d213 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -38,13 +38,13 @@ foo(1, 2, "abc"); foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void ->...a : string[] +>...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->...a : string[] +>...a : string >a : string[] obj.foo(1, 2, "abc"); @@ -58,7 +58,7 @@ obj.foo(1, 2, ...a); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] obj.foo(1, 2, ...a, "abc"); @@ -66,7 +66,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] (obj.foo)(1, 2, "abc"); @@ -82,7 +82,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] (obj.foo)(1, 2, ...a, "abc"); @@ -91,7 +91,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] xa[1].foo(1, 2, "abc"); @@ -107,7 +107,7 @@ xa[1].foo(1, 2, ...a); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] xa[1].foo(1, 2, ...a, "abc"); @@ -116,7 +116,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any ->...a : string[] +>...a : string >a : string[] (xa[1].foo)(...[1, 2, "abc"]); @@ -128,7 +128,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any ->...[1, 2, "abc"] : (string | number)[] +>...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] class C { @@ -154,7 +154,7 @@ class C { >foo : (x: number, y: number, ...z: string[]) => void >x : number >y : number ->...z : string[] +>...z : string >z : string[] } foo(x: number, y: number, ...z: string[]) { @@ -177,7 +177,7 @@ class D extends C { super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C ->...a : string[] +>...a : string >a : string[] } foo() { @@ -194,7 +194,7 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->...a : string[] +>...a : string >a : string[] } } @@ -204,6 +204,6 @@ var c = new C(1, 2, ...a); >c : C >new C(1, 2, ...a) : C >C : typeof C ->...a : string[] +>...a : string >a : string[] From 2288946afc0dded99f92ef19bf5e3c5deaea1f51 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 24 Mar 2015 16:33:24 -0700 Subject: [PATCH 04/69] Support iterators in spread element --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f095c8574c5..c3a9b2960ef 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5913,7 +5913,7 @@ module ts { function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type { let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); if (languageVersion >= ScriptTarget.ES6) { - // Check for iterable, not yet implemented + return checkIteratedType(arrayOrIterableType, node.expression) || unknownType; } if (isArrayLikeType(arrayOrIterableType)) { From 376574d1be89195a34c5b04ce33ecc41282919f2 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 24 Mar 2015 16:33:56 -0700 Subject: [PATCH 05/69] Add tests for iterator spread in an array literal --- .../reference/iteratorSpreadInArray.js | 31 +++++++++ .../reference/iteratorSpreadInArray.types | 37 ++++++++++ .../iteratorSpreadInArray10.errors.txt | 13 ++++ .../reference/iteratorSpreadInArray10.js | 18 +++++ .../reference/iteratorSpreadInArray2.js | 56 +++++++++++++++ .../reference/iteratorSpreadInArray2.types | 68 +++++++++++++++++++ .../reference/iteratorSpreadInArray3.js | 35 ++++++++++ .../reference/iteratorSpreadInArray3.types | 39 +++++++++++ .../reference/iteratorSpreadInArray4.js | 33 +++++++++ .../reference/iteratorSpreadInArray4.types | 37 ++++++++++ .../iteratorSpreadInArray5.errors.txt | 24 +++++++ .../reference/iteratorSpreadInArray5.js | 33 +++++++++ .../iteratorSpreadInArray6.errors.txt | 21 ++++++ .../reference/iteratorSpreadInArray6.js | 36 ++++++++++ .../reference/iteratorSpreadInArray7.js | 33 +++++++++ .../reference/iteratorSpreadInArray7.types | 43 ++++++++++++ .../iteratorSpreadInArray8.errors.txt | 16 +++++ .../reference/iteratorSpreadInArray8.js | 24 +++++++ .../iteratorSpreadInArray9.errors.txt | 33 +++++++++ .../reference/iteratorSpreadInArray9.js | 29 ++++++++ .../es6/spread/iteratorSpreadInArray.ts | 15 ++++ .../es6/spread/iteratorSpreadInArray10.ts | 8 +++ .../es6/spread/iteratorSpreadInArray2.ts | 28 ++++++++ .../es6/spread/iteratorSpreadInArray3.ts | 15 ++++ .../es6/spread/iteratorSpreadInArray4.ts | 15 ++++ .../es6/spread/iteratorSpreadInArray5.ts | 15 ++++ .../es6/spread/iteratorSpreadInArray6.ts | 16 +++++ .../es6/spread/iteratorSpreadInArray7.ts | 16 +++++ .../es6/spread/iteratorSpreadInArray8.ts | 11 +++ .../es6/spread/iteratorSpreadInArray9.ts | 14 ++++ 30 files changed, 812 insertions(+) create mode 100644 tests/baselines/reference/iteratorSpreadInArray.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray10.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray10.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray2.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray2.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray3.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray3.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray4.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray4.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray5.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray5.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray6.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray6.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray7.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray7.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray8.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray8.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray9.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray9.js create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts diff --git a/tests/baselines/reference/iteratorSpreadInArray.js b/tests/baselines/reference/iteratorSpreadInArray.js new file mode 100644 index 00000000000..ae1a2c5916c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInArray.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray.js] +var array = [ + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types new file mode 100644 index 00000000000..13b1a458eb9 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts === +var array = [...new SymbolIterator]; +>array : symbol[] +>[...new SymbolIterator] : symbol[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray10.errors.txt b/tests/baselines/reference/iteratorSpreadInArray10.errors.txt new file mode 100644 index 00000000000..90cde7d03b1 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray10.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts(1,17): error TS2489: An iterator must have a 'next()' method. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2489: An iterator must have a 'next()' method. + + class SymbolIterator { + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray10.js b/tests/baselines/reference/iteratorSpreadInArray10.js new file mode 100644 index 00000000000..c33d7e8a015 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray10.js @@ -0,0 +1,18 @@ +//// [iteratorSpreadInArray10.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray10.js] +var array = [ + ...new SymbolIterator +]; +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray2.js b/tests/baselines/reference/iteratorSpreadInArray2.js new file mode 100644 index 00000000000..4589d9bb904 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.js @@ -0,0 +1,56 @@ +//// [iteratorSpreadInArray2.ts] +var array = [...new NumberIterator, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray2.js] +var array = [ + ...new NumberIterator, + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types new file mode 100644 index 00000000000..3cb27445f57 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts === +var array = [...new NumberIterator, ...new SymbolIterator]; +>array : (number | symbol)[] +>[...new NumberIterator, ...new SymbolIterator] : (number | symbol)[] +>...new NumberIterator : number +>new NumberIterator : NumberIterator +>NumberIterator : typeof NumberIterator +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class NumberIterator { +>NumberIterator : NumberIterator + + next() { +>next : () => { value: number; done: boolean; } + + return { +>{ value: 0, done: false } : { value: number; done: boolean; } + + value: 0, +>value : number + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : NumberIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.js b/tests/baselines/reference/iteratorSpreadInArray3.js new file mode 100644 index 00000000000..b9eac64b29f --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.js @@ -0,0 +1,35 @@ +//// [iteratorSpreadInArray3.ts] +var array = [...[0, 1], ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray3.js] +var array = [ + ...[ + 0, + 1 + ], + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types new file mode 100644 index 00000000000..e5c25daabc7 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts === +var array = [...[0, 1], ...new SymbolIterator]; +>array : (number | symbol)[] +>[...[0, 1], ...new SymbolIterator] : (number | symbol)[] +>...[0, 1] : number +>[0, 1] : number[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.js b/tests/baselines/reference/iteratorSpreadInArray4.js new file mode 100644 index 00000000000..22571495f05 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.js @@ -0,0 +1,33 @@ +//// [iteratorSpreadInArray4.ts] +var array = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray4.js] +var array = [ + 0, + 1, + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types new file mode 100644 index 00000000000..790fc9db1ba --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts === +var array = [0, 1, ...new SymbolIterator]; +>array : (number | symbol)[] +>[0, 1, ...new SymbolIterator] : (number | symbol)[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray5.errors.txt b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt new file mode 100644 index 00000000000..498cc7d48ef --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts(1,5): error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. + Type 'number | symbol' is not assignable to type 'number'. + Type 'symbol' is not assignable to type 'number'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts (1 errors) ==== + var array: number[] = [0, 1, ...new SymbolIterator]; + ~~~~~ +!!! error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. +!!! error TS2322: Type 'number | symbol' is not assignable to type 'number'. +!!! error TS2322: Type 'symbol' is not assignable to type 'number'. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray5.js b/tests/baselines/reference/iteratorSpreadInArray5.js new file mode 100644 index 00000000000..b5e4c95d22b --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray5.js @@ -0,0 +1,33 @@ +//// [iteratorSpreadInArray5.ts] +var array: number[] = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray5.js] +var array = [ + 0, + 1, + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt new file mode 100644 index 00000000000..b90ac5f203c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(2,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== + var array: number[] = [0, 1]; + array.concat([...new SymbolIterator]); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number'. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.js b/tests/baselines/reference/iteratorSpreadInArray6.js new file mode 100644 index 00000000000..df34201b827 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray6.js @@ -0,0 +1,36 @@ +//// [iteratorSpreadInArray6.ts] +var array: number[] = [0, 1]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray6.js] +var array = [ + 0, + 1 +]; +array.concat([ + ...new SymbolIterator +]); +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.js b/tests/baselines/reference/iteratorSpreadInArray7.js new file mode 100644 index 00000000000..ca7acd5a786 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.js @@ -0,0 +1,33 @@ +//// [iteratorSpreadInArray7.ts] +var array: symbol[]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray7.js] +var array; +array.concat([ + ...new SymbolIterator +]); +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types new file mode 100644 index 00000000000..c58d01f098b --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -0,0 +1,43 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts === +var array: symbol[]; +>array : symbol[] + +array.concat([...new SymbolIterator]); +>array.concat([...new SymbolIterator]) : symbol[] +>array.concat : { (...items: U[]): symbol[]; (...items: symbol[]): symbol[]; } +>array : symbol[] +>concat : { (...items: U[]): symbol[]; (...items: symbol[]): symbol[]; } +>[...new SymbolIterator] : symbol[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray8.errors.txt b/tests/baselines/reference/iteratorSpreadInArray8.errors.txt new file mode 100644 index 00000000000..365bc8db9c2 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray8.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts(1,17): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray8.js b/tests/baselines/reference/iteratorSpreadInArray8.js new file mode 100644 index 00000000000..e1edeee1168 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray8.js @@ -0,0 +1,24 @@ +//// [iteratorSpreadInArray8.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} + +//// [iteratorSpreadInArray8.js] +var array = [ + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt new file mode 100644 index 00000000000..e0e3d061f16 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => SymbolIterator' is not assignable to type '() => Iterator'. + Type 'SymbolIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. + Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. + Property 'done' is missing in type '{ value: symbol; }'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. +!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator'. +!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. +!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. +!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'. + + class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray9.js b/tests/baselines/reference/iteratorSpreadInArray9.js new file mode 100644 index 00000000000..93de78065fb --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray9.js @@ -0,0 +1,29 @@ +//// [iteratorSpreadInArray9.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray9.js] +var array = [ + ...new SymbolIterator +]; +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts new file mode 100644 index 00000000000..4b4f3e8cc1c --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts new file mode 100644 index 00000000000..f8549b82b76 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts @@ -0,0 +1,8 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts new file mode 100644 index 00000000000..9db5d010874 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts @@ -0,0 +1,28 @@ +//@target: ES6 +var array = [...new NumberIterator, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts new file mode 100644 index 00000000000..174c97de7cc --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [...[0, 1], ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts new file mode 100644 index 00000000000..47c2e633702 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts new file mode 100644 index 00000000000..e6a8041a961 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array: number[] = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts new file mode 100644 index 00000000000..7495ca6aac6 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts @@ -0,0 +1,16 @@ +//@target: ES6 +var array: number[] = [0, 1]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts new file mode 100644 index 00000000000..12ca478c738 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts @@ -0,0 +1,16 @@ +//@target: ES6 +var array: symbol[]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts new file mode 100644 index 00000000000..0e2258aa5ea --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts @@ -0,0 +1,11 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts new file mode 100644 index 00000000000..2b8d93c9ccb --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file From 4a0af76064ae039efd99b47133eb35a21c1cc43f Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 24 Mar 2015 16:52:00 -0700 Subject: [PATCH 06/69] Add tests for iterator spread in call --- .../reference/iteratorSpreadInCall.errors.txt | 21 +++++ .../reference/iteratorSpreadInCall.js | 32 ++++++++ .../iteratorSpreadInCall10.errors.txt | 22 +++++ .../reference/iteratorSpreadInCall10.js | 34 ++++++++ .../reference/iteratorSpreadInCall11.js | 34 ++++++++ .../reference/iteratorSpreadInCall11.types | 45 +++++++++++ .../reference/iteratorSpreadInCall12.js | 66 +++++++++++++++ .../reference/iteratorSpreadInCall12.types | 81 +++++++++++++++++++ .../iteratorSpreadInCall2.errors.txt | 21 +++++ .../reference/iteratorSpreadInCall2.js | 32 ++++++++ .../reference/iteratorSpreadInCall3.js | 32 ++++++++ .../reference/iteratorSpreadInCall3.types | 41 ++++++++++ .../iteratorSpreadInCall4.errors.txt | 21 +++++ .../reference/iteratorSpreadInCall4.js | 32 ++++++++ .../reference/iteratorSpreadInCall5.js | 56 +++++++++++++ .../reference/iteratorSpreadInCall5.types | 72 +++++++++++++++++ .../iteratorSpreadInCall6.errors.txt | 36 +++++++++ .../reference/iteratorSpreadInCall6.js | 56 +++++++++++++ .../iteratorSpreadInCall7.errors.txt | 36 +++++++++ .../reference/iteratorSpreadInCall7.js | 57 +++++++++++++ .../iteratorSpreadInCall8.errors.txt | 39 +++++++++ .../reference/iteratorSpreadInCall8.js | 61 ++++++++++++++ .../iteratorSpreadInCall9.errors.txt | 39 +++++++++ .../reference/iteratorSpreadInCall9.js | 63 +++++++++++++++ .../es6/spread/iteratorSpreadInCall.ts | 16 ++++ .../es6/spread/iteratorSpreadInCall10.ts | 17 ++++ .../es6/spread/iteratorSpreadInCall11.ts | 17 ++++ .../es6/spread/iteratorSpreadInCall12.ts | 32 ++++++++ .../es6/spread/iteratorSpreadInCall2.ts | 16 ++++ .../es6/spread/iteratorSpreadInCall3.ts | 16 ++++ .../es6/spread/iteratorSpreadInCall4.ts | 16 ++++ .../es6/spread/iteratorSpreadInCall5.ts | 29 +++++++ .../es6/spread/iteratorSpreadInCall6.ts | 29 +++++++ .../es6/spread/iteratorSpreadInCall7.ts | 29 +++++++ .../es6/spread/iteratorSpreadInCall8.ts | 32 ++++++++ .../es6/spread/iteratorSpreadInCall9.ts | 32 ++++++++ 36 files changed, 1310 insertions(+) create mode 100644 tests/baselines/reference/iteratorSpreadInCall.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall10.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall10.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall11.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall11.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall12.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall12.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall2.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall2.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall3.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall3.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall4.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall4.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall5.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall5.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall6.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall6.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall7.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall7.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall8.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall8.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall9.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall9.js create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts diff --git a/tests/baselines/reference/iteratorSpreadInCall.errors.txt b/tests/baselines/reference/iteratorSpreadInCall.errors.txt new file mode 100644 index 00000000000..614153192d7 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: symbol) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall.js b/tests/baselines/reference/iteratorSpreadInCall.js new file mode 100644 index 00000000000..0dcff404f53 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall.ts] +foo(...new SymbolIterator); + +function foo(s: symbol) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall.js] +foo(...new SymbolIterator); +function foo(s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall10.errors.txt b/tests/baselines/reference/iteratorSpreadInCall10.errors.txt new file mode 100644 index 00000000000..04d9045e86c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall10.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: T[]) { return s[0] } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall10.js b/tests/baselines/reference/iteratorSpreadInCall10.js new file mode 100644 index 00000000000..5c400ae2c30 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall10.js @@ -0,0 +1,34 @@ +//// [iteratorSpreadInCall10.ts] +foo(...new SymbolIterator); + +function foo(s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall10.js] +foo(...new SymbolIterator); +function foo(s) { + return s[0]; +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.js b/tests/baselines/reference/iteratorSpreadInCall11.js new file mode 100644 index 00000000000..a3cccb96409 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.js @@ -0,0 +1,34 @@ +//// [iteratorSpreadInCall11.ts] +foo(...new SymbolIterator); + +function foo(...s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall11.js] +foo(...new SymbolIterator); +function foo(...s) { + return s[0]; +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types new file mode 100644 index 00000000000..a37fc6e2232 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts === +foo(...new SymbolIterator); +>foo(...new SymbolIterator) : symbol +>foo : (...s: T[]) => T +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +function foo(...s: T[]) { return s[0] } +>foo : (...s: T[]) => T +>T : T +>s : T[] +>T : T +>s[0] : T +>s : T[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.js b/tests/baselines/reference/iteratorSpreadInCall12.js new file mode 100644 index 00000000000..dd95cab0cf8 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.js @@ -0,0 +1,66 @@ +//// [iteratorSpreadInCall12.ts] +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall12.js] +new Foo(...[ + ...new SymbolIterator, + ...[ + ...new StringIterator + ] +]); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types new file mode 100644 index 00000000000..78ce973a532 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -0,0 +1,81 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts === +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +>new Foo(...[...new SymbolIterator, ...[...new StringIterator]]) : Foo +>Foo : typeof Foo +>...[...new SymbolIterator, ...[...new StringIterator]] : string | symbol +>[...new SymbolIterator, ...[...new StringIterator]] : (string | symbol)[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator +>...[...new StringIterator] : string +>[...new StringIterator] : string[] +>...new StringIterator : string +>new StringIterator : StringIterator +>StringIterator : typeof StringIterator + +class Foo { +>Foo : Foo +>T : T + + constructor(...s: T[]) { } +>s : T[] +>T : T +} + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class StringIterator { +>StringIterator : StringIterator + + next() { +>next : () => { value: string; done: boolean; } + + return { +>{ value: "", done: false } : { value: string; done: boolean; } + + value: "", +>value : string + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : StringIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall2.errors.txt b/tests/baselines/reference/iteratorSpreadInCall2.errors.txt new file mode 100644 index 00000000000..bd994ab37b0 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: symbol[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall2.js b/tests/baselines/reference/iteratorSpreadInCall2.js new file mode 100644 index 00000000000..d833cd77fb0 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall2.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall2.ts] +foo(...new SymbolIterator); + +function foo(s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall2.js] +foo(...new SymbolIterator); +function foo(s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.js b/tests/baselines/reference/iteratorSpreadInCall3.js new file mode 100644 index 00000000000..17d0a3ed37d --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall3.ts] +foo(...new SymbolIterator); + +function foo(...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall3.js] +foo(...new SymbolIterator); +function foo(...s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types new file mode 100644 index 00000000000..07eb149ba31 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -0,0 +1,41 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts === +foo(...new SymbolIterator); +>foo(...new SymbolIterator) : void +>foo : (...s: symbol[]) => void +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +function foo(...s: symbol[]) { } +>foo : (...s: symbol[]) => void +>s : symbol[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall4.errors.txt b/tests/baselines/reference/iteratorSpreadInCall4.errors.txt new file mode 100644 index 00000000000..0e0a40a512f --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall4.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s1: symbol, ...s: symbol[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall4.js b/tests/baselines/reference/iteratorSpreadInCall4.js new file mode 100644 index 00000000000..e1888f47634 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall4.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall4.ts] +foo(...new SymbolIterator); + +function foo(s1: symbol, ...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall4.js] +foo(...new SymbolIterator); +function foo(s1, ...s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.js b/tests/baselines/reference/iteratorSpreadInCall5.js new file mode 100644 index 00000000000..2b7be4cdce6 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.js @@ -0,0 +1,56 @@ +//// [iteratorSpreadInCall5.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | string)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall5.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types new file mode 100644 index 00000000000..6e924a1ef42 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -0,0 +1,72 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts === +foo(...new SymbolIterator, ...new StringIterator); +>foo(...new SymbolIterator, ...new StringIterator) : void +>foo : (...s: (string | symbol)[]) => void +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator +>...new StringIterator : string +>new StringIterator : StringIterator +>StringIterator : typeof StringIterator + +function foo(...s: (symbol | string)[]) { } +>foo : (...s: (string | symbol)[]) => void +>s : (string | symbol)[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class StringIterator { +>StringIterator : StringIterator + + next() { +>next : () => { value: string; done: boolean; } + + return { +>{ value: "", done: false } : { value: string; done: boolean; } + + value: "", +>value : string + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : StringIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall6.errors.txt b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt new file mode 100644 index 00000000000..be085beb632 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(1,28): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'. + Type 'string' is not assignable to type 'symbol'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts (1 errors) ==== + foo(...new SymbolIterator, ...new StringIterator); + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'. +!!! error TS2345: Type 'string' is not assignable to type 'symbol'. + + function foo(...s: (symbol | number)[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall6.js b/tests/baselines/reference/iteratorSpreadInCall6.js new file mode 100644 index 00000000000..87e96d039de --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall6.js @@ -0,0 +1,56 @@ +//// [iteratorSpreadInCall6.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | number)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall6.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall7.errors.txt b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt new file mode 100644 index 00000000000..51cae1d72b2 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts(1,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts (1 errors) ==== + foo(...new SymbolIterator, ...new StringIterator); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + function foo(...s: T[]) { return s[0]; } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall7.js b/tests/baselines/reference/iteratorSpreadInCall7.js new file mode 100644 index 00000000000..1b7e53ba47a --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall7.js @@ -0,0 +1,57 @@ +//// [iteratorSpreadInCall7.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: T[]) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall7.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { + return s[0]; +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall8.errors.txt b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt new file mode 100644 index 00000000000..d7913458b6a --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts(1,5): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts (1 errors) ==== + new Foo(...new SymbolIterator, ...new StringIterator); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + class Foo { + constructor(...s: T[]) { } + } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall8.js b/tests/baselines/reference/iteratorSpreadInCall8.js new file mode 100644 index 00000000000..ac22bbcf5a3 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall8.js @@ -0,0 +1,61 @@ +//// [iteratorSpreadInCall8.ts] +new Foo(...new SymbolIterator, ...new StringIterator); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall8.js] +new Foo(...new SymbolIterator, ...new StringIterator); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall9.errors.txt b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt new file mode 100644 index 00000000000..da2ee7f8efc --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts(1,5): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts (1 errors) ==== + new Foo(...new SymbolIterator, ...[...new StringIterator]); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + class Foo { + constructor(...s: T[]) { } + } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall9.js b/tests/baselines/reference/iteratorSpreadInCall9.js new file mode 100644 index 00000000000..2efd94683c0 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall9.js @@ -0,0 +1,63 @@ +//// [iteratorSpreadInCall9.ts] +new Foo(...new SymbolIterator, ...[...new StringIterator]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall9.js] +new Foo(...new SymbolIterator, ...[ + ...new StringIterator +]); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts new file mode 100644 index 00000000000..85d07e56996 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: symbol) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts new file mode 100644 index 00000000000..bf8ad336fbf --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts @@ -0,0 +1,17 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts new file mode 100644 index 00000000000..182e454cfc8 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts @@ -0,0 +1,17 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(...s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts new file mode 100644 index 00000000000..a0bd1ede193 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts new file mode 100644 index 00000000000..4a8fd9ff389 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts new file mode 100644 index 00000000000..b6e8fe0c86b --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts new file mode 100644 index 00000000000..2a73fd6f3c9 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s1: symbol, ...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts new file mode 100644 index 00000000000..c17c4156e65 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | string)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts new file mode 100644 index 00000000000..2c6150f8040 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | number)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts new file mode 100644 index 00000000000..56fb7936eb7 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: T[]) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts new file mode 100644 index 00000000000..e5b969456b7 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...new SymbolIterator, ...new StringIterator); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts new file mode 100644 index 00000000000..470f99844ba --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...new SymbolIterator, ...[...new StringIterator]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file From 8c2cd2610317dcc0f22f3f57c60c959a2cb53e41 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 24 Mar 2015 18:29:52 -0700 Subject: [PATCH 07/69] Add createIterableType --- src/compiler/checker.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c3a9b2960ef..80e0ebfc665 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3408,6 +3408,10 @@ module ts { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType: Type): Type { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } + function createArrayType(elementType: Type): Type { // globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if // user code augments the Array type with call or construct signatures that have an array type as the return type. @@ -9268,10 +9272,7 @@ module ts { // Now even though we have extracted the iteratedType, we will have to validate that the type // passed in is actually an Iterable. if (expressionForError && iteratedType) { - let completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + checkTypeAssignableTo(iterable, createIterableType(iteratedType), expressionForError); } return iteratedType; From 42ed6aab89ff1bd739f11ba6f0ab1bbfb57e38fe Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 24 Mar 2015 18:39:25 -0700 Subject: [PATCH 08/69] getTypeFromArrayBindingPattern returns an iterable in ES6 --- src/compiler/checker.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 80e0ebfc665..157ed8154c5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2153,7 +2153,16 @@ module ts { hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + var unionOfElements = getUnionType(elementTypes); + return languageVersion >= ScriptTarget.ES6 ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + } + + // If the pattern has at least one element, and no rest element, then it should imply a tuple type. + return createTupleType(elementTypes); } // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself From 806c9ce25b1a78ac442b5f6de169b4b02f7a15b2 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 12:08:19 -0700 Subject: [PATCH 09/69] Refactor iterable or array checks into checkIteratedTypeOrElementType --- src/compiler/checker.ts | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 157ed8154c5..c6c0300fd5a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2043,8 +2043,10 @@ module ts { } } else { - // For an array binding element the specified or inferred type of the parent must be an array-like type - if (!isArrayLikeType(parentType)) { + // In a ES3/ES5, we must be destructuring an array type. However, ES6 supports destructuring + // an iterator into an array pattern, so we suppress this error. If the parentType is not an iterator, + // there will be an error in checkIteratedType. + if (languageVersion < ScriptTarget.ES6 && !isArrayLikeType(parentType)) { error(pattern, Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); return unknownType; } @@ -5925,16 +5927,7 @@ module ts { function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type { let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - if (languageVersion >= ScriptTarget.ES6) { - return checkIteratedType(arrayOrIterableType, node.expression) || unknownType; - } - - if (isArrayLikeType(arrayOrIterableType)) { - return getIndexTypeOfType(arrayOrIterableType, IndexKind.Number); - } - - error(node.expression, Diagnostics.Type_0_is_not_an_array_type, typeToString(arrayOrIterableType)); - return unknownType; + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function checkArrayLiteral(node: ArrayLiteralExpression, contextualMapper?: TypeMapper): Type { @@ -9267,9 +9260,24 @@ module ts { function checkRightHandSideOfForOf(rhsExpression: Expression): Type { let expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= ScriptTarget.ES6 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); + } + + function checkIteratedTypeOrElementType(inputType: Type, expressionForError: Expression, allowStringInput: boolean): Type { + if (languageVersion >= ScriptTarget.ES6) { + return checkIteratedType(inputType, expressionForError) || anyType; + } + + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, expressionForError); + } + + if (isArrayLikeType(inputType)) { + return getIndexTypeOfType(inputType, IndexKind.Number); + } + + error(expressionForError, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; } /** From 06d6717859cb065492bfd65552f939ac9f3ed6e7 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 13:35:27 -0700 Subject: [PATCH 10/69] Type of an array binding element is the iterated type of its parent in ES6 --- src/compiler/checker.ts | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c6c0300fd5a..550ffa54103 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2046,14 +2046,12 @@ module ts { // In a ES3/ES5, we must be destructuring an array type. However, ES6 supports destructuring // an iterator into an array pattern, so we suppress this error. If the parentType is not an iterator, // there will be an error in checkIteratedType. - if (languageVersion < ScriptTarget.ES6 && !isArrayLikeType(parentType)) { - error(pattern, Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } if (!declaration.dotDotDotToken) { // Use specific property type when parent is a tuple or numeric index type when parent is an array let propName = "" + indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, IndexKind.Number); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); if (!type) { if (isTupleType(parentType)) { error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), (parentType).elementTypes.length, pattern.elements.length); @@ -2066,7 +2064,7 @@ module ts { } else { // Rest element has an array type with the same element type as the parent type - type = createArrayType(getIndexTypeOfType(parentType, IndexKind.Number)); + type = createArrayType(checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false)); } } return type; @@ -9263,38 +9261,38 @@ module ts { return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); } - function checkIteratedTypeOrElementType(inputType: Type, expressionForError: Expression, allowStringInput: boolean): Type { + function checkIteratedTypeOrElementType(inputType: Type, errorNode: Node, allowStringInput: boolean): Type { if (languageVersion >= ScriptTarget.ES6) { - return checkIteratedType(inputType, expressionForError) || anyType; + return checkIteratedType(inputType, errorNode) || anyType; } if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, expressionForError); + return checkElementTypeOfArrayOrString(inputType, errorNode); } if (isArrayLikeType(inputType)) { return getIndexTypeOfType(inputType, IndexKind.Number); } - error(expressionForError, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + error(errorNode, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); return unknownType; } /** - * When expressionForError is undefined, it means we should not report any errors. + * When errorNode is undefined, it means we should not report any errors. */ - function checkIteratedType(iterable: Type, expressionForError: Expression): Type { + function checkIteratedType(iterable: Type, errorNode: Node): Type { Debug.assert(languageVersion >= ScriptTarget.ES6); - let iteratedType = getIteratedType(iterable, expressionForError); + let iteratedType = getIteratedType(iterable, errorNode); // Now even though we have extracted the iteratedType, we will have to validate that the type // passed in is actually an Iterable. - if (expressionForError && iteratedType) { - checkTypeAssignableTo(iterable, createIterableType(iteratedType), expressionForError); + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable: Type, expressionForError: Expression) { + function getIteratedType(iterable: Type, errorNode: Node) { // We want to treat type as an iterable, and get the type it is an iterable of. The iterable // must have the following structure (annotated with the names of the variables below): // @@ -9332,8 +9330,8 @@ module ts { let iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, SignatureKind.Call) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } @@ -9350,8 +9348,8 @@ module ts { let iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, SignatureKind.Call) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, Diagnostics.An_iterator_must_have_a_next_method); + if (errorNode) { + error(errorNode, Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } @@ -9363,8 +9361,8 @@ module ts { let iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } @@ -9390,7 +9388,7 @@ module ts { * 1. Some constituent is neither a string nor an array. * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). */ - function checkElementTypeOfArrayOrString(arrayOrStringType: Type, expressionForError: Expression): Type { + function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type { Debug.assert(languageVersion < ScriptTarget.ES6); // After we remove all types that are StringLike, we will know if there was a string constituent @@ -9401,7 +9399,7 @@ module ts { let reportedError = false; if (hasStringConstituent) { if (languageVersion < ScriptTarget.ES5) { - error(expressionForError, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + error(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } @@ -9421,7 +9419,7 @@ module ts { let diagnostic = hasStringConstituent ? Diagnostics.Type_0_is_not_an_array_type : Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(expressionForError, diagnostic, typeToString(arrayType)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } From 17d201f92225370bf1a4521c1728bed1beb3f98a Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 15:20:00 -0700 Subject: [PATCH 11/69] Use iterated type in checkArrayLiteralAssignment --- src/compiler/checker.ts | 29 +++++++++++-------- .../reference/ES5For-of30.errors.txt | 8 ++++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 550ffa54103..841ec0a0716 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2043,15 +2043,20 @@ module ts { } } else { - // In a ES3/ES5, we must be destructuring an array type. However, ES6 supports destructuring - // an iterator into an array pattern, so we suppress this error. If the parentType is not an iterator, - // there will be an error in checkIteratedType. + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + let elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); if (!declaration.dotDotDotToken) { + if (elementType.flags & TypeFlags.Any) { + return elementType; + } + // Use specific property type when parent is a tuple or numeric index type when parent is an array let propName = "" + indexOf(pattern.elements, declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) - : checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), (parentType).elementTypes.length, pattern.elements.length); @@ -2064,7 +2069,7 @@ module ts { } else { // Rest element has an array type with the same element type as the parent type - type = createArrayType(checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false)); + type = createArrayType(elementType); } } return type; @@ -7551,11 +7556,10 @@ module ts { } function checkArrayLiteralAssignment(node: ArrayLiteralExpression, sourceType: Type, contextualMapper?: TypeMapper): Type { - // TODOO(andersh): Allow iterable source type in ES6 - if (!isArrayLikeType(sourceType)) { - error(node, Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false); let elements = node.elements; for (let i = 0; i < elements.length; i++) { let e = elements[i]; @@ -7563,8 +7567,9 @@ module ts { if (e.kind !== SyntaxKind.SpreadElementExpression) { let propName = "" + i; let type = sourceType.flags & TypeFlags.Any ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, IndexKind.Number); + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } diff --git a/tests/baselines/reference/ES5For-of30.errors.txt b/tests/baselines/reference/ES5For-of30.errors.txt index 0b02a55ba3f..e99b8284bf3 100644 --- a/tests/baselines/reference/ES5For-of30.errors.txt +++ b/tests/baselines/reference/ES5For-of30.errors.txt @@ -1,12 +1,18 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (1 errors) ==== +==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (3 errors) ==== var a: string, b: number; var tuple: [number, string] = [2, "3"]; for ([a = 1, b = ""] of tuple) { ~~~~~~~~~~~~~~~ !!! error TS2461: Type 'string | number' is not an array type. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. a; b; } \ No newline at end of file From 6b2d5ceb7c40533cdb82617d38e78c9d0cd866a9 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 15:21:00 -0700 Subject: [PATCH 12/69] Wrap elementType in createArrayType for rest element in checkArrayLiteralAssignment --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 841ec0a0716..dc05154e223 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7584,7 +7584,7 @@ module ts { } else { if (i === elements.length - 1) { - checkReferenceAssignment((e).expression, sourceType, contextualMapper); + checkReferenceAssignment((e).expression, createArrayType(elementType), contextualMapper); } else { error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); From a477b63420407985b2df252604946d600cbdc4c3 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 17:20:51 -0700 Subject: [PATCH 13/69] Adjust getTypeFromArrayBindingPattern to return an array if inside a rest parameter --- src/compiler/checker.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dc05154e223..2eb2470f027 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2162,8 +2162,26 @@ module ts { return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType; } else if (hasSpreadElement) { - var unionOfElements = getUnionType(elementTypes); - return languageVersion >= ScriptTarget.ES6 ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + let unionOfElements = getUnionType(elementTypes); + if (languageVersion >= ScriptTarget.ES6) { + // If the user has something like: + // + // function fun(...[a, ...b]) { } + // + // Normally, in ES6, the implied type of an array binding pattern with a rest element is + // an iterable. However, there is a requirement in our grammar checker that all rest + // parameters be array types. To satisfy this, we have an exception to the rule that + // says the type of an array binding pattern with a rest element is an array type + // if it is *itself* in a rest parameter. It will still be compatible with a spreaded + // iterable argument, but within the function it will be an array. + let parent = pattern.parent; + let isRestParameter = parent.kind === SyntaxKind.Parameter && + pattern === (parent).name && + (parent).dotDotDotToken !== undefined; + return isRestParameter ? createArrayType(unionOfElements) : createIterableType(unionOfElements); + } + + return createArrayType(unionOfElements); } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. From e1f2fbff63cb6835dd557e4aa20b092145ce005c Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 17:36:47 -0700 Subject: [PATCH 14/69] Add tests for array destructuring of iterables --- .../reference/iterableArrayPattern1.js | 28 +++++++++ .../reference/iterableArrayPattern1.types | 36 +++++++++++ .../iterableArrayPattern10.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern10.js | 37 +++++++++++ .../reference/iterableArrayPattern11.js | 37 +++++++++++ .../reference/iterableArrayPattern11.types | 52 ++++++++++++++++ .../reference/iterableArrayPattern12.js | 37 +++++++++++ .../reference/iterableArrayPattern12.types | 52 ++++++++++++++++ .../reference/iterableArrayPattern13.js | 37 +++++++++++ .../reference/iterableArrayPattern13.types | 50 +++++++++++++++ .../reference/iterableArrayPattern14.js | 37 +++++++++++ .../reference/iterableArrayPattern14.types | 50 +++++++++++++++ .../reference/iterableArrayPattern15.js | 37 +++++++++++ .../reference/iterableArrayPattern15.types | 52 ++++++++++++++++ .../iterableArrayPattern16.errors.txt | 37 +++++++++++ .../reference/iterableArrayPattern16.js | 61 +++++++++++++++++++ .../iterableArrayPattern17.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern17.js | 37 +++++++++++ .../iterableArrayPattern18.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern18.js | 37 +++++++++++ .../iterableArrayPattern19.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern19.js | 39 ++++++++++++ .../reference/iterableArrayPattern2.js | 28 +++++++++ .../reference/iterableArrayPattern2.types | 36 +++++++++++ .../reference/iterableArrayPattern20.js | 41 +++++++++++++ .../reference/iterableArrayPattern20.types | 58 ++++++++++++++++++ .../iterableArrayPattern21.errors.txt | 7 +++ .../reference/iterableArrayPattern21.js | 8 +++ .../iterableArrayPattern22.errors.txt | 7 +++ .../reference/iterableArrayPattern22.js | 8 +++ .../iterableArrayPattern23.errors.txt | 8 +++ .../reference/iterableArrayPattern23.js | 13 ++++ .../iterableArrayPattern24.errors.txt | 8 +++ .../reference/iterableArrayPattern24.js | 13 ++++ .../iterableArrayPattern25.errors.txt | 8 +++ .../reference/iterableArrayPattern25.js | 17 ++++++ .../iterableArrayPattern26.errors.txt | 10 +++ .../reference/iterableArrayPattern26.js | 17 ++++++ .../reference/iterableArrayPattern27.js | 17 ++++++ .../reference/iterableArrayPattern27.types | 18 ++++++ .../iterableArrayPattern28.errors.txt | 10 +++ .../reference/iterableArrayPattern28.js | 17 ++++++ .../iterableArrayPattern29.errors.txt | 12 ++++ .../reference/iterableArrayPattern29.js | 17 ++++++ .../reference/iterableArrayPattern3.js | 39 ++++++++++++ .../reference/iterableArrayPattern3.types | 53 ++++++++++++++++ .../reference/iterableArrayPattern30.js | 14 +++++ .../reference/iterableArrayPattern30.types | 12 ++++ .../reference/iterableArrayPattern4.js | 39 ++++++++++++ .../reference/iterableArrayPattern4.types | 54 ++++++++++++++++ .../iterableArrayPattern5.errors.txt | 22 +++++++ .../reference/iterableArrayPattern5.js | 39 ++++++++++++ .../iterableArrayPattern6.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern6.js | 39 ++++++++++++ .../iterableArrayPattern7.errors.txt | 24 ++++++++ .../reference/iterableArrayPattern7.js | 39 ++++++++++++ .../iterableArrayPattern8.errors.txt | 22 +++++++ .../reference/iterableArrayPattern8.js | 39 ++++++++++++ .../reference/iterableArrayPattern9.js | 35 +++++++++++ .../reference/iterableArrayPattern9.types | 46 ++++++++++++++ .../destructuring/iterableArrayPattern1.ts | 14 +++++ .../destructuring/iterableArrayPattern10.ts | 17 ++++++ .../destructuring/iterableArrayPattern11.ts | 17 ++++++ .../destructuring/iterableArrayPattern12.ts | 17 ++++++ .../destructuring/iterableArrayPattern13.ts | 17 ++++++ .../destructuring/iterableArrayPattern14.ts | 17 ++++++ .../destructuring/iterableArrayPattern15.ts | 17 ++++++ .../destructuring/iterableArrayPattern16.ts | 30 +++++++++ .../destructuring/iterableArrayPattern17.ts | 17 ++++++ .../destructuring/iterableArrayPattern18.ts | 17 ++++++ .../destructuring/iterableArrayPattern19.ts | 17 ++++++ .../destructuring/iterableArrayPattern2.ts | 14 +++++ .../destructuring/iterableArrayPattern20.ts | 17 ++++++ .../destructuring/iterableArrayPattern21.ts | 2 + .../destructuring/iterableArrayPattern22.ts | 2 + .../destructuring/iterableArrayPattern23.ts | 3 + .../destructuring/iterableArrayPattern24.ts | 3 + .../destructuring/iterableArrayPattern25.ts | 3 + .../destructuring/iterableArrayPattern26.ts | 3 + .../destructuring/iterableArrayPattern27.ts | 3 + .../destructuring/iterableArrayPattern28.ts | 3 + .../destructuring/iterableArrayPattern29.ts | 3 + .../destructuring/iterableArrayPattern3.ts | 17 ++++++ .../destructuring/iterableArrayPattern30.ts | 2 + .../destructuring/iterableArrayPattern4.ts | 17 ++++++ .../destructuring/iterableArrayPattern5.ts | 17 ++++++ .../destructuring/iterableArrayPattern6.ts | 17 ++++++ .../destructuring/iterableArrayPattern7.ts | 17 ++++++ .../destructuring/iterableArrayPattern8.ts | 17 ++++++ .../destructuring/iterableArrayPattern9.ts | 16 +++++ 90 files changed, 2140 insertions(+) create mode 100644 tests/baselines/reference/iterableArrayPattern1.js create mode 100644 tests/baselines/reference/iterableArrayPattern1.types create mode 100644 tests/baselines/reference/iterableArrayPattern10.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern10.js create mode 100644 tests/baselines/reference/iterableArrayPattern11.js create mode 100644 tests/baselines/reference/iterableArrayPattern11.types create mode 100644 tests/baselines/reference/iterableArrayPattern12.js create mode 100644 tests/baselines/reference/iterableArrayPattern12.types create mode 100644 tests/baselines/reference/iterableArrayPattern13.js create mode 100644 tests/baselines/reference/iterableArrayPattern13.types create mode 100644 tests/baselines/reference/iterableArrayPattern14.js create mode 100644 tests/baselines/reference/iterableArrayPattern14.types create mode 100644 tests/baselines/reference/iterableArrayPattern15.js create mode 100644 tests/baselines/reference/iterableArrayPattern15.types create mode 100644 tests/baselines/reference/iterableArrayPattern16.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern16.js create mode 100644 tests/baselines/reference/iterableArrayPattern17.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern17.js create mode 100644 tests/baselines/reference/iterableArrayPattern18.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern18.js create mode 100644 tests/baselines/reference/iterableArrayPattern19.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern19.js create mode 100644 tests/baselines/reference/iterableArrayPattern2.js create mode 100644 tests/baselines/reference/iterableArrayPattern2.types create mode 100644 tests/baselines/reference/iterableArrayPattern20.js create mode 100644 tests/baselines/reference/iterableArrayPattern20.types create mode 100644 tests/baselines/reference/iterableArrayPattern21.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern21.js create mode 100644 tests/baselines/reference/iterableArrayPattern22.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern22.js create mode 100644 tests/baselines/reference/iterableArrayPattern23.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern23.js create mode 100644 tests/baselines/reference/iterableArrayPattern24.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern24.js create mode 100644 tests/baselines/reference/iterableArrayPattern25.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern25.js create mode 100644 tests/baselines/reference/iterableArrayPattern26.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern26.js create mode 100644 tests/baselines/reference/iterableArrayPattern27.js create mode 100644 tests/baselines/reference/iterableArrayPattern27.types create mode 100644 tests/baselines/reference/iterableArrayPattern28.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern28.js create mode 100644 tests/baselines/reference/iterableArrayPattern29.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern29.js create mode 100644 tests/baselines/reference/iterableArrayPattern3.js create mode 100644 tests/baselines/reference/iterableArrayPattern3.types create mode 100644 tests/baselines/reference/iterableArrayPattern30.js create mode 100644 tests/baselines/reference/iterableArrayPattern30.types create mode 100644 tests/baselines/reference/iterableArrayPattern4.js create mode 100644 tests/baselines/reference/iterableArrayPattern4.types create mode 100644 tests/baselines/reference/iterableArrayPattern5.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern5.js create mode 100644 tests/baselines/reference/iterableArrayPattern6.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern6.js create mode 100644 tests/baselines/reference/iterableArrayPattern7.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern7.js create mode 100644 tests/baselines/reference/iterableArrayPattern8.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern8.js create mode 100644 tests/baselines/reference/iterableArrayPattern9.js create mode 100644 tests/baselines/reference/iterableArrayPattern9.types create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts diff --git a/tests/baselines/reference/iterableArrayPattern1.js b/tests/baselines/reference/iterableArrayPattern1.js new file mode 100644 index 00000000000..b45ac92d1fd --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.js @@ -0,0 +1,28 @@ +//// [iterableArrayPattern1.ts] +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern1.js] +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types new file mode 100644 index 00000000000..8be8521c684 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts === +var [a, b] = new SymbolIterator; +>a : symbol +>b : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern10.errors.txt b/tests/baselines/reference/iterableArrayPattern10.errors.txt new file mode 100644 index 00000000000..f06c4d7de17 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern10.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. + Property '0' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts (1 errors) ==== + function fun([a, b]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. +!!! error TS2345: Property '0' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern10.js b/tests/baselines/reference/iterableArrayPattern10.js new file mode 100644 index 00000000000..2e532e2b773 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern10.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern10.ts] +function fun([a, b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern10.js] +function fun([a, b]) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.js b/tests/baselines/reference/iterableArrayPattern11.js new file mode 100644 index 00000000000..a3940edc362 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern11.ts] +function fun([a, b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern11.js] +function fun([a, b] = new FooIterator) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types new file mode 100644 index 00000000000..2b6f1d67336 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts === +function fun([a, b] = new FooIterator) { } +>fun : ([a, b]?: FooIterator) => void +>a : Foo +>b : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, b]?: FooIterator) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.js b/tests/baselines/reference/iterableArrayPattern12.js new file mode 100644 index 00000000000..64581c54251 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern12.ts] +function fun([a, ...b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern12.js] +function fun([a, ...b] = new FooIterator) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types new file mode 100644 index 00000000000..a415539b91c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts === +function fun([a, ...b] = new FooIterator) { } +>fun : ([a, ...b]?: FooIterator) => void +>a : Foo +>b : Foo[] +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, ...b]?: FooIterator) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.js b/tests/baselines/reference/iterableArrayPattern13.js new file mode 100644 index 00000000000..f4ea18d4fec --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern13.ts] +function fun([a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern13.js] +function fun([a, ...b]) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types new file mode 100644 index 00000000000..dbfbf9a1ebc --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts === +function fun([a, ...b]) { } +>fun : ([a, ...b]: Iterable) => void +>a : any +>b : any[] + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, ...b]: Iterable) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern14.js b/tests/baselines/reference/iterableArrayPattern14.js new file mode 100644 index 00000000000..81b2c66f14d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern14.ts] +function fun(...[a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern14.js] +function fun(...[a, ...b]) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern14.types b/tests/baselines/reference/iterableArrayPattern14.types new file mode 100644 index 00000000000..3f73f2973d1 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts === +function fun(...[a, ...b]) { } +>fun : (...[a, ...b]: any[]) => void +>a : any +>b : any[] + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : (...[a, ...b]: any[]) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern15.js b/tests/baselines/reference/iterableArrayPattern15.js new file mode 100644 index 00000000000..fcb5ec82508 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern15.ts] +function fun(...[a, b]: Bar[]) { } +fun(...new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern15.js] +function fun(...[a, b]) { +} +fun(...new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern15.types b/tests/baselines/reference/iterableArrayPattern15.types new file mode 100644 index 00000000000..de548a91c26 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts === +function fun(...[a, b]: Bar[]) { } +>fun : (...[a, b]: Bar[]) => void +>a : Bar +>b : Bar +>Bar : Bar + +fun(...new FooIterator); +>fun(...new FooIterator) : void +>fun : (...[a, b]: Bar[]) => void +>...new FooIterator : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt new file mode 100644 index 00000000000..42236140be7 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. + Property '0' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (1 errors) ==== + function fun(...[a, b]: [Bar, Bar][]) { } + fun(...new FooIteratorIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. +!!! error TS2345: Property '0' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern16.js b/tests/baselines/reference/iterableArrayPattern16.js new file mode 100644 index 00000000000..d3127991799 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern16.js @@ -0,0 +1,61 @@ +//// [iterableArrayPattern16.ts] +function fun(...[a, b]: [Bar, Bar][]) { } +fun(...new FooIteratorIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern16.js] +function fun(...[a, b]) { +} +fun(...new FooIteratorIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern17.errors.txt b/tests/baselines/reference/iterableArrayPattern17.errors.txt new file mode 100644 index 00000000000..306b00ea990 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern17.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. + Property 'x' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (1 errors) ==== + function fun(...[a, b]: Bar[]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. +!!! error TS2345: Property 'x' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern17.js b/tests/baselines/reference/iterableArrayPattern17.js new file mode 100644 index 00000000000..db5c4001c88 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern17.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern17.ts] +function fun(...[a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern17.js] +function fun(...[a, b]) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern18.errors.txt b/tests/baselines/reference/iterableArrayPattern18.errors.txt new file mode 100644 index 00000000000..c6f8c5e28bd --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern18.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'. + Property 'length' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts (1 errors) ==== + function fun([a, b]: Bar[]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'. +!!! error TS2345: Property 'length' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern18.js b/tests/baselines/reference/iterableArrayPattern18.js new file mode 100644 index 00000000000..3e13f2ef619 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern18.js @@ -0,0 +1,37 @@ +//// [iterableArrayPattern18.ts] +function fun([a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern18.js] +function fun([a, b]) { +} +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern19.errors.txt b/tests/baselines/reference/iterableArrayPattern19.errors.txt new file mode 100644 index 00000000000..3f8b550d287 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern19.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts(2,5): error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'. + Property 'length' is missing in type 'FooArrayIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts (1 errors) ==== + function fun([[a], b]: Bar[][]) { } + fun(new FooArrayIterator); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'. +!!! error TS2345: Property 'length' is missing in type 'FooArrayIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern19.js b/tests/baselines/reference/iterableArrayPattern19.js new file mode 100644 index 00000000000..60ace366eb7 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern19.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern19.ts] +function fun([[a], b]: Bar[][]) { } +fun(new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern19.js] +function fun([[a], b]) { +} +fun(new FooArrayIterator); +class Bar { +} +class Foo extends Bar { +} +class FooArrayIterator { + next() { + return { + value: [ + new Foo + ], + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.js b/tests/baselines/reference/iterableArrayPattern2.js new file mode 100644 index 00000000000..7392db7d6b2 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.js @@ -0,0 +1,28 @@ +//// [iterableArrayPattern2.ts] +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern2.js] +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types new file mode 100644 index 00000000000..819516dfe05 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts === +var [a, ...b] = new SymbolIterator; +>a : symbol +>b : symbol[] +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern20.js b/tests/baselines/reference/iterableArrayPattern20.js new file mode 100644 index 00000000000..271a35b791d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.js @@ -0,0 +1,41 @@ +//// [iterableArrayPattern20.ts] +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +fun(...new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern20.js] +function fun(...[[a = new Foo], b = [ + new Foo + ]]) { +} +fun(...new FooArrayIterator); +class Bar { +} +class Foo extends Bar { +} +class FooArrayIterator { + next() { + return { + value: [ + new Foo + ], + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern20.types b/tests/baselines/reference/iterableArrayPattern20.types new file mode 100644 index 00000000000..055dfa95859 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.types @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts === +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +>fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void +>a : Bar +>new Foo : Foo +>Foo : typeof Foo +>b : Bar[] +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo +>Bar : Bar + +fun(...new FooArrayIterator); +>fun(...new FooArrayIterator) : void +>fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void +>...new FooArrayIterator : Foo[] +>new FooArrayIterator : FooArrayIterator +>FooArrayIterator : typeof FooArrayIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooArrayIterator { +>FooArrayIterator : FooArrayIterator + + next() { +>next : () => { value: Foo[]; done: boolean; } + + return { +>{ value: [new Foo], done: false } : { value: Foo[]; done: boolean; } + + value: [new Foo], +>value : Foo[] +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooArrayIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern21.errors.txt b/tests/baselines/reference/iterableArrayPattern21.errors.txt new file mode 100644 index 00000000000..7e853c90b24 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern21.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts(1,5): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts (1 errors) ==== + var [a, b] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern21.js b/tests/baselines/reference/iterableArrayPattern21.js new file mode 100644 index 00000000000..f226406ec63 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern21.js @@ -0,0 +1,8 @@ +//// [iterableArrayPattern21.ts] +var [a, b] = { 0: "", 1: true }; + +//// [iterableArrayPattern21.js] +var [a, b] = { + 0: "", + 1: true +}; diff --git a/tests/baselines/reference/iterableArrayPattern22.errors.txt b/tests/baselines/reference/iterableArrayPattern22.errors.txt new file mode 100644 index 00000000000..3e40e4fd602 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern22.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts(1,5): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts (1 errors) ==== + var [...a] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern22.js b/tests/baselines/reference/iterableArrayPattern22.js new file mode 100644 index 00000000000..9c3afc0ffe5 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern22.js @@ -0,0 +1,8 @@ +//// [iterableArrayPattern22.ts] +var [...a] = { 0: "", 1: true }; + +//// [iterableArrayPattern22.js] +var [...a] = { + 0: "", + 1: true +}; diff --git a/tests/baselines/reference/iterableArrayPattern23.errors.txt b/tests/baselines/reference/iterableArrayPattern23.errors.txt new file mode 100644 index 00000000000..1df5d909aed --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern23.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts(2,1): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts (1 errors) ==== + var a: string, b: boolean; + [a, b] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern23.js b/tests/baselines/reference/iterableArrayPattern23.js new file mode 100644 index 00000000000..ffeb1abe32e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern23.js @@ -0,0 +1,13 @@ +//// [iterableArrayPattern23.ts] +var a: string, b: boolean; +[a, b] = { 0: "", 1: true }; + +//// [iterableArrayPattern23.js] +var a, b; +[ + a, + b +] = { + 0: "", + 1: true +}; diff --git a/tests/baselines/reference/iterableArrayPattern24.errors.txt b/tests/baselines/reference/iterableArrayPattern24.errors.txt new file mode 100644 index 00000000000..e954c59f2ea --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern24.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts(2,1): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts (1 errors) ==== + var a: string, b: boolean[]; + [a, ...b] = { 0: "", 1: true }; + ~~~~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern24.js b/tests/baselines/reference/iterableArrayPattern24.js new file mode 100644 index 00000000000..89cc3e2dc99 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern24.js @@ -0,0 +1,13 @@ +//// [iterableArrayPattern24.ts] +var a: string, b: boolean[]; +[a, ...b] = { 0: "", 1: true }; + +//// [iterableArrayPattern24.js] +var a, b; +[ + a, + ...b +] = { + 0: "", + 1: true +}; diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt new file mode 100644 index 00000000000..cc901523b55 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,30): error TS2370: A rest parameter must be of an array type. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2370: A rest parameter must be of an array type. + takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern25.js b/tests/baselines/reference/iterableArrayPattern25.js new file mode 100644 index 00000000000..63686f5a39e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern25.js @@ -0,0 +1,17 @@ +//// [iterableArrayPattern25.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern25.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { +} +takeFirstTwoEntries(new Map([ + [ + "", + 0 + ], + [ + "hello", + 1 + ] +])); diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt new file mode 100644 index 00000000000..9fb3e688039 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. + Property '0' is missing in type 'Map'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. +!!! error TS2345: Property '0' is missing in type 'Map'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern26.js b/tests/baselines/reference/iterableArrayPattern26.js new file mode 100644 index 00000000000..7edcf52b6ba --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern26.js @@ -0,0 +1,17 @@ +//// [iterableArrayPattern26.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern26.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { +} +takeFirstTwoEntries(new Map([ + [ + "", + 0 + ], + [ + "hello", + 1 + ] +])); diff --git a/tests/baselines/reference/iterableArrayPattern27.js b/tests/baselines/reference/iterableArrayPattern27.js new file mode 100644 index 00000000000..2d8a7e9d76e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.js @@ -0,0 +1,17 @@ +//// [iterableArrayPattern27.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern27.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { +} +takeFirstTwoEntries(...new Map([ + [ + "", + 0 + ], + [ + "hello", + 1 + ] +])); diff --git a/tests/baselines/reference/iterableArrayPattern27.types b/tests/baselines/reference/iterableArrayPattern27.types new file mode 100644 index 00000000000..72d13ee0e00 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts === +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +>takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void +>k1 : string +>v1 : number +>k2 : string +>v2 : number + +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); +>takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])) : void +>takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void +>...new Map([["", 0], ["hello", 1]]) : [string, number] +>new Map([["", 0], ["hello", 1]]) : Map +>Map : MapConstructor +>[["", 0], ["hello", 1]] : [string, number][] +>["", 0] : [string, number] +>["hello", 1] : [string, number] + diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt new file mode 100644 index 00000000000..0190dd939e8 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,28): error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); + ~~~ +!!! error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.js b/tests/baselines/reference/iterableArrayPattern28.js new file mode 100644 index 00000000000..03e9264f72d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern28.js @@ -0,0 +1,17 @@ +//// [iterableArrayPattern28.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); + +//// [iterableArrayPattern28.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { +} +takeFirstTwoEntries(...new Map([ + [ + "", + 0 + ], + [ + "hello", + true + ] +])); diff --git a/tests/baselines/reference/iterableArrayPattern29.errors.txt b/tests/baselines/reference/iterableArrayPattern29.errors.txt new file mode 100644 index 00000000000..632854ae952 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern29.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(2,21): error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. +!!! error TS2345: Types of property '1' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern29.js b/tests/baselines/reference/iterableArrayPattern29.js new file mode 100644 index 00000000000..926f5608bd0 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern29.js @@ -0,0 +1,17 @@ +//// [iterableArrayPattern29.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); + +//// [iterableArrayPattern29.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { +} +takeFirstTwoEntries(...new Map([ + [ + "", + true + ], + [ + "hello", + true + ] +])); diff --git a/tests/baselines/reference/iterableArrayPattern3.js b/tests/baselines/reference/iterableArrayPattern3.js new file mode 100644 index 00000000000..4180bac8960 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern3.ts] +var a: Bar, b: Bar; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern3.js] +var a, b; +[ + a, + b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types new file mode 100644 index 00000000000..291eed9723a --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -0,0 +1,53 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts === +var a: Bar, b: Bar; +>a : Bar +>Bar : Bar +>b : Bar +>Bar : Bar + +[a, b] = new FooIterator; +>[a, b] = new FooIterator : FooIterator +>[a, b] : [Bar, Bar] +>a : Bar +>b : Bar +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern30.js b/tests/baselines/reference/iterableArrayPattern30.js new file mode 100644 index 00000000000..aafa09c3911 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.js @@ -0,0 +1,14 @@ +//// [iterableArrayPattern30.ts] +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) + +//// [iterableArrayPattern30.js] +const [[k1, v1], [k2, v2]] = new Map([ + [ + "", + true + ], + [ + "hello", + true + ] +]); diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types new file mode 100644 index 00000000000..998da11d651 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts === +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) +>k1 : string +>v1 : boolean +>k2 : string +>v2 : boolean +>new Map([["", true], ["hello", true]]) : Map +>Map : MapConstructor +>[["", true], ["hello", true]] : [string, boolean][] +>["", true] : [string, boolean] +>["hello", true] : [string, boolean] + diff --git a/tests/baselines/reference/iterableArrayPattern4.js b/tests/baselines/reference/iterableArrayPattern4.js new file mode 100644 index 00000000000..a03263e3c5e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern4.ts] +var a: Bar, b: Bar[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern4.js] +var a, b; +[ + a, + ...b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types new file mode 100644 index 00000000000..531b2aa8275 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -0,0 +1,54 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts === +var a: Bar, b: Bar[]; +>a : Bar +>Bar : Bar +>b : Bar[] +>Bar : Bar + +[a, ...b] = new FooIterator; +>[a, ...b] = new FooIterator : FooIterator +>[a, ...b] : Bar[] +>a : Bar +>...b : Bar +>b : Bar[] +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern5.errors.txt b/tests/baselines/reference/iterableArrayPattern5.errors.txt new file mode 100644 index 00000000000..ca540d805be --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern5.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts (1 errors) ==== + var a: Bar, b: string; + [a, b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern5.js b/tests/baselines/reference/iterableArrayPattern5.js new file mode 100644 index 00000000000..84e14644aa9 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern5.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern5.ts] +var a: Bar, b: string; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern5.js] +var a, b; +[ + a, + b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern6.errors.txt b/tests/baselines/reference/iterableArrayPattern6.errors.txt new file mode 100644 index 00000000000..e0a546d154c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern6.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string[]'. + Type 'Foo' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts (1 errors) ==== + var a: Bar, b: string[]; + [a, ...b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'Foo' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern6.js b/tests/baselines/reference/iterableArrayPattern6.js new file mode 100644 index 00000000000..b4faf6394e6 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern6.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern6.ts] +var a: Bar, b: string[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern6.js] +var a, b; +[ + a, + ...b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern7.errors.txt b/tests/baselines/reference/iterableArrayPattern7.errors.txt new file mode 100644 index 00000000000..997cc21f38b --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern7.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string[]'. + Property 'length' is missing in type 'Foo'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts (1 errors) ==== + var a: Bar, b: string[]; + [a, b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Foo'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern7.js b/tests/baselines/reference/iterableArrayPattern7.js new file mode 100644 index 00000000000..30a8d24bbd2 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern7.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern7.ts] +var a: Bar, b: string[]; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern7.js] +var a, b; +[ + a, + b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern8.errors.txt b/tests/baselines/reference/iterableArrayPattern8.errors.txt new file mode 100644 index 00000000000..c06e0c9543f --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern8.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts (1 errors) ==== + var a: Bar, b: string; + [a, ...b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo[]' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern8.js b/tests/baselines/reference/iterableArrayPattern8.js new file mode 100644 index 00000000000..35a4a62a3df --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern8.js @@ -0,0 +1,39 @@ +//// [iterableArrayPattern8.ts] +var a: Bar, b: string; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern8.js] +var a, b; +[ + a, + ...b +] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.js b/tests/baselines/reference/iterableArrayPattern9.js new file mode 100644 index 00000000000..558758561a4 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.js @@ -0,0 +1,35 @@ +//// [iterableArrayPattern9.ts] +function fun([a, b] = new FooIterator) { } +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern9.js] +function fun([a, b] = new FooIterator) { +} +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types new file mode 100644 index 00000000000..67d4bab1a83 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts === +function fun([a, b] = new FooIterator) { } +>fun : ([a, b]?: FooIterator) => void +>a : Foo +>b : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts new file mode 100644 index 00000000000..7b3be0365e9 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts new file mode 100644 index 00000000000..35d05ef1f9c --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts new file mode 100644 index 00000000000..ed93b5175d0 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts new file mode 100644 index 00000000000..b7e763694ea --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, ...b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts new file mode 100644 index 00000000000..f0b9b142f40 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts new file mode 100644 index 00000000000..c327efa3ec2 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts new file mode 100644 index 00000000000..21d632fd541 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, b]: Bar[]) { } +fun(...new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts new file mode 100644 index 00000000000..ba2c74681fe --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts @@ -0,0 +1,30 @@ +//@target: ES6 +function fun(...[a, b]: [Bar, Bar][]) { } +fun(...new FooIteratorIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts new file mode 100644 index 00000000000..90db0e5edb5 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts new file mode 100644 index 00000000000..e6e5ad617b2 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts new file mode 100644 index 00000000000..8513dd07649 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([[a], b]: Bar[][]) { } +fun(new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts new file mode 100644 index 00000000000..587f1f0b056 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts new file mode 100644 index 00000000000..b5be67b393f --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +fun(...new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts new file mode 100644 index 00000000000..c8f17395d14 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var [a, b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts new file mode 100644 index 00000000000..8cf60df5597 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var [...a] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts new file mode 100644 index 00000000000..91ce911b04c --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var a: string, b: boolean; +[a, b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts new file mode 100644 index 00000000000..462b3663b8b --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var a: string, b: boolean[]; +[a, ...b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts new file mode 100644 index 00000000000..a47edb4e987 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts new file mode 100644 index 00000000000..be295333b2e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts new file mode 100644 index 00000000000..fcf6967cd4e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts new file mode 100644 index 00000000000..111abd70ac3 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts new file mode 100644 index 00000000000..403347d61e5 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts new file mode 100644 index 00000000000..31656b5661f --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: Bar; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts new file mode 100644 index 00000000000..075ff3fd467 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts @@ -0,0 +1,2 @@ +//@target: ES6 +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts new file mode 100644 index 00000000000..edd95be1598 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: Bar[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts new file mode 100644 index 00000000000..b51d0f09d08 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts new file mode 100644 index 00000000000..fc9395ed6a4 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts new file mode 100644 index 00000000000..85b2f2e54e3 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string[]; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts new file mode 100644 index 00000000000..dd49205d6e0 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts new file mode 100644 index 00000000000..1573c55ca8e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts @@ -0,0 +1,16 @@ +//@target: ES6 +function fun([a, b] = new FooIterator) { } +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file From 197a42a692d818d683451820c8896c25320034b1 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 18:38:14 -0700 Subject: [PATCH 15/69] Optimize direct Iterable reference in getIteratedType --- src/compiler/checker.ts | 6 ++++++ tests/baselines/reference/for-of57.js | 8 ++++++++ tests/baselines/reference/for-of57.types | 9 +++++++++ tests/baselines/reference/iteratorSpreadInArray11.js | 9 +++++++++ .../baselines/reference/iteratorSpreadInArray11.types | 11 +++++++++++ .../conformance/es6/for-ofStatements/for-of57.ts | 3 +++ .../conformance/es6/spread/iteratorSpreadInArray11.ts | 3 +++ 7 files changed, 49 insertions(+) create mode 100644 tests/baselines/reference/for-of57.js create mode 100644 tests/baselines/reference/for-of57.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray11.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray11.types create mode 100644 tests/cases/conformance/es6/for-ofStatements/for-of57.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2eb2470f027..844589ee851 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9346,6 +9346,12 @@ module ts { return undefined; } + // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), + // then just grab its type argument. + if ((iterable.flags & TypeFlags.Reference) && (iterable).target === globalIterableType) { + return (iterable).typeArguments[0]; + } + let iteratorFunction = getTypeOfPropertyOfType(iterable, getPropertyNameForKnownSymbolName("iterator")); if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, TypeFlags.Any)) { return undefined; diff --git a/tests/baselines/reference/for-of57.js b/tests/baselines/reference/for-of57.js new file mode 100644 index 00000000000..0dedd6c3222 --- /dev/null +++ b/tests/baselines/reference/for-of57.js @@ -0,0 +1,8 @@ +//// [for-of57.ts] +var iter: Iterable; +for (let num of iter) { } + +//// [for-of57.js] +var iter; +for (let num of iter) { +} diff --git a/tests/baselines/reference/for-of57.types b/tests/baselines/reference/for-of57.types new file mode 100644 index 00000000000..cfd4f68cfca --- /dev/null +++ b/tests/baselines/reference/for-of57.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of57.ts === +var iter: Iterable; +>iter : Iterable +>Iterable : Iterable + +for (let num of iter) { } +>num : number +>iter : Iterable + diff --git a/tests/baselines/reference/iteratorSpreadInArray11.js b/tests/baselines/reference/iteratorSpreadInArray11.js new file mode 100644 index 00000000000..830fa04380b --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.js @@ -0,0 +1,9 @@ +//// [iteratorSpreadInArray11.ts] +var iter: Iterable; +var array = [...iter]; + +//// [iteratorSpreadInArray11.js] +var iter; +var array = [ + ...iter +]; diff --git a/tests/baselines/reference/iteratorSpreadInArray11.types b/tests/baselines/reference/iteratorSpreadInArray11.types new file mode 100644 index 00000000000..a3ed7826e07 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === +var iter: Iterable; +>iter : Iterable +>Iterable : Iterable + +var array = [...iter]; +>array : number[] +>[...iter] : number[] +>...iter : number +>iter : Iterable + diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of57.ts b/tests/cases/conformance/es6/for-ofStatements/for-of57.ts new file mode 100644 index 00000000000..f3c8dd97822 --- /dev/null +++ b/tests/cases/conformance/es6/for-ofStatements/for-of57.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var iter: Iterable; +for (let num of iter) { } \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts new file mode 100644 index 00000000000..0c0108433aa --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var iter: Iterable; +var array = [...iter]; \ No newline at end of file From 17719e85ff1d4f05e6df257c9a3f787c055c8ef9 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 25 Mar 2015 19:06:34 -0700 Subject: [PATCH 16/69] Fix comment to be more accurate --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 844589ee851..c1f729574eb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2169,7 +2169,7 @@ module ts { // function fun(...[a, ...b]) { } // // Normally, in ES6, the implied type of an array binding pattern with a rest element is - // an iterable. However, there is a requirement in our grammar checker that all rest + // an iterable. However, there is a requirement in our type system that all rest // parameters be array types. To satisfy this, we have an exception to the rule that // says the type of an array binding pattern with a rest element is an array type // if it is *itself* in a rest parameter. It will still be compatible with a spreaded From 903c1d8dd8b1768f843be86d6fdf2b6da1a036df Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Thu, 26 Mar 2015 15:15:02 -0700 Subject: [PATCH 17/69] Add clarifying comment about checkExpressionCached --- src/compiler/checker.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 09674139c34..677361c196a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5949,6 +5949,12 @@ module ts { } function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type { + // It is usually not safe to call checkExpressionCached if we can be contextually typing. + // You can tell that we are contextually typing because of the contextualMapper parameter. + // While it is true that a spread element can have a contextual type, it does not do anything + // with this type. It is neither affected by it, nor does it propagate it to its operand. + // So the fact that contextualMapper is passed is not important, because the operand of a spread + // element is not contextually typed. let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } From a1ab10a42a86d61e7d4e614bad56494fbd5cfdce Mon Sep 17 00:00:00 2001 From: ahmad-farid Date: Wed, 1 Apr 2015 16:16:04 -0700 Subject: [PATCH 18/69] Update CONTRIBUTING.md Fixing a typo in Coding Guidelines link https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines (was missing an 'e') --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92eb646f480..5de2bd87e63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Your pull request should: * Tests should include reasonable permutations of the target fix/change * Include baseline changes with your change * All changed code must have 100% code coverage -* Follow the code conventions descriped in [Coding guidlines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidlines) +* Follow the code conventions descriped in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) * To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration ## Running the Tests From 27f349ca7dfac7c0c02ee2c83aa8baee4a173637 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Thu, 2 Apr 2015 14:38:22 -0700 Subject: [PATCH 19/69] outlining Comments v0.1 4/2 --- src/compiler/parser.ts | 2 +- src/compiler/scanner.ts | 3 +- src/compiler/types.ts | 3 +- src/services/outliningElementsCollector.ts | 70 +++++++++++++++++----- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 14311ccbc52..5e359ef462a 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5195,7 +5195,7 @@ module ts { break; } - let range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + let range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; let comment = sourceText.substring(range.pos, range.end); let referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 3a208698c25..1e7ce744bc2 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -523,6 +523,7 @@ module ts { let nextChar = text.charCodeAt(pos + 1); let hasTrailingNewLine = false; if (nextChar === CharacterCodes.slash || nextChar === CharacterCodes.asterisk) { + let kind = nextChar === CharacterCodes.slash ? SyntaxKind.SingleLineCommentTrivia : SyntaxKind.MultiLineCommentTrivia; let startPos = pos; pos += 2; if (nextChar === CharacterCodes.slash) { @@ -548,7 +549,7 @@ module ts { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind }); } continue; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8992a6fbd94..5a07956908c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -966,9 +966,10 @@ module ts { export interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } - // Source files are declarations when they are external modules. + //* Source files are declarations when they are external modules. export interface SourceFile extends Declaration { statements: NodeArray; endOfFileToken: Node; diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 4c9dcedc7a4..ccba1b5c598 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,17 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. 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. -// + +/// module ts { export module OutliningElementsCollector { @@ -31,6 +19,53 @@ module ts { } } + function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) { + if (commentSpan) { + let span: OutliningSpan = { + textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); + } + } + + function addOutliningForLeadingCommentsForNode(n: Node) { + let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + + // if we found comments + if (comments) { + let firstSingleLineCommentStart = -1; + let lastSingleLineCommentEnd = -1; + let isFirstSingleLineComment = true; + let singleLineCommentCount = 0; + + for (let i = 0; i < comments.length; i++) { + let currentComment = comments[i]; + + if (currentComment.kind == SyntaxKind.SingleLineCommentTrivia) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; + } + + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + + if (currentComment.kind == SyntaxKind.MultiLineCommentTrivia) + { + // add the block + addOutliningSpanComments(currentComment, false); + + // see if we have multiple single line ones + } + + + } + } + } + function autoCollapse(node: Node) { return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction; } @@ -41,6 +76,8 @@ module ts { if (depth > maxDepth) { return; } + + addOutliningForLeadingCommentsForNode(n); switch (n.kind) { case SyntaxKind.Block: if (!isFunctionBlock(n)) { @@ -93,7 +130,7 @@ module ts { }); break; } - // Fallthrough. + // Fallthrough. case SyntaxKind.ModuleBlock: { let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); @@ -116,6 +153,9 @@ module ts { let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; + case SyntaxKind.Constructor: + // addOutliningForLeadingCommentsForNode(n); + break; } depth++; forEachChild(n, walk); From 64fbf94940794355bf8a64bcca4264baa7e030c0 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Thu, 2 Apr 2015 16:23:22 -0700 Subject: [PATCH 20/69] outlinging comments v0.2 --- src/compiler/types.ts | 2 +- src/services/outliningElementsCollector.ts | 45 ++++++++++++++-------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5a07956908c..bd43006f4e8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -969,7 +969,7 @@ module ts { kind: SyntaxKind; } - //* Source files are declarations when they are external modules. + // Source files are declarations when they are external modules. export interface SourceFile extends Declaration { statements: NodeArray; endOfFileToken: Node; diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index ccba1b5c598..6e0d6434398 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -32,9 +32,8 @@ module ts { } function addOutliningForLeadingCommentsForNode(n: Node) { - let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); - - // if we found comments + let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + if (comments) { let firstSingleLineCommentStart = -1; let lastSingleLineCommentEnd = -1; @@ -44,25 +43,42 @@ module ts { for (let i = 0; i < comments.length; i++) { let currentComment = comments[i]; - if (currentComment.kind == SyntaxKind.SingleLineCommentTrivia) { + // For single line comments, combine consecutive ones (2 or more) into + // a single span from the start of the first till the end of the last + if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) { if (isFirstSingleLineComment) { firstSingleLineCommentStart = currentComment.pos; } - + isFirstSingleLineComment = false; lastSingleLineCommentEnd = currentComment.end; singleLineCommentCount++; - } - - if (currentComment.kind == SyntaxKind.MultiLineCommentTrivia) - { - // add the block + } + else { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); addOutliningSpanComments(currentComment, false); - // see if we have multiple single line ones + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; } - - } + + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + + function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { + + // Only outline spans of two or more consecutive single line comments + if (count > 1) { + + let multipleSingleLineComments = { + pos: start, + end: end, + kind: SyntaxKind.SingleLineCommentTrivia + } + + addOutliningSpanComments(multipleSingleLineComments, false); } } @@ -153,9 +169,6 @@ module ts { let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; - case SyntaxKind.Constructor: - // addOutliningForLeadingCommentsForNode(n); - break; } depth++; forEachChild(n, walk); From 5543d5456c0007e536e1ff4bf6ada102fb73fc96 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 14:11:18 -0700 Subject: [PATCH 21/69] removing extra reference header --- src/services/outliningElementsCollector.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 6e0d6434398..0d9895d148e 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,6 +1,3 @@ - -/// - module ts { export module OutliningElementsCollector { export function collectElements(sourceFile: SourceFile): OutliningSpan[] { From d1c7f9927ff7cfe7f06bde90fc5c5bf5abcf8019 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 14:26:26 -0700 Subject: [PATCH 22/69] updating test 1 --- tests/baselines/reference/APISample_compile.js | 1 + tests/baselines/reference/APISample_compile.types | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 6c28c96a6d8..e2025bd0da7 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -796,6 +796,7 @@ declare module "typescript" { } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index 635aff75628..f2e63dd2048 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -2419,6 +2419,10 @@ declare module "typescript" { hasTrailingNewLine?: boolean; >hasTrailingNewLine : boolean + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind } interface SourceFile extends Declaration { >SourceFile : SourceFile From 8a49ce7c9fed4b08d5d4bd3e028e619c4b9fc523 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 14:39:44 -0700 Subject: [PATCH 23/69] updating test 2 --- tests/baselines/reference/APISample_linter.js | 1 + tests/baselines/reference/APISample_linter.types | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index f59fa91da14..2058db63e36 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -827,6 +827,7 @@ declare module "typescript" { } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 12f4ac12fdc..0e508961216 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -2565,6 +2565,10 @@ declare module "typescript" { hasTrailingNewLine?: boolean; >hasTrailingNewLine : boolean + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind } interface SourceFile extends Declaration { >SourceFile : SourceFile From 2e41e45e6400699646a7b184648dffd3543175e3 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 14:55:39 -0700 Subject: [PATCH 24/69] updating tests --- .../reference/APISample_linter.js.bak | 2114 ++++++ .../reference/APISample_linter.types.bak | 6438 +++++++++++++++++ .../reference/APISample_transform.js | 1 + .../reference/APISample_transform.types | 4 + .../baselines/reference/APISample_watcher.js | 1 + .../reference/APISample_watcher.types | 4 + 6 files changed, 8562 insertions(+) create mode 100644 tests/baselines/reference/APISample_linter.js.bak create mode 100644 tests/baselines/reference/APISample_linter.types.bak diff --git a/tests/baselines/reference/APISample_linter.js.bak b/tests/baselines/reference/APISample_linter.js.bak new file mode 100644 index 00000000000..f59fa91da14 --- /dev/null +++ b/tests/baselines/reference/APISample_linter.js.bak @@ -0,0 +1,2114 @@ +//// [tests/cases/compiler/APISample_linter.ts] //// + +//// [APISample_linter.ts] + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var fs: any; + +import ts = require("typescript"); + +export function delint(sourceFile: ts.SourceFile) { + delintNode(sourceFile); + + function delintNode(node: ts.Node) { + switch (node.kind) { + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + if ((node).statement.kind !== ts.SyntaxKind.Block) { + report(node, "A looping statement's contents should be wrapped in a block body."); + } + break; + case ts.SyntaxKind.IfStatement: + var ifStatement = (node); + if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { + report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); + } + if (ifStatement.elseStatement && + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); + } + break; + + case ts.SyntaxKind.BinaryExpression: + var op = (node).operatorToken.kind; + + if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { + report(node, "Use '===' and '!=='.") + } + break; + } + + ts.forEachChild(node, delintNode); + } + + function report(node: ts.Node, message: string) { + var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) + } +} + +var fileNames = process.argv.slice(2); +fileNames.forEach(fileName => { + // Parse a file + var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + + // delint it + delint(sourceFile); +}); + +//// [typescript.d.ts] +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. 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 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +declare module "typescript" { + interface Map { + [index: string]: T; + } + interface TextRange { + pos: number; + end: number; + } + const enum SyntaxKind { + Unknown = 0, + EndOfFileToken = 1, + SingleLineCommentTrivia = 2, + MultiLineCommentTrivia = 3, + NewLineTrivia = 4, + WhitespaceTrivia = 5, + ConflictMarkerTrivia = 6, + NumericLiteral = 7, + StringLiteral = 8, + RegularExpressionLiteral = 9, + NoSubstitutionTemplateLiteral = 10, + TemplateHead = 11, + TemplateMiddle = 12, + TemplateTail = 13, + OpenBraceToken = 14, + CloseBraceToken = 15, + OpenParenToken = 16, + CloseParenToken = 17, + OpenBracketToken = 18, + CloseBracketToken = 19, + DotToken = 20, + DotDotDotToken = 21, + SemicolonToken = 22, + CommaToken = 23, + LessThanToken = 24, + GreaterThanToken = 25, + LessThanEqualsToken = 26, + GreaterThanEqualsToken = 27, + EqualsEqualsToken = 28, + ExclamationEqualsToken = 29, + EqualsEqualsEqualsToken = 30, + ExclamationEqualsEqualsToken = 31, + EqualsGreaterThanToken = 32, + PlusToken = 33, + MinusToken = 34, + AsteriskToken = 35, + SlashToken = 36, + PercentToken = 37, + PlusPlusToken = 38, + MinusMinusToken = 39, + LessThanLessThanToken = 40, + GreaterThanGreaterThanToken = 41, + GreaterThanGreaterThanGreaterThanToken = 42, + AmpersandToken = 43, + BarToken = 44, + CaretToken = 45, + ExclamationToken = 46, + TildeToken = 47, + AmpersandAmpersandToken = 48, + BarBarToken = 49, + QuestionToken = 50, + ColonToken = 51, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + DeclareKeyword = 115, + GetKeyword = 116, + ModuleKeyword = 117, + RequireKeyword = 118, + NumberKeyword = 119, + SetKeyword = 120, + StringKeyword = 121, + SymbolKeyword = 122, + TypeKeyword = 123, + FromKeyword = 124, + OfKeyword = 125, + QualifiedName = 126, + ComputedPropertyName = 127, + TypeParameter = 128, + Parameter = 129, + Decorator = 130, + PropertySignature = 131, + PropertyDeclaration = 132, + MethodSignature = 133, + MethodDeclaration = 134, + Constructor = 135, + GetAccessor = 136, + SetAccessor = 137, + CallSignature = 138, + ConstructSignature = 139, + IndexSignature = 140, + TypeReference = 141, + FunctionType = 142, + ConstructorType = 143, + TypeQuery = 144, + TypeLiteral = 145, + ArrayType = 146, + TupleType = 147, + UnionType = 148, + ParenthesizedType = 149, + ObjectBindingPattern = 150, + ArrayBindingPattern = 151, + BindingElement = 152, + ArrayLiteralExpression = 153, + ObjectLiteralExpression = 154, + PropertyAccessExpression = 155, + ElementAccessExpression = 156, + CallExpression = 157, + NewExpression = 158, + TaggedTemplateExpression = 159, + TypeAssertionExpression = 160, + ParenthesizedExpression = 161, + FunctionExpression = 162, + ArrowFunction = 163, + DeleteExpression = 164, + TypeOfExpression = 165, + VoidExpression = 166, + PrefixUnaryExpression = 167, + PostfixUnaryExpression = 168, + BinaryExpression = 169, + ConditionalExpression = 170, + TemplateExpression = 171, + YieldExpression = 172, + SpreadElementExpression = 173, + ClassExpression = 174, + OmittedExpression = 175, + TemplateSpan = 176, + HeritageClauseElement = 177, + SemicolonClassElement = 178, + Block = 179, + VariableStatement = 180, + EmptyStatement = 181, + ExpressionStatement = 182, + IfStatement = 183, + DoStatement = 184, + WhileStatement = 185, + ForStatement = 186, + ForInStatement = 187, + ForOfStatement = 188, + ContinueStatement = 189, + BreakStatement = 190, + ReturnStatement = 191, + WithStatement = 192, + SwitchStatement = 193, + LabeledStatement = 194, + ThrowStatement = 195, + TryStatement = 196, + DebuggerStatement = 197, + VariableDeclaration = 198, + VariableDeclarationList = 199, + FunctionDeclaration = 200, + ClassDeclaration = 201, + InterfaceDeclaration = 202, + TypeAliasDeclaration = 203, + EnumDeclaration = 204, + ModuleDeclaration = 205, + ModuleBlock = 206, + CaseBlock = 207, + ImportEqualsDeclaration = 208, + ImportDeclaration = 209, + ImportClause = 210, + NamespaceImport = 211, + NamedImports = 212, + ImportSpecifier = 213, + ExportAssignment = 214, + ExportDeclaration = 215, + NamedExports = 216, + ExportSpecifier = 217, + MissingDeclaration = 218, + ExternalModuleReference = 219, + CaseClause = 220, + DefaultClause = 221, + HeritageClause = 222, + CatchClause = 223, + PropertyAssignment = 224, + ShorthandPropertyAssignment = 225, + EnumMember = 226, + SourceFile = 227, + SyntaxList = 228, + Count = 229, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, + FirstPunctuation = 14, + LastPunctuation = 64, + FirstToken = 0, + LastToken = 125, + FirstTriviaToken = 2, + LastTriviaToken = 6, + FirstLiteralToken = 7, + LastLiteralToken = 10, + FirstTemplateToken = 10, + LastTemplateToken = 13, + FirstBinaryOperator = 24, + LastBinaryOperator = 64, + FirstNode = 126, + } + const enum NodeFlags { + Export = 1, + Ambient = 2, + Public = 16, + Private = 32, + Protected = 64, + Static = 128, + Default = 256, + MultiLine = 512, + Synthetic = 1024, + DeclarationFile = 2048, + Let = 4096, + Const = 8192, + OctalLiteral = 16384, + ExportContext = 32768, + Modifier = 499, + AccessibilityModifier = 112, + BlockScoped = 12288, + } + const enum ParserContextFlags { + StrictMode = 1, + DisallowIn = 2, + Yield = 4, + GeneratorParameter = 8, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, + } + const enum RelationComparisonResult { + Succeeded = 1, + Failed = 2, + FailedAndReported = 3, + } + interface Node extends TextRange { + kind: SyntaxKind; + flags: NodeFlags; + parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; + modifiers?: ModifiersArray; + id?: number; + parent?: Node; + symbol?: Symbol; + locals?: SymbolTable; + nextContainer?: Node; + localSymbol?: Symbol; + } + interface NodeArray extends Array, TextRange { + hasTrailingComma?: boolean; + } + interface ModifiersArray extends NodeArray { + flags: number; + } + interface Identifier extends PrimaryExpression { + text: string; + } + interface QualifiedName extends Node { + left: EntityName; + right: Identifier; + } + type EntityName = Identifier | QualifiedName; + type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; + interface Declaration extends Node { + _declarationBrand: any; + name?: DeclarationName; + } + interface ComputedPropertyName extends Node { + expression: Expression; + } + interface Decorator extends Node { + expression: LeftHandSideExpression; + } + interface TypeParameterDeclaration extends Declaration { + name: Identifier; + constraint?: TypeNode; + expression?: Expression; + } + interface SignatureDeclaration extends Declaration { + typeParameters?: NodeArray; + parameters: NodeArray; + type?: TypeNode; + } + interface VariableDeclaration extends Declaration { + parent?: VariableDeclarationList; + name: Identifier | BindingPattern; + type?: TypeNode; + initializer?: Expression; + } + interface VariableDeclarationList extends Node { + declarations: NodeArray; + } + interface ParameterDeclaration extends Declaration { + dotDotDotToken?: Node; + name: Identifier | BindingPattern; + questionToken?: Node; + type?: TypeNode; + initializer?: Expression; + } + interface BindingElement extends Declaration { + propertyName?: Identifier; + dotDotDotToken?: Node; + name: Identifier | BindingPattern; + initializer?: Expression; + } + interface PropertyDeclaration extends Declaration, ClassElement { + name: DeclarationName; + questionToken?: Node; + type?: TypeNode; + initializer?: Expression; + } + interface ObjectLiteralElement extends Declaration { + _objectLiteralBrandBrand: any; + } + interface PropertyAssignment extends ObjectLiteralElement { + _propertyAssignmentBrand: any; + name: DeclarationName; + questionToken?: Node; + initializer: Expression; + } + interface ShorthandPropertyAssignment extends ObjectLiteralElement { + name: Identifier; + questionToken?: Node; + } + interface VariableLikeDeclaration extends Declaration { + propertyName?: Identifier; + dotDotDotToken?: Node; + name: DeclarationName; + questionToken?: Node; + type?: TypeNode; + initializer?: Expression; + } + interface BindingPattern extends Node { + elements: NodeArray; + } + /** + * Several node kinds share function-like features such as a signature, + * a name, and a body. These nodes should extend FunctionLikeDeclaration. + * Examples: + * FunctionDeclaration + * MethodDeclaration + * AccessorDeclaration + */ + interface FunctionLikeDeclaration extends SignatureDeclaration { + _functionLikeDeclarationBrand: any; + asteriskToken?: Node; + questionToken?: Node; + body?: Block | Expression; + } + interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { + name?: Identifier; + body?: Block; + } + interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { + body?: Block; + } + interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { + body?: Block; + } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } + interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { + _accessorDeclarationBrand: any; + body: Block; + } + interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { + _indexSignatureDeclarationBrand: any; + } + interface TypeNode extends Node { + _typeNodeBrand: any; + } + interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { + _functionOrConstructorTypeNodeBrand: any; + } + interface TypeReferenceNode extends TypeNode { + typeName: EntityName; + typeArguments?: NodeArray; + } + interface TypeQueryNode extends TypeNode { + exprName: EntityName; + } + interface TypeLiteralNode extends TypeNode, Declaration { + members: NodeArray; + } + interface ArrayTypeNode extends TypeNode { + elementType: TypeNode; + } + interface TupleTypeNode extends TypeNode { + elementTypes: NodeArray; + } + interface UnionTypeNode extends TypeNode { + types: NodeArray; + } + interface ParenthesizedTypeNode extends TypeNode { + type: TypeNode; + } + interface StringLiteralTypeNode extends LiteralExpression, TypeNode { + } + interface Expression extends Node { + _expressionBrand: any; + contextualType?: Type; + } + interface UnaryExpression extends Expression { + _unaryExpressionBrand: any; + } + interface PrefixUnaryExpression extends UnaryExpression { + operator: SyntaxKind; + operand: UnaryExpression; + } + interface PostfixUnaryExpression extends PostfixExpression { + operand: LeftHandSideExpression; + operator: SyntaxKind; + } + interface PostfixExpression extends UnaryExpression { + _postfixExpressionBrand: any; + } + interface LeftHandSideExpression extends PostfixExpression { + _leftHandSideExpressionBrand: any; + } + interface MemberExpression extends LeftHandSideExpression { + _memberExpressionBrand: any; + } + interface PrimaryExpression extends MemberExpression { + _primaryExpressionBrand: any; + } + interface DeleteExpression extends UnaryExpression { + expression: UnaryExpression; + } + interface TypeOfExpression extends UnaryExpression { + expression: UnaryExpression; + } + interface VoidExpression extends UnaryExpression { + expression: UnaryExpression; + } + interface YieldExpression extends Expression { + asteriskToken?: Node; + expression: Expression; + } + interface BinaryExpression extends Expression { + left: Expression; + operatorToken: Node; + right: Expression; + } + interface ConditionalExpression extends Expression { + condition: Expression; + questionToken: Node; + whenTrue: Expression; + colonToken: Node; + whenFalse: Expression; + } + interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { + name?: Identifier; + body: Block | Expression; + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } + interface LiteralExpression extends PrimaryExpression { + text: string; + isUnterminated?: boolean; + hasExtendedUnicodeEscape?: boolean; + } + interface StringLiteralExpression extends LiteralExpression { + _stringLiteralExpressionBrand: any; + } + interface TemplateExpression extends PrimaryExpression { + head: LiteralExpression; + templateSpans: NodeArray; + } + interface TemplateSpan extends Node { + expression: Expression; + literal: LiteralExpression; + } + interface ParenthesizedExpression extends PrimaryExpression { + expression: Expression; + } + interface ArrayLiteralExpression extends PrimaryExpression { + elements: NodeArray; + } + interface SpreadElementExpression extends Expression { + expression: Expression; + } + interface ObjectLiteralExpression extends PrimaryExpression, Declaration { + properties: NodeArray; + } + interface PropertyAccessExpression extends MemberExpression { + expression: LeftHandSideExpression; + dotToken: Node; + name: Identifier; + } + interface ElementAccessExpression extends MemberExpression { + expression: LeftHandSideExpression; + argumentExpression?: Expression; + } + interface CallExpression extends LeftHandSideExpression { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + arguments: NodeArray; + } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } + interface NewExpression extends CallExpression, PrimaryExpression { + } + interface TaggedTemplateExpression extends MemberExpression { + tag: LeftHandSideExpression; + template: LiteralExpression | TemplateExpression; + } + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; + interface TypeAssertion extends UnaryExpression { + type: TypeNode; + expression: UnaryExpression; + } + interface Statement extends Node, ModuleElement { + _statementBrand: any; + } + interface Block extends Statement { + statements: NodeArray; + } + interface VariableStatement extends Statement { + declarationList: VariableDeclarationList; + } + interface ExpressionStatement extends Statement { + expression: Expression; + } + interface IfStatement extends Statement { + expression: Expression; + thenStatement: Statement; + elseStatement?: Statement; + } + interface IterationStatement extends Statement { + statement: Statement; + } + interface DoStatement extends IterationStatement { + expression: Expression; + } + interface WhileStatement extends IterationStatement { + expression: Expression; + } + interface ForStatement extends IterationStatement { + initializer?: VariableDeclarationList | Expression; + condition?: Expression; + iterator?: Expression; + } + interface ForInStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } + interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } + interface BreakOrContinueStatement extends Statement { + label?: Identifier; + } + interface ReturnStatement extends Statement { + expression?: Expression; + } + interface WithStatement extends Statement { + expression: Expression; + statement: Statement; + } + interface SwitchStatement extends Statement { + expression: Expression; + caseBlock: CaseBlock; + } + interface CaseBlock extends Node { + clauses: NodeArray; + } + interface CaseClause extends Node { + expression?: Expression; + statements: NodeArray; + } + interface DefaultClause extends Node { + statements: NodeArray; + } + type CaseOrDefaultClause = CaseClause | DefaultClause; + interface LabeledStatement extends Statement { + label: Identifier; + statement: Statement; + } + interface ThrowStatement extends Statement { + expression: Expression; + } + interface TryStatement extends Statement { + tryBlock: Block; + catchClause?: CatchClause; + finallyBlock?: Block; + } + interface CatchClause extends Node { + variableDeclaration: VariableDeclaration; + block: Block; + } + interface ModuleElement extends Node { + _moduleElementBrand: any; + } + interface ClassLikeDeclaration extends Declaration { + name?: Identifier; + typeParameters?: NodeArray; + heritageClauses?: NodeArray; + members: NodeArray; + } + interface ClassDeclaration extends ClassLikeDeclaration, Statement { + } + interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { + } + interface ClassElement extends Declaration { + _classElementBrand: any; + } + interface InterfaceDeclaration extends Declaration, ModuleElement { + name: Identifier; + typeParameters?: NodeArray; + heritageClauses?: NodeArray; + members: NodeArray; + } + interface HeritageClause extends Node { + token: SyntaxKind; + types?: NodeArray; + } + interface TypeAliasDeclaration extends Declaration, ModuleElement { + name: Identifier; + type: TypeNode; + } + interface EnumMember extends Declaration { + name: DeclarationName; + initializer?: Expression; + } + interface EnumDeclaration extends Declaration, ModuleElement { + name: Identifier; + members: NodeArray; + } + interface ModuleDeclaration extends Declaration, ModuleElement { + name: Identifier | LiteralExpression; + body: ModuleBlock | ModuleDeclaration; + } + interface ModuleBlock extends Node, ModuleElement { + statements: NodeArray; + } + interface ImportEqualsDeclaration extends Declaration, ModuleElement { + name: Identifier; + moduleReference: EntityName | ExternalModuleReference; + } + interface ExternalModuleReference extends Node { + expression?: Expression; + } + interface ImportDeclaration extends ModuleElement { + importClause?: ImportClause; + moduleSpecifier: Expression; + } + interface ImportClause extends Declaration { + name?: Identifier; + namedBindings?: NamespaceImport | NamedImports; + } + interface NamespaceImport extends Declaration { + name: Identifier; + } + interface ExportDeclaration extends Declaration, ModuleElement { + exportClause?: NamedExports; + moduleSpecifier?: Expression; + } + interface NamedImportsOrExports extends Node { + elements: NodeArray; + } + type NamedImports = NamedImportsOrExports; + type NamedExports = NamedImportsOrExports; + interface ImportOrExportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } + type ImportSpecifier = ImportOrExportSpecifier; + type ExportSpecifier = ImportOrExportSpecifier; + interface ExportAssignment extends Declaration, ModuleElement { + isExportEquals?: boolean; + expression?: Expression; + type?: TypeNode; + } + interface FileReference extends TextRange { + fileName: string; + } + interface CommentRange extends TextRange { + hasTrailingNewLine?: boolean; + } + interface SourceFile extends Declaration { + statements: NodeArray; + endOfFileToken: Node; + fileName: string; + text: string; + amdDependencies: { + path: string; + name: string; + }[]; + amdModuleName: string; + referencedFiles: FileReference[]; + hasNoDefaultLib: boolean; + externalModuleIndicator: Node; + languageVersion: ScriptTarget; + identifiers: Map; + } + interface ScriptReferenceHost { + getCompilerOptions(): CompilerOptions; + getSourceFile(fileName: string): SourceFile; + getCurrentDirectory(): string; + } + interface WriteFileCallback { + (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; + } + interface Program extends ScriptReferenceHost { + getSourceFiles(): SourceFile[]; + /** + * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then + * the JavaScript and declaration files will be produced for all the files in this program. + * If targetSourceFile is specified, then only the JavaScript and declaration for that + * specific file will be generated. + * + * If writeFile is not specified then the writeFile callback from the compiler host will be + * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter + * will be invoked when writing the JavaScript and declaration files. + */ + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; + getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getGlobalDiagnostics(): Diagnostic[]; + getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getTypeChecker(): TypeChecker; + getCommonSourceDirectory(): string; + } + interface SourceMapSpan { + emittedLine: number; + emittedColumn: number; + sourceLine: number; + sourceColumn: number; + nameIndex?: number; + sourceIndex: number; + } + interface SourceMapData { + sourceMapFilePath: string; + jsSourceMappingURL: string; + sourceMapFile: string; + sourceMapSourceRoot: string; + sourceMapSources: string[]; + inputSourceFileNames: string[]; + sourceMapNames?: string[]; + sourceMapMappings: string; + sourceMapDecodedMappings: SourceMapSpan[]; + } + enum ExitStatus { + Success = 0, + DiagnosticsPresent_OutputsSkipped = 1, + DiagnosticsPresent_OutputsGenerated = 2, + } + interface EmitResult { + emitSkipped: boolean; + diagnostics: Diagnostic[]; + sourceMaps: SourceMapData[]; + } + interface TypeCheckerHost { + getCompilerOptions(): CompilerOptions; + getSourceFiles(): SourceFile[]; + getSourceFile(fileName: string): SourceFile; + } + interface TypeChecker { + getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; + getDeclaredTypeOfSymbol(symbol: Symbol): Type; + getPropertiesOfType(type: Type): Symbol[]; + getPropertyOfType(type: Type, propertyName: string): Symbol; + getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; + getIndexTypeOfType(type: Type, kind: IndexKind): Type; + getReturnTypeOfSignature(signature: Signature): Type; + getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; + getSymbolAtLocation(node: Node): Symbol; + getShorthandAssignmentValueSymbol(location: Node): Symbol; + getTypeAtLocation(node: Node): Type; + typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; + symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + getSymbolDisplayBuilder(): SymbolDisplayBuilder; + getFullyQualifiedName(symbol: Symbol): string; + getAugmentedPropertiesOfType(type: Type): Symbol[]; + getRootSymbols(symbol: Symbol): Symbol[]; + getContextualType(node: Expression): Type; + getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; + getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; + isUndefinedSymbol(symbol: Symbol): boolean; + isArgumentsSymbol(symbol: Symbol): boolean; + getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; + isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; + getAliasedSymbol(symbol: Symbol): Symbol; + getExportsOfModule(moduleSymbol: Symbol): Symbol[]; + } + interface SymbolDisplayBuilder { + buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; + buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; + buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + } + interface SymbolWriter { + writeKeyword(text: string): void; + writeOperator(text: string): void; + writePunctuation(text: string): void; + writeSpace(text: string): void; + writeStringLiteral(text: string): void; + writeParameter(text: string): void; + writeSymbol(text: string, symbol: Symbol): void; + writeLine(): void; + increaseIndent(): void; + decreaseIndent(): void; + clear(): void; + trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; + } + const enum TypeFormatFlags { + None = 0, + WriteArrayAsGenericType = 1, + UseTypeOfFunction = 2, + NoTruncation = 4, + WriteArrowStyleSignature = 8, + WriteOwnNameForAnyLike = 16, + WriteTypeArgumentsOfSignature = 32, + InElementType = 64, + UseFullyQualifiedType = 128, + } + const enum SymbolFormatFlags { + None = 0, + WriteTypeParametersOrArguments = 1, + UseOnlyExternalAliasing = 2, + } + const enum SymbolAccessibility { + Accessible = 0, + NotAccessible = 1, + CannotBeNamed = 2, + } + type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; + interface SymbolVisibilityResult { + accessibility: SymbolAccessibility; + aliasesToMakeVisible?: AnyImportSyntax[]; + errorSymbolName?: string; + errorNode?: Node; + } + interface SymbolAccessiblityResult extends SymbolVisibilityResult { + errorModuleName?: string; + } + interface EmitResolver { + hasGlobalName(name: string): boolean; + getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; + isValueAliasDeclaration(node: Node): boolean; + isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; + getNodeCheckFlags(node: Node): NodeCheckFlags; + isDeclarationVisible(node: Declaration): boolean; + collectLinkedAliases(node: Identifier): Node[]; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; + writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; + getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; + resolvesToSomeValue(location: Node, name: string): boolean; + getBlockScopedVariableId(node: Identifier): number; + } + const enum SymbolFlags { + FunctionScopedVariable = 1, + BlockScopedVariable = 2, + Property = 4, + EnumMember = 8, + Function = 16, + Class = 32, + Interface = 64, + ConstEnum = 128, + RegularEnum = 256, + ValueModule = 512, + NamespaceModule = 1024, + TypeLiteral = 2048, + ObjectLiteral = 4096, + Method = 8192, + Constructor = 16384, + GetAccessor = 32768, + SetAccessor = 65536, + Signature = 131072, + TypeParameter = 262144, + TypeAlias = 524288, + ExportValue = 1048576, + ExportType = 2097152, + ExportNamespace = 4194304, + Alias = 8388608, + Instantiated = 16777216, + Merged = 33554432, + Transient = 67108864, + Prototype = 134217728, + UnionProperty = 268435456, + Optional = 536870912, + ExportStar = 1073741824, + Enum = 384, + Variable = 3, + Value = 107455, + Type = 793056, + Namespace = 1536, + Module = 1536, + Accessor = 98304, + FunctionScopedVariableExcludes = 107454, + BlockScopedVariableExcludes = 107455, + ParameterExcludes = 107455, + PropertyExcludes = 107455, + EnumMemberExcludes = 107455, + FunctionExcludes = 106927, + ClassExcludes = 899583, + InterfaceExcludes = 792992, + RegularEnumExcludes = 899327, + ConstEnumExcludes = 899967, + ValueModuleExcludes = 106639, + NamespaceModuleExcludes = 0, + MethodExcludes = 99263, + GetAccessorExcludes = 41919, + SetAccessorExcludes = 74687, + TypeParameterExcludes = 530912, + TypeAliasExcludes = 793056, + AliasExcludes = 8388608, + ModuleMember = 8914931, + ExportHasLocal = 944, + HasLocals = 255504, + HasExports = 1952, + HasMembers = 6240, + IsContainer = 262128, + PropertyOrAccessor = 98308, + Export = 7340032, + } + interface Symbol { + flags: SymbolFlags; + name: string; + id?: number; + mergeId?: number; + declarations?: Declaration[]; + parent?: Symbol; + members?: SymbolTable; + exports?: SymbolTable; + exportSymbol?: Symbol; + valueDeclaration?: Declaration; + constEnumOnlyModule?: boolean; + } + interface SymbolLinks { + target?: Symbol; + type?: Type; + declaredType?: Type; + mapper?: TypeMapper; + referenced?: boolean; + unionType?: UnionType; + resolvedExports?: SymbolTable; + exportsChecked?: boolean; + } + interface TransientSymbol extends Symbol, SymbolLinks { + } + interface SymbolTable { + [index: string]: Symbol; + } + const enum NodeCheckFlags { + TypeChecked = 1, + LexicalThis = 2, + CaptureThis = 4, + EmitExtends = 8, + SuperInstance = 16, + SuperStatic = 32, + ContextChecked = 64, + EnumValuesComputed = 128, + BlockScopedBindingInLoop = 256, + EmitDecorate = 512, + } + interface NodeLinks { + resolvedType?: Type; + resolvedSignature?: Signature; + resolvedSymbol?: Symbol; + flags?: NodeCheckFlags; + enumMemberValue?: number; + isIllegalTypeReferenceInConstraint?: boolean; + isVisible?: boolean; + generatedName?: string; + generatedNames?: Map; + assignmentChecks?: Map; + hasReportedStatementInAmbientContext?: boolean; + importOnRightSide?: Symbol; + } + const enum TypeFlags { + Any = 1, + String = 2, + Number = 4, + Boolean = 8, + Void = 16, + Undefined = 32, + Null = 64, + Enum = 128, + StringLiteral = 256, + TypeParameter = 512, + Class = 1024, + Interface = 2048, + Reference = 4096, + Tuple = 8192, + Union = 16384, + Anonymous = 32768, + FromSignature = 65536, + ObjectLiteral = 131072, + ContainsUndefinedOrNull = 262144, + ContainsObjectLiteral = 524288, + ESSymbol = 1048576, + Intrinsic = 1048703, + Primitive = 1049086, + StringLike = 258, + NumberLike = 132, + ObjectType = 48128, + RequiresWidening = 786432, + } + interface Type { + flags: TypeFlags; + id: number; + symbol?: Symbol; + } + interface IntrinsicType extends Type { + intrinsicName: string; + } + interface StringLiteralType extends Type { + text: string; + } + interface ObjectType extends Type { + } + interface InterfaceType extends ObjectType { + typeParameters: TypeParameter[]; + baseTypes: ObjectType[]; + declaredProperties: Symbol[]; + declaredCallSignatures: Signature[]; + declaredConstructSignatures: Signature[]; + declaredStringIndexType: Type; + declaredNumberIndexType: Type; + } + interface TypeReference extends ObjectType { + target: GenericType; + typeArguments: Type[]; + } + interface GenericType extends InterfaceType, TypeReference { + instantiations: Map; + } + interface TupleType extends ObjectType { + elementTypes: Type[]; + baseArrayType: TypeReference; + } + interface UnionType extends Type { + types: Type[]; + resolvedProperties: SymbolTable; + } + interface ResolvedType extends ObjectType, UnionType { + members: SymbolTable; + properties: Symbol[]; + callSignatures: Signature[]; + constructSignatures: Signature[]; + stringIndexType: Type; + numberIndexType: Type; + } + interface TypeParameter extends Type { + constraint: Type; + target?: TypeParameter; + mapper?: TypeMapper; + } + const enum SignatureKind { + Call = 0, + Construct = 1, + } + interface Signature { + declaration: SignatureDeclaration; + typeParameters: TypeParameter[]; + parameters: Symbol[]; + resolvedReturnType: Type; + minArgumentCount: number; + hasRestParameter: boolean; + hasStringLiterals: boolean; + target?: Signature; + mapper?: TypeMapper; + unionSignatures?: Signature[]; + erasedSignatureCache?: Signature; + isolatedSignatureType?: ObjectType; + } + const enum IndexKind { + String = 0, + Number = 1, + } + interface TypeMapper { + (t: Type): Type; + } + interface DiagnosticMessage { + key: string; + category: DiagnosticCategory; + code: number; + } + interface DiagnosticMessageChain { + messageText: string; + category: DiagnosticCategory; + code: number; + next?: DiagnosticMessageChain; + } + interface Diagnostic { + file: SourceFile; + start: number; + length: number; + messageText: string | DiagnosticMessageChain; + category: DiagnosticCategory; + code: number; + } + enum DiagnosticCategory { + Warning = 0, + Error = 1, + Message = 2, + } + interface CompilerOptions { + allowNonTsExtensions?: boolean; + charset?: string; + declaration?: boolean; + diagnostics?: boolean; + emitBOM?: boolean; + help?: boolean; + listFiles?: boolean; + locale?: string; + mapRoot?: string; + module?: ModuleKind; + noEmit?: boolean; + noEmitOnError?: boolean; + noErrorTruncation?: boolean; + noImplicitAny?: boolean; + noLib?: boolean; + noResolve?: boolean; + out?: string; + outDir?: string; + preserveConstEnums?: boolean; + project?: string; + removeComments?: boolean; + sourceMap?: boolean; + sourceRoot?: string; + suppressImplicitAnyIndexErrors?: boolean; + target?: ScriptTarget; + version?: boolean; + watch?: boolean; + separateCompilation?: boolean; + [option: string]: string | number | boolean; + } + const enum ModuleKind { + None = 0, + CommonJS = 1, + AMD = 2, + } + interface LineAndCharacter { + line: number; + character: number; + } + const enum ScriptTarget { + ES3 = 0, + ES5 = 1, + ES6 = 2, + Latest = 2, + } + interface ParsedCommandLine { + options: CompilerOptions; + fileNames: string[]; + errors: Diagnostic[]; + } + interface CommandLineOption { + name: string; + type: string | Map; + isFilePath?: boolean; + shortName?: string; + description?: DiagnosticMessage; + paramType?: DiagnosticMessage; + error?: DiagnosticMessage; + experimental?: boolean; + } + const enum CharacterCodes { + nullCharacter = 0, + maxAsciiCharacter = 127, + lineFeed = 10, + carriageReturn = 13, + lineSeparator = 8232, + paragraphSeparator = 8233, + nextLine = 133, + space = 32, + nonBreakingSpace = 160, + enQuad = 8192, + emQuad = 8193, + enSpace = 8194, + emSpace = 8195, + threePerEmSpace = 8196, + fourPerEmSpace = 8197, + sixPerEmSpace = 8198, + figureSpace = 8199, + punctuationSpace = 8200, + thinSpace = 8201, + hairSpace = 8202, + zeroWidthSpace = 8203, + narrowNoBreakSpace = 8239, + ideographicSpace = 12288, + mathematicalSpace = 8287, + ogham = 5760, + _ = 95, + $ = 36, + _0 = 48, + _1 = 49, + _2 = 50, + _3 = 51, + _4 = 52, + _5 = 53, + _6 = 54, + _7 = 55, + _8 = 56, + _9 = 57, + a = 97, + b = 98, + c = 99, + d = 100, + e = 101, + f = 102, + g = 103, + h = 104, + i = 105, + j = 106, + k = 107, + l = 108, + m = 109, + n = 110, + o = 111, + p = 112, + q = 113, + r = 114, + s = 115, + t = 116, + u = 117, + v = 118, + w = 119, + x = 120, + y = 121, + z = 122, + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + ampersand = 38, + asterisk = 42, + at = 64, + backslash = 92, + backtick = 96, + bar = 124, + caret = 94, + closeBrace = 125, + closeBracket = 93, + closeParen = 41, + colon = 58, + comma = 44, + dot = 46, + doubleQuote = 34, + equals = 61, + exclamation = 33, + greaterThan = 62, + hash = 35, + lessThan = 60, + minus = 45, + openBrace = 123, + openBracket = 91, + openParen = 40, + percent = 37, + plus = 43, + question = 63, + semicolon = 59, + singleQuote = 39, + slash = 47, + tilde = 126, + backspace = 8, + formFeed = 12, + byteOrderMark = 65279, + tab = 9, + verticalTab = 11, + } + interface CancellationToken { + isCancellationRequested(): boolean; + } + interface CompilerHost { + getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; + getDefaultLibFileName(options: CompilerOptions): string; + getCancellationToken?(): CancellationToken; + writeFile: WriteFileCallback; + getCurrentDirectory(): string; + getCanonicalFileName(fileName: string): string; + useCaseSensitiveFileNames(): boolean; + getNewLine(): string; + } + interface TextSpan { + start: number; + length: number; + } + interface TextChangeRange { + span: TextSpan; + newLength: number; + } +} +declare module "typescript" { + interface ErrorCallback { + (message: DiagnosticMessage, length: number): void; + } + interface Scanner { + getStartPos(): number; + getToken(): SyntaxKind; + getTextPos(): number; + getTokenPos(): number; + getTokenText(): string; + getTokenValue(): string; + hasExtendedUnicodeEscape(): boolean; + hasPrecedingLineBreak(): boolean; + isIdentifier(): boolean; + isReservedWord(): boolean; + isUnterminated(): boolean; + reScanGreaterToken(): SyntaxKind; + reScanSlashToken(): SyntaxKind; + reScanTemplateToken(): SyntaxKind; + scan(): SyntaxKind; + setText(text: string): void; + setTextPos(textPos: number): void; + lookAhead(callback: () => T): T; + tryScan(callback: () => T): T; + } + function tokenToString(t: SyntaxKind): string; + function computeLineStarts(text: string): number[]; + function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; + function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; + function getLineStarts(sourceFile: SourceFile): number[]; + function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { + line: number; + character: number; + }; + function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; + function isWhiteSpace(ch: number): boolean; + function isLineBreak(ch: number): boolean; + function isOctalDigit(ch: number): boolean; + function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; + function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; + function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; + function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; + function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; + function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; +} +declare module "typescript" { + function getNodeConstructor(kind: SyntaxKind): new () => Node; + function createNode(kind: SyntaxKind): Node; + function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; + function modifierToFlag(token: SyntaxKind): NodeFlags; + function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; + function isEvalOrArgumentsIdentifier(node: Node): boolean; + function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; + function isLeftHandSideExpression(expr: Expression): boolean; + function isAssignmentOperator(token: SyntaxKind): boolean; +} +declare module "typescript" { + function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; +} +declare module "typescript" { + /** The version of the TypeScript compiler release */ + let version: string; + function findConfigFile(searchPath: string): string; + function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; + function getPreEmitDiagnostics(program: Program): Diagnostic[]; + function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; + function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; +} +declare module "typescript" { + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ + function readConfigFile(fileName: string): any; + /** + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; +} +declare module "typescript" { + /** The version of the language service API */ + let servicesVersion: string; + interface Node { + getSourceFile(): SourceFile; + getChildCount(sourceFile?: SourceFile): number; + getChildAt(index: number, sourceFile?: SourceFile): Node; + getChildren(sourceFile?: SourceFile): Node[]; + getStart(sourceFile?: SourceFile): number; + getFullStart(): number; + getEnd(): number; + getWidth(sourceFile?: SourceFile): number; + getFullWidth(): number; + getLeadingTriviaWidth(sourceFile?: SourceFile): number; + getFullText(sourceFile?: SourceFile): string; + getText(sourceFile?: SourceFile): string; + getFirstToken(sourceFile?: SourceFile): Node; + getLastToken(sourceFile?: SourceFile): Node; + } + interface Symbol { + getFlags(): SymbolFlags; + getName(): string; + getDeclarations(): Declaration[]; + getDocumentationComment(): SymbolDisplayPart[]; + } + interface Type { + getFlags(): TypeFlags; + getSymbol(): Symbol; + getProperties(): Symbol[]; + getProperty(propertyName: string): Symbol; + getApparentProperties(): Symbol[]; + getCallSignatures(): Signature[]; + getConstructSignatures(): Signature[]; + getStringIndexType(): Type; + getNumberIndexType(): Type; + } + interface Signature { + getDeclaration(): SignatureDeclaration; + getTypeParameters(): Type[]; + getParameters(): Symbol[]; + getReturnType(): Type; + getDocumentationComment(): SymbolDisplayPart[]; + } + interface SourceFile { + getNamedDeclarations(): Declaration[]; + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; + getLineStarts(): number[]; + getPositionOfLineAndCharacter(line: number, character: number): number; + update(newText: string, textChangeRange: TextChangeRange): SourceFile; + } + /** + * Represents an immutable snapshot of a script at a specified time.Once acquired, the + * snapshot is observably immutable. i.e. the same calls with the same parameters will return + * the same values. + */ + interface IScriptSnapshot { + /** Gets a portion of the script snapshot specified by [start, end). */ + getText(start: number, end: number): string; + /** Gets the length of this script snapshot. */ + getLength(): number; + /** + * Gets the TextChangeRange that describe how the text changed between this text and + * an older version. This information is used by the incremental parser to determine + * what sections of the script need to be re-parsed. 'undefined' can be returned if the + * change range cannot be determined. However, in that case, incremental parsing will + * not happen and the entire document will be re - parsed. + */ + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; + } + module ScriptSnapshot { + function fromString(text: string): IScriptSnapshot; + } + interface PreProcessedFileInfo { + referencedFiles: FileReference[]; + importedFiles: FileReference[]; + isLibFile: boolean; + } + interface LanguageServiceHost { + getCompilationSettings(): CompilerOptions; + getNewLine?(): string; + getScriptFileNames(): string[]; + getScriptVersion(fileName: string): string; + getScriptSnapshot(fileName: string): IScriptSnapshot; + getLocalizedDiagnosticMessages?(): any; + getCancellationToken?(): CancellationToken; + getCurrentDirectory(): string; + getDefaultLibFileName(options: CompilerOptions): string; + log?(s: string): void; + trace?(s: string): void; + error?(s: string): void; + } + interface LanguageService { + cleanupSemanticCache(): void; + getSyntacticDiagnostics(fileName: string): Diagnostic[]; + getSemanticDiagnostics(fileName: string): Diagnostic[]; + getCompilerOptionsDiagnostics(): Diagnostic[]; + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; + getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; + getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; + getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; + getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; + getRenameInfo(fileName: string, position: number): RenameInfo; + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; + getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + findReferences(fileName: string, position: number): ReferencedSymbol[]; + getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; + getNavigationBarItems(fileName: string): NavigationBarItem[]; + getOutliningSpans(fileName: string): OutliningSpan[]; + getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; + getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; + getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; + getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; + getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; + getEmitOutput(fileName: string): EmitOutput; + getProgram(): Program; + getSourceFile(fileName: string): SourceFile; + dispose(): void; + } + interface ClassifiedSpan { + textSpan: TextSpan; + classificationType: string; + } + interface NavigationBarItem { + text: string; + kind: string; + kindModifiers: string; + spans: TextSpan[]; + childItems: NavigationBarItem[]; + indent: number; + bolded: boolean; + grayed: boolean; + } + interface TodoCommentDescriptor { + text: string; + priority: number; + } + interface TodoComment { + descriptor: TodoCommentDescriptor; + message: string; + position: number; + } + class TextChange { + span: TextSpan; + newText: string; + } + interface RenameLocation { + textSpan: TextSpan; + fileName: string; + } + interface ReferenceEntry { + textSpan: TextSpan; + fileName: string; + isWriteAccess: boolean; + } + interface NavigateToItem { + name: string; + kind: string; + kindModifiers: string; + matchKind: string; + isCaseSensitive: boolean; + fileName: string; + textSpan: TextSpan; + containerName: string; + containerKind: string; + } + interface EditorOptions { + IndentSize: number; + TabSize: number; + NewLineCharacter: string; + ConvertTabsToSpaces: boolean; + } + interface FormatCodeOptions extends EditorOptions { + InsertSpaceAfterCommaDelimiter: boolean; + InsertSpaceAfterSemicolonInForStatements: boolean; + InsertSpaceBeforeAndAfterBinaryOperators: boolean; + InsertSpaceAfterKeywordsInControlFlowStatements: boolean; + InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; + InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; + PlaceOpenBraceOnNewLineForFunctions: boolean; + PlaceOpenBraceOnNewLineForControlBlocks: boolean; + [s: string]: boolean | number | string; + } + interface DefinitionInfo { + fileName: string; + textSpan: TextSpan; + kind: string; + name: string; + containerKind: string; + containerName: string; + } + interface ReferencedSymbol { + definition: DefinitionInfo; + references: ReferenceEntry[]; + } + enum SymbolDisplayPartKind { + aliasName = 0, + className = 1, + enumName = 2, + fieldName = 3, + interfaceName = 4, + keyword = 5, + lineBreak = 6, + numericLiteral = 7, + stringLiteral = 8, + localName = 9, + methodName = 10, + moduleName = 11, + operator = 12, + parameterName = 13, + propertyName = 14, + punctuation = 15, + space = 16, + text = 17, + typeParameterName = 18, + enumMemberName = 19, + functionName = 20, + regularExpressionLiteral = 21, + } + interface SymbolDisplayPart { + text: string; + kind: string; + } + interface QuickInfo { + kind: string; + kindModifiers: string; + textSpan: TextSpan; + displayParts: SymbolDisplayPart[]; + documentation: SymbolDisplayPart[]; + } + interface RenameInfo { + canRename: boolean; + localizedErrorMessage: string; + displayName: string; + fullDisplayName: string; + kind: string; + kindModifiers: string; + triggerSpan: TextSpan; + } + interface SignatureHelpParameter { + name: string; + documentation: SymbolDisplayPart[]; + displayParts: SymbolDisplayPart[]; + isOptional: boolean; + } + /** + * Represents a single signature to show in signature help. + * The id is used for subsequent calls into the language service to ask questions about the + * signature help item in the context of any documents that have been updated. i.e. after + * an edit has happened, while signature help is still active, the host can ask important + * questions like 'what parameter is the user currently contained within?'. + */ + interface SignatureHelpItem { + isVariadic: boolean; + prefixDisplayParts: SymbolDisplayPart[]; + suffixDisplayParts: SymbolDisplayPart[]; + separatorDisplayParts: SymbolDisplayPart[]; + parameters: SignatureHelpParameter[]; + documentation: SymbolDisplayPart[]; + } + /** + * Represents a set of signature help items, and the preferred item that should be selected. + */ + interface SignatureHelpItems { + items: SignatureHelpItem[]; + applicableSpan: TextSpan; + selectedItemIndex: number; + argumentIndex: number; + argumentCount: number; + } + interface CompletionInfo { + isMemberCompletion: boolean; + isNewIdentifierLocation: boolean; + entries: CompletionEntry[]; + } + interface CompletionEntry { + name: string; + kind: string; + kindModifiers: string; + sortText: string; + } + interface CompletionEntryDetails { + name: string; + kind: string; + kindModifiers: string; + displayParts: SymbolDisplayPart[]; + documentation: SymbolDisplayPart[]; + } + interface OutliningSpan { + /** The span of the document to actually collapse. */ + textSpan: TextSpan; + /** The span of the document to display when the user hovers over the collapsed span. */ + hintSpan: TextSpan; + /** The text to display in the editor for the collapsed region. */ + bannerText: string; + /** + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ + autoCollapse: boolean; + } + interface EmitOutput { + outputFiles: OutputFile[]; + emitSkipped: boolean; + } + const enum OutputFileType { + JavaScript = 0, + SourceMap = 1, + Declaration = 2, + } + interface OutputFile { + name: string; + writeByteOrderMark: boolean; + text: string; + } + const enum EndOfLineState { + Start = 0, + InMultiLineCommentTrivia = 1, + InSingleQuoteStringLiteral = 2, + InDoubleQuoteStringLiteral = 3, + InTemplateHeadOrNoSubstitutionTemplate = 4, + InTemplateMiddleOrTail = 5, + InTemplateSubstitutionPosition = 6, + } + enum TokenClass { + Punctuation = 0, + Keyword = 1, + Operator = 2, + Comment = 3, + Whitespace = 4, + Identifier = 5, + NumberLiteral = 6, + StringLiteral = 7, + RegExpLiteral = 8, + } + interface ClassificationResult { + finalLexState: EndOfLineState; + entries: ClassificationInfo[]; + } + interface ClassificationInfo { + length: number; + classification: TokenClass; + } + interface Classifier { + /** + * Gives lexical classifications of tokens on a line without any syntactic context. + * For instance, a token consisting of the text 'string' can be either an identifier + * named 'string' or the keyword 'string', however, because this classifier is not aware, + * it relies on certain heuristics to give acceptable results. For classifications where + * speed trumps accuracy, this function is preferable; however, for true accuracy, the + * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the + * lexical, syntactic, and semantic classifiers may issue the best user experience. + * + * @param text The text of a line to classify. + * @param lexState The state of the lexical classifier at the end of the previous line. + * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. + * If there is no syntactic classifier (syntacticClassifierAbsent=true), + * certain heuristics may be used in its place; however, if there is a + * syntactic classifier (syntacticClassifierAbsent=false), certain + * classifications which may be incorrectly categorized will be given + * back as Identifiers in order to allow the syntactic classifier to + * subsume the classification. + */ + getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; + } + /** + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ + interface DocumentRegistry { + /** + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ + acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; + /** + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ + updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; + /** + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ + releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; + } + class ScriptElementKind { + static unknown: string; + static warning: string; + static keyword: string; + static scriptElement: string; + static moduleElement: string; + static classElement: string; + static interfaceElement: string; + static typeElement: string; + static enumElement: string; + static variableElement: string; + static localVariableElement: string; + static functionElement: string; + static localFunctionElement: string; + static memberFunctionElement: string; + static memberGetAccessorElement: string; + static memberSetAccessorElement: string; + static memberVariableElement: string; + static constructorImplementationElement: string; + static callSignatureElement: string; + static indexSignatureElement: string; + static constructSignatureElement: string; + static parameterElement: string; + static typeParameterElement: string; + static primitiveType: string; + static label: string; + static alias: string; + static constElement: string; + static letElement: string; + } + class ScriptElementKindModifier { + static none: string; + static publicMemberModifier: string; + static privateMemberModifier: string; + static protectedMemberModifier: string; + static exportedModifier: string; + static ambientModifier: string; + static staticModifier: string; + } + class ClassificationTypeNames { + static comment: string; + static identifier: string; + static keyword: string; + static numericLiteral: string; + static operator: string; + static stringLiteral: string; + static whiteSpace: string; + static text: string; + static punctuation: string; + static className: string; + static enumName: string; + static interfaceName: string; + static moduleName: string; + static typeParameterName: string; + static typeAlias: string; + } + interface DisplayPartsSymbolWriter extends SymbolWriter { + displayParts(): SymbolDisplayPart[]; + } + function displayPartsToString(displayParts: SymbolDisplayPart[]): string; + function getDefaultCompilerOptions(): CompilerOptions; + class OperationCanceledException { + } + class CancellationTokenObject { + private cancellationToken; + static None: CancellationTokenObject; + constructor(cancellationToken: CancellationToken); + isCancellationRequested(): boolean; + throwIfCancellationRequested(): void; + } + function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; + function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; + let disableIncrementalParsing: boolean; + function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; + function createDocumentRegistry(): DocumentRegistry; + function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; + function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; + function createClassifier(): Classifier; + /** + * Get the path of the default library file (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ + function getDefaultLibFilePath(options: CompilerOptions): string; +} + + +//// [APISample_linter.js] +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ +var ts = require("typescript"); +function delint(sourceFile) { + delintNode(sourceFile); + function delintNode(node) { + switch (node.kind) { + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + if (node.statement.kind !== 179 /* Block */) { + report(node, "A looping statement's contents should be wrapped in a block body."); + } + break; + case 183 /* IfStatement */: + var ifStatement = node; + if (ifStatement.thenStatement.kind !== 179 /* Block */) { + report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); + } + if (ifStatement.elseStatement && + ifStatement.elseStatement.kind !== 179 /* Block */ && ifStatement.elseStatement.kind !== 183 /* IfStatement */) { + report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); + } + break; + case 169 /* BinaryExpression */: + var op = node.operatorToken.kind; + if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { + report(node, "Use '===' and '!=='."); + } + break; + } + ts.forEachChild(node, delintNode); + } + function report(node, message) { + var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(sourceFile.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + message); + } +} +exports.delint = delint; +var fileNames = process.argv.slice(2); +fileNames.forEach(function (fileName) { + // Parse a file + var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), 2 /* ES6 */, true); + // delint it + delint(sourceFile); +}); diff --git a/tests/baselines/reference/APISample_linter.types.bak b/tests/baselines/reference/APISample_linter.types.bak new file mode 100644 index 00000000000..12f4ac12fdc --- /dev/null +++ b/tests/baselines/reference/APISample_linter.types.bak @@ -0,0 +1,6438 @@ +=== tests/cases/compiler/APISample_linter.ts === + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +>process : any + +declare var console: any; +>console : any + +declare var fs: any; +>fs : any + +import ts = require("typescript"); +>ts : typeof ts + +export function delint(sourceFile: ts.SourceFile) { +>delint : (sourceFile: ts.SourceFile) => void +>sourceFile : ts.SourceFile +>ts : unknown +>SourceFile : ts.SourceFile + + delintNode(sourceFile); +>delintNode(sourceFile) : void +>delintNode : (node: ts.Node) => void +>sourceFile : ts.SourceFile + + function delintNode(node: ts.Node) { +>delintNode : (node: ts.Node) => void +>node : ts.Node +>ts : unknown +>Node : ts.Node + + switch (node.kind) { +>node.kind : ts.SyntaxKind +>node : ts.Node +>kind : ts.SyntaxKind + + case ts.SyntaxKind.ForStatement: +>ts.SyntaxKind.ForStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>ForStatement : ts.SyntaxKind + + case ts.SyntaxKind.ForInStatement: +>ts.SyntaxKind.ForInStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>ForInStatement : ts.SyntaxKind + + case ts.SyntaxKind.WhileStatement: +>ts.SyntaxKind.WhileStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>WhileStatement : ts.SyntaxKind + + case ts.SyntaxKind.DoStatement: +>ts.SyntaxKind.DoStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>DoStatement : ts.SyntaxKind + + if ((node).statement.kind !== ts.SyntaxKind.Block) { +>(node).statement.kind !== ts.SyntaxKind.Block : boolean +>(node).statement.kind : ts.SyntaxKind +>(node).statement : ts.Statement +>(node) : ts.IterationStatement +>node : ts.IterationStatement +>ts : unknown +>IterationStatement : ts.IterationStatement +>node : ts.Node +>statement : ts.Statement +>kind : ts.SyntaxKind +>ts.SyntaxKind.Block : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>Block : ts.SyntaxKind + + report(node, "A looping statement's contents should be wrapped in a block body."); +>report(node, "A looping statement's contents should be wrapped in a block body.") : void +>report : (node: ts.Node, message: string) => void +>node : ts.Node + } + break; + case ts.SyntaxKind.IfStatement: +>ts.SyntaxKind.IfStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>IfStatement : ts.SyntaxKind + + var ifStatement = (node); +>ifStatement : ts.IfStatement +>(node) : ts.IfStatement +>node : ts.IfStatement +>ts : unknown +>IfStatement : ts.IfStatement +>node : ts.Node + + if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { +>ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean +>ifStatement.thenStatement.kind : ts.SyntaxKind +>ifStatement.thenStatement : ts.Statement +>ifStatement : ts.IfStatement +>thenStatement : ts.Statement +>kind : ts.SyntaxKind +>ts.SyntaxKind.Block : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>Block : ts.SyntaxKind + + report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); +>report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.") : void +>report : (node: ts.Node, message: string) => void +>ifStatement.thenStatement : ts.Statement +>ifStatement : ts.IfStatement +>thenStatement : ts.Statement + } + if (ifStatement.elseStatement && +>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean +>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean +>ifStatement.elseStatement : ts.Statement +>ifStatement : ts.IfStatement +>elseStatement : ts.Statement + + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { +>ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean +>ifStatement.elseStatement.kind : ts.SyntaxKind +>ifStatement.elseStatement : ts.Statement +>ifStatement : ts.IfStatement +>elseStatement : ts.Statement +>kind : ts.SyntaxKind +>ts.SyntaxKind.Block : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>Block : ts.SyntaxKind +>ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean +>ifStatement.elseStatement.kind : ts.SyntaxKind +>ifStatement.elseStatement : ts.Statement +>ifStatement : ts.IfStatement +>elseStatement : ts.Statement +>kind : ts.SyntaxKind +>ts.SyntaxKind.IfStatement : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>IfStatement : ts.SyntaxKind + + report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); +>report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.") : void +>report : (node: ts.Node, message: string) => void +>ifStatement.elseStatement : ts.Statement +>ifStatement : ts.IfStatement +>elseStatement : ts.Statement + } + break; + + case ts.SyntaxKind.BinaryExpression: +>ts.SyntaxKind.BinaryExpression : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>BinaryExpression : ts.SyntaxKind + + var op = (node).operatorToken.kind; +>op : ts.SyntaxKind +>(node).operatorToken.kind : ts.SyntaxKind +>(node).operatorToken : ts.Node +>(node) : ts.BinaryExpression +>node : ts.BinaryExpression +>ts : unknown +>BinaryExpression : ts.BinaryExpression +>node : ts.Node +>operatorToken : ts.Node +>kind : ts.SyntaxKind + + if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { +>op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken : boolean +>op === ts.SyntaxKind.EqualsEqualsToken : boolean +>op : ts.SyntaxKind +>ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>EqualsEqualsToken : ts.SyntaxKind +>op === ts.SyntaxKind.ExclamationEqualsToken : boolean +>op : ts.SyntaxKind +>ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind +>ts.SyntaxKind : typeof ts.SyntaxKind +>ts : typeof ts +>SyntaxKind : typeof ts.SyntaxKind +>ExclamationEqualsToken : ts.SyntaxKind + + report(node, "Use '===' and '!=='.") +>report(node, "Use '===' and '!=='.") : void +>report : (node: ts.Node, message: string) => void +>node : ts.Node + } + break; + } + + ts.forEachChild(node, delintNode); +>ts.forEachChild(node, delintNode) : void +>ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T +>ts : typeof ts +>forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T +>node : ts.Node +>delintNode : (node: ts.Node) => void + } + + function report(node: ts.Node, message: string) { +>report : (node: ts.Node, message: string) => void +>node : ts.Node +>ts : unknown +>Node : ts.Node +>message : string + + var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); +>lineChar : ts.LineAndCharacter +>sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter +>sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter +>sourceFile : ts.SourceFile +>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter +>node.getStart() : number +>node.getStart : (sourceFile?: ts.SourceFile) => number +>node : ts.Node +>getStart : (sourceFile?: ts.SourceFile) => number + + console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) +>console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) : any +>console.log : any +>console : any +>log : any +>sourceFile.fileName : string +>sourceFile : ts.SourceFile +>fileName : string +>lineChar.line + 1 : number +>lineChar.line : number +>lineChar : ts.LineAndCharacter +>line : number +>lineChar.character + 1 : number +>lineChar.character : number +>lineChar : ts.LineAndCharacter +>character : number +>message : string + } +} + +var fileNames = process.argv.slice(2); +>fileNames : any +>process.argv.slice(2) : any +>process.argv.slice : any +>process.argv : any +>process : any +>argv : any +>slice : any + +fileNames.forEach(fileName => { +>fileNames.forEach(fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any +>fileNames.forEach : any +>fileNames : any +>forEach : any +>fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void +>fileName : any + + // Parse a file + var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); +>sourceFile : ts.SourceFile +>ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile +>ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile +>ts : typeof ts +>createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile +>fileName : any +>fs.readFileSync(fileName).toString() : any +>fs.readFileSync(fileName).toString : any +>fs.readFileSync(fileName) : any +>fs.readFileSync : any +>fs : any +>readFileSync : any +>fileName : any +>toString : any +>ts.ScriptTarget.ES6 : ts.ScriptTarget +>ts.ScriptTarget : typeof ts.ScriptTarget +>ts : typeof ts +>ScriptTarget : typeof ts.ScriptTarget +>ES6 : ts.ScriptTarget + + // delint it + delint(sourceFile); +>delint(sourceFile) : void +>delint : (sourceFile: ts.SourceFile) => void +>sourceFile : ts.SourceFile + +}); + +=== typescript.d.ts === +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. 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 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +declare module "typescript" { + interface Map { +>Map : Map +>T : T + + [index: string]: T; +>index : string +>T : T + } + interface TextRange { +>TextRange : TextRange + + pos: number; +>pos : number + + end: number; +>end : number + } + const enum SyntaxKind { +>SyntaxKind : SyntaxKind + + Unknown = 0, +>Unknown : SyntaxKind + + EndOfFileToken = 1, +>EndOfFileToken : SyntaxKind + + SingleLineCommentTrivia = 2, +>SingleLineCommentTrivia : SyntaxKind + + MultiLineCommentTrivia = 3, +>MultiLineCommentTrivia : SyntaxKind + + NewLineTrivia = 4, +>NewLineTrivia : SyntaxKind + + WhitespaceTrivia = 5, +>WhitespaceTrivia : SyntaxKind + + ConflictMarkerTrivia = 6, +>ConflictMarkerTrivia : SyntaxKind + + NumericLiteral = 7, +>NumericLiteral : SyntaxKind + + StringLiteral = 8, +>StringLiteral : SyntaxKind + + RegularExpressionLiteral = 9, +>RegularExpressionLiteral : SyntaxKind + + NoSubstitutionTemplateLiteral = 10, +>NoSubstitutionTemplateLiteral : SyntaxKind + + TemplateHead = 11, +>TemplateHead : SyntaxKind + + TemplateMiddle = 12, +>TemplateMiddle : SyntaxKind + + TemplateTail = 13, +>TemplateTail : SyntaxKind + + OpenBraceToken = 14, +>OpenBraceToken : SyntaxKind + + CloseBraceToken = 15, +>CloseBraceToken : SyntaxKind + + OpenParenToken = 16, +>OpenParenToken : SyntaxKind + + CloseParenToken = 17, +>CloseParenToken : SyntaxKind + + OpenBracketToken = 18, +>OpenBracketToken : SyntaxKind + + CloseBracketToken = 19, +>CloseBracketToken : SyntaxKind + + DotToken = 20, +>DotToken : SyntaxKind + + DotDotDotToken = 21, +>DotDotDotToken : SyntaxKind + + SemicolonToken = 22, +>SemicolonToken : SyntaxKind + + CommaToken = 23, +>CommaToken : SyntaxKind + + LessThanToken = 24, +>LessThanToken : SyntaxKind + + GreaterThanToken = 25, +>GreaterThanToken : SyntaxKind + + LessThanEqualsToken = 26, +>LessThanEqualsToken : SyntaxKind + + GreaterThanEqualsToken = 27, +>GreaterThanEqualsToken : SyntaxKind + + EqualsEqualsToken = 28, +>EqualsEqualsToken : SyntaxKind + + ExclamationEqualsToken = 29, +>ExclamationEqualsToken : SyntaxKind + + EqualsEqualsEqualsToken = 30, +>EqualsEqualsEqualsToken : SyntaxKind + + ExclamationEqualsEqualsToken = 31, +>ExclamationEqualsEqualsToken : SyntaxKind + + EqualsGreaterThanToken = 32, +>EqualsGreaterThanToken : SyntaxKind + + PlusToken = 33, +>PlusToken : SyntaxKind + + MinusToken = 34, +>MinusToken : SyntaxKind + + AsteriskToken = 35, +>AsteriskToken : SyntaxKind + + SlashToken = 36, +>SlashToken : SyntaxKind + + PercentToken = 37, +>PercentToken : SyntaxKind + + PlusPlusToken = 38, +>PlusPlusToken : SyntaxKind + + MinusMinusToken = 39, +>MinusMinusToken : SyntaxKind + + LessThanLessThanToken = 40, +>LessThanLessThanToken : SyntaxKind + + GreaterThanGreaterThanToken = 41, +>GreaterThanGreaterThanToken : SyntaxKind + + GreaterThanGreaterThanGreaterThanToken = 42, +>GreaterThanGreaterThanGreaterThanToken : SyntaxKind + + AmpersandToken = 43, +>AmpersandToken : SyntaxKind + + BarToken = 44, +>BarToken : SyntaxKind + + CaretToken = 45, +>CaretToken : SyntaxKind + + ExclamationToken = 46, +>ExclamationToken : SyntaxKind + + TildeToken = 47, +>TildeToken : SyntaxKind + + AmpersandAmpersandToken = 48, +>AmpersandAmpersandToken : SyntaxKind + + BarBarToken = 49, +>BarBarToken : SyntaxKind + + QuestionToken = 50, +>QuestionToken : SyntaxKind + + ColonToken = 51, +>ColonToken : SyntaxKind + + AtToken = 52, +>AtToken : SyntaxKind + + EqualsToken = 53, +>EqualsToken : SyntaxKind + + PlusEqualsToken = 54, +>PlusEqualsToken : SyntaxKind + + MinusEqualsToken = 55, +>MinusEqualsToken : SyntaxKind + + AsteriskEqualsToken = 56, +>AsteriskEqualsToken : SyntaxKind + + SlashEqualsToken = 57, +>SlashEqualsToken : SyntaxKind + + PercentEqualsToken = 58, +>PercentEqualsToken : SyntaxKind + + LessThanLessThanEqualsToken = 59, +>LessThanLessThanEqualsToken : SyntaxKind + + GreaterThanGreaterThanEqualsToken = 60, +>GreaterThanGreaterThanEqualsToken : SyntaxKind + + GreaterThanGreaterThanGreaterThanEqualsToken = 61, +>GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind + + AmpersandEqualsToken = 62, +>AmpersandEqualsToken : SyntaxKind + + BarEqualsToken = 63, +>BarEqualsToken : SyntaxKind + + CaretEqualsToken = 64, +>CaretEqualsToken : SyntaxKind + + Identifier = 65, +>Identifier : SyntaxKind + + BreakKeyword = 66, +>BreakKeyword : SyntaxKind + + CaseKeyword = 67, +>CaseKeyword : SyntaxKind + + CatchKeyword = 68, +>CatchKeyword : SyntaxKind + + ClassKeyword = 69, +>ClassKeyword : SyntaxKind + + ConstKeyword = 70, +>ConstKeyword : SyntaxKind + + ContinueKeyword = 71, +>ContinueKeyword : SyntaxKind + + DebuggerKeyword = 72, +>DebuggerKeyword : SyntaxKind + + DefaultKeyword = 73, +>DefaultKeyword : SyntaxKind + + DeleteKeyword = 74, +>DeleteKeyword : SyntaxKind + + DoKeyword = 75, +>DoKeyword : SyntaxKind + + ElseKeyword = 76, +>ElseKeyword : SyntaxKind + + EnumKeyword = 77, +>EnumKeyword : SyntaxKind + + ExportKeyword = 78, +>ExportKeyword : SyntaxKind + + ExtendsKeyword = 79, +>ExtendsKeyword : SyntaxKind + + FalseKeyword = 80, +>FalseKeyword : SyntaxKind + + FinallyKeyword = 81, +>FinallyKeyword : SyntaxKind + + ForKeyword = 82, +>ForKeyword : SyntaxKind + + FunctionKeyword = 83, +>FunctionKeyword : SyntaxKind + + IfKeyword = 84, +>IfKeyword : SyntaxKind + + ImportKeyword = 85, +>ImportKeyword : SyntaxKind + + InKeyword = 86, +>InKeyword : SyntaxKind + + InstanceOfKeyword = 87, +>InstanceOfKeyword : SyntaxKind + + NewKeyword = 88, +>NewKeyword : SyntaxKind + + NullKeyword = 89, +>NullKeyword : SyntaxKind + + ReturnKeyword = 90, +>ReturnKeyword : SyntaxKind + + SuperKeyword = 91, +>SuperKeyword : SyntaxKind + + SwitchKeyword = 92, +>SwitchKeyword : SyntaxKind + + ThisKeyword = 93, +>ThisKeyword : SyntaxKind + + ThrowKeyword = 94, +>ThrowKeyword : SyntaxKind + + TrueKeyword = 95, +>TrueKeyword : SyntaxKind + + TryKeyword = 96, +>TryKeyword : SyntaxKind + + TypeOfKeyword = 97, +>TypeOfKeyword : SyntaxKind + + VarKeyword = 98, +>VarKeyword : SyntaxKind + + VoidKeyword = 99, +>VoidKeyword : SyntaxKind + + WhileKeyword = 100, +>WhileKeyword : SyntaxKind + + WithKeyword = 101, +>WithKeyword : SyntaxKind + + AsKeyword = 102, +>AsKeyword : SyntaxKind + + ImplementsKeyword = 103, +>ImplementsKeyword : SyntaxKind + + InterfaceKeyword = 104, +>InterfaceKeyword : SyntaxKind + + LetKeyword = 105, +>LetKeyword : SyntaxKind + + PackageKeyword = 106, +>PackageKeyword : SyntaxKind + + PrivateKeyword = 107, +>PrivateKeyword : SyntaxKind + + ProtectedKeyword = 108, +>ProtectedKeyword : SyntaxKind + + PublicKeyword = 109, +>PublicKeyword : SyntaxKind + + StaticKeyword = 110, +>StaticKeyword : SyntaxKind + + YieldKeyword = 111, +>YieldKeyword : SyntaxKind + + AnyKeyword = 112, +>AnyKeyword : SyntaxKind + + BooleanKeyword = 113, +>BooleanKeyword : SyntaxKind + + ConstructorKeyword = 114, +>ConstructorKeyword : SyntaxKind + + DeclareKeyword = 115, +>DeclareKeyword : SyntaxKind + + GetKeyword = 116, +>GetKeyword : SyntaxKind + + ModuleKeyword = 117, +>ModuleKeyword : SyntaxKind + + RequireKeyword = 118, +>RequireKeyword : SyntaxKind + + NumberKeyword = 119, +>NumberKeyword : SyntaxKind + + SetKeyword = 120, +>SetKeyword : SyntaxKind + + StringKeyword = 121, +>StringKeyword : SyntaxKind + + SymbolKeyword = 122, +>SymbolKeyword : SyntaxKind + + TypeKeyword = 123, +>TypeKeyword : SyntaxKind + + FromKeyword = 124, +>FromKeyword : SyntaxKind + + OfKeyword = 125, +>OfKeyword : SyntaxKind + + QualifiedName = 126, +>QualifiedName : SyntaxKind + + ComputedPropertyName = 127, +>ComputedPropertyName : SyntaxKind + + TypeParameter = 128, +>TypeParameter : SyntaxKind + + Parameter = 129, +>Parameter : SyntaxKind + + Decorator = 130, +>Decorator : SyntaxKind + + PropertySignature = 131, +>PropertySignature : SyntaxKind + + PropertyDeclaration = 132, +>PropertyDeclaration : SyntaxKind + + MethodSignature = 133, +>MethodSignature : SyntaxKind + + MethodDeclaration = 134, +>MethodDeclaration : SyntaxKind + + Constructor = 135, +>Constructor : SyntaxKind + + GetAccessor = 136, +>GetAccessor : SyntaxKind + + SetAccessor = 137, +>SetAccessor : SyntaxKind + + CallSignature = 138, +>CallSignature : SyntaxKind + + ConstructSignature = 139, +>ConstructSignature : SyntaxKind + + IndexSignature = 140, +>IndexSignature : SyntaxKind + + TypeReference = 141, +>TypeReference : SyntaxKind + + FunctionType = 142, +>FunctionType : SyntaxKind + + ConstructorType = 143, +>ConstructorType : SyntaxKind + + TypeQuery = 144, +>TypeQuery : SyntaxKind + + TypeLiteral = 145, +>TypeLiteral : SyntaxKind + + ArrayType = 146, +>ArrayType : SyntaxKind + + TupleType = 147, +>TupleType : SyntaxKind + + UnionType = 148, +>UnionType : SyntaxKind + + ParenthesizedType = 149, +>ParenthesizedType : SyntaxKind + + ObjectBindingPattern = 150, +>ObjectBindingPattern : SyntaxKind + + ArrayBindingPattern = 151, +>ArrayBindingPattern : SyntaxKind + + BindingElement = 152, +>BindingElement : SyntaxKind + + ArrayLiteralExpression = 153, +>ArrayLiteralExpression : SyntaxKind + + ObjectLiteralExpression = 154, +>ObjectLiteralExpression : SyntaxKind + + PropertyAccessExpression = 155, +>PropertyAccessExpression : SyntaxKind + + ElementAccessExpression = 156, +>ElementAccessExpression : SyntaxKind + + CallExpression = 157, +>CallExpression : SyntaxKind + + NewExpression = 158, +>NewExpression : SyntaxKind + + TaggedTemplateExpression = 159, +>TaggedTemplateExpression : SyntaxKind + + TypeAssertionExpression = 160, +>TypeAssertionExpression : SyntaxKind + + ParenthesizedExpression = 161, +>ParenthesizedExpression : SyntaxKind + + FunctionExpression = 162, +>FunctionExpression : SyntaxKind + + ArrowFunction = 163, +>ArrowFunction : SyntaxKind + + DeleteExpression = 164, +>DeleteExpression : SyntaxKind + + TypeOfExpression = 165, +>TypeOfExpression : SyntaxKind + + VoidExpression = 166, +>VoidExpression : SyntaxKind + + PrefixUnaryExpression = 167, +>PrefixUnaryExpression : SyntaxKind + + PostfixUnaryExpression = 168, +>PostfixUnaryExpression : SyntaxKind + + BinaryExpression = 169, +>BinaryExpression : SyntaxKind + + ConditionalExpression = 170, +>ConditionalExpression : SyntaxKind + + TemplateExpression = 171, +>TemplateExpression : SyntaxKind + + YieldExpression = 172, +>YieldExpression : SyntaxKind + + SpreadElementExpression = 173, +>SpreadElementExpression : SyntaxKind + + ClassExpression = 174, +>ClassExpression : SyntaxKind + + OmittedExpression = 175, +>OmittedExpression : SyntaxKind + + TemplateSpan = 176, +>TemplateSpan : SyntaxKind + + HeritageClauseElement = 177, +>HeritageClauseElement : SyntaxKind + + SemicolonClassElement = 178, +>SemicolonClassElement : SyntaxKind + + Block = 179, +>Block : SyntaxKind + + VariableStatement = 180, +>VariableStatement : SyntaxKind + + EmptyStatement = 181, +>EmptyStatement : SyntaxKind + + ExpressionStatement = 182, +>ExpressionStatement : SyntaxKind + + IfStatement = 183, +>IfStatement : SyntaxKind + + DoStatement = 184, +>DoStatement : SyntaxKind + + WhileStatement = 185, +>WhileStatement : SyntaxKind + + ForStatement = 186, +>ForStatement : SyntaxKind + + ForInStatement = 187, +>ForInStatement : SyntaxKind + + ForOfStatement = 188, +>ForOfStatement : SyntaxKind + + ContinueStatement = 189, +>ContinueStatement : SyntaxKind + + BreakStatement = 190, +>BreakStatement : SyntaxKind + + ReturnStatement = 191, +>ReturnStatement : SyntaxKind + + WithStatement = 192, +>WithStatement : SyntaxKind + + SwitchStatement = 193, +>SwitchStatement : SyntaxKind + + LabeledStatement = 194, +>LabeledStatement : SyntaxKind + + ThrowStatement = 195, +>ThrowStatement : SyntaxKind + + TryStatement = 196, +>TryStatement : SyntaxKind + + DebuggerStatement = 197, +>DebuggerStatement : SyntaxKind + + VariableDeclaration = 198, +>VariableDeclaration : SyntaxKind + + VariableDeclarationList = 199, +>VariableDeclarationList : SyntaxKind + + FunctionDeclaration = 200, +>FunctionDeclaration : SyntaxKind + + ClassDeclaration = 201, +>ClassDeclaration : SyntaxKind + + InterfaceDeclaration = 202, +>InterfaceDeclaration : SyntaxKind + + TypeAliasDeclaration = 203, +>TypeAliasDeclaration : SyntaxKind + + EnumDeclaration = 204, +>EnumDeclaration : SyntaxKind + + ModuleDeclaration = 205, +>ModuleDeclaration : SyntaxKind + + ModuleBlock = 206, +>ModuleBlock : SyntaxKind + + CaseBlock = 207, +>CaseBlock : SyntaxKind + + ImportEqualsDeclaration = 208, +>ImportEqualsDeclaration : SyntaxKind + + ImportDeclaration = 209, +>ImportDeclaration : SyntaxKind + + ImportClause = 210, +>ImportClause : SyntaxKind + + NamespaceImport = 211, +>NamespaceImport : SyntaxKind + + NamedImports = 212, +>NamedImports : SyntaxKind + + ImportSpecifier = 213, +>ImportSpecifier : SyntaxKind + + ExportAssignment = 214, +>ExportAssignment : SyntaxKind + + ExportDeclaration = 215, +>ExportDeclaration : SyntaxKind + + NamedExports = 216, +>NamedExports : SyntaxKind + + ExportSpecifier = 217, +>ExportSpecifier : SyntaxKind + + MissingDeclaration = 218, +>MissingDeclaration : SyntaxKind + + ExternalModuleReference = 219, +>ExternalModuleReference : SyntaxKind + + CaseClause = 220, +>CaseClause : SyntaxKind + + DefaultClause = 221, +>DefaultClause : SyntaxKind + + HeritageClause = 222, +>HeritageClause : SyntaxKind + + CatchClause = 223, +>CatchClause : SyntaxKind + + PropertyAssignment = 224, +>PropertyAssignment : SyntaxKind + + ShorthandPropertyAssignment = 225, +>ShorthandPropertyAssignment : SyntaxKind + + EnumMember = 226, +>EnumMember : SyntaxKind + + SourceFile = 227, +>SourceFile : SyntaxKind + + SyntaxList = 228, +>SyntaxList : SyntaxKind + + Count = 229, +>Count : SyntaxKind + + FirstAssignment = 53, +>FirstAssignment : SyntaxKind + + LastAssignment = 64, +>LastAssignment : SyntaxKind + + FirstReservedWord = 66, +>FirstReservedWord : SyntaxKind + + LastReservedWord = 101, +>LastReservedWord : SyntaxKind + + FirstKeyword = 66, +>FirstKeyword : SyntaxKind + + LastKeyword = 125, +>LastKeyword : SyntaxKind + + FirstFutureReservedWord = 103, +>FirstFutureReservedWord : SyntaxKind + + LastFutureReservedWord = 111, +>LastFutureReservedWord : SyntaxKind + + FirstTypeNode = 141, +>FirstTypeNode : SyntaxKind + + LastTypeNode = 149, +>LastTypeNode : SyntaxKind + + FirstPunctuation = 14, +>FirstPunctuation : SyntaxKind + + LastPunctuation = 64, +>LastPunctuation : SyntaxKind + + FirstToken = 0, +>FirstToken : SyntaxKind + + LastToken = 125, +>LastToken : SyntaxKind + + FirstTriviaToken = 2, +>FirstTriviaToken : SyntaxKind + + LastTriviaToken = 6, +>LastTriviaToken : SyntaxKind + + FirstLiteralToken = 7, +>FirstLiteralToken : SyntaxKind + + LastLiteralToken = 10, +>LastLiteralToken : SyntaxKind + + FirstTemplateToken = 10, +>FirstTemplateToken : SyntaxKind + + LastTemplateToken = 13, +>LastTemplateToken : SyntaxKind + + FirstBinaryOperator = 24, +>FirstBinaryOperator : SyntaxKind + + LastBinaryOperator = 64, +>LastBinaryOperator : SyntaxKind + + FirstNode = 126, +>FirstNode : SyntaxKind + } + const enum NodeFlags { +>NodeFlags : NodeFlags + + Export = 1, +>Export : NodeFlags + + Ambient = 2, +>Ambient : NodeFlags + + Public = 16, +>Public : NodeFlags + + Private = 32, +>Private : NodeFlags + + Protected = 64, +>Protected : NodeFlags + + Static = 128, +>Static : NodeFlags + + Default = 256, +>Default : NodeFlags + + MultiLine = 512, +>MultiLine : NodeFlags + + Synthetic = 1024, +>Synthetic : NodeFlags + + DeclarationFile = 2048, +>DeclarationFile : NodeFlags + + Let = 4096, +>Let : NodeFlags + + Const = 8192, +>Const : NodeFlags + + OctalLiteral = 16384, +>OctalLiteral : NodeFlags + + ExportContext = 32768, +>ExportContext : NodeFlags + + Modifier = 499, +>Modifier : NodeFlags + + AccessibilityModifier = 112, +>AccessibilityModifier : NodeFlags + + BlockScoped = 12288, +>BlockScoped : NodeFlags + } + const enum ParserContextFlags { +>ParserContextFlags : ParserContextFlags + + StrictMode = 1, +>StrictMode : ParserContextFlags + + DisallowIn = 2, +>DisallowIn : ParserContextFlags + + Yield = 4, +>Yield : ParserContextFlags + + GeneratorParameter = 8, +>GeneratorParameter : ParserContextFlags + + Decorator = 16, +>Decorator : ParserContextFlags + + ThisNodeHasError = 32, +>ThisNodeHasError : ParserContextFlags + + ParserGeneratedFlags = 63, +>ParserGeneratedFlags : ParserContextFlags + + ThisNodeOrAnySubNodesHasError = 64, +>ThisNodeOrAnySubNodesHasError : ParserContextFlags + + HasAggregatedChildData = 128, +>HasAggregatedChildData : ParserContextFlags + } + const enum RelationComparisonResult { +>RelationComparisonResult : RelationComparisonResult + + Succeeded = 1, +>Succeeded : RelationComparisonResult + + Failed = 2, +>Failed : RelationComparisonResult + + FailedAndReported = 3, +>FailedAndReported : RelationComparisonResult + } + interface Node extends TextRange { +>Node : Node +>TextRange : TextRange + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind + + flags: NodeFlags; +>flags : NodeFlags +>NodeFlags : NodeFlags + + parserContextFlags?: ParserContextFlags; +>parserContextFlags : ParserContextFlags +>ParserContextFlags : ParserContextFlags + + decorators?: NodeArray; +>decorators : NodeArray +>NodeArray : NodeArray +>Decorator : Decorator + + modifiers?: ModifiersArray; +>modifiers : ModifiersArray +>ModifiersArray : ModifiersArray + + id?: number; +>id : number + + parent?: Node; +>parent : Node +>Node : Node + + symbol?: Symbol; +>symbol : Symbol +>Symbol : Symbol + + locals?: SymbolTable; +>locals : SymbolTable +>SymbolTable : SymbolTable + + nextContainer?: Node; +>nextContainer : Node +>Node : Node + + localSymbol?: Symbol; +>localSymbol : Symbol +>Symbol : Symbol + } + interface NodeArray extends Array, TextRange { +>NodeArray : NodeArray +>T : T +>Array : T[] +>T : T +>TextRange : TextRange + + hasTrailingComma?: boolean; +>hasTrailingComma : boolean + } + interface ModifiersArray extends NodeArray { +>ModifiersArray : ModifiersArray +>NodeArray : NodeArray +>Node : Node + + flags: number; +>flags : number + } + interface Identifier extends PrimaryExpression { +>Identifier : Identifier +>PrimaryExpression : PrimaryExpression + + text: string; +>text : string + } + interface QualifiedName extends Node { +>QualifiedName : QualifiedName +>Node : Node + + left: EntityName; +>left : Identifier | QualifiedName +>EntityName : Identifier | QualifiedName + + right: Identifier; +>right : Identifier +>Identifier : Identifier + } + type EntityName = Identifier | QualifiedName; +>EntityName : Identifier | QualifiedName +>Identifier : Identifier +>QualifiedName : QualifiedName + + type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>Identifier : Identifier +>LiteralExpression : LiteralExpression +>ComputedPropertyName : ComputedPropertyName +>BindingPattern : BindingPattern + + interface Declaration extends Node { +>Declaration : Declaration +>Node : Node + + _declarationBrand: any; +>_declarationBrand : any + + name?: DeclarationName; +>name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern + } + interface ComputedPropertyName extends Node { +>ComputedPropertyName : ComputedPropertyName +>Node : Node + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface Decorator extends Node { +>Decorator : Decorator +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + } + interface TypeParameterDeclaration extends Declaration { +>TypeParameterDeclaration : TypeParameterDeclaration +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + constraint?: TypeNode; +>constraint : TypeNode +>TypeNode : TypeNode + + expression?: Expression; +>expression : Expression +>Expression : Expression + } + interface SignatureDeclaration extends Declaration { +>SignatureDeclaration : SignatureDeclaration +>Declaration : Declaration + + typeParameters?: NodeArray; +>typeParameters : NodeArray +>NodeArray : NodeArray +>TypeParameterDeclaration : TypeParameterDeclaration + + parameters: NodeArray; +>parameters : NodeArray +>NodeArray : NodeArray +>ParameterDeclaration : ParameterDeclaration + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + } + interface VariableDeclaration extends Declaration { +>VariableDeclaration : VariableDeclaration +>Declaration : Declaration + + parent?: VariableDeclarationList; +>parent : VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList + + name: Identifier | BindingPattern; +>name : Identifier | BindingPattern +>Identifier : Identifier +>BindingPattern : BindingPattern + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface VariableDeclarationList extends Node { +>VariableDeclarationList : VariableDeclarationList +>Node : Node + + declarations: NodeArray; +>declarations : NodeArray +>NodeArray : NodeArray +>VariableDeclaration : VariableDeclaration + } + interface ParameterDeclaration extends Declaration { +>ParameterDeclaration : ParameterDeclaration +>Declaration : Declaration + + dotDotDotToken?: Node; +>dotDotDotToken : Node +>Node : Node + + name: Identifier | BindingPattern; +>name : Identifier | BindingPattern +>Identifier : Identifier +>BindingPattern : BindingPattern + + questionToken?: Node; +>questionToken : Node +>Node : Node + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface BindingElement extends Declaration { +>BindingElement : BindingElement +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + dotDotDotToken?: Node; +>dotDotDotToken : Node +>Node : Node + + name: Identifier | BindingPattern; +>name : Identifier | BindingPattern +>Identifier : Identifier +>BindingPattern : BindingPattern + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface PropertyDeclaration extends Declaration, ClassElement { +>PropertyDeclaration : PropertyDeclaration +>Declaration : Declaration +>ClassElement : ClassElement + + name: DeclarationName; +>name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern + + questionToken?: Node; +>questionToken : Node +>Node : Node + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface ObjectLiteralElement extends Declaration { +>ObjectLiteralElement : ObjectLiteralElement +>Declaration : Declaration + + _objectLiteralBrandBrand: any; +>_objectLiteralBrandBrand : any + } + interface PropertyAssignment extends ObjectLiteralElement { +>PropertyAssignment : PropertyAssignment +>ObjectLiteralElement : ObjectLiteralElement + + _propertyAssignmentBrand: any; +>_propertyAssignmentBrand : any + + name: DeclarationName; +>name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern + + questionToken?: Node; +>questionToken : Node +>Node : Node + + initializer: Expression; +>initializer : Expression +>Expression : Expression + } + interface ShorthandPropertyAssignment extends ObjectLiteralElement { +>ShorthandPropertyAssignment : ShorthandPropertyAssignment +>ObjectLiteralElement : ObjectLiteralElement + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + questionToken?: Node; +>questionToken : Node +>Node : Node + } + interface VariableLikeDeclaration extends Declaration { +>VariableLikeDeclaration : VariableLikeDeclaration +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + dotDotDotToken?: Node; +>dotDotDotToken : Node +>Node : Node + + name: DeclarationName; +>name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern + + questionToken?: Node; +>questionToken : Node +>Node : Node + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface BindingPattern extends Node { +>BindingPattern : BindingPattern +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>BindingElement : BindingElement + } + /** + * Several node kinds share function-like features such as a signature, + * a name, and a body. These nodes should extend FunctionLikeDeclaration. + * Examples: + * FunctionDeclaration + * MethodDeclaration + * AccessorDeclaration + */ + interface FunctionLikeDeclaration extends SignatureDeclaration { +>FunctionLikeDeclaration : FunctionLikeDeclaration +>SignatureDeclaration : SignatureDeclaration + + _functionLikeDeclarationBrand: any; +>_functionLikeDeclarationBrand : any + + asteriskToken?: Node; +>asteriskToken : Node +>Node : Node + + questionToken?: Node; +>questionToken : Node +>Node : Node + + body?: Block | Expression; +>body : Expression | Block +>Block : Block +>Expression : Expression + } + interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { +>FunctionDeclaration : FunctionDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration +>Statement : Statement + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + body?: Block; +>body : Block +>Block : Block + } + interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { +>MethodDeclaration : MethodDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration +>ClassElement : ClassElement +>ObjectLiteralElement : ObjectLiteralElement + + body?: Block; +>body : Block +>Block : Block + } + interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { +>ConstructorDeclaration : ConstructorDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration +>ClassElement : ClassElement + + body?: Block; +>body : Block +>Block : Block + } + interface SemicolonClassElement extends ClassElement { +>SemicolonClassElement : SemicolonClassElement +>ClassElement : ClassElement + + _semicolonClassElementBrand: any; +>_semicolonClassElementBrand : any + } + interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { +>AccessorDeclaration : AccessorDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration +>ClassElement : ClassElement +>ObjectLiteralElement : ObjectLiteralElement + + _accessorDeclarationBrand: any; +>_accessorDeclarationBrand : any + + body: Block; +>body : Block +>Block : Block + } + interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { +>IndexSignatureDeclaration : IndexSignatureDeclaration +>SignatureDeclaration : SignatureDeclaration +>ClassElement : ClassElement + + _indexSignatureDeclarationBrand: any; +>_indexSignatureDeclarationBrand : any + } + interface TypeNode extends Node { +>TypeNode : TypeNode +>Node : Node + + _typeNodeBrand: any; +>_typeNodeBrand : any + } + interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { +>FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode +>TypeNode : TypeNode +>SignatureDeclaration : SignatureDeclaration + + _functionOrConstructorTypeNodeBrand: any; +>_functionOrConstructorTypeNodeBrand : any + } + interface TypeReferenceNode extends TypeNode { +>TypeReferenceNode : TypeReferenceNode +>TypeNode : TypeNode + + typeName: EntityName; +>typeName : Identifier | QualifiedName +>EntityName : Identifier | QualifiedName + + typeArguments?: NodeArray; +>typeArguments : NodeArray +>NodeArray : NodeArray +>TypeNode : TypeNode + } + interface TypeQueryNode extends TypeNode { +>TypeQueryNode : TypeQueryNode +>TypeNode : TypeNode + + exprName: EntityName; +>exprName : Identifier | QualifiedName +>EntityName : Identifier | QualifiedName + } + interface TypeLiteralNode extends TypeNode, Declaration { +>TypeLiteralNode : TypeLiteralNode +>TypeNode : TypeNode +>Declaration : Declaration + + members: NodeArray; +>members : NodeArray +>NodeArray : NodeArray +>Node : Node + } + interface ArrayTypeNode extends TypeNode { +>ArrayTypeNode : ArrayTypeNode +>TypeNode : TypeNode + + elementType: TypeNode; +>elementType : TypeNode +>TypeNode : TypeNode + } + interface TupleTypeNode extends TypeNode { +>TupleTypeNode : TupleTypeNode +>TypeNode : TypeNode + + elementTypes: NodeArray; +>elementTypes : NodeArray +>NodeArray : NodeArray +>TypeNode : TypeNode + } + interface UnionTypeNode extends TypeNode { +>UnionTypeNode : UnionTypeNode +>TypeNode : TypeNode + + types: NodeArray; +>types : NodeArray +>NodeArray : NodeArray +>TypeNode : TypeNode + } + interface ParenthesizedTypeNode extends TypeNode { +>ParenthesizedTypeNode : ParenthesizedTypeNode +>TypeNode : TypeNode + + type: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + } + interface StringLiteralTypeNode extends LiteralExpression, TypeNode { +>StringLiteralTypeNode : StringLiteralTypeNode +>LiteralExpression : LiteralExpression +>TypeNode : TypeNode + } + interface Expression extends Node { +>Expression : Expression +>Node : Node + + _expressionBrand: any; +>_expressionBrand : any + + contextualType?: Type; +>contextualType : Type +>Type : Type + } + interface UnaryExpression extends Expression { +>UnaryExpression : UnaryExpression +>Expression : Expression + + _unaryExpressionBrand: any; +>_unaryExpressionBrand : any + } + interface PrefixUnaryExpression extends UnaryExpression { +>PrefixUnaryExpression : PrefixUnaryExpression +>UnaryExpression : UnaryExpression + + operator: SyntaxKind; +>operator : SyntaxKind +>SyntaxKind : SyntaxKind + + operand: UnaryExpression; +>operand : UnaryExpression +>UnaryExpression : UnaryExpression + } + interface PostfixUnaryExpression extends PostfixExpression { +>PostfixUnaryExpression : PostfixUnaryExpression +>PostfixExpression : PostfixExpression + + operand: LeftHandSideExpression; +>operand : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + operator: SyntaxKind; +>operator : SyntaxKind +>SyntaxKind : SyntaxKind + } + interface PostfixExpression extends UnaryExpression { +>PostfixExpression : PostfixExpression +>UnaryExpression : UnaryExpression + + _postfixExpressionBrand: any; +>_postfixExpressionBrand : any + } + interface LeftHandSideExpression extends PostfixExpression { +>LeftHandSideExpression : LeftHandSideExpression +>PostfixExpression : PostfixExpression + + _leftHandSideExpressionBrand: any; +>_leftHandSideExpressionBrand : any + } + interface MemberExpression extends LeftHandSideExpression { +>MemberExpression : MemberExpression +>LeftHandSideExpression : LeftHandSideExpression + + _memberExpressionBrand: any; +>_memberExpressionBrand : any + } + interface PrimaryExpression extends MemberExpression { +>PrimaryExpression : PrimaryExpression +>MemberExpression : MemberExpression + + _primaryExpressionBrand: any; +>_primaryExpressionBrand : any + } + interface DeleteExpression extends UnaryExpression { +>DeleteExpression : DeleteExpression +>UnaryExpression : UnaryExpression + + expression: UnaryExpression; +>expression : UnaryExpression +>UnaryExpression : UnaryExpression + } + interface TypeOfExpression extends UnaryExpression { +>TypeOfExpression : TypeOfExpression +>UnaryExpression : UnaryExpression + + expression: UnaryExpression; +>expression : UnaryExpression +>UnaryExpression : UnaryExpression + } + interface VoidExpression extends UnaryExpression { +>VoidExpression : VoidExpression +>UnaryExpression : UnaryExpression + + expression: UnaryExpression; +>expression : UnaryExpression +>UnaryExpression : UnaryExpression + } + interface YieldExpression extends Expression { +>YieldExpression : YieldExpression +>Expression : Expression + + asteriskToken?: Node; +>asteriskToken : Node +>Node : Node + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface BinaryExpression extends Expression { +>BinaryExpression : BinaryExpression +>Expression : Expression + + left: Expression; +>left : Expression +>Expression : Expression + + operatorToken: Node; +>operatorToken : Node +>Node : Node + + right: Expression; +>right : Expression +>Expression : Expression + } + interface ConditionalExpression extends Expression { +>ConditionalExpression : ConditionalExpression +>Expression : Expression + + condition: Expression; +>condition : Expression +>Expression : Expression + + questionToken: Node; +>questionToken : Node +>Node : Node + + whenTrue: Expression; +>whenTrue : Expression +>Expression : Expression + + colonToken: Node; +>colonToken : Node +>Node : Node + + whenFalse: Expression; +>whenFalse : Expression +>Expression : Expression + } + interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { +>FunctionExpression : FunctionExpression +>PrimaryExpression : PrimaryExpression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + body: Block | Expression; +>body : Expression | Block +>Block : Block +>Expression : Expression + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { +>ArrowFunction : ArrowFunction +>Expression : Expression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + equalsGreaterThanToken: Node; +>equalsGreaterThanToken : Node +>Node : Node + } + interface LiteralExpression extends PrimaryExpression { +>LiteralExpression : LiteralExpression +>PrimaryExpression : PrimaryExpression + + text: string; +>text : string + + isUnterminated?: boolean; +>isUnterminated : boolean + + hasExtendedUnicodeEscape?: boolean; +>hasExtendedUnicodeEscape : boolean + } + interface StringLiteralExpression extends LiteralExpression { +>StringLiteralExpression : StringLiteralExpression +>LiteralExpression : LiteralExpression + + _stringLiteralExpressionBrand: any; +>_stringLiteralExpressionBrand : any + } + interface TemplateExpression extends PrimaryExpression { +>TemplateExpression : TemplateExpression +>PrimaryExpression : PrimaryExpression + + head: LiteralExpression; +>head : LiteralExpression +>LiteralExpression : LiteralExpression + + templateSpans: NodeArray; +>templateSpans : NodeArray +>NodeArray : NodeArray +>TemplateSpan : TemplateSpan + } + interface TemplateSpan extends Node { +>TemplateSpan : TemplateSpan +>Node : Node + + expression: Expression; +>expression : Expression +>Expression : Expression + + literal: LiteralExpression; +>literal : LiteralExpression +>LiteralExpression : LiteralExpression + } + interface ParenthesizedExpression extends PrimaryExpression { +>ParenthesizedExpression : ParenthesizedExpression +>PrimaryExpression : PrimaryExpression + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface ArrayLiteralExpression extends PrimaryExpression { +>ArrayLiteralExpression : ArrayLiteralExpression +>PrimaryExpression : PrimaryExpression + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>Expression : Expression + } + interface SpreadElementExpression extends Expression { +>SpreadElementExpression : SpreadElementExpression +>Expression : Expression + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface ObjectLiteralExpression extends PrimaryExpression, Declaration { +>ObjectLiteralExpression : ObjectLiteralExpression +>PrimaryExpression : PrimaryExpression +>Declaration : Declaration + + properties: NodeArray; +>properties : NodeArray +>NodeArray : NodeArray +>ObjectLiteralElement : ObjectLiteralElement + } + interface PropertyAccessExpression extends MemberExpression { +>PropertyAccessExpression : PropertyAccessExpression +>MemberExpression : MemberExpression + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + dotToken: Node; +>dotToken : Node +>Node : Node + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface ElementAccessExpression extends MemberExpression { +>ElementAccessExpression : ElementAccessExpression +>MemberExpression : MemberExpression + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + argumentExpression?: Expression; +>argumentExpression : Expression +>Expression : Expression + } + interface CallExpression extends LeftHandSideExpression { +>CallExpression : CallExpression +>LeftHandSideExpression : LeftHandSideExpression + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + typeArguments?: NodeArray; +>typeArguments : NodeArray +>NodeArray : NodeArray +>TypeNode : TypeNode + + arguments: NodeArray; +>arguments : NodeArray +>NodeArray : NodeArray +>Expression : Expression + } + interface HeritageClauseElement extends Node { +>HeritageClauseElement : HeritageClauseElement +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + typeArguments?: NodeArray; +>typeArguments : NodeArray +>NodeArray : NodeArray +>TypeNode : TypeNode + } + interface NewExpression extends CallExpression, PrimaryExpression { +>NewExpression : NewExpression +>CallExpression : CallExpression +>PrimaryExpression : PrimaryExpression + } + interface TaggedTemplateExpression extends MemberExpression { +>TaggedTemplateExpression : TaggedTemplateExpression +>MemberExpression : MemberExpression + + tag: LeftHandSideExpression; +>tag : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression + + template: LiteralExpression | TemplateExpression; +>template : LiteralExpression | TemplateExpression +>LiteralExpression : LiteralExpression +>TemplateExpression : TemplateExpression + } + type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; +>CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression +>CallExpression : CallExpression +>NewExpression : NewExpression +>TaggedTemplateExpression : TaggedTemplateExpression + + interface TypeAssertion extends UnaryExpression { +>TypeAssertion : TypeAssertion +>UnaryExpression : UnaryExpression + + type: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + + expression: UnaryExpression; +>expression : UnaryExpression +>UnaryExpression : UnaryExpression + } + interface Statement extends Node, ModuleElement { +>Statement : Statement +>Node : Node +>ModuleElement : ModuleElement + + _statementBrand: any; +>_statementBrand : any + } + interface Block extends Statement { +>Block : Block +>Statement : Statement + + statements: NodeArray; +>statements : NodeArray +>NodeArray : NodeArray +>Statement : Statement + } + interface VariableStatement extends Statement { +>VariableStatement : VariableStatement +>Statement : Statement + + declarationList: VariableDeclarationList; +>declarationList : VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList + } + interface ExpressionStatement extends Statement { +>ExpressionStatement : ExpressionStatement +>Statement : Statement + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface IfStatement extends Statement { +>IfStatement : IfStatement +>Statement : Statement + + expression: Expression; +>expression : Expression +>Expression : Expression + + thenStatement: Statement; +>thenStatement : Statement +>Statement : Statement + + elseStatement?: Statement; +>elseStatement : Statement +>Statement : Statement + } + interface IterationStatement extends Statement { +>IterationStatement : IterationStatement +>Statement : Statement + + statement: Statement; +>statement : Statement +>Statement : Statement + } + interface DoStatement extends IterationStatement { +>DoStatement : DoStatement +>IterationStatement : IterationStatement + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface WhileStatement extends IterationStatement { +>WhileStatement : WhileStatement +>IterationStatement : IterationStatement + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface ForStatement extends IterationStatement { +>ForStatement : ForStatement +>IterationStatement : IterationStatement + + initializer?: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + condition?: Expression; +>condition : Expression +>Expression : Expression + + iterator?: Expression; +>iterator : Expression +>Expression : Expression + } + interface ForInStatement extends IterationStatement { +>ForInStatement : ForInStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface ForOfStatement extends IterationStatement { +>ForOfStatement : ForOfStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface BreakOrContinueStatement extends Statement { +>BreakOrContinueStatement : BreakOrContinueStatement +>Statement : Statement + + label?: Identifier; +>label : Identifier +>Identifier : Identifier + } + interface ReturnStatement extends Statement { +>ReturnStatement : ReturnStatement +>Statement : Statement + + expression?: Expression; +>expression : Expression +>Expression : Expression + } + interface WithStatement extends Statement { +>WithStatement : WithStatement +>Statement : Statement + + expression: Expression; +>expression : Expression +>Expression : Expression + + statement: Statement; +>statement : Statement +>Statement : Statement + } + interface SwitchStatement extends Statement { +>SwitchStatement : SwitchStatement +>Statement : Statement + + expression: Expression; +>expression : Expression +>Expression : Expression + + caseBlock: CaseBlock; +>caseBlock : CaseBlock +>CaseBlock : CaseBlock + } + interface CaseBlock extends Node { +>CaseBlock : CaseBlock +>Node : Node + + clauses: NodeArray; +>clauses : NodeArray +>NodeArray : NodeArray +>CaseOrDefaultClause : CaseClause | DefaultClause + } + interface CaseClause extends Node { +>CaseClause : CaseClause +>Node : Node + + expression?: Expression; +>expression : Expression +>Expression : Expression + + statements: NodeArray; +>statements : NodeArray +>NodeArray : NodeArray +>Statement : Statement + } + interface DefaultClause extends Node { +>DefaultClause : DefaultClause +>Node : Node + + statements: NodeArray; +>statements : NodeArray +>NodeArray : NodeArray +>Statement : Statement + } + type CaseOrDefaultClause = CaseClause | DefaultClause; +>CaseOrDefaultClause : CaseClause | DefaultClause +>CaseClause : CaseClause +>DefaultClause : DefaultClause + + interface LabeledStatement extends Statement { +>LabeledStatement : LabeledStatement +>Statement : Statement + + label: Identifier; +>label : Identifier +>Identifier : Identifier + + statement: Statement; +>statement : Statement +>Statement : Statement + } + interface ThrowStatement extends Statement { +>ThrowStatement : ThrowStatement +>Statement : Statement + + expression: Expression; +>expression : Expression +>Expression : Expression + } + interface TryStatement extends Statement { +>TryStatement : TryStatement +>Statement : Statement + + tryBlock: Block; +>tryBlock : Block +>Block : Block + + catchClause?: CatchClause; +>catchClause : CatchClause +>CatchClause : CatchClause + + finallyBlock?: Block; +>finallyBlock : Block +>Block : Block + } + interface CatchClause extends Node { +>CatchClause : CatchClause +>Node : Node + + variableDeclaration: VariableDeclaration; +>variableDeclaration : VariableDeclaration +>VariableDeclaration : VariableDeclaration + + block: Block; +>block : Block +>Block : Block + } + interface ModuleElement extends Node { +>ModuleElement : ModuleElement +>Node : Node + + _moduleElementBrand: any; +>_moduleElementBrand : any + } + interface ClassLikeDeclaration extends Declaration { +>ClassLikeDeclaration : ClassLikeDeclaration +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + typeParameters?: NodeArray; +>typeParameters : NodeArray +>NodeArray : NodeArray +>TypeParameterDeclaration : TypeParameterDeclaration + + heritageClauses?: NodeArray; +>heritageClauses : NodeArray +>NodeArray : NodeArray +>HeritageClause : HeritageClause + + members: NodeArray; +>members : NodeArray +>NodeArray : NodeArray +>ClassElement : ClassElement + } + interface ClassDeclaration extends ClassLikeDeclaration, Statement { +>ClassDeclaration : ClassDeclaration +>ClassLikeDeclaration : ClassLikeDeclaration +>Statement : Statement + } + interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { +>ClassExpression : ClassExpression +>ClassLikeDeclaration : ClassLikeDeclaration +>PrimaryExpression : PrimaryExpression + } + interface ClassElement extends Declaration { +>ClassElement : ClassElement +>Declaration : Declaration + + _classElementBrand: any; +>_classElementBrand : any + } + interface InterfaceDeclaration extends Declaration, ModuleElement { +>InterfaceDeclaration : InterfaceDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + typeParameters?: NodeArray; +>typeParameters : NodeArray +>NodeArray : NodeArray +>TypeParameterDeclaration : TypeParameterDeclaration + + heritageClauses?: NodeArray; +>heritageClauses : NodeArray +>NodeArray : NodeArray +>HeritageClause : HeritageClause + + members: NodeArray; +>members : NodeArray +>NodeArray : NodeArray +>Declaration : Declaration + } + interface HeritageClause extends Node { +>HeritageClause : HeritageClause +>Node : Node + + token: SyntaxKind; +>token : SyntaxKind +>SyntaxKind : SyntaxKind + + types?: NodeArray; +>types : NodeArray +>NodeArray : NodeArray +>HeritageClauseElement : HeritageClauseElement + } + interface TypeAliasDeclaration extends Declaration, ModuleElement { +>TypeAliasDeclaration : TypeAliasDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + type: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + } + interface EnumMember extends Declaration { +>EnumMember : EnumMember +>Declaration : Declaration + + name: DeclarationName; +>name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern +>DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern + + initializer?: Expression; +>initializer : Expression +>Expression : Expression + } + interface EnumDeclaration extends Declaration, ModuleElement { +>EnumDeclaration : EnumDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + members: NodeArray; +>members : NodeArray +>NodeArray : NodeArray +>EnumMember : EnumMember + } + interface ModuleDeclaration extends Declaration, ModuleElement { +>ModuleDeclaration : ModuleDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + name: Identifier | LiteralExpression; +>name : Identifier | LiteralExpression +>Identifier : Identifier +>LiteralExpression : LiteralExpression + + body: ModuleBlock | ModuleDeclaration; +>body : ModuleDeclaration | ModuleBlock +>ModuleBlock : ModuleBlock +>ModuleDeclaration : ModuleDeclaration + } + interface ModuleBlock extends Node, ModuleElement { +>ModuleBlock : ModuleBlock +>Node : Node +>ModuleElement : ModuleElement + + statements: NodeArray; +>statements : NodeArray +>NodeArray : NodeArray +>ModuleElement : ModuleElement + } + interface ImportEqualsDeclaration extends Declaration, ModuleElement { +>ImportEqualsDeclaration : ImportEqualsDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + name: Identifier; +>name : Identifier +>Identifier : Identifier + + moduleReference: EntityName | ExternalModuleReference; +>moduleReference : Identifier | QualifiedName | ExternalModuleReference +>EntityName : Identifier | QualifiedName +>ExternalModuleReference : ExternalModuleReference + } + interface ExternalModuleReference extends Node { +>ExternalModuleReference : ExternalModuleReference +>Node : Node + + expression?: Expression; +>expression : Expression +>Expression : Expression + } + interface ImportDeclaration extends ModuleElement { +>ImportDeclaration : ImportDeclaration +>ModuleElement : ModuleElement + + importClause?: ImportClause; +>importClause : ImportClause +>ImportClause : ImportClause + + moduleSpecifier: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface ImportClause extends Declaration { +>ImportClause : ImportClause +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + namedBindings?: NamespaceImport | NamedImports; +>namedBindings : NamespaceImport | NamedImportsOrExports +>NamespaceImport : NamespaceImport +>NamedImports : NamedImportsOrExports + } + interface NamespaceImport extends Declaration { +>NamespaceImport : NamespaceImport +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface ExportDeclaration extends Declaration, ModuleElement { +>ExportDeclaration : ExportDeclaration +>Declaration : Declaration +>ModuleElement : ModuleElement + + exportClause?: NamedExports; +>exportClause : NamedImportsOrExports +>NamedExports : NamedImportsOrExports + + moduleSpecifier?: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface NamedImportsOrExports extends Node { +>NamedImportsOrExports : NamedImportsOrExports +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>ImportOrExportSpecifier : ImportOrExportSpecifier + } + type NamedImports = NamedImportsOrExports; +>NamedImports : NamedImportsOrExports +>NamedImportsOrExports : NamedImportsOrExports + + type NamedExports = NamedImportsOrExports; +>NamedExports : NamedImportsOrExports +>NamedImportsOrExports : NamedImportsOrExports + + interface ImportOrExportSpecifier extends Declaration { +>ImportOrExportSpecifier : ImportOrExportSpecifier +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + type ImportSpecifier = ImportOrExportSpecifier; +>ImportSpecifier : ImportOrExportSpecifier +>ImportOrExportSpecifier : ImportOrExportSpecifier + + type ExportSpecifier = ImportOrExportSpecifier; +>ExportSpecifier : ImportOrExportSpecifier +>ImportOrExportSpecifier : ImportOrExportSpecifier + + interface ExportAssignment extends Declaration, ModuleElement { +>ExportAssignment : ExportAssignment +>Declaration : Declaration +>ModuleElement : ModuleElement + + isExportEquals?: boolean; +>isExportEquals : boolean + + expression?: Expression; +>expression : Expression +>Expression : Expression + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode + } + interface FileReference extends TextRange { +>FileReference : FileReference +>TextRange : TextRange + + fileName: string; +>fileName : string + } + interface CommentRange extends TextRange { +>CommentRange : CommentRange +>TextRange : TextRange + + hasTrailingNewLine?: boolean; +>hasTrailingNewLine : boolean + } + interface SourceFile extends Declaration { +>SourceFile : SourceFile +>Declaration : Declaration + + statements: NodeArray; +>statements : NodeArray +>NodeArray : NodeArray +>ModuleElement : ModuleElement + + endOfFileToken: Node; +>endOfFileToken : Node +>Node : Node + + fileName: string; +>fileName : string + + text: string; +>text : string + + amdDependencies: { +>amdDependencies : { path: string; name: string; }[] + + path: string; +>path : string + + name: string; +>name : string + + }[]; + amdModuleName: string; +>amdModuleName : string + + referencedFiles: FileReference[]; +>referencedFiles : FileReference[] +>FileReference : FileReference + + hasNoDefaultLib: boolean; +>hasNoDefaultLib : boolean + + externalModuleIndicator: Node; +>externalModuleIndicator : Node +>Node : Node + + languageVersion: ScriptTarget; +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget + + identifiers: Map; +>identifiers : Map +>Map : Map + } + interface ScriptReferenceHost { +>ScriptReferenceHost : ScriptReferenceHost + + getCompilerOptions(): CompilerOptions; +>getCompilerOptions : () => CompilerOptions +>CompilerOptions : CompilerOptions + + getSourceFile(fileName: string): SourceFile; +>getSourceFile : (fileName: string) => SourceFile +>fileName : string +>SourceFile : SourceFile + + getCurrentDirectory(): string; +>getCurrentDirectory : () => string + } + interface WriteFileCallback { +>WriteFileCallback : WriteFileCallback + + (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; +>fileName : string +>data : string +>writeByteOrderMark : boolean +>onError : (message: string) => void +>message : string + } + interface Program extends ScriptReferenceHost { +>Program : Program +>ScriptReferenceHost : ScriptReferenceHost + + getSourceFiles(): SourceFile[]; +>getSourceFiles : () => SourceFile[] +>SourceFile : SourceFile + + /** + * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then + * the JavaScript and declaration files will be produced for all the files in this program. + * If targetSourceFile is specified, then only the JavaScript and declaration for that + * specific file will be generated. + * + * If writeFile is not specified then the writeFile callback from the compiler host will be + * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter + * will be invoked when writing the JavaScript and declaration files. + */ + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; +>emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult +>targetSourceFile : SourceFile +>SourceFile : SourceFile +>writeFile : WriteFileCallback +>WriteFileCallback : WriteFileCallback +>EmitResult : EmitResult + + getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; +>getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] +>sourceFile : SourceFile +>SourceFile : SourceFile +>Diagnostic : Diagnostic + + getGlobalDiagnostics(): Diagnostic[]; +>getGlobalDiagnostics : () => Diagnostic[] +>Diagnostic : Diagnostic + + getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; +>getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] +>sourceFile : SourceFile +>SourceFile : SourceFile +>Diagnostic : Diagnostic + + getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; +>getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] +>sourceFile : SourceFile +>SourceFile : SourceFile +>Diagnostic : Diagnostic + + getTypeChecker(): TypeChecker; +>getTypeChecker : () => TypeChecker +>TypeChecker : TypeChecker + + getCommonSourceDirectory(): string; +>getCommonSourceDirectory : () => string + } + interface SourceMapSpan { +>SourceMapSpan : SourceMapSpan + + emittedLine: number; +>emittedLine : number + + emittedColumn: number; +>emittedColumn : number + + sourceLine: number; +>sourceLine : number + + sourceColumn: number; +>sourceColumn : number + + nameIndex?: number; +>nameIndex : number + + sourceIndex: number; +>sourceIndex : number + } + interface SourceMapData { +>SourceMapData : SourceMapData + + sourceMapFilePath: string; +>sourceMapFilePath : string + + jsSourceMappingURL: string; +>jsSourceMappingURL : string + + sourceMapFile: string; +>sourceMapFile : string + + sourceMapSourceRoot: string; +>sourceMapSourceRoot : string + + sourceMapSources: string[]; +>sourceMapSources : string[] + + inputSourceFileNames: string[]; +>inputSourceFileNames : string[] + + sourceMapNames?: string[]; +>sourceMapNames : string[] + + sourceMapMappings: string; +>sourceMapMappings : string + + sourceMapDecodedMappings: SourceMapSpan[]; +>sourceMapDecodedMappings : SourceMapSpan[] +>SourceMapSpan : SourceMapSpan + } + enum ExitStatus { +>ExitStatus : ExitStatus + + Success = 0, +>Success : ExitStatus + + DiagnosticsPresent_OutputsSkipped = 1, +>DiagnosticsPresent_OutputsSkipped : ExitStatus + + DiagnosticsPresent_OutputsGenerated = 2, +>DiagnosticsPresent_OutputsGenerated : ExitStatus + } + interface EmitResult { +>EmitResult : EmitResult + + emitSkipped: boolean; +>emitSkipped : boolean + + diagnostics: Diagnostic[]; +>diagnostics : Diagnostic[] +>Diagnostic : Diagnostic + + sourceMaps: SourceMapData[]; +>sourceMaps : SourceMapData[] +>SourceMapData : SourceMapData + } + interface TypeCheckerHost { +>TypeCheckerHost : TypeCheckerHost + + getCompilerOptions(): CompilerOptions; +>getCompilerOptions : () => CompilerOptions +>CompilerOptions : CompilerOptions + + getSourceFiles(): SourceFile[]; +>getSourceFiles : () => SourceFile[] +>SourceFile : SourceFile + + getSourceFile(fileName: string): SourceFile; +>getSourceFile : (fileName: string) => SourceFile +>fileName : string +>SourceFile : SourceFile + } + interface TypeChecker { +>TypeChecker : TypeChecker + + getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; +>getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type +>symbol : Symbol +>Symbol : Symbol +>node : Node +>Node : Node +>Type : Type + + getDeclaredTypeOfSymbol(symbol: Symbol): Type; +>getDeclaredTypeOfSymbol : (symbol: Symbol) => Type +>symbol : Symbol +>Symbol : Symbol +>Type : Type + + getPropertiesOfType(type: Type): Symbol[]; +>getPropertiesOfType : (type: Type) => Symbol[] +>type : Type +>Type : Type +>Symbol : Symbol + + getPropertyOfType(type: Type, propertyName: string): Symbol; +>getPropertyOfType : (type: Type, propertyName: string) => Symbol +>type : Type +>Type : Type +>propertyName : string +>Symbol : Symbol + + getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; +>getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] +>type : Type +>Type : Type +>kind : SignatureKind +>SignatureKind : SignatureKind +>Signature : Signature + + getIndexTypeOfType(type: Type, kind: IndexKind): Type; +>getIndexTypeOfType : (type: Type, kind: IndexKind) => Type +>type : Type +>Type : Type +>kind : IndexKind +>IndexKind : IndexKind +>Type : Type + + getReturnTypeOfSignature(signature: Signature): Type; +>getReturnTypeOfSignature : (signature: Signature) => Type +>signature : Signature +>Signature : Signature +>Type : Type + + getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; +>getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] +>location : Node +>Node : Node +>meaning : SymbolFlags +>SymbolFlags : SymbolFlags +>Symbol : Symbol + + getSymbolAtLocation(node: Node): Symbol; +>getSymbolAtLocation : (node: Node) => Symbol +>node : Node +>Node : Node +>Symbol : Symbol + + getShorthandAssignmentValueSymbol(location: Node): Symbol; +>getShorthandAssignmentValueSymbol : (location: Node) => Symbol +>location : Node +>Node : Node +>Symbol : Symbol + + getTypeAtLocation(node: Node): Type; +>getTypeAtLocation : (node: Node) => Type +>node : Node +>Node : Node +>Type : Type + + typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; +>typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string +>type : Type +>Type : Type +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; +>symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string +>symbol : Symbol +>Symbol : Symbol +>enclosingDeclaration : Node +>Node : Node +>meaning : SymbolFlags +>SymbolFlags : SymbolFlags + + getSymbolDisplayBuilder(): SymbolDisplayBuilder; +>getSymbolDisplayBuilder : () => SymbolDisplayBuilder +>SymbolDisplayBuilder : SymbolDisplayBuilder + + getFullyQualifiedName(symbol: Symbol): string; +>getFullyQualifiedName : (symbol: Symbol) => string +>symbol : Symbol +>Symbol : Symbol + + getAugmentedPropertiesOfType(type: Type): Symbol[]; +>getAugmentedPropertiesOfType : (type: Type) => Symbol[] +>type : Type +>Type : Type +>Symbol : Symbol + + getRootSymbols(symbol: Symbol): Symbol[]; +>getRootSymbols : (symbol: Symbol) => Symbol[] +>symbol : Symbol +>Symbol : Symbol +>Symbol : Symbol + + getContextualType(node: Expression): Type; +>getContextualType : (node: Expression) => Type +>node : Expression +>Expression : Expression +>Type : Type + + getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; +>getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature +>node : CallExpression | NewExpression | TaggedTemplateExpression +>CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression +>candidatesOutArray : Signature[] +>Signature : Signature +>Signature : Signature + + getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; +>getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature +>declaration : SignatureDeclaration +>SignatureDeclaration : SignatureDeclaration +>Signature : Signature + + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; +>isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean +>node : FunctionLikeDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration + + isUndefinedSymbol(symbol: Symbol): boolean; +>isUndefinedSymbol : (symbol: Symbol) => boolean +>symbol : Symbol +>Symbol : Symbol + + isArgumentsSymbol(symbol: Symbol): boolean; +>isArgumentsSymbol : (symbol: Symbol) => boolean +>symbol : Symbol +>Symbol : Symbol + + getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; +>getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number +>node : PropertyAccessExpression | ElementAccessExpression | EnumMember +>EnumMember : EnumMember +>PropertyAccessExpression : PropertyAccessExpression +>ElementAccessExpression : ElementAccessExpression + + isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; +>isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean +>node : QualifiedName | PropertyAccessExpression +>PropertyAccessExpression : PropertyAccessExpression +>QualifiedName : QualifiedName +>propertyName : string + + getAliasedSymbol(symbol: Symbol): Symbol; +>getAliasedSymbol : (symbol: Symbol) => Symbol +>symbol : Symbol +>Symbol : Symbol +>Symbol : Symbol + + getExportsOfModule(moduleSymbol: Symbol): Symbol[]; +>getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] +>moduleSymbol : Symbol +>Symbol : Symbol +>Symbol : Symbol + } + interface SymbolDisplayBuilder { +>SymbolDisplayBuilder : SymbolDisplayBuilder + + buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>type : Type +>Type : Type +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; +>buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void +>symbol : Symbol +>Symbol : Symbol +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>meaning : SymbolFlags +>SymbolFlags : SymbolFlags +>flags : SymbolFormatFlags +>SymbolFormatFlags : SymbolFormatFlags + + buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>signatures : Signature +>Signature : Signature +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>parameter : Symbol +>Symbol : Symbol +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>tp : TypeParameter +>TypeParameter : TypeParameter +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; +>buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void +>symbol : Symbol +>Symbol : Symbol +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaraiton : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>parameters : Symbol[] +>Symbol : Symbol +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>typeParameters : TypeParameter[] +>TypeParameter : TypeParameter +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + + buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; +>buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void +>signature : Signature +>Signature : Signature +>writer : SymbolWriter +>SymbolWriter : SymbolWriter +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags + } + interface SymbolWriter { +>SymbolWriter : SymbolWriter + + writeKeyword(text: string): void; +>writeKeyword : (text: string) => void +>text : string + + writeOperator(text: string): void; +>writeOperator : (text: string) => void +>text : string + + writePunctuation(text: string): void; +>writePunctuation : (text: string) => void +>text : string + + writeSpace(text: string): void; +>writeSpace : (text: string) => void +>text : string + + writeStringLiteral(text: string): void; +>writeStringLiteral : (text: string) => void +>text : string + + writeParameter(text: string): void; +>writeParameter : (text: string) => void +>text : string + + writeSymbol(text: string, symbol: Symbol): void; +>writeSymbol : (text: string, symbol: Symbol) => void +>text : string +>symbol : Symbol +>Symbol : Symbol + + writeLine(): void; +>writeLine : () => void + + increaseIndent(): void; +>increaseIndent : () => void + + decreaseIndent(): void; +>decreaseIndent : () => void + + clear(): void; +>clear : () => void + + trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; +>trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void +>symbol : Symbol +>Symbol : Symbol +>enclosingDeclaration : Node +>Node : Node +>meaning : SymbolFlags +>SymbolFlags : SymbolFlags + } + const enum TypeFormatFlags { +>TypeFormatFlags : TypeFormatFlags + + None = 0, +>None : TypeFormatFlags + + WriteArrayAsGenericType = 1, +>WriteArrayAsGenericType : TypeFormatFlags + + UseTypeOfFunction = 2, +>UseTypeOfFunction : TypeFormatFlags + + NoTruncation = 4, +>NoTruncation : TypeFormatFlags + + WriteArrowStyleSignature = 8, +>WriteArrowStyleSignature : TypeFormatFlags + + WriteOwnNameForAnyLike = 16, +>WriteOwnNameForAnyLike : TypeFormatFlags + + WriteTypeArgumentsOfSignature = 32, +>WriteTypeArgumentsOfSignature : TypeFormatFlags + + InElementType = 64, +>InElementType : TypeFormatFlags + + UseFullyQualifiedType = 128, +>UseFullyQualifiedType : TypeFormatFlags + } + const enum SymbolFormatFlags { +>SymbolFormatFlags : SymbolFormatFlags + + None = 0, +>None : SymbolFormatFlags + + WriteTypeParametersOrArguments = 1, +>WriteTypeParametersOrArguments : SymbolFormatFlags + + UseOnlyExternalAliasing = 2, +>UseOnlyExternalAliasing : SymbolFormatFlags + } + const enum SymbolAccessibility { +>SymbolAccessibility : SymbolAccessibility + + Accessible = 0, +>Accessible : SymbolAccessibility + + NotAccessible = 1, +>NotAccessible : SymbolAccessibility + + CannotBeNamed = 2, +>CannotBeNamed : SymbolAccessibility + } + type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; +>AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration +>ImportDeclaration : ImportDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration + + interface SymbolVisibilityResult { +>SymbolVisibilityResult : SymbolVisibilityResult + + accessibility: SymbolAccessibility; +>accessibility : SymbolAccessibility +>SymbolAccessibility : SymbolAccessibility + + aliasesToMakeVisible?: AnyImportSyntax[]; +>aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] +>AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration + + errorSymbolName?: string; +>errorSymbolName : string + + errorNode?: Node; +>errorNode : Node +>Node : Node + } + interface SymbolAccessiblityResult extends SymbolVisibilityResult { +>SymbolAccessiblityResult : SymbolAccessiblityResult +>SymbolVisibilityResult : SymbolVisibilityResult + + errorModuleName?: string; +>errorModuleName : string + } + interface EmitResolver { +>EmitResolver : EmitResolver + + hasGlobalName(name: string): boolean; +>hasGlobalName : (name: string) => boolean +>name : string + + getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; +>getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string +>node : Identifier +>Identifier : Identifier +>getGeneratedNameForNode : (node: Node) => string +>node : Node +>Node : Node + + isValueAliasDeclaration(node: Node): boolean; +>isValueAliasDeclaration : (node: Node) => boolean +>node : Node +>Node : Node + + isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; +>isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean +>node : Node +>Node : Node +>checkChildren : boolean + + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; +>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean +>node : ImportEqualsDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration + + getNodeCheckFlags(node: Node): NodeCheckFlags; +>getNodeCheckFlags : (node: Node) => NodeCheckFlags +>node : Node +>Node : Node +>NodeCheckFlags : NodeCheckFlags + + isDeclarationVisible(node: Declaration): boolean; +>isDeclarationVisible : (node: Declaration) => boolean +>node : Declaration +>Declaration : Declaration + + collectLinkedAliases(node: Identifier): Node[]; +>collectLinkedAliases : (node: Identifier) => Node[] +>node : Identifier +>Identifier : Identifier +>Node : Node + + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; +>isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean +>node : FunctionLikeDeclaration +>FunctionLikeDeclaration : FunctionLikeDeclaration + + writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; +>writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void +>declaration : VariableLikeDeclaration | AccessorDeclaration +>AccessorDeclaration : AccessorDeclaration +>VariableLikeDeclaration : VariableLikeDeclaration +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags +>writer : SymbolWriter +>SymbolWriter : SymbolWriter + + writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; +>writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void +>signatureDeclaration : SignatureDeclaration +>SignatureDeclaration : SignatureDeclaration +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags +>writer : SymbolWriter +>SymbolWriter : SymbolWriter + + writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; +>writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void +>expr : Expression +>Expression : Expression +>enclosingDeclaration : Node +>Node : Node +>flags : TypeFormatFlags +>TypeFormatFlags : TypeFormatFlags +>writer : SymbolWriter +>SymbolWriter : SymbolWriter + + isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; +>isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult +>symbol : Symbol +>Symbol : Symbol +>enclosingDeclaration : Node +>Node : Node +>meaning : SymbolFlags +>SymbolFlags : SymbolFlags +>SymbolAccessiblityResult : SymbolAccessiblityResult + + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; +>isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult +>entityName : Identifier | Expression | QualifiedName +>EntityName : Identifier | QualifiedName +>Expression : Expression +>enclosingDeclaration : Node +>Node : Node +>SymbolVisibilityResult : SymbolVisibilityResult + + getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; +>getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number +>node : PropertyAccessExpression | ElementAccessExpression | EnumMember +>EnumMember : EnumMember +>PropertyAccessExpression : PropertyAccessExpression +>ElementAccessExpression : ElementAccessExpression + + resolvesToSomeValue(location: Node, name: string): boolean; +>resolvesToSomeValue : (location: Node, name: string) => boolean +>location : Node +>Node : Node +>name : string + + getBlockScopedVariableId(node: Identifier): number; +>getBlockScopedVariableId : (node: Identifier) => number +>node : Identifier +>Identifier : Identifier + } + const enum SymbolFlags { +>SymbolFlags : SymbolFlags + + FunctionScopedVariable = 1, +>FunctionScopedVariable : SymbolFlags + + BlockScopedVariable = 2, +>BlockScopedVariable : SymbolFlags + + Property = 4, +>Property : SymbolFlags + + EnumMember = 8, +>EnumMember : SymbolFlags + + Function = 16, +>Function : SymbolFlags + + Class = 32, +>Class : SymbolFlags + + Interface = 64, +>Interface : SymbolFlags + + ConstEnum = 128, +>ConstEnum : SymbolFlags + + RegularEnum = 256, +>RegularEnum : SymbolFlags + + ValueModule = 512, +>ValueModule : SymbolFlags + + NamespaceModule = 1024, +>NamespaceModule : SymbolFlags + + TypeLiteral = 2048, +>TypeLiteral : SymbolFlags + + ObjectLiteral = 4096, +>ObjectLiteral : SymbolFlags + + Method = 8192, +>Method : SymbolFlags + + Constructor = 16384, +>Constructor : SymbolFlags + + GetAccessor = 32768, +>GetAccessor : SymbolFlags + + SetAccessor = 65536, +>SetAccessor : SymbolFlags + + Signature = 131072, +>Signature : SymbolFlags + + TypeParameter = 262144, +>TypeParameter : SymbolFlags + + TypeAlias = 524288, +>TypeAlias : SymbolFlags + + ExportValue = 1048576, +>ExportValue : SymbolFlags + + ExportType = 2097152, +>ExportType : SymbolFlags + + ExportNamespace = 4194304, +>ExportNamespace : SymbolFlags + + Alias = 8388608, +>Alias : SymbolFlags + + Instantiated = 16777216, +>Instantiated : SymbolFlags + + Merged = 33554432, +>Merged : SymbolFlags + + Transient = 67108864, +>Transient : SymbolFlags + + Prototype = 134217728, +>Prototype : SymbolFlags + + UnionProperty = 268435456, +>UnionProperty : SymbolFlags + + Optional = 536870912, +>Optional : SymbolFlags + + ExportStar = 1073741824, +>ExportStar : SymbolFlags + + Enum = 384, +>Enum : SymbolFlags + + Variable = 3, +>Variable : SymbolFlags + + Value = 107455, +>Value : SymbolFlags + + Type = 793056, +>Type : SymbolFlags + + Namespace = 1536, +>Namespace : SymbolFlags + + Module = 1536, +>Module : SymbolFlags + + Accessor = 98304, +>Accessor : SymbolFlags + + FunctionScopedVariableExcludes = 107454, +>FunctionScopedVariableExcludes : SymbolFlags + + BlockScopedVariableExcludes = 107455, +>BlockScopedVariableExcludes : SymbolFlags + + ParameterExcludes = 107455, +>ParameterExcludes : SymbolFlags + + PropertyExcludes = 107455, +>PropertyExcludes : SymbolFlags + + EnumMemberExcludes = 107455, +>EnumMemberExcludes : SymbolFlags + + FunctionExcludes = 106927, +>FunctionExcludes : SymbolFlags + + ClassExcludes = 899583, +>ClassExcludes : SymbolFlags + + InterfaceExcludes = 792992, +>InterfaceExcludes : SymbolFlags + + RegularEnumExcludes = 899327, +>RegularEnumExcludes : SymbolFlags + + ConstEnumExcludes = 899967, +>ConstEnumExcludes : SymbolFlags + + ValueModuleExcludes = 106639, +>ValueModuleExcludes : SymbolFlags + + NamespaceModuleExcludes = 0, +>NamespaceModuleExcludes : SymbolFlags + + MethodExcludes = 99263, +>MethodExcludes : SymbolFlags + + GetAccessorExcludes = 41919, +>GetAccessorExcludes : SymbolFlags + + SetAccessorExcludes = 74687, +>SetAccessorExcludes : SymbolFlags + + TypeParameterExcludes = 530912, +>TypeParameterExcludes : SymbolFlags + + TypeAliasExcludes = 793056, +>TypeAliasExcludes : SymbolFlags + + AliasExcludes = 8388608, +>AliasExcludes : SymbolFlags + + ModuleMember = 8914931, +>ModuleMember : SymbolFlags + + ExportHasLocal = 944, +>ExportHasLocal : SymbolFlags + + HasLocals = 255504, +>HasLocals : SymbolFlags + + HasExports = 1952, +>HasExports : SymbolFlags + + HasMembers = 6240, +>HasMembers : SymbolFlags + + IsContainer = 262128, +>IsContainer : SymbolFlags + + PropertyOrAccessor = 98308, +>PropertyOrAccessor : SymbolFlags + + Export = 7340032, +>Export : SymbolFlags + } + interface Symbol { +>Symbol : Symbol + + flags: SymbolFlags; +>flags : SymbolFlags +>SymbolFlags : SymbolFlags + + name: string; +>name : string + + id?: number; +>id : number + + mergeId?: number; +>mergeId : number + + declarations?: Declaration[]; +>declarations : Declaration[] +>Declaration : Declaration + + parent?: Symbol; +>parent : Symbol +>Symbol : Symbol + + members?: SymbolTable; +>members : SymbolTable +>SymbolTable : SymbolTable + + exports?: SymbolTable; +>exports : SymbolTable +>SymbolTable : SymbolTable + + exportSymbol?: Symbol; +>exportSymbol : Symbol +>Symbol : Symbol + + valueDeclaration?: Declaration; +>valueDeclaration : Declaration +>Declaration : Declaration + + constEnumOnlyModule?: boolean; +>constEnumOnlyModule : boolean + } + interface SymbolLinks { +>SymbolLinks : SymbolLinks + + target?: Symbol; +>target : Symbol +>Symbol : Symbol + + type?: Type; +>type : Type +>Type : Type + + declaredType?: Type; +>declaredType : Type +>Type : Type + + mapper?: TypeMapper; +>mapper : TypeMapper +>TypeMapper : TypeMapper + + referenced?: boolean; +>referenced : boolean + + unionType?: UnionType; +>unionType : UnionType +>UnionType : UnionType + + resolvedExports?: SymbolTable; +>resolvedExports : SymbolTable +>SymbolTable : SymbolTable + + exportsChecked?: boolean; +>exportsChecked : boolean + } + interface TransientSymbol extends Symbol, SymbolLinks { +>TransientSymbol : TransientSymbol +>Symbol : Symbol +>SymbolLinks : SymbolLinks + } + interface SymbolTable { +>SymbolTable : SymbolTable + + [index: string]: Symbol; +>index : string +>Symbol : Symbol + } + const enum NodeCheckFlags { +>NodeCheckFlags : NodeCheckFlags + + TypeChecked = 1, +>TypeChecked : NodeCheckFlags + + LexicalThis = 2, +>LexicalThis : NodeCheckFlags + + CaptureThis = 4, +>CaptureThis : NodeCheckFlags + + EmitExtends = 8, +>EmitExtends : NodeCheckFlags + + SuperInstance = 16, +>SuperInstance : NodeCheckFlags + + SuperStatic = 32, +>SuperStatic : NodeCheckFlags + + ContextChecked = 64, +>ContextChecked : NodeCheckFlags + + EnumValuesComputed = 128, +>EnumValuesComputed : NodeCheckFlags + + BlockScopedBindingInLoop = 256, +>BlockScopedBindingInLoop : NodeCheckFlags + + EmitDecorate = 512, +>EmitDecorate : NodeCheckFlags + } + interface NodeLinks { +>NodeLinks : NodeLinks + + resolvedType?: Type; +>resolvedType : Type +>Type : Type + + resolvedSignature?: Signature; +>resolvedSignature : Signature +>Signature : Signature + + resolvedSymbol?: Symbol; +>resolvedSymbol : Symbol +>Symbol : Symbol + + flags?: NodeCheckFlags; +>flags : NodeCheckFlags +>NodeCheckFlags : NodeCheckFlags + + enumMemberValue?: number; +>enumMemberValue : number + + isIllegalTypeReferenceInConstraint?: boolean; +>isIllegalTypeReferenceInConstraint : boolean + + isVisible?: boolean; +>isVisible : boolean + + generatedName?: string; +>generatedName : string + + generatedNames?: Map; +>generatedNames : Map +>Map : Map + + assignmentChecks?: Map; +>assignmentChecks : Map +>Map : Map + + hasReportedStatementInAmbientContext?: boolean; +>hasReportedStatementInAmbientContext : boolean + + importOnRightSide?: Symbol; +>importOnRightSide : Symbol +>Symbol : Symbol + } + const enum TypeFlags { +>TypeFlags : TypeFlags + + Any = 1, +>Any : TypeFlags + + String = 2, +>String : TypeFlags + + Number = 4, +>Number : TypeFlags + + Boolean = 8, +>Boolean : TypeFlags + + Void = 16, +>Void : TypeFlags + + Undefined = 32, +>Undefined : TypeFlags + + Null = 64, +>Null : TypeFlags + + Enum = 128, +>Enum : TypeFlags + + StringLiteral = 256, +>StringLiteral : TypeFlags + + TypeParameter = 512, +>TypeParameter : TypeFlags + + Class = 1024, +>Class : TypeFlags + + Interface = 2048, +>Interface : TypeFlags + + Reference = 4096, +>Reference : TypeFlags + + Tuple = 8192, +>Tuple : TypeFlags + + Union = 16384, +>Union : TypeFlags + + Anonymous = 32768, +>Anonymous : TypeFlags + + FromSignature = 65536, +>FromSignature : TypeFlags + + ObjectLiteral = 131072, +>ObjectLiteral : TypeFlags + + ContainsUndefinedOrNull = 262144, +>ContainsUndefinedOrNull : TypeFlags + + ContainsObjectLiteral = 524288, +>ContainsObjectLiteral : TypeFlags + + ESSymbol = 1048576, +>ESSymbol : TypeFlags + + Intrinsic = 1048703, +>Intrinsic : TypeFlags + + Primitive = 1049086, +>Primitive : TypeFlags + + StringLike = 258, +>StringLike : TypeFlags + + NumberLike = 132, +>NumberLike : TypeFlags + + ObjectType = 48128, +>ObjectType : TypeFlags + + RequiresWidening = 786432, +>RequiresWidening : TypeFlags + } + interface Type { +>Type : Type + + flags: TypeFlags; +>flags : TypeFlags +>TypeFlags : TypeFlags + + id: number; +>id : number + + symbol?: Symbol; +>symbol : Symbol +>Symbol : Symbol + } + interface IntrinsicType extends Type { +>IntrinsicType : IntrinsicType +>Type : Type + + intrinsicName: string; +>intrinsicName : string + } + interface StringLiteralType extends Type { +>StringLiteralType : StringLiteralType +>Type : Type + + text: string; +>text : string + } + interface ObjectType extends Type { +>ObjectType : ObjectType +>Type : Type + } + interface InterfaceType extends ObjectType { +>InterfaceType : InterfaceType +>ObjectType : ObjectType + + typeParameters: TypeParameter[]; +>typeParameters : TypeParameter[] +>TypeParameter : TypeParameter + + baseTypes: ObjectType[]; +>baseTypes : ObjectType[] +>ObjectType : ObjectType + + declaredProperties: Symbol[]; +>declaredProperties : Symbol[] +>Symbol : Symbol + + declaredCallSignatures: Signature[]; +>declaredCallSignatures : Signature[] +>Signature : Signature + + declaredConstructSignatures: Signature[]; +>declaredConstructSignatures : Signature[] +>Signature : Signature + + declaredStringIndexType: Type; +>declaredStringIndexType : Type +>Type : Type + + declaredNumberIndexType: Type; +>declaredNumberIndexType : Type +>Type : Type + } + interface TypeReference extends ObjectType { +>TypeReference : TypeReference +>ObjectType : ObjectType + + target: GenericType; +>target : GenericType +>GenericType : GenericType + + typeArguments: Type[]; +>typeArguments : Type[] +>Type : Type + } + interface GenericType extends InterfaceType, TypeReference { +>GenericType : GenericType +>InterfaceType : InterfaceType +>TypeReference : TypeReference + + instantiations: Map; +>instantiations : Map +>Map : Map +>TypeReference : TypeReference + } + interface TupleType extends ObjectType { +>TupleType : TupleType +>ObjectType : ObjectType + + elementTypes: Type[]; +>elementTypes : Type[] +>Type : Type + + baseArrayType: TypeReference; +>baseArrayType : TypeReference +>TypeReference : TypeReference + } + interface UnionType extends Type { +>UnionType : UnionType +>Type : Type + + types: Type[]; +>types : Type[] +>Type : Type + + resolvedProperties: SymbolTable; +>resolvedProperties : SymbolTable +>SymbolTable : SymbolTable + } + interface ResolvedType extends ObjectType, UnionType { +>ResolvedType : ResolvedType +>ObjectType : ObjectType +>UnionType : UnionType + + members: SymbolTable; +>members : SymbolTable +>SymbolTable : SymbolTable + + properties: Symbol[]; +>properties : Symbol[] +>Symbol : Symbol + + callSignatures: Signature[]; +>callSignatures : Signature[] +>Signature : Signature + + constructSignatures: Signature[]; +>constructSignatures : Signature[] +>Signature : Signature + + stringIndexType: Type; +>stringIndexType : Type +>Type : Type + + numberIndexType: Type; +>numberIndexType : Type +>Type : Type + } + interface TypeParameter extends Type { +>TypeParameter : TypeParameter +>Type : Type + + constraint: Type; +>constraint : Type +>Type : Type + + target?: TypeParameter; +>target : TypeParameter +>TypeParameter : TypeParameter + + mapper?: TypeMapper; +>mapper : TypeMapper +>TypeMapper : TypeMapper + } + const enum SignatureKind { +>SignatureKind : SignatureKind + + Call = 0, +>Call : SignatureKind + + Construct = 1, +>Construct : SignatureKind + } + interface Signature { +>Signature : Signature + + declaration: SignatureDeclaration; +>declaration : SignatureDeclaration +>SignatureDeclaration : SignatureDeclaration + + typeParameters: TypeParameter[]; +>typeParameters : TypeParameter[] +>TypeParameter : TypeParameter + + parameters: Symbol[]; +>parameters : Symbol[] +>Symbol : Symbol + + resolvedReturnType: Type; +>resolvedReturnType : Type +>Type : Type + + minArgumentCount: number; +>minArgumentCount : number + + hasRestParameter: boolean; +>hasRestParameter : boolean + + hasStringLiterals: boolean; +>hasStringLiterals : boolean + + target?: Signature; +>target : Signature +>Signature : Signature + + mapper?: TypeMapper; +>mapper : TypeMapper +>TypeMapper : TypeMapper + + unionSignatures?: Signature[]; +>unionSignatures : Signature[] +>Signature : Signature + + erasedSignatureCache?: Signature; +>erasedSignatureCache : Signature +>Signature : Signature + + isolatedSignatureType?: ObjectType; +>isolatedSignatureType : ObjectType +>ObjectType : ObjectType + } + const enum IndexKind { +>IndexKind : IndexKind + + String = 0, +>String : IndexKind + + Number = 1, +>Number : IndexKind + } + interface TypeMapper { +>TypeMapper : TypeMapper + + (t: Type): Type; +>t : Type +>Type : Type +>Type : Type + } + interface DiagnosticMessage { +>DiagnosticMessage : DiagnosticMessage + + key: string; +>key : string + + category: DiagnosticCategory; +>category : DiagnosticCategory +>DiagnosticCategory : DiagnosticCategory + + code: number; +>code : number + } + interface DiagnosticMessageChain { +>DiagnosticMessageChain : DiagnosticMessageChain + + messageText: string; +>messageText : string + + category: DiagnosticCategory; +>category : DiagnosticCategory +>DiagnosticCategory : DiagnosticCategory + + code: number; +>code : number + + next?: DiagnosticMessageChain; +>next : DiagnosticMessageChain +>DiagnosticMessageChain : DiagnosticMessageChain + } + interface Diagnostic { +>Diagnostic : Diagnostic + + file: SourceFile; +>file : SourceFile +>SourceFile : SourceFile + + start: number; +>start : number + + length: number; +>length : number + + messageText: string | DiagnosticMessageChain; +>messageText : string | DiagnosticMessageChain +>DiagnosticMessageChain : DiagnosticMessageChain + + category: DiagnosticCategory; +>category : DiagnosticCategory +>DiagnosticCategory : DiagnosticCategory + + code: number; +>code : number + } + enum DiagnosticCategory { +>DiagnosticCategory : DiagnosticCategory + + Warning = 0, +>Warning : DiagnosticCategory + + Error = 1, +>Error : DiagnosticCategory + + Message = 2, +>Message : DiagnosticCategory + } + interface CompilerOptions { +>CompilerOptions : CompilerOptions + + allowNonTsExtensions?: boolean; +>allowNonTsExtensions : boolean + + charset?: string; +>charset : string + + declaration?: boolean; +>declaration : boolean + + diagnostics?: boolean; +>diagnostics : boolean + + emitBOM?: boolean; +>emitBOM : boolean + + help?: boolean; +>help : boolean + + listFiles?: boolean; +>listFiles : boolean + + locale?: string; +>locale : string + + mapRoot?: string; +>mapRoot : string + + module?: ModuleKind; +>module : ModuleKind +>ModuleKind : ModuleKind + + noEmit?: boolean; +>noEmit : boolean + + noEmitOnError?: boolean; +>noEmitOnError : boolean + + noErrorTruncation?: boolean; +>noErrorTruncation : boolean + + noImplicitAny?: boolean; +>noImplicitAny : boolean + + noLib?: boolean; +>noLib : boolean + + noResolve?: boolean; +>noResolve : boolean + + out?: string; +>out : string + + outDir?: string; +>outDir : string + + preserveConstEnums?: boolean; +>preserveConstEnums : boolean + + project?: string; +>project : string + + removeComments?: boolean; +>removeComments : boolean + + sourceMap?: boolean; +>sourceMap : boolean + + sourceRoot?: string; +>sourceRoot : string + + suppressImplicitAnyIndexErrors?: boolean; +>suppressImplicitAnyIndexErrors : boolean + + target?: ScriptTarget; +>target : ScriptTarget +>ScriptTarget : ScriptTarget + + version?: boolean; +>version : boolean + + watch?: boolean; +>watch : boolean + + separateCompilation?: boolean; +>separateCompilation : boolean + + [option: string]: string | number | boolean; +>option : string + } + const enum ModuleKind { +>ModuleKind : ModuleKind + + None = 0, +>None : ModuleKind + + CommonJS = 1, +>CommonJS : ModuleKind + + AMD = 2, +>AMD : ModuleKind + } + interface LineAndCharacter { +>LineAndCharacter : LineAndCharacter + + line: number; +>line : number + + character: number; +>character : number + } + const enum ScriptTarget { +>ScriptTarget : ScriptTarget + + ES3 = 0, +>ES3 : ScriptTarget + + ES5 = 1, +>ES5 : ScriptTarget + + ES6 = 2, +>ES6 : ScriptTarget + + Latest = 2, +>Latest : ScriptTarget + } + interface ParsedCommandLine { +>ParsedCommandLine : ParsedCommandLine + + options: CompilerOptions; +>options : CompilerOptions +>CompilerOptions : CompilerOptions + + fileNames: string[]; +>fileNames : string[] + + errors: Diagnostic[]; +>errors : Diagnostic[] +>Diagnostic : Diagnostic + } + interface CommandLineOption { +>CommandLineOption : CommandLineOption + + name: string; +>name : string + + type: string | Map; +>type : string | Map +>Map : Map + + isFilePath?: boolean; +>isFilePath : boolean + + shortName?: string; +>shortName : string + + description?: DiagnosticMessage; +>description : DiagnosticMessage +>DiagnosticMessage : DiagnosticMessage + + paramType?: DiagnosticMessage; +>paramType : DiagnosticMessage +>DiagnosticMessage : DiagnosticMessage + + error?: DiagnosticMessage; +>error : DiagnosticMessage +>DiagnosticMessage : DiagnosticMessage + + experimental?: boolean; +>experimental : boolean + } + const enum CharacterCodes { +>CharacterCodes : CharacterCodes + + nullCharacter = 0, +>nullCharacter : CharacterCodes + + maxAsciiCharacter = 127, +>maxAsciiCharacter : CharacterCodes + + lineFeed = 10, +>lineFeed : CharacterCodes + + carriageReturn = 13, +>carriageReturn : CharacterCodes + + lineSeparator = 8232, +>lineSeparator : CharacterCodes + + paragraphSeparator = 8233, +>paragraphSeparator : CharacterCodes + + nextLine = 133, +>nextLine : CharacterCodes + + space = 32, +>space : CharacterCodes + + nonBreakingSpace = 160, +>nonBreakingSpace : CharacterCodes + + enQuad = 8192, +>enQuad : CharacterCodes + + emQuad = 8193, +>emQuad : CharacterCodes + + enSpace = 8194, +>enSpace : CharacterCodes + + emSpace = 8195, +>emSpace : CharacterCodes + + threePerEmSpace = 8196, +>threePerEmSpace : CharacterCodes + + fourPerEmSpace = 8197, +>fourPerEmSpace : CharacterCodes + + sixPerEmSpace = 8198, +>sixPerEmSpace : CharacterCodes + + figureSpace = 8199, +>figureSpace : CharacterCodes + + punctuationSpace = 8200, +>punctuationSpace : CharacterCodes + + thinSpace = 8201, +>thinSpace : CharacterCodes + + hairSpace = 8202, +>hairSpace : CharacterCodes + + zeroWidthSpace = 8203, +>zeroWidthSpace : CharacterCodes + + narrowNoBreakSpace = 8239, +>narrowNoBreakSpace : CharacterCodes + + ideographicSpace = 12288, +>ideographicSpace : CharacterCodes + + mathematicalSpace = 8287, +>mathematicalSpace : CharacterCodes + + ogham = 5760, +>ogham : CharacterCodes + + _ = 95, +>_ : CharacterCodes + + $ = 36, +>$ : CharacterCodes + + _0 = 48, +>_0 : CharacterCodes + + _1 = 49, +>_1 : CharacterCodes + + _2 = 50, +>_2 : CharacterCodes + + _3 = 51, +>_3 : CharacterCodes + + _4 = 52, +>_4 : CharacterCodes + + _5 = 53, +>_5 : CharacterCodes + + _6 = 54, +>_6 : CharacterCodes + + _7 = 55, +>_7 : CharacterCodes + + _8 = 56, +>_8 : CharacterCodes + + _9 = 57, +>_9 : CharacterCodes + + a = 97, +>a : CharacterCodes + + b = 98, +>b : CharacterCodes + + c = 99, +>c : CharacterCodes + + d = 100, +>d : CharacterCodes + + e = 101, +>e : CharacterCodes + + f = 102, +>f : CharacterCodes + + g = 103, +>g : CharacterCodes + + h = 104, +>h : CharacterCodes + + i = 105, +>i : CharacterCodes + + j = 106, +>j : CharacterCodes + + k = 107, +>k : CharacterCodes + + l = 108, +>l : CharacterCodes + + m = 109, +>m : CharacterCodes + + n = 110, +>n : CharacterCodes + + o = 111, +>o : CharacterCodes + + p = 112, +>p : CharacterCodes + + q = 113, +>q : CharacterCodes + + r = 114, +>r : CharacterCodes + + s = 115, +>s : CharacterCodes + + t = 116, +>t : CharacterCodes + + u = 117, +>u : CharacterCodes + + v = 118, +>v : CharacterCodes + + w = 119, +>w : CharacterCodes + + x = 120, +>x : CharacterCodes + + y = 121, +>y : CharacterCodes + + z = 122, +>z : CharacterCodes + + A = 65, +>A : CharacterCodes + + B = 66, +>B : CharacterCodes + + C = 67, +>C : CharacterCodes + + D = 68, +>D : CharacterCodes + + E = 69, +>E : CharacterCodes + + F = 70, +>F : CharacterCodes + + G = 71, +>G : CharacterCodes + + H = 72, +>H : CharacterCodes + + I = 73, +>I : CharacterCodes + + J = 74, +>J : CharacterCodes + + K = 75, +>K : CharacterCodes + + L = 76, +>L : CharacterCodes + + M = 77, +>M : CharacterCodes + + N = 78, +>N : CharacterCodes + + O = 79, +>O : CharacterCodes + + P = 80, +>P : CharacterCodes + + Q = 81, +>Q : CharacterCodes + + R = 82, +>R : CharacterCodes + + S = 83, +>S : CharacterCodes + + T = 84, +>T : CharacterCodes + + U = 85, +>U : CharacterCodes + + V = 86, +>V : CharacterCodes + + W = 87, +>W : CharacterCodes + + X = 88, +>X : CharacterCodes + + Y = 89, +>Y : CharacterCodes + + Z = 90, +>Z : CharacterCodes + + ampersand = 38, +>ampersand : CharacterCodes + + asterisk = 42, +>asterisk : CharacterCodes + + at = 64, +>at : CharacterCodes + + backslash = 92, +>backslash : CharacterCodes + + backtick = 96, +>backtick : CharacterCodes + + bar = 124, +>bar : CharacterCodes + + caret = 94, +>caret : CharacterCodes + + closeBrace = 125, +>closeBrace : CharacterCodes + + closeBracket = 93, +>closeBracket : CharacterCodes + + closeParen = 41, +>closeParen : CharacterCodes + + colon = 58, +>colon : CharacterCodes + + comma = 44, +>comma : CharacterCodes + + dot = 46, +>dot : CharacterCodes + + doubleQuote = 34, +>doubleQuote : CharacterCodes + + equals = 61, +>equals : CharacterCodes + + exclamation = 33, +>exclamation : CharacterCodes + + greaterThan = 62, +>greaterThan : CharacterCodes + + hash = 35, +>hash : CharacterCodes + + lessThan = 60, +>lessThan : CharacterCodes + + minus = 45, +>minus : CharacterCodes + + openBrace = 123, +>openBrace : CharacterCodes + + openBracket = 91, +>openBracket : CharacterCodes + + openParen = 40, +>openParen : CharacterCodes + + percent = 37, +>percent : CharacterCodes + + plus = 43, +>plus : CharacterCodes + + question = 63, +>question : CharacterCodes + + semicolon = 59, +>semicolon : CharacterCodes + + singleQuote = 39, +>singleQuote : CharacterCodes + + slash = 47, +>slash : CharacterCodes + + tilde = 126, +>tilde : CharacterCodes + + backspace = 8, +>backspace : CharacterCodes + + formFeed = 12, +>formFeed : CharacterCodes + + byteOrderMark = 65279, +>byteOrderMark : CharacterCodes + + tab = 9, +>tab : CharacterCodes + + verticalTab = 11, +>verticalTab : CharacterCodes + } + interface CancellationToken { +>CancellationToken : CancellationToken + + isCancellationRequested(): boolean; +>isCancellationRequested : () => boolean + } + interface CompilerHost { +>CompilerHost : CompilerHost + + getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; +>getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile +>fileName : string +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget +>onError : (message: string) => void +>message : string +>SourceFile : SourceFile + + getDefaultLibFileName(options: CompilerOptions): string; +>getDefaultLibFileName : (options: CompilerOptions) => string +>options : CompilerOptions +>CompilerOptions : CompilerOptions + + getCancellationToken?(): CancellationToken; +>getCancellationToken : () => CancellationToken +>CancellationToken : CancellationToken + + writeFile: WriteFileCallback; +>writeFile : WriteFileCallback +>WriteFileCallback : WriteFileCallback + + getCurrentDirectory(): string; +>getCurrentDirectory : () => string + + getCanonicalFileName(fileName: string): string; +>getCanonicalFileName : (fileName: string) => string +>fileName : string + + useCaseSensitiveFileNames(): boolean; +>useCaseSensitiveFileNames : () => boolean + + getNewLine(): string; +>getNewLine : () => string + } + interface TextSpan { +>TextSpan : TextSpan + + start: number; +>start : number + + length: number; +>length : number + } + interface TextChangeRange { +>TextChangeRange : TextChangeRange + + span: TextSpan; +>span : TextSpan +>TextSpan : TextSpan + + newLength: number; +>newLength : number + } +} +declare module "typescript" { + interface ErrorCallback { +>ErrorCallback : ErrorCallback + + (message: DiagnosticMessage, length: number): void; +>message : DiagnosticMessage +>DiagnosticMessage : DiagnosticMessage +>length : number + } + interface Scanner { +>Scanner : Scanner + + getStartPos(): number; +>getStartPos : () => number + + getToken(): SyntaxKind; +>getToken : () => SyntaxKind +>SyntaxKind : SyntaxKind + + getTextPos(): number; +>getTextPos : () => number + + getTokenPos(): number; +>getTokenPos : () => number + + getTokenText(): string; +>getTokenText : () => string + + getTokenValue(): string; +>getTokenValue : () => string + + hasExtendedUnicodeEscape(): boolean; +>hasExtendedUnicodeEscape : () => boolean + + hasPrecedingLineBreak(): boolean; +>hasPrecedingLineBreak : () => boolean + + isIdentifier(): boolean; +>isIdentifier : () => boolean + + isReservedWord(): boolean; +>isReservedWord : () => boolean + + isUnterminated(): boolean; +>isUnterminated : () => boolean + + reScanGreaterToken(): SyntaxKind; +>reScanGreaterToken : () => SyntaxKind +>SyntaxKind : SyntaxKind + + reScanSlashToken(): SyntaxKind; +>reScanSlashToken : () => SyntaxKind +>SyntaxKind : SyntaxKind + + reScanTemplateToken(): SyntaxKind; +>reScanTemplateToken : () => SyntaxKind +>SyntaxKind : SyntaxKind + + scan(): SyntaxKind; +>scan : () => SyntaxKind +>SyntaxKind : SyntaxKind + + setText(text: string): void; +>setText : (text: string) => void +>text : string + + setTextPos(textPos: number): void; +>setTextPos : (textPos: number) => void +>textPos : number + + lookAhead(callback: () => T): T; +>lookAhead : (callback: () => T) => T +>T : T +>callback : () => T +>T : T +>T : T + + tryScan(callback: () => T): T; +>tryScan : (callback: () => T) => T +>T : T +>callback : () => T +>T : T +>T : T + } + function tokenToString(t: SyntaxKind): string; +>tokenToString : (t: SyntaxKind) => string +>t : SyntaxKind +>SyntaxKind : SyntaxKind + + function computeLineStarts(text: string): number[]; +>computeLineStarts : (text: string) => number[] +>text : string + + function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; +>getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number +>sourceFile : SourceFile +>SourceFile : SourceFile +>line : number +>character : number + + function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; +>computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number +>lineStarts : number[] +>line : number +>character : number + + function getLineStarts(sourceFile: SourceFile): number[]; +>getLineStarts : (sourceFile: SourceFile) => number[] +>sourceFile : SourceFile +>SourceFile : SourceFile + + function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { +>computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } +>lineStarts : number[] +>position : number + + line: number; +>line : number + + character: number; +>character : number + + }; + function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; +>getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter +>sourceFile : SourceFile +>SourceFile : SourceFile +>position : number +>LineAndCharacter : LineAndCharacter + + function isWhiteSpace(ch: number): boolean; +>isWhiteSpace : (ch: number) => boolean +>ch : number + + function isLineBreak(ch: number): boolean; +>isLineBreak : (ch: number) => boolean +>ch : number + + function isOctalDigit(ch: number): boolean; +>isOctalDigit : (ch: number) => boolean +>ch : number + + function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; +>skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number +>text : string +>pos : number +>stopAfterLineBreak : boolean + + function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; +>getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] +>text : string +>pos : number +>CommentRange : CommentRange + + function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; +>getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] +>text : string +>pos : number +>CommentRange : CommentRange + + function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; +>isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean +>ch : number +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget + + function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; +>isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean +>ch : number +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget + + function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; +>createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget +>skipTrivia : boolean +>text : string +>onError : ErrorCallback +>ErrorCallback : ErrorCallback +>Scanner : Scanner +} +declare module "typescript" { + function getNodeConstructor(kind: SyntaxKind): new () => Node; +>getNodeConstructor : (kind: SyntaxKind) => new () => Node +>kind : SyntaxKind +>SyntaxKind : SyntaxKind +>Node : Node + + function createNode(kind: SyntaxKind): Node; +>createNode : (kind: SyntaxKind) => Node +>kind : SyntaxKind +>SyntaxKind : SyntaxKind +>Node : Node + + function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; +>forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T +>T : T +>node : Node +>Node : Node +>cbNode : (node: Node) => T +>node : Node +>Node : Node +>T : T +>cbNodeArray : (nodes: Node[]) => T +>nodes : Node[] +>Node : Node +>T : T +>T : T + + function modifierToFlag(token: SyntaxKind): NodeFlags; +>modifierToFlag : (token: SyntaxKind) => NodeFlags +>token : SyntaxKind +>SyntaxKind : SyntaxKind +>NodeFlags : NodeFlags + + function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; +>updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile +>sourceFile : SourceFile +>SourceFile : SourceFile +>newText : string +>textChangeRange : TextChangeRange +>TextChangeRange : TextChangeRange +>aggressiveChecks : boolean +>SourceFile : SourceFile + + function isEvalOrArgumentsIdentifier(node: Node): boolean; +>isEvalOrArgumentsIdentifier : (node: Node) => boolean +>node : Node +>Node : Node + + function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; +>createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile +>fileName : string +>sourceText : string +>languageVersion : ScriptTarget +>ScriptTarget : ScriptTarget +>setParentNodes : boolean +>SourceFile : SourceFile + + function isLeftHandSideExpression(expr: Expression): boolean; +>isLeftHandSideExpression : (expr: Expression) => boolean +>expr : Expression +>Expression : Expression + + function isAssignmentOperator(token: SyntaxKind): boolean; +>isAssignmentOperator : (token: SyntaxKind) => boolean +>token : SyntaxKind +>SyntaxKind : SyntaxKind +} +declare module "typescript" { + function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; +>createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker +>host : TypeCheckerHost +>TypeCheckerHost : TypeCheckerHost +>produceDiagnostics : boolean +>TypeChecker : TypeChecker +} +declare module "typescript" { + /** The version of the TypeScript compiler release */ + let version: string; +>version : string + + function findConfigFile(searchPath: string): string; +>findConfigFile : (searchPath: string) => string +>searchPath : string + + function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; +>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost +>options : CompilerOptions +>CompilerOptions : CompilerOptions +>setParentNodes : boolean +>CompilerHost : CompilerHost + + function getPreEmitDiagnostics(program: Program): Diagnostic[]; +>getPreEmitDiagnostics : (program: Program) => Diagnostic[] +>program : Program +>Program : Program +>Diagnostic : Diagnostic + + function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; +>flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string +>messageText : string | DiagnosticMessageChain +>DiagnosticMessageChain : DiagnosticMessageChain +>newLine : string + + function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; +>createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program +>rootNames : string[] +>options : CompilerOptions +>CompilerOptions : CompilerOptions +>host : CompilerHost +>CompilerHost : CompilerHost +>Program : Program +} +declare module "typescript" { + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ + function readConfigFile(fileName: string): any; +>readConfigFile : (fileName: string) => any +>fileName : string + + /** + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ + function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; +>parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine +>json : any +>basePath : string +>ParsedCommandLine : ParsedCommandLine +} +declare module "typescript" { + /** The version of the language service API */ + let servicesVersion: string; +>servicesVersion : string + + interface Node { +>Node : Node + + getSourceFile(): SourceFile; +>getSourceFile : () => SourceFile +>SourceFile : SourceFile + + getChildCount(sourceFile?: SourceFile): number; +>getChildCount : (sourceFile?: SourceFile) => number +>sourceFile : SourceFile +>SourceFile : SourceFile + + getChildAt(index: number, sourceFile?: SourceFile): Node; +>getChildAt : (index: number, sourceFile?: SourceFile) => Node +>index : number +>sourceFile : SourceFile +>SourceFile : SourceFile +>Node : Node + + getChildren(sourceFile?: SourceFile): Node[]; +>getChildren : (sourceFile?: SourceFile) => Node[] +>sourceFile : SourceFile +>SourceFile : SourceFile +>Node : Node + + getStart(sourceFile?: SourceFile): number; +>getStart : (sourceFile?: SourceFile) => number +>sourceFile : SourceFile +>SourceFile : SourceFile + + getFullStart(): number; +>getFullStart : () => number + + getEnd(): number; +>getEnd : () => number + + getWidth(sourceFile?: SourceFile): number; +>getWidth : (sourceFile?: SourceFile) => number +>sourceFile : SourceFile +>SourceFile : SourceFile + + getFullWidth(): number; +>getFullWidth : () => number + + getLeadingTriviaWidth(sourceFile?: SourceFile): number; +>getLeadingTriviaWidth : (sourceFile?: SourceFile) => number +>sourceFile : SourceFile +>SourceFile : SourceFile + + getFullText(sourceFile?: SourceFile): string; +>getFullText : (sourceFile?: SourceFile) => string +>sourceFile : SourceFile +>SourceFile : SourceFile + + getText(sourceFile?: SourceFile): string; +>getText : (sourceFile?: SourceFile) => string +>sourceFile : SourceFile +>SourceFile : SourceFile + + getFirstToken(sourceFile?: SourceFile): Node; +>getFirstToken : (sourceFile?: SourceFile) => Node +>sourceFile : SourceFile +>SourceFile : SourceFile +>Node : Node + + getLastToken(sourceFile?: SourceFile): Node; +>getLastToken : (sourceFile?: SourceFile) => Node +>sourceFile : SourceFile +>SourceFile : SourceFile +>Node : Node + } + interface Symbol { +>Symbol : Symbol + + getFlags(): SymbolFlags; +>getFlags : () => SymbolFlags +>SymbolFlags : SymbolFlags + + getName(): string; +>getName : () => string + + getDeclarations(): Declaration[]; +>getDeclarations : () => Declaration[] +>Declaration : Declaration + + getDocumentationComment(): SymbolDisplayPart[]; +>getDocumentationComment : () => SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + interface Type { +>Type : Type + + getFlags(): TypeFlags; +>getFlags : () => TypeFlags +>TypeFlags : TypeFlags + + getSymbol(): Symbol; +>getSymbol : () => Symbol +>Symbol : Symbol + + getProperties(): Symbol[]; +>getProperties : () => Symbol[] +>Symbol : Symbol + + getProperty(propertyName: string): Symbol; +>getProperty : (propertyName: string) => Symbol +>propertyName : string +>Symbol : Symbol + + getApparentProperties(): Symbol[]; +>getApparentProperties : () => Symbol[] +>Symbol : Symbol + + getCallSignatures(): Signature[]; +>getCallSignatures : () => Signature[] +>Signature : Signature + + getConstructSignatures(): Signature[]; +>getConstructSignatures : () => Signature[] +>Signature : Signature + + getStringIndexType(): Type; +>getStringIndexType : () => Type +>Type : Type + + getNumberIndexType(): Type; +>getNumberIndexType : () => Type +>Type : Type + } + interface Signature { +>Signature : Signature + + getDeclaration(): SignatureDeclaration; +>getDeclaration : () => SignatureDeclaration +>SignatureDeclaration : SignatureDeclaration + + getTypeParameters(): Type[]; +>getTypeParameters : () => Type[] +>Type : Type + + getParameters(): Symbol[]; +>getParameters : () => Symbol[] +>Symbol : Symbol + + getReturnType(): Type; +>getReturnType : () => Type +>Type : Type + + getDocumentationComment(): SymbolDisplayPart[]; +>getDocumentationComment : () => SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + interface SourceFile { +>SourceFile : SourceFile + + getNamedDeclarations(): Declaration[]; +>getNamedDeclarations : () => Declaration[] +>Declaration : Declaration + + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; +>getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter +>pos : number +>LineAndCharacter : LineAndCharacter + + getLineStarts(): number[]; +>getLineStarts : () => number[] + + getPositionOfLineAndCharacter(line: number, character: number): number; +>getPositionOfLineAndCharacter : (line: number, character: number) => number +>line : number +>character : number + + update(newText: string, textChangeRange: TextChangeRange): SourceFile; +>update : (newText: string, textChangeRange: TextChangeRange) => SourceFile +>newText : string +>textChangeRange : TextChangeRange +>TextChangeRange : TextChangeRange +>SourceFile : SourceFile + } + /** + * Represents an immutable snapshot of a script at a specified time.Once acquired, the + * snapshot is observably immutable. i.e. the same calls with the same parameters will return + * the same values. + */ + interface IScriptSnapshot { +>IScriptSnapshot : IScriptSnapshot + + /** Gets a portion of the script snapshot specified by [start, end). */ + getText(start: number, end: number): string; +>getText : (start: number, end: number) => string +>start : number +>end : number + + /** Gets the length of this script snapshot. */ + getLength(): number; +>getLength : () => number + + /** + * Gets the TextChangeRange that describe how the text changed between this text and + * an older version. This information is used by the incremental parser to determine + * what sections of the script need to be re-parsed. 'undefined' can be returned if the + * change range cannot be determined. However, in that case, incremental parsing will + * not happen and the entire document will be re - parsed. + */ + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; +>getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange +>oldSnapshot : IScriptSnapshot +>IScriptSnapshot : IScriptSnapshot +>TextChangeRange : TextChangeRange + } + module ScriptSnapshot { +>ScriptSnapshot : typeof ScriptSnapshot + + function fromString(text: string): IScriptSnapshot; +>fromString : (text: string) => IScriptSnapshot +>text : string +>IScriptSnapshot : IScriptSnapshot + } + interface PreProcessedFileInfo { +>PreProcessedFileInfo : PreProcessedFileInfo + + referencedFiles: FileReference[]; +>referencedFiles : FileReference[] +>FileReference : FileReference + + importedFiles: FileReference[]; +>importedFiles : FileReference[] +>FileReference : FileReference + + isLibFile: boolean; +>isLibFile : boolean + } + interface LanguageServiceHost { +>LanguageServiceHost : LanguageServiceHost + + getCompilationSettings(): CompilerOptions; +>getCompilationSettings : () => CompilerOptions +>CompilerOptions : CompilerOptions + + getNewLine?(): string; +>getNewLine : () => string + + getScriptFileNames(): string[]; +>getScriptFileNames : () => string[] + + getScriptVersion(fileName: string): string; +>getScriptVersion : (fileName: string) => string +>fileName : string + + getScriptSnapshot(fileName: string): IScriptSnapshot; +>getScriptSnapshot : (fileName: string) => IScriptSnapshot +>fileName : string +>IScriptSnapshot : IScriptSnapshot + + getLocalizedDiagnosticMessages?(): any; +>getLocalizedDiagnosticMessages : () => any + + getCancellationToken?(): CancellationToken; +>getCancellationToken : () => CancellationToken +>CancellationToken : CancellationToken + + getCurrentDirectory(): string; +>getCurrentDirectory : () => string + + getDefaultLibFileName(options: CompilerOptions): string; +>getDefaultLibFileName : (options: CompilerOptions) => string +>options : CompilerOptions +>CompilerOptions : CompilerOptions + + log?(s: string): void; +>log : (s: string) => void +>s : string + + trace?(s: string): void; +>trace : (s: string) => void +>s : string + + error?(s: string): void; +>error : (s: string) => void +>s : string + } + interface LanguageService { +>LanguageService : LanguageService + + cleanupSemanticCache(): void; +>cleanupSemanticCache : () => void + + getSyntacticDiagnostics(fileName: string): Diagnostic[]; +>getSyntacticDiagnostics : (fileName: string) => Diagnostic[] +>fileName : string +>Diagnostic : Diagnostic + + getSemanticDiagnostics(fileName: string): Diagnostic[]; +>getSemanticDiagnostics : (fileName: string) => Diagnostic[] +>fileName : string +>Diagnostic : Diagnostic + + getCompilerOptionsDiagnostics(): Diagnostic[]; +>getCompilerOptionsDiagnostics : () => Diagnostic[] +>Diagnostic : Diagnostic + + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; +>getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] +>fileName : string +>span : TextSpan +>TextSpan : TextSpan +>ClassifiedSpan : ClassifiedSpan + + getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; +>getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] +>fileName : string +>span : TextSpan +>TextSpan : TextSpan +>ClassifiedSpan : ClassifiedSpan + + getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; +>getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo +>fileName : string +>position : number +>CompletionInfo : CompletionInfo + + getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; +>getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails +>fileName : string +>position : number +>entryName : string +>CompletionEntryDetails : CompletionEntryDetails + + getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; +>getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo +>fileName : string +>position : number +>QuickInfo : QuickInfo + + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; +>getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan +>fileName : string +>startPos : number +>endPos : number +>TextSpan : TextSpan + + getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; +>getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan +>fileName : string +>position : number +>TextSpan : TextSpan + + getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; +>getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems +>fileName : string +>position : number +>SignatureHelpItems : SignatureHelpItems + + getRenameInfo(fileName: string, position: number): RenameInfo; +>getRenameInfo : (fileName: string, position: number) => RenameInfo +>fileName : string +>position : number +>RenameInfo : RenameInfo + + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; +>findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] +>fileName : string +>position : number +>findInStrings : boolean +>findInComments : boolean +>RenameLocation : RenameLocation + + getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; +>getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] +>fileName : string +>position : number +>DefinitionInfo : DefinitionInfo + + getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; +>getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] +>fileName : string +>position : number +>ReferenceEntry : ReferenceEntry + + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; +>getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] +>fileName : string +>position : number +>ReferenceEntry : ReferenceEntry + + findReferences(fileName: string, position: number): ReferencedSymbol[]; +>findReferences : (fileName: string, position: number) => ReferencedSymbol[] +>fileName : string +>position : number +>ReferencedSymbol : ReferencedSymbol + + getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; +>getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] +>searchValue : string +>maxResultCount : number +>NavigateToItem : NavigateToItem + + getNavigationBarItems(fileName: string): NavigationBarItem[]; +>getNavigationBarItems : (fileName: string) => NavigationBarItem[] +>fileName : string +>NavigationBarItem : NavigationBarItem + + getOutliningSpans(fileName: string): OutliningSpan[]; +>getOutliningSpans : (fileName: string) => OutliningSpan[] +>fileName : string +>OutliningSpan : OutliningSpan + + getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; +>getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] +>fileName : string +>descriptors : TodoCommentDescriptor[] +>TodoCommentDescriptor : TodoCommentDescriptor +>TodoComment : TodoComment + + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; +>getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] +>fileName : string +>position : number +>TextSpan : TextSpan + + getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; +>getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number +>fileName : string +>position : number +>options : EditorOptions +>EditorOptions : EditorOptions + + getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; +>getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] +>fileName : string +>start : number +>end : number +>options : FormatCodeOptions +>FormatCodeOptions : FormatCodeOptions +>TextChange : TextChange + + getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; +>getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] +>fileName : string +>options : FormatCodeOptions +>FormatCodeOptions : FormatCodeOptions +>TextChange : TextChange + + getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; +>getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] +>fileName : string +>position : number +>key : string +>options : FormatCodeOptions +>FormatCodeOptions : FormatCodeOptions +>TextChange : TextChange + + getEmitOutput(fileName: string): EmitOutput; +>getEmitOutput : (fileName: string) => EmitOutput +>fileName : string +>EmitOutput : EmitOutput + + getProgram(): Program; +>getProgram : () => Program +>Program : Program + + getSourceFile(fileName: string): SourceFile; +>getSourceFile : (fileName: string) => SourceFile +>fileName : string +>SourceFile : SourceFile + + dispose(): void; +>dispose : () => void + } + interface ClassifiedSpan { +>ClassifiedSpan : ClassifiedSpan + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + classificationType: string; +>classificationType : string + } + interface NavigationBarItem { +>NavigationBarItem : NavigationBarItem + + text: string; +>text : string + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + spans: TextSpan[]; +>spans : TextSpan[] +>TextSpan : TextSpan + + childItems: NavigationBarItem[]; +>childItems : NavigationBarItem[] +>NavigationBarItem : NavigationBarItem + + indent: number; +>indent : number + + bolded: boolean; +>bolded : boolean + + grayed: boolean; +>grayed : boolean + } + interface TodoCommentDescriptor { +>TodoCommentDescriptor : TodoCommentDescriptor + + text: string; +>text : string + + priority: number; +>priority : number + } + interface TodoComment { +>TodoComment : TodoComment + + descriptor: TodoCommentDescriptor; +>descriptor : TodoCommentDescriptor +>TodoCommentDescriptor : TodoCommentDescriptor + + message: string; +>message : string + + position: number; +>position : number + } + class TextChange { +>TextChange : TextChange + + span: TextSpan; +>span : TextSpan +>TextSpan : TextSpan + + newText: string; +>newText : string + } + interface RenameLocation { +>RenameLocation : RenameLocation + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + fileName: string; +>fileName : string + } + interface ReferenceEntry { +>ReferenceEntry : ReferenceEntry + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + fileName: string; +>fileName : string + + isWriteAccess: boolean; +>isWriteAccess : boolean + } + interface NavigateToItem { +>NavigateToItem : NavigateToItem + + name: string; +>name : string + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + matchKind: string; +>matchKind : string + + isCaseSensitive: boolean; +>isCaseSensitive : boolean + + fileName: string; +>fileName : string + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + containerName: string; +>containerName : string + + containerKind: string; +>containerKind : string + } + interface EditorOptions { +>EditorOptions : EditorOptions + + IndentSize: number; +>IndentSize : number + + TabSize: number; +>TabSize : number + + NewLineCharacter: string; +>NewLineCharacter : string + + ConvertTabsToSpaces: boolean; +>ConvertTabsToSpaces : boolean + } + interface FormatCodeOptions extends EditorOptions { +>FormatCodeOptions : FormatCodeOptions +>EditorOptions : EditorOptions + + InsertSpaceAfterCommaDelimiter: boolean; +>InsertSpaceAfterCommaDelimiter : boolean + + InsertSpaceAfterSemicolonInForStatements: boolean; +>InsertSpaceAfterSemicolonInForStatements : boolean + + InsertSpaceBeforeAndAfterBinaryOperators: boolean; +>InsertSpaceBeforeAndAfterBinaryOperators : boolean + + InsertSpaceAfterKeywordsInControlFlowStatements: boolean; +>InsertSpaceAfterKeywordsInControlFlowStatements : boolean + + InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; +>InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean + + InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; +>InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean + + PlaceOpenBraceOnNewLineForFunctions: boolean; +>PlaceOpenBraceOnNewLineForFunctions : boolean + + PlaceOpenBraceOnNewLineForControlBlocks: boolean; +>PlaceOpenBraceOnNewLineForControlBlocks : boolean + + [s: string]: boolean | number | string; +>s : string + } + interface DefinitionInfo { +>DefinitionInfo : DefinitionInfo + + fileName: string; +>fileName : string + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + kind: string; +>kind : string + + name: string; +>name : string + + containerKind: string; +>containerKind : string + + containerName: string; +>containerName : string + } + interface ReferencedSymbol { +>ReferencedSymbol : ReferencedSymbol + + definition: DefinitionInfo; +>definition : DefinitionInfo +>DefinitionInfo : DefinitionInfo + + references: ReferenceEntry[]; +>references : ReferenceEntry[] +>ReferenceEntry : ReferenceEntry + } + enum SymbolDisplayPartKind { +>SymbolDisplayPartKind : SymbolDisplayPartKind + + aliasName = 0, +>aliasName : SymbolDisplayPartKind + + className = 1, +>className : SymbolDisplayPartKind + + enumName = 2, +>enumName : SymbolDisplayPartKind + + fieldName = 3, +>fieldName : SymbolDisplayPartKind + + interfaceName = 4, +>interfaceName : SymbolDisplayPartKind + + keyword = 5, +>keyword : SymbolDisplayPartKind + + lineBreak = 6, +>lineBreak : SymbolDisplayPartKind + + numericLiteral = 7, +>numericLiteral : SymbolDisplayPartKind + + stringLiteral = 8, +>stringLiteral : SymbolDisplayPartKind + + localName = 9, +>localName : SymbolDisplayPartKind + + methodName = 10, +>methodName : SymbolDisplayPartKind + + moduleName = 11, +>moduleName : SymbolDisplayPartKind + + operator = 12, +>operator : SymbolDisplayPartKind + + parameterName = 13, +>parameterName : SymbolDisplayPartKind + + propertyName = 14, +>propertyName : SymbolDisplayPartKind + + punctuation = 15, +>punctuation : SymbolDisplayPartKind + + space = 16, +>space : SymbolDisplayPartKind + + text = 17, +>text : SymbolDisplayPartKind + + typeParameterName = 18, +>typeParameterName : SymbolDisplayPartKind + + enumMemberName = 19, +>enumMemberName : SymbolDisplayPartKind + + functionName = 20, +>functionName : SymbolDisplayPartKind + + regularExpressionLiteral = 21, +>regularExpressionLiteral : SymbolDisplayPartKind + } + interface SymbolDisplayPart { +>SymbolDisplayPart : SymbolDisplayPart + + text: string; +>text : string + + kind: string; +>kind : string + } + interface QuickInfo { +>QuickInfo : QuickInfo + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + displayParts: SymbolDisplayPart[]; +>displayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + documentation: SymbolDisplayPart[]; +>documentation : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + interface RenameInfo { +>RenameInfo : RenameInfo + + canRename: boolean; +>canRename : boolean + + localizedErrorMessage: string; +>localizedErrorMessage : string + + displayName: string; +>displayName : string + + fullDisplayName: string; +>fullDisplayName : string + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + triggerSpan: TextSpan; +>triggerSpan : TextSpan +>TextSpan : TextSpan + } + interface SignatureHelpParameter { +>SignatureHelpParameter : SignatureHelpParameter + + name: string; +>name : string + + documentation: SymbolDisplayPart[]; +>documentation : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + displayParts: SymbolDisplayPart[]; +>displayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + isOptional: boolean; +>isOptional : boolean + } + /** + * Represents a single signature to show in signature help. + * The id is used for subsequent calls into the language service to ask questions about the + * signature help item in the context of any documents that have been updated. i.e. after + * an edit has happened, while signature help is still active, the host can ask important + * questions like 'what parameter is the user currently contained within?'. + */ + interface SignatureHelpItem { +>SignatureHelpItem : SignatureHelpItem + + isVariadic: boolean; +>isVariadic : boolean + + prefixDisplayParts: SymbolDisplayPart[]; +>prefixDisplayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + suffixDisplayParts: SymbolDisplayPart[]; +>suffixDisplayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + separatorDisplayParts: SymbolDisplayPart[]; +>separatorDisplayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + parameters: SignatureHelpParameter[]; +>parameters : SignatureHelpParameter[] +>SignatureHelpParameter : SignatureHelpParameter + + documentation: SymbolDisplayPart[]; +>documentation : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + /** + * Represents a set of signature help items, and the preferred item that should be selected. + */ + interface SignatureHelpItems { +>SignatureHelpItems : SignatureHelpItems + + items: SignatureHelpItem[]; +>items : SignatureHelpItem[] +>SignatureHelpItem : SignatureHelpItem + + applicableSpan: TextSpan; +>applicableSpan : TextSpan +>TextSpan : TextSpan + + selectedItemIndex: number; +>selectedItemIndex : number + + argumentIndex: number; +>argumentIndex : number + + argumentCount: number; +>argumentCount : number + } + interface CompletionInfo { +>CompletionInfo : CompletionInfo + + isMemberCompletion: boolean; +>isMemberCompletion : boolean + + isNewIdentifierLocation: boolean; +>isNewIdentifierLocation : boolean + + entries: CompletionEntry[]; +>entries : CompletionEntry[] +>CompletionEntry : CompletionEntry + } + interface CompletionEntry { +>CompletionEntry : CompletionEntry + + name: string; +>name : string + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + sortText: string; +>sortText : string + } + interface CompletionEntryDetails { +>CompletionEntryDetails : CompletionEntryDetails + + name: string; +>name : string + + kind: string; +>kind : string + + kindModifiers: string; +>kindModifiers : string + + displayParts: SymbolDisplayPart[]; +>displayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + documentation: SymbolDisplayPart[]; +>documentation : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + interface OutliningSpan { +>OutliningSpan : OutliningSpan + + /** The span of the document to actually collapse. */ + textSpan: TextSpan; +>textSpan : TextSpan +>TextSpan : TextSpan + + /** The span of the document to display when the user hovers over the collapsed span. */ + hintSpan: TextSpan; +>hintSpan : TextSpan +>TextSpan : TextSpan + + /** The text to display in the editor for the collapsed region. */ + bannerText: string; +>bannerText : string + + /** + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ + autoCollapse: boolean; +>autoCollapse : boolean + } + interface EmitOutput { +>EmitOutput : EmitOutput + + outputFiles: OutputFile[]; +>outputFiles : OutputFile[] +>OutputFile : OutputFile + + emitSkipped: boolean; +>emitSkipped : boolean + } + const enum OutputFileType { +>OutputFileType : OutputFileType + + JavaScript = 0, +>JavaScript : OutputFileType + + SourceMap = 1, +>SourceMap : OutputFileType + + Declaration = 2, +>Declaration : OutputFileType + } + interface OutputFile { +>OutputFile : OutputFile + + name: string; +>name : string + + writeByteOrderMark: boolean; +>writeByteOrderMark : boolean + + text: string; +>text : string + } + const enum EndOfLineState { +>EndOfLineState : EndOfLineState + + Start = 0, +>Start : EndOfLineState + + InMultiLineCommentTrivia = 1, +>InMultiLineCommentTrivia : EndOfLineState + + InSingleQuoteStringLiteral = 2, +>InSingleQuoteStringLiteral : EndOfLineState + + InDoubleQuoteStringLiteral = 3, +>InDoubleQuoteStringLiteral : EndOfLineState + + InTemplateHeadOrNoSubstitutionTemplate = 4, +>InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState + + InTemplateMiddleOrTail = 5, +>InTemplateMiddleOrTail : EndOfLineState + + InTemplateSubstitutionPosition = 6, +>InTemplateSubstitutionPosition : EndOfLineState + } + enum TokenClass { +>TokenClass : TokenClass + + Punctuation = 0, +>Punctuation : TokenClass + + Keyword = 1, +>Keyword : TokenClass + + Operator = 2, +>Operator : TokenClass + + Comment = 3, +>Comment : TokenClass + + Whitespace = 4, +>Whitespace : TokenClass + + Identifier = 5, +>Identifier : TokenClass + + NumberLiteral = 6, +>NumberLiteral : TokenClass + + StringLiteral = 7, +>StringLiteral : TokenClass + + RegExpLiteral = 8, +>RegExpLiteral : TokenClass + } + interface ClassificationResult { +>ClassificationResult : ClassificationResult + + finalLexState: EndOfLineState; +>finalLexState : EndOfLineState +>EndOfLineState : EndOfLineState + + entries: ClassificationInfo[]; +>entries : ClassificationInfo[] +>ClassificationInfo : ClassificationInfo + } + interface ClassificationInfo { +>ClassificationInfo : ClassificationInfo + + length: number; +>length : number + + classification: TokenClass; +>classification : TokenClass +>TokenClass : TokenClass + } + interface Classifier { +>Classifier : Classifier + + /** + * Gives lexical classifications of tokens on a line without any syntactic context. + * For instance, a token consisting of the text 'string' can be either an identifier + * named 'string' or the keyword 'string', however, because this classifier is not aware, + * it relies on certain heuristics to give acceptable results. For classifications where + * speed trumps accuracy, this function is preferable; however, for true accuracy, the + * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the + * lexical, syntactic, and semantic classifiers may issue the best user experience. + * + * @param text The text of a line to classify. + * @param lexState The state of the lexical classifier at the end of the previous line. + * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. + * If there is no syntactic classifier (syntacticClassifierAbsent=true), + * certain heuristics may be used in its place; however, if there is a + * syntactic classifier (syntacticClassifierAbsent=false), certain + * classifications which may be incorrectly categorized will be given + * back as Identifiers in order to allow the syntactic classifier to + * subsume the classification. + */ + getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; +>getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult +>text : string +>lexState : EndOfLineState +>EndOfLineState : EndOfLineState +>syntacticClassifierAbsent : boolean +>ClassificationResult : ClassificationResult + } + /** + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ + interface DocumentRegistry { +>DocumentRegistry : DocumentRegistry + + /** + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ + acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; +>acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile +>fileName : string +>compilationSettings : CompilerOptions +>CompilerOptions : CompilerOptions +>scriptSnapshot : IScriptSnapshot +>IScriptSnapshot : IScriptSnapshot +>version : string +>SourceFile : SourceFile + + /** + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ + updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; +>updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile +>fileName : string +>compilationSettings : CompilerOptions +>CompilerOptions : CompilerOptions +>scriptSnapshot : IScriptSnapshot +>IScriptSnapshot : IScriptSnapshot +>version : string +>SourceFile : SourceFile + + /** + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ + releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; +>releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void +>fileName : string +>compilationSettings : CompilerOptions +>CompilerOptions : CompilerOptions + } + class ScriptElementKind { +>ScriptElementKind : ScriptElementKind + + static unknown: string; +>unknown : string + + static warning: string; +>warning : string + + static keyword: string; +>keyword : string + + static scriptElement: string; +>scriptElement : string + + static moduleElement: string; +>moduleElement : string + + static classElement: string; +>classElement : string + + static interfaceElement: string; +>interfaceElement : string + + static typeElement: string; +>typeElement : string + + static enumElement: string; +>enumElement : string + + static variableElement: string; +>variableElement : string + + static localVariableElement: string; +>localVariableElement : string + + static functionElement: string; +>functionElement : string + + static localFunctionElement: string; +>localFunctionElement : string + + static memberFunctionElement: string; +>memberFunctionElement : string + + static memberGetAccessorElement: string; +>memberGetAccessorElement : string + + static memberSetAccessorElement: string; +>memberSetAccessorElement : string + + static memberVariableElement: string; +>memberVariableElement : string + + static constructorImplementationElement: string; +>constructorImplementationElement : string + + static callSignatureElement: string; +>callSignatureElement : string + + static indexSignatureElement: string; +>indexSignatureElement : string + + static constructSignatureElement: string; +>constructSignatureElement : string + + static parameterElement: string; +>parameterElement : string + + static typeParameterElement: string; +>typeParameterElement : string + + static primitiveType: string; +>primitiveType : string + + static label: string; +>label : string + + static alias: string; +>alias : string + + static constElement: string; +>constElement : string + + static letElement: string; +>letElement : string + } + class ScriptElementKindModifier { +>ScriptElementKindModifier : ScriptElementKindModifier + + static none: string; +>none : string + + static publicMemberModifier: string; +>publicMemberModifier : string + + static privateMemberModifier: string; +>privateMemberModifier : string + + static protectedMemberModifier: string; +>protectedMemberModifier : string + + static exportedModifier: string; +>exportedModifier : string + + static ambientModifier: string; +>ambientModifier : string + + static staticModifier: string; +>staticModifier : string + } + class ClassificationTypeNames { +>ClassificationTypeNames : ClassificationTypeNames + + static comment: string; +>comment : string + + static identifier: string; +>identifier : string + + static keyword: string; +>keyword : string + + static numericLiteral: string; +>numericLiteral : string + + static operator: string; +>operator : string + + static stringLiteral: string; +>stringLiteral : string + + static whiteSpace: string; +>whiteSpace : string + + static text: string; +>text : string + + static punctuation: string; +>punctuation : string + + static className: string; +>className : string + + static enumName: string; +>enumName : string + + static interfaceName: string; +>interfaceName : string + + static moduleName: string; +>moduleName : string + + static typeParameterName: string; +>typeParameterName : string + + static typeAlias: string; +>typeAlias : string + } + interface DisplayPartsSymbolWriter extends SymbolWriter { +>DisplayPartsSymbolWriter : DisplayPartsSymbolWriter +>SymbolWriter : SymbolWriter + + displayParts(): SymbolDisplayPart[]; +>displayParts : () => SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + } + function displayPartsToString(displayParts: SymbolDisplayPart[]): string; +>displayPartsToString : (displayParts: SymbolDisplayPart[]) => string +>displayParts : SymbolDisplayPart[] +>SymbolDisplayPart : SymbolDisplayPart + + function getDefaultCompilerOptions(): CompilerOptions; +>getDefaultCompilerOptions : () => CompilerOptions +>CompilerOptions : CompilerOptions + + class OperationCanceledException { +>OperationCanceledException : OperationCanceledException + } + class CancellationTokenObject { +>CancellationTokenObject : CancellationTokenObject + + private cancellationToken; +>cancellationToken : any + + static None: CancellationTokenObject; +>None : CancellationTokenObject +>CancellationTokenObject : CancellationTokenObject + + constructor(cancellationToken: CancellationToken); +>cancellationToken : CancellationToken +>CancellationToken : CancellationToken + + isCancellationRequested(): boolean; +>isCancellationRequested : () => boolean + + throwIfCancellationRequested(): void; +>throwIfCancellationRequested : () => void + } + function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; +>transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string +>input : string +>compilerOptions : CompilerOptions +>CompilerOptions : CompilerOptions +>fileName : string +>diagnostics : Diagnostic[] +>Diagnostic : Diagnostic + + function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; +>createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile +>fileName : string +>scriptSnapshot : IScriptSnapshot +>IScriptSnapshot : IScriptSnapshot +>scriptTarget : ScriptTarget +>ScriptTarget : ScriptTarget +>version : string +>setNodeParents : boolean +>SourceFile : SourceFile + + let disableIncrementalParsing: boolean; +>disableIncrementalParsing : boolean + + function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; +>updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile +>sourceFile : SourceFile +>SourceFile : SourceFile +>scriptSnapshot : IScriptSnapshot +>IScriptSnapshot : IScriptSnapshot +>version : string +>textChangeRange : TextChangeRange +>TextChangeRange : TextChangeRange +>aggressiveChecks : boolean +>SourceFile : SourceFile + + function createDocumentRegistry(): DocumentRegistry; +>createDocumentRegistry : () => DocumentRegistry +>DocumentRegistry : DocumentRegistry + + function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; +>preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo +>sourceText : string +>readImportFiles : boolean +>PreProcessedFileInfo : PreProcessedFileInfo + + function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; +>createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService +>host : LanguageServiceHost +>LanguageServiceHost : LanguageServiceHost +>documentRegistry : DocumentRegistry +>DocumentRegistry : DocumentRegistry +>LanguageService : LanguageService + + function createClassifier(): Classifier; +>createClassifier : () => Classifier +>Classifier : Classifier + + /** + * Get the path of the default library file (lib.d.ts) as distributed with the typescript + * node package. + * The functionality is not supported if the ts module is consumed outside of a node module. + */ + function getDefaultLibFilePath(options: CompilerOptions): string; +>getDefaultLibFilePath : (options: CompilerOptions) => string +>options : CompilerOptions +>CompilerOptions : CompilerOptions +} + diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index 6bdf755ae12..c40d33110e1 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -828,6 +828,7 @@ declare module "typescript" { } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4bd248d70c7..534bced2129 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -2515,6 +2515,10 @@ declare module "typescript" { hasTrailingNewLine?: boolean; >hasTrailingNewLine : boolean + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind } interface SourceFile extends Declaration { >SourceFile : SourceFile diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 3c11e27f0e1..a7d706de83a 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -865,6 +865,7 @@ declare module "typescript" { } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index f38cdc9b1af..68114fabf7c 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -2688,6 +2688,10 @@ declare module "typescript" { hasTrailingNewLine?: boolean; >hasTrailingNewLine : boolean + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind } interface SourceFile extends Declaration { >SourceFile : SourceFile From a4b8276ff1261da52dadd2eb14939747ecbcb2ae Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 14:56:19 -0700 Subject: [PATCH 25/69] updating tests --- .../reference/APISample_linter.js.bak | 2114 ------ .../reference/APISample_linter.types.bak | 6438 ----------------- 2 files changed, 8552 deletions(-) delete mode 100644 tests/baselines/reference/APISample_linter.js.bak delete mode 100644 tests/baselines/reference/APISample_linter.types.bak diff --git a/tests/baselines/reference/APISample_linter.js.bak b/tests/baselines/reference/APISample_linter.js.bak deleted file mode 100644 index f59fa91da14..00000000000 --- a/tests/baselines/reference/APISample_linter.js.bak +++ /dev/null @@ -1,2114 +0,0 @@ -//// [tests/cases/compiler/APISample_linter.ts] //// - -//// [APISample_linter.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var fs: any; - -import ts = require("typescript"); - -export function delint(sourceFile: ts.SourceFile) { - delintNode(sourceFile); - - function delintNode(node: ts.Node) { - switch (node.kind) { - case ts.SyntaxKind.ForStatement: - case ts.SyntaxKind.ForInStatement: - case ts.SyntaxKind.WhileStatement: - case ts.SyntaxKind.DoStatement: - if ((node).statement.kind !== ts.SyntaxKind.Block) { - report(node, "A looping statement's contents should be wrapped in a block body."); - } - break; - case ts.SyntaxKind.IfStatement: - var ifStatement = (node); - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); - } - if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); - } - break; - - case ts.SyntaxKind.BinaryExpression: - var op = (node).operatorToken.kind; - - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { - report(node, "Use '===' and '!=='.") - } - break; - } - - ts.forEachChild(node, delintNode); - } - - function report(node: ts.Node, message: string) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) - } -} - -var fileNames = process.argv.slice(2); -fileNames.forEach(fileName => { - // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); - - // delint it - delint(sourceFile); -}); - -//// [typescript.d.ts] -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface HeritageClauseElement extends Node { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - separateCompilation?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static warning: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - - -//// [APISample_linter.js] -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ -var ts = require("typescript"); -function delint(sourceFile) { - delintNode(sourceFile); - function delintNode(node) { - switch (node.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: - if (node.statement.kind !== 179 /* Block */) { - report(node, "A looping statement's contents should be wrapped in a block body."); - } - break; - case 183 /* IfStatement */: - var ifStatement = node; - if (ifStatement.thenStatement.kind !== 179 /* Block */) { - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); - } - if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 179 /* Block */ && ifStatement.elseStatement.kind !== 183 /* IfStatement */) { - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); - } - break; - case 169 /* BinaryExpression */: - var op = node.operatorToken.kind; - if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { - report(node, "Use '===' and '!=='."); - } - break; - } - ts.forEachChild(node, delintNode); - } - function report(node, message) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(sourceFile.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + message); - } -} -exports.delint = delint; -var fileNames = process.argv.slice(2); -fileNames.forEach(function (fileName) { - // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), 2 /* ES6 */, true); - // delint it - delint(sourceFile); -}); diff --git a/tests/baselines/reference/APISample_linter.types.bak b/tests/baselines/reference/APISample_linter.types.bak deleted file mode 100644 index 12f4ac12fdc..00000000000 --- a/tests/baselines/reference/APISample_linter.types.bak +++ /dev/null @@ -1,6438 +0,0 @@ -=== tests/cases/compiler/APISample_linter.ts === - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; ->process : any - -declare var console: any; ->console : any - -declare var fs: any; ->fs : any - -import ts = require("typescript"); ->ts : typeof ts - -export function delint(sourceFile: ts.SourceFile) { ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile ->ts : unknown ->SourceFile : ts.SourceFile - - delintNode(sourceFile); ->delintNode(sourceFile) : void ->delintNode : (node: ts.Node) => void ->sourceFile : ts.SourceFile - - function delintNode(node: ts.Node) { ->delintNode : (node: ts.Node) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node - - switch (node.kind) { ->node.kind : ts.SyntaxKind ->node : ts.Node ->kind : ts.SyntaxKind - - case ts.SyntaxKind.ForStatement: ->ts.SyntaxKind.ForStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForStatement : ts.SyntaxKind - - case ts.SyntaxKind.ForInStatement: ->ts.SyntaxKind.ForInStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForInStatement : ts.SyntaxKind - - case ts.SyntaxKind.WhileStatement: ->ts.SyntaxKind.WhileStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->WhileStatement : ts.SyntaxKind - - case ts.SyntaxKind.DoStatement: ->ts.SyntaxKind.DoStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->DoStatement : ts.SyntaxKind - - if ((node).statement.kind !== ts.SyntaxKind.Block) { ->(node).statement.kind !== ts.SyntaxKind.Block : boolean ->(node).statement.kind : ts.SyntaxKind ->(node).statement : ts.Statement ->(node) : ts.IterationStatement ->node : ts.IterationStatement ->ts : unknown ->IterationStatement : ts.IterationStatement ->node : ts.Node ->statement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - report(node, "A looping statement's contents should be wrapped in a block body."); ->report(node, "A looping statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->node : ts.Node - } - break; - case ts.SyntaxKind.IfStatement: ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - var ifStatement = (node); ->ifStatement : ts.IfStatement ->(node) : ts.IfStatement ->node : ts.IfStatement ->ts : unknown ->IfStatement : ts.IfStatement ->node : ts.Node - - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { ->ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.thenStatement.kind : ts.SyntaxKind ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->thenStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); ->report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->thenStatement : ts.Statement - } - if (ifStatement.elseStatement && ->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean ->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { ->ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.elseStatement.kind : ts.SyntaxKind ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind ->ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean ->ifStatement.elseStatement.kind : ts.SyntaxKind ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); ->report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - } - break; - - case ts.SyntaxKind.BinaryExpression: ->ts.SyntaxKind.BinaryExpression : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->BinaryExpression : ts.SyntaxKind - - var op = (node).operatorToken.kind; ->op : ts.SyntaxKind ->(node).operatorToken.kind : ts.SyntaxKind ->(node).operatorToken : ts.Node ->(node) : ts.BinaryExpression ->node : ts.BinaryExpression ->ts : unknown ->BinaryExpression : ts.BinaryExpression ->node : ts.Node ->operatorToken : ts.Node ->kind : ts.SyntaxKind - - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { ->op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken : boolean ->op === ts.SyntaxKind.EqualsEqualsToken : boolean ->op : ts.SyntaxKind ->ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->EqualsEqualsToken : ts.SyntaxKind ->op === ts.SyntaxKind.ExclamationEqualsToken : boolean ->op : ts.SyntaxKind ->ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ExclamationEqualsToken : ts.SyntaxKind - - report(node, "Use '===' and '!=='.") ->report(node, "Use '===' and '!=='.") : void ->report : (node: ts.Node, message: string) => void ->node : ts.Node - } - break; - } - - ts.forEachChild(node, delintNode); ->ts.forEachChild(node, delintNode) : void ->ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T ->ts : typeof ts ->forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T ->node : ts.Node ->delintNode : (node: ts.Node) => void - } - - function report(node: ts.Node, message: string) { ->report : (node: ts.Node, message: string) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node ->message : string - - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); ->lineChar : ts.LineAndCharacter ->sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter ->sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->sourceFile : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile) => number ->node : ts.Node ->getStart : (sourceFile?: ts.SourceFile) => number - - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) ->console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) : any ->console.log : any ->console : any ->log : any ->sourceFile.fileName : string ->sourceFile : ts.SourceFile ->fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter ->line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter ->character : number ->message : string - } -} - -var fileNames = process.argv.slice(2); ->fileNames : any ->process.argv.slice(2) : any ->process.argv.slice : any ->process.argv : any ->process : any ->argv : any ->slice : any - -fileNames.forEach(fileName => { ->fileNames.forEach(fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any ->fileNames.forEach : any ->fileNames : any ->forEach : any ->fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void ->fileName : any - - // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); ->sourceFile : ts.SourceFile ->ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile ->ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->ts : typeof ts ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->fileName : any ->fs.readFileSync(fileName).toString() : any ->fs.readFileSync(fileName).toString : any ->fs.readFileSync(fileName) : any ->fs.readFileSync : any ->fs : any ->readFileSync : any ->fileName : any ->toString : any ->ts.ScriptTarget.ES6 : ts.ScriptTarget ->ts.ScriptTarget : typeof ts.ScriptTarget ->ts : typeof ts ->ScriptTarget : typeof ts.ScriptTarget ->ES6 : ts.ScriptTarget - - // delint it - delint(sourceFile); ->delint(sourceFile) : void ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile - -}); - -=== typescript.d.ts === -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - ClassExpression = 174, ->ClassExpression : SyntaxKind - - OmittedExpression = 175, ->OmittedExpression : SyntaxKind - - TemplateSpan = 176, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 177, ->HeritageClauseElement : SyntaxKind - - SemicolonClassElement = 178, ->SemicolonClassElement : SyntaxKind - - Block = 179, ->Block : SyntaxKind - - VariableStatement = 180, ->VariableStatement : SyntaxKind - - EmptyStatement = 181, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 182, ->ExpressionStatement : SyntaxKind - - IfStatement = 183, ->IfStatement : SyntaxKind - - DoStatement = 184, ->DoStatement : SyntaxKind - - WhileStatement = 185, ->WhileStatement : SyntaxKind - - ForStatement = 186, ->ForStatement : SyntaxKind - - ForInStatement = 187, ->ForInStatement : SyntaxKind - - ForOfStatement = 188, ->ForOfStatement : SyntaxKind - - ContinueStatement = 189, ->ContinueStatement : SyntaxKind - - BreakStatement = 190, ->BreakStatement : SyntaxKind - - ReturnStatement = 191, ->ReturnStatement : SyntaxKind - - WithStatement = 192, ->WithStatement : SyntaxKind - - SwitchStatement = 193, ->SwitchStatement : SyntaxKind - - LabeledStatement = 194, ->LabeledStatement : SyntaxKind - - ThrowStatement = 195, ->ThrowStatement : SyntaxKind - - TryStatement = 196, ->TryStatement : SyntaxKind - - DebuggerStatement = 197, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 198, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 199, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 200, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 201, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 202, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 203, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 204, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 205, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 206, ->ModuleBlock : SyntaxKind - - CaseBlock = 207, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 208, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 209, ->ImportDeclaration : SyntaxKind - - ImportClause = 210, ->ImportClause : SyntaxKind - - NamespaceImport = 211, ->NamespaceImport : SyntaxKind - - NamedImports = 212, ->NamedImports : SyntaxKind - - ImportSpecifier = 213, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 214, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 215, ->ExportDeclaration : SyntaxKind - - NamedExports = 216, ->NamedExports : SyntaxKind - - ExportSpecifier = 217, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 218, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 219, ->ExternalModuleReference : SyntaxKind - - CaseClause = 220, ->CaseClause : SyntaxKind - - DefaultClause = 221, ->DefaultClause : SyntaxKind - - HeritageClause = 222, ->HeritageClause : SyntaxKind - - CatchClause = 223, ->CatchClause : SyntaxKind - - PropertyAssignment = 224, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 225, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 226, ->EnumMember : SyntaxKind - - SourceFile = 227, ->SourceFile : SyntaxKind - - SyntaxList = 228, ->SyntaxList : SyntaxKind - - Count = 229, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface SemicolonClassElement extends ClassElement { ->SemicolonClassElement : SemicolonClassElement ->ClassElement : ClassElement - - _semicolonClassElementBrand: any; ->_semicolonClassElementBrand : any - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface HeritageClauseElement extends Node { ->HeritageClauseElement : HeritageClauseElement ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassLikeDeclaration extends Declaration { ->ClassLikeDeclaration : ClassLikeDeclaration ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { ->ClassDeclaration : ClassDeclaration ->ClassLikeDeclaration : ClassLikeDeclaration ->Statement : Statement - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { ->ClassExpression : ClassExpression ->ClassLikeDeclaration : ClassLikeDeclaration ->PrimaryExpression : PrimaryExpression - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->HeritageClauseElement : HeritageClauseElement - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends ModuleElement { ->ImportDeclaration : ImportDeclaration ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; ->getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] ->moduleSymbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | Expression | QualifiedName ->EntityName : Identifier | QualifiedName ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - separateCompilation?: boolean; ->separateCompilation : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; ->readConfigFile : (fileName: string) => any ->fileName : string - - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; ->parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine ->json : any ->basePath : string ->ParsedCommandLine : ParsedCommandLine -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - sortText: string; ->sortText : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static warning: string; ->warning : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; ->transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string ->input : string ->compilerOptions : CompilerOptions ->CompilerOptions : CompilerOptions ->fileName : string ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - From 854d5496b438dd8686fee3a84cde63974885a700 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 15:28:23 -0700 Subject: [PATCH 26/69] updating tests --- src/compiler/scanner.ts | 2 +- tests/baselines/reference/APISample_linter.types.pull | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 1e7ce744bc2..a83ec813d06 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -549,7 +549,7 @@ module ts { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); } continue; } diff --git a/tests/baselines/reference/APISample_linter.types.pull b/tests/baselines/reference/APISample_linter.types.pull index 0a2a7ea948a..a7f896c90a4 100644 --- a/tests/baselines/reference/APISample_linter.types.pull +++ b/tests/baselines/reference/APISample_linter.types.pull @@ -2565,6 +2565,10 @@ declare module "typescript" { hasTrailingNewLine?: boolean; >hasTrailingNewLine : boolean + + kind: SyntaxKind; +>kind : SyntaxKind +>SyntaxKind : SyntaxKind } interface SourceFile extends Declaration { >SourceFile : SourceFile From 7fcbb8c9a0376d5f7ccf057d21bc2cfad613ecf3 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Fri, 3 Apr 2015 19:21:27 -0700 Subject: [PATCH 27/69] adding unit tests fot block comments outlining --- src/compiler/scanner.ts | 2 +- src/services/outliningElementsCollector.ts | 18 +-- .../fourslash/getOutliningForBlockComments.ts | 104 ++++++++++++++++++ 3 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 tests/cases/fourslash/getOutliningForBlockComments.ts diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index a83ec813d06..a568667d182 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -549,7 +549,7 @@ module ts { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine, kind }); } continue; } diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 0d9895d148e..13ed3d3ea69 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -37,8 +37,7 @@ module ts { let isFirstSingleLineComment = true; let singleLineCommentCount = 0; - for (let i = 0; i < comments.length; i++) { - let currentComment = comments[i]; + for (let currentComment of comments) { // For single line comments, combine consecutive ones (2 or more) into // a single span from the start of the first till the end of the last @@ -50,9 +49,9 @@ module ts { lastSingleLineCommentEnd = currentComment.end; singleLineCommentCount++; } - else { + else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) { combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); - addOutliningSpanComments(currentComment, false); + addOutliningSpanComments(currentComment, /*autoCollapse*/ false); singleLineCommentCount = 0; lastSingleLineCommentEnd = -1; @@ -64,18 +63,16 @@ module ts { } } - function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { - + function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { // Only outline spans of two or more consecutive single line comments if (count > 1) { - let multipleSingleLineComments = { pos: start, end: end, kind: SyntaxKind.SingleLineCommentTrivia } - addOutliningSpanComments(multipleSingleLineComments, false); + addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); } } @@ -90,7 +87,10 @@ module ts { return; } - addOutliningForLeadingCommentsForNode(n); + if (isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } + switch (n.kind) { case SyntaxKind.Block: if (!isFunctionBlock(n)) { diff --git a/tests/cases/fourslash/getOutliningForBlockComments.ts b/tests/cases/fourslash/getOutliningForBlockComments.ts new file mode 100644 index 00000000000..facbe741d76 --- /dev/null +++ b/tests/cases/fourslash/getOutliningForBlockComments.ts @@ -0,0 +1,104 @@ +/// + +////[|/* +//// Comment before module: +//// line one of the comment +//// line two of the comment +//// line three +//// line four +//// line five +////*/|] +////module Sayings [|{ +//// [|/* +//// Comment before class: +//// line one of the comment +//// line two of the comment +//// line three +//// line four +//// line five +//// */|] +//// export class Greeter [|{ +//// [|/* +//// Comment before a string identifier +//// line two of the comment +//// */|] +//// greeting: string; +//// [|/* +//// constructor +//// parameter message as a string +//// */|] +//// /* This is a single line block comment style. Should not be collapsed*/ +//// [|/* +//// Multiple comments should be collapsed individually +//// */|] +//// constructor(message: string /* do not collapse single lines*/) [|{ +//// this.greeting = message; +//// }|] +//// [|/* +//// method of a class +//// */|] +//// greet() [|{ +//// return "Hello, " + this.greeting; +//// }|] +//// }|] +////}|] +//// +////[|/* +//// Block comment for interface. The ending can be on the same line as the declaration. +////*/|]interface IFoo [|{ +//// [|/* +//// Multiple block comments +//// */|] +//// +//// [|/* +//// should be collapsed +//// */|] +//// +//// [|/* +//// individually +//// */|] +//// +//// [|/* +//// this comment has trailing space before /* and after *-/ signs +//// */|] +//// +//// [|/** +//// * +//// * +//// * +//// */|] +//// +//// [|/* +//// */|] +//// +//// [|/* +//// */|] +//// // single line comments in the middle should not have an effect +//// [|/* +//// */|] +//// +//// [|/* +//// */|] +//// +//// [|/* +//// this block comment ends +//// on the same line */|] [|/* where the following comment starts +//// should be collapsed separately +//// */|] +//// +//// getDist(): number; +////}|] +//// +////var x =[|{ +//// a:1, +//// b: 2, +//// [|/* +//// Over a function in an object literal +//// */|] +//// get foo() [|{ +//// return 1; +//// }|] +////}|] +verify.outliningSpansInCurrentFile(test.ranges()); + + From 049b8fb2d0ff47cfa40bb7846e2dbdbb1a1ba62f Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Mon, 6 Apr 2015 14:42:43 -0700 Subject: [PATCH 28/69] Addressing PR comments and adding unit tests --- .../fourslash/getOutliningForBlockComments.ts | 17 ++-- .../getOutliningForSingleLineComments.ts | 81 +++++++++++++++++++ 2 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 tests/cases/fourslash/getOutliningForSingleLineComments.ts diff --git a/tests/cases/fourslash/getOutliningForBlockComments.ts b/tests/cases/fourslash/getOutliningForBlockComments.ts index facbe741d76..06b30228274 100644 --- a/tests/cases/fourslash/getOutliningForBlockComments.ts +++ b/tests/cases/fourslash/getOutliningForBlockComments.ts @@ -1,14 +1,14 @@ /// ////[|/* -//// Comment before module: +//// Block comment at the beginning of the file before module: //// line one of the comment //// line two of the comment //// line three //// line four //// line five ////*/|] -////module Sayings [|{ +////module Sayings[| { //// [|/* //// Comment before class: //// line one of the comment @@ -17,7 +17,7 @@ //// line four //// line five //// */|] -//// export class Greeter [|{ +//// export class Greeter[| { //// [|/* //// Comment before a string identifier //// line two of the comment @@ -27,17 +27,17 @@ //// constructor //// parameter message as a string //// */|] -//// /* This is a single line block comment style. Should not be collapsed*/ +//// //// [|/* //// Multiple comments should be collapsed individually //// */|] -//// constructor(message: string /* do not collapse single lines*/) [|{ +//// constructor(message: string /* do not collapse this */)[| { //// this.greeting = message; //// }|] //// [|/* //// method of a class //// */|] -//// greet() [|{ +//// greet()[| { //// return "Hello, " + this.greeting; //// }|] //// }|] @@ -45,7 +45,7 @@ //// ////[|/* //// Block comment for interface. The ending can be on the same line as the declaration. -////*/|]interface IFoo [|{ +////*/|]interface IFoo[| { //// [|/* //// Multiple block comments //// */|] @@ -95,10 +95,11 @@ //// [|/* //// Over a function in an object literal //// */|] -//// get foo() [|{ +//// get foo()[| { //// return 1; //// }|] ////}|] +debugger; verify.outliningSpansInCurrentFile(test.ranges()); diff --git a/tests/cases/fourslash/getOutliningForSingleLineComments.ts b/tests/cases/fourslash/getOutliningForSingleLineComments.ts new file mode 100644 index 00000000000..42d782581a7 --- /dev/null +++ b/tests/cases/fourslash/getOutliningForSingleLineComments.ts @@ -0,0 +1,81 @@ +/// + +////[|// Single line comments at the start of the file +////// line 2 +////// line 3 +////// line 4|] +////module Sayings[| { +//// +//// [|/* +//// */|] +//// [|// A sequence of +//// // single line|] +//// [|/* +//// and block +//// */|] +//// [|// comments +//// //|] +//// export class Sample[| { +//// }|] +////}|] +//// +////interface IFoo[| { +//// [|// all consecutive single line comments should be in one block regardless of their number or empty lines/spaces inbetween +//// +//// // comment 2 +//// // comment 3 +//// +//// //comment 4 +//// /// comment 5 +//// ///// comment 6 +//// +//// //comment 7 +//// ///comment 8 +//// // comment 9 +//// // //comment 10 +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// +//// // // //comment 11 +//// // comment 12 +//// // comment 13 +//// // comment 14 +//// // comment 15 +//// +//// // comment 16 +//// // comment 17 +//// // comment 18 +//// // comment 19 +//// // comment 20 +//// // comment 21|] +//// +//// getDist(): number; // One single line comment should not be collapsed +////}|] +//// +////// One single line comment should not be collapsed +////class WithOneSingleLineComment[| { +////}|] + + + + +verify.outliningSpansInCurrentFile(test.ranges()); + + From de01f5da899e4e584b2c3de81ad0f90a6dc066fe Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Mon, 6 Apr 2015 14:50:08 -0700 Subject: [PATCH 29/69] Addressing PR comments and adding unit tests (removing extra new lines and debugging statements) --- tests/cases/fourslash/getOutliningForBlockComments.ts | 2 +- tests/cases/fourslash/getOutliningForSingleLineComments.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/cases/fourslash/getOutliningForBlockComments.ts b/tests/cases/fourslash/getOutliningForBlockComments.ts index 06b30228274..66838d0db75 100644 --- a/tests/cases/fourslash/getOutliningForBlockComments.ts +++ b/tests/cases/fourslash/getOutliningForBlockComments.ts @@ -99,7 +99,7 @@ //// return 1; //// }|] ////}|] -debugger; + verify.outliningSpansInCurrentFile(test.ranges()); diff --git a/tests/cases/fourslash/getOutliningForSingleLineComments.ts b/tests/cases/fourslash/getOutliningForSingleLineComments.ts index 42d782581a7..903b1c55494 100644 --- a/tests/cases/fourslash/getOutliningForSingleLineComments.ts +++ b/tests/cases/fourslash/getOutliningForSingleLineComments.ts @@ -73,9 +73,6 @@ ////class WithOneSingleLineComment[| { ////}|] - - - verify.outliningSpansInCurrentFile(test.ranges()); From 87a02ebb0017b79d228883e2c01c88b25e1ebe41 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 7 Apr 2015 12:37:05 -0700 Subject: [PATCH 30/69] Fix find all refs and goto def for decorators --- src/compiler/utilities.ts | 1 + .../fourslash/findAllRefsOnDecorators.ts | 19 ++++++++++++++ .../fourslash/goToDefinitionDecorator.ts | 26 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 tests/cases/fourslash/findAllRefsOnDecorators.ts create mode 100644 tests/cases/fourslash/goToDefinitionDecorator.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index e3efd12de0a..cc466834cbf 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -703,6 +703,7 @@ module ts { case SyntaxKind.TemplateExpression: case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.OmittedExpression: + case SyntaxKind.Decorator: return true; case SyntaxKind.QualifiedName: while (node.parent.kind === SyntaxKind.QualifiedName) { diff --git a/tests/cases/fourslash/findAllRefsOnDecorators.ts b/tests/cases/fourslash/findAllRefsOnDecorators.ts new file mode 100644 index 00000000000..3225bc108ce --- /dev/null +++ b/tests/cases/fourslash/findAllRefsOnDecorators.ts @@ -0,0 +1,19 @@ +/// + +// @Filename: a.ts +////function decorator(target) { +//// return target; +////} +////decorator(); + +// @Filename: b.ts +////@deco/*1*/rator @decorator("again") +////class C { +//// @decorator +//// method() {} +////} + +goTo.file("b.ts"); +goTo.marker("1"); + +verify.referencesCountIs(5); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionDecorator.ts b/tests/cases/fourslash/goToDefinitionDecorator.ts new file mode 100644 index 00000000000..b0899a9576c --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionDecorator.ts @@ -0,0 +1,26 @@ +/// + +// @Filename: b.ts +////@/*decoratorUse*/decorator +////class C { +//// @decora/*decoratorFactoryUse*/torFactory(a, "22", true) +//// method() {} +////} + + +// @Filename: a.ts +/////*decoratorDefinition*/function decorator(target) { +//// return target; +////} +/////*decoratorFactoryDefinition*/function decoratorFactory(...args) { +//// return target => target; +////} + + +goTo.marker('decoratorUse'); +goTo.definition(); +verify.caretAtMarker('decoratorDefinition'); + +goTo.marker('decoratorFactoryUse'); +goTo.definition(); +verify.caretAtMarker('decoratorFactoryDefinition'); From 955c9f1ff209b763a33b4d9d209fa7a2a8f814d0 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 7 Apr 2015 13:09:43 -0700 Subject: [PATCH 31/69] Update baselines --- .../reference/decoratorOnClass1.types | 2 +- .../reference/decoratorOnClass2.types | 2 +- .../reference/decoratorOnClassAccessor1.types | 2 +- .../reference/decoratorOnClassAccessor2.types | 2 +- .../reference/decoratorOnClassAccessor4.types | 2 +- .../reference/decoratorOnClassAccessor5.types | 2 +- ...decoratorOnClassConstructorParameter1.types | 2 +- .../reference/decoratorOnClassMethod1.types | 2 +- .../reference/decoratorOnClassMethod2.types | 2 +- .../reference/decoratorOnClassMethod4.types | 2 +- .../reference/decoratorOnClassMethod6.types | 2 +- .../reference/decoratorOnClassMethod7.types | 2 +- .../reference/decoratorOnClassMethod8.types | 2 +- .../decoratorOnClassMethodParameter1.types | 2 +- .../reference/decoratorOnClassProperty1.types | 2 +- .../reference/decoratorOnClassProperty11.types | 2 +- .../reference/decoratorOnClassProperty2.types | 2 +- .../reference/decoratorOnClassProperty6.types | 2 +- .../sourceMapValidationDecorators.types | 18 +++++++++--------- 19 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/baselines/reference/decoratorOnClass1.types b/tests/baselines/reference/decoratorOnClass1.types index 19e066586da..91c9feb4e35 100644 --- a/tests/baselines/reference/decoratorOnClass1.types +++ b/tests/baselines/reference/decoratorOnClass1.types @@ -7,7 +7,7 @@ declare function dec(target: T): T; >T : T @dec ->dec : unknown +>dec : (target: T) => T class C { >C : C diff --git a/tests/baselines/reference/decoratorOnClass2.types b/tests/baselines/reference/decoratorOnClass2.types index 43102ee9122..48565b74b43 100644 --- a/tests/baselines/reference/decoratorOnClass2.types +++ b/tests/baselines/reference/decoratorOnClass2.types @@ -7,7 +7,7 @@ declare function dec(target: T): T; >T : T @dec ->dec : unknown +>dec : (target: T) => T export class C { >C : C diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.types b/tests/baselines/reference/decoratorOnClassAccessor1.types index fd592d7d294..602faf1fd22 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.types +++ b/tests/baselines/reference/decoratorOnClassAccessor1.types @@ -14,6 +14,6 @@ class C { >C : C @dec get accessor() { return 1; } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.types b/tests/baselines/reference/decoratorOnClassAccessor2.types index 32bb503d889..e43733db132 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.types +++ b/tests/baselines/reference/decoratorOnClassAccessor2.types @@ -14,6 +14,6 @@ class C { >C : C @dec public get accessor() { return 1; } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.types b/tests/baselines/reference/decoratorOnClassAccessor4.types index 40dd43d7e62..59399c5ea31 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.types +++ b/tests/baselines/reference/decoratorOnClassAccessor4.types @@ -14,7 +14,7 @@ class C { >C : C @dec set accessor(value: number) { } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number >value : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.types b/tests/baselines/reference/decoratorOnClassAccessor5.types index 4b167fe8df1..8fe5ee55368 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.types +++ b/tests/baselines/reference/decoratorOnClassAccessor5.types @@ -14,7 +14,7 @@ class C { >C : C @dec public set accessor(value: number) { } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number >value : number } diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.types b/tests/baselines/reference/decoratorOnClassConstructorParameter1.types index d5ce51269bc..a325945d8a2 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.types +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.types @@ -10,6 +10,6 @@ class C { >C : C constructor(@dec p: number) {} ->dec : unknown +>dec : (target: Function, propertyKey: string | symbol, parameterIndex: number) => void >p : number } diff --git a/tests/baselines/reference/decoratorOnClassMethod1.types b/tests/baselines/reference/decoratorOnClassMethod1.types index 760f758bbff..fc7f27c5dfb 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.types +++ b/tests/baselines/reference/decoratorOnClassMethod1.types @@ -14,6 +14,6 @@ class C { >C : C @dec method() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethod2.types b/tests/baselines/reference/decoratorOnClassMethod2.types index 98539648cd0..b83605c9c3c 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.types +++ b/tests/baselines/reference/decoratorOnClassMethod2.types @@ -14,6 +14,6 @@ class C { >C : C @dec public method() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 6d55e01e97a..5b48b267e1d 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -14,5 +14,5 @@ class C { >C : C @dec ["method"]() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor } diff --git a/tests/baselines/reference/decoratorOnClassMethod6.types b/tests/baselines/reference/decoratorOnClassMethod6.types index 4e6629cd60a..8b167b5fb0f 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.types +++ b/tests/baselines/reference/decoratorOnClassMethod6.types @@ -14,5 +14,5 @@ class C { >C : C @dec ["method"]() {} ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index 7e426cb773c..038d3ca7df5 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -14,5 +14,5 @@ class C { >C : C @dec public ["method"]() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor } diff --git a/tests/baselines/reference/decoratorOnClassMethod8.types b/tests/baselines/reference/decoratorOnClassMethod8.types index f932ab8696f..20890b09846 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.types +++ b/tests/baselines/reference/decoratorOnClassMethod8.types @@ -10,6 +10,6 @@ class C { >C : C @dec method() {} ->dec : unknown +>dec : (target: T) => T >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.types b/tests/baselines/reference/decoratorOnClassMethodParameter1.types index cf7bfd352bf..0b75471471f 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.types +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.types @@ -11,6 +11,6 @@ class C { method(@dec p: number) {} >method : (p: number) => void ->dec : unknown +>dec : (target: Function, propertyKey: string | symbol, parameterIndex: number) => void >p : number } diff --git a/tests/baselines/reference/decoratorOnClassProperty1.types b/tests/baselines/reference/decoratorOnClassProperty1.types index 651085c7ac4..e974397e532 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.types +++ b/tests/baselines/reference/decoratorOnClassProperty1.types @@ -8,6 +8,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty11.types b/tests/baselines/reference/decoratorOnClassProperty11.types index 5377e53c31c..5caa467d3ba 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.types +++ b/tests/baselines/reference/decoratorOnClassProperty11.types @@ -9,6 +9,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : () => (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty2.types b/tests/baselines/reference/decoratorOnClassProperty2.types index 2d5c9fe07d7..78d35004f8f 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.types +++ b/tests/baselines/reference/decoratorOnClassProperty2.types @@ -8,6 +8,6 @@ class C { >C : C @dec public prop; ->dec : unknown +>dec : (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty6.types b/tests/baselines/reference/decoratorOnClassProperty6.types index 2c8c41abf78..59d03678330 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.types +++ b/tests/baselines/reference/decoratorOnClassProperty6.types @@ -8,6 +8,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : (target: Function) => void >prop : any } diff --git a/tests/baselines/reference/sourceMapValidationDecorators.types b/tests/baselines/reference/sourceMapValidationDecorators.types index 8be7f237391..05b512fa439 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.types +++ b/tests/baselines/reference/sourceMapValidationDecorators.types @@ -43,7 +43,7 @@ declare function ParameterDecorator2(x: number): (target: Function, key: string >paramIndex : number @ClassDecorator1 ->ClassDecorator1 : unknown +>ClassDecorator1 : (target: Function) => void @ClassDecorator2(10) >ClassDecorator2(10) : (target: Function) => void @@ -54,7 +54,7 @@ class Greeter { constructor( @ParameterDecorator1 ->ParameterDecorator1 : unknown +>ParameterDecorator1 : (target: Function, key: string | symbol, paramIndex: number) => void @ParameterDecorator2(20) >ParameterDecorator2(20) : (target: Function, key: string | symbol, paramIndex: number) => void @@ -64,7 +64,7 @@ class Greeter { >greeting : string @ParameterDecorator1 ->ParameterDecorator1 : unknown +>ParameterDecorator1 : (target: Function, key: string | symbol, paramIndex: number) => void @ParameterDecorator2(30) >ParameterDecorator2(30) : (target: Function, key: string | symbol, paramIndex: number) => void @@ -75,7 +75,7 @@ class Greeter { } @PropertyDecorator1 ->PropertyDecorator1 : unknown +>PropertyDecorator1 : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @PropertyDecorator2(40) >PropertyDecorator2(40) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @@ -93,7 +93,7 @@ class Greeter { } @PropertyDecorator1 ->PropertyDecorator1 : unknown +>PropertyDecorator1 : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @PropertyDecorator2(50) >PropertyDecorator2(50) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @@ -103,7 +103,7 @@ class Greeter { >x : string @PropertyDecorator1 ->PropertyDecorator1 : unknown +>PropertyDecorator1 : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @PropertyDecorator2(60) >PropertyDecorator2(60) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @@ -116,7 +116,7 @@ class Greeter { >fn : (x: number) => string @ParameterDecorator1 ->ParameterDecorator1 : unknown +>ParameterDecorator1 : (target: Function, key: string | symbol, paramIndex: number) => void @ParameterDecorator2(70) >ParameterDecorator2(70) : (target: Function, key: string | symbol, paramIndex: number) => void @@ -132,7 +132,7 @@ class Greeter { } @PropertyDecorator1 ->PropertyDecorator1 : unknown +>PropertyDecorator1 : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @PropertyDecorator2(80) >PropertyDecorator2(80) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void @@ -151,7 +151,7 @@ class Greeter { >greetings : string @ParameterDecorator1 ->ParameterDecorator1 : unknown +>ParameterDecorator1 : (target: Function, key: string | symbol, paramIndex: number) => void @ParameterDecorator2(90) >ParameterDecorator2(90) : (target: Function, key: string | symbol, paramIndex: number) => void From 0258a648f9a04cdadf4fbe075f70ac11fb4d753c Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 7 Apr 2015 15:41:21 -0700 Subject: [PATCH 32/69] Add tests --- .../cases/fourslash/getOccurrencesOfDecorators.ts | 14 ++++++++++++++ tests/cases/fourslash/quickInfoForDecorators.ts | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/cases/fourslash/getOccurrencesOfDecorators.ts create mode 100644 tests/cases/fourslash/quickInfoForDecorators.ts diff --git a/tests/cases/fourslash/getOccurrencesOfDecorators.ts b/tests/cases/fourslash/getOccurrencesOfDecorators.ts new file mode 100644 index 00000000000..207e6877d99 --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesOfDecorators.ts @@ -0,0 +1,14 @@ +/// + +// @Filename: b.ts +////@/*1*/decorator +////class C { +//// @decorator +//// method() {} +////} +////function decorator(target) { +//// return target; +////} + +goTo.marker("1"); +verify.occurrencesAtPositionCount(3); diff --git a/tests/cases/fourslash/quickInfoForDecorators.ts b/tests/cases/fourslash/quickInfoForDecorators.ts new file mode 100644 index 00000000000..14390f3c8ae --- /dev/null +++ b/tests/cases/fourslash/quickInfoForDecorators.ts @@ -0,0 +1,11 @@ +/// + +////@/*1*/decorator +////class C { + +////} +/////** decorator documentation*/ +////var decorator = t=> t; + +goTo.marker("1"); +verify.quickInfoIs("var decorator: (t: any) => any", "decorator documentation"); \ No newline at end of file From 1a1bb34864d703d74615f2dcc9364c09330fe389 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 7 Apr 2015 16:15:02 -0700 Subject: [PATCH 33/69] Added rules for spacing around decorators, computing the undecorated start line of a node --- src/compiler/utilities.ts | 10 +- src/services/formatting/formatting.ts | 26 +++-- src/services/formatting/rules.ts | 12 +- src/services/services.ts | 6 +- tests/cases/fourslash/formattingDecorators.ts | 106 ++++++++++++++++++ 5 files changed, 147 insertions(+), 13 deletions(-) create mode 100644 tests/cases/fourslash/formattingDecorators.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index e3efd12de0a..30f392e5ded 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -150,14 +150,20 @@ module ts { return !nodeIsMissing(node); } - export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { + export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile, skipDecorators?: boolean): number { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. if (nodeIsMissing(node)) { return node.pos; } - return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); + let pos = node.pos; + if (skipDecorators && node.decorators) { + // Skip past decorators + pos = node.decorators.end; + } + + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, pos); } export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string { diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 6a5ed25459e..ddf2f4cad27 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -328,8 +328,13 @@ module ts.formatting { if (formattingScanner.isOnToken()) { let startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + let undecoratedStartLine = startLine; + if (enclosingNode.decorators) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile, /*skipDecorators*/ true)).line; + } + let delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } formattingScanner.close(); @@ -500,7 +505,7 @@ module ts.formatting { } } - function processNode(node: Node, contextNode: Node, nodeStartLine: number, indentation: number, delta: number) { + function processNode(node: Node, contextNode: Node, nodeStartLine: number, undecoratedNodeStartLine: number, indentation: number, delta: number) { if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { return; } @@ -526,7 +531,7 @@ module ts.formatting { forEachChild( node, child => { - processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, /*isListElement*/ false) + processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListElement*/ false) }, (nodes: NodeArray) => { processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); @@ -547,11 +552,17 @@ module ts.formatting { parent: Node, parentDynamicIndentation: DynamicIndentation, parentStartLine: number, + undecoratedParentStartLine: number, isListItem: boolean): number { let childStartPos = child.getStart(sourceFile); - let childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); + let childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + + let undecoratedChildStartLine = childStartLine; + if (child.decorators) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(child.getStart(sourceFile, /*skipDecorators*/ true)).line; + } // if child is a list item - try to get its indentation let childIndentationAmount = Constants.Unknown; @@ -594,9 +605,10 @@ module ts.formatting { return inheritedIndentation; } - let childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + let effectiveParentStartLine = child.kind === SyntaxKind.Decorator ? childStartLine : undecoratedParentStartLine; + let childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); - processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -640,7 +652,7 @@ module ts.formatting { let inheritedIndentation = Constants.Unknown; for (let child of nodes) { - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, /*isListElement*/ true) + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, startLine, /*isListElement*/ true) } if (listEndToken !== SyntaxKind.Unknown) { diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 7d3509ef495..4319f4bf311 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -208,6 +208,10 @@ module ts.formatting { public SpaceAfterAnonymousFunctionKeyword: Rule; public NoSpaceAfterAnonymousFunctionKeyword: Rule; + // Insert space after @ in decorator + public SpaceBeforeAt: Rule; + public NoSpaceAfterAt: Rule; + constructor() { /// /// Common Rules @@ -344,6 +348,10 @@ module ts.formatting { // Remove spaces in empty interface literals. e.g.: x: {} this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Rule(RuleDescriptor.create1(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), RuleAction.Delete)); + // decorators + this.SpaceBeforeAt = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.AtToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + this.NoSpaceAfterAt = new Rule(RuleDescriptor.create3(SyntaxKind.AtToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ @@ -381,7 +389,9 @@ module ts.formatting { this.NoSpaceBetweenCloseParenAndAngularBracket, this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket + this.NoSpaceAfterCloseAngularBracket, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, ]; // These rules are lower in priority than user-configurable rules. diff --git a/src/services/services.ts b/src/services/services.ts index 86c323f24bf..042e2f4f01e 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -19,7 +19,7 @@ module ts { getChildCount(sourceFile?: SourceFile): number; getChildAt(index: number, sourceFile?: SourceFile): Node; getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; + getStart(sourceFile?: SourceFile, skipDecorators?: boolean): number; getFullStart(): number; getEnd(): number; getWidth(sourceFile?: SourceFile): number; @@ -149,8 +149,8 @@ module ts { return getSourceFileOfNode(this); } - public getStart(sourceFile?: SourceFile): number { - return getTokenPosOfNode(this, sourceFile); + public getStart(sourceFile?: SourceFile, skipDecorators?: boolean): number { + return getTokenPosOfNode(this, sourceFile, skipDecorators); } public getFullStart(): number { diff --git a/tests/cases/fourslash/formattingDecorators.ts b/tests/cases/fourslash/formattingDecorators.ts new file mode 100644 index 00000000000..9fc63d9d47b --- /dev/null +++ b/tests/cases/fourslash/formattingDecorators.ts @@ -0,0 +1,106 @@ +/// + +/////*1*/ @ decorator1 +/////*2*/ @ decorator2 +/////*3*/ @decorator3 +/////*4*/ @ decorator4 @ decorator5 +/////*5*/class C { +/////*6*/ @ decorator6 +/////*7*/ @ decorator7 +/////*8*/ @decorator8 +/////*9*/ method1() { } +//// +/////*10*/ @ decorator9 @ decorator10 @decorator11 method2() { } +//// +//// method3( +/////*11*/ @ decorator12 +/////*12*/ @ decorator13 +/////*13*/ @decorator14 +/////*14*/ x) { } +//// +//// method4( +/////*15*/ @ decorator15 @ decorator16 @decorator17 x) { } +//// +/////*16*/ @ decorator18 +/////*17*/ @ decorator19 +/////*18*/ @decorator20 +/////*19*/ ["computed1"]() { } +//// +/////*20*/ @ decorator21 @ decorator22 @decorator23 ["computed2"]() { } +//// +/////*21*/ @ decorator24 +/////*22*/ @ decorator25 +/////*23*/ @decorator26 +/////*24*/ get accessor1() { } +//// +/////*25*/ @ decorator27 @ decorator28 @decorator29 get accessor2() { } +//// +/////*26*/ @ decorator30 +/////*27*/ @ decorator31 +/////*28*/ @decorator32 +/////*29*/ property1; +//// +/////*30*/ @ decorator33 @ decorator34 @decorator35 property2; +////} + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("@decorator1"); +goTo.marker("2"); +verify.currentLineContentIs("@decorator2"); +goTo.marker("3"); +verify.currentLineContentIs("@decorator3"); +goTo.marker("4"); +verify.currentLineContentIs("@decorator4 @decorator5"); +goTo.marker("5"); +verify.currentLineContentIs("class C {"); +goTo.marker("6"); +verify.currentLineContentIs(" @decorator6"); +goTo.marker("7"); +verify.currentLineContentIs(" @decorator7"); +goTo.marker("8"); +verify.currentLineContentIs(" @decorator8"); +goTo.marker("9"); +verify.currentLineContentIs(" method1() { }"); +goTo.marker("10"); +verify.currentLineContentIs(" @decorator9 @decorator10 @decorator11 method2() { }"); +goTo.marker("11"); +verify.currentLineContentIs(" @decorator12"); +goTo.marker("12"); +verify.currentLineContentIs(" @decorator13"); +goTo.marker("13"); +verify.currentLineContentIs(" @decorator14"); +goTo.marker("14"); +verify.currentLineContentIs(" x) { }"); +goTo.marker("15"); +verify.currentLineContentIs(" @decorator15 @decorator16 @decorator17 x) { }"); +goTo.marker("16"); +verify.currentLineContentIs(" @decorator18"); +goTo.marker("17"); +verify.currentLineContentIs(" @decorator19"); +goTo.marker("18"); +verify.currentLineContentIs(" @decorator20"); +goTo.marker("19"); +verify.currentLineContentIs(" [\"computed1\"]() { }"); +goTo.marker("20"); +verify.currentLineContentIs(" @decorator21 @decorator22 @decorator23 [\"computed2\"]() { }"); +goTo.marker("21"); +verify.currentLineContentIs(" @decorator24"); +goTo.marker("22"); +verify.currentLineContentIs(" @decorator25"); +goTo.marker("23"); +verify.currentLineContentIs(" @decorator26"); +goTo.marker("24"); +verify.currentLineContentIs(" get accessor1() { }"); +goTo.marker("25"); +verify.currentLineContentIs(" @decorator27 @decorator28 @decorator29 get accessor2() { }"); +goTo.marker("26"); +verify.currentLineContentIs(" @decorator30"); +goTo.marker("27"); +verify.currentLineContentIs(" @decorator31"); +goTo.marker("28"); +verify.currentLineContentIs(" @decorator32"); +goTo.marker("29"); +verify.currentLineContentIs(" property1;"); +goTo.marker("30"); +verify.currentLineContentIs(" @decorator33 @decorator34 @decorator35 property2;"); \ No newline at end of file From eec39c2fc50fdeee05b385e8c83fd54992e03d87 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 7 Apr 2015 17:23:52 -0700 Subject: [PATCH 34/69] Additional rule for spacing between decorator on same line as its declaration --- src/services/formatting/rules.ts | 25 +++++++++++++++++++ .../reference/APISample_linter.types | 4 +-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 4319f4bf311..ac3d7fe6783 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -211,6 +211,7 @@ module ts.formatting { // Insert space after @ in decorator public SpaceBeforeAt: Rule; public NoSpaceAfterAt: Rule; + public SpaceAfterDecorator: Rule; constructor() { /// @@ -351,6 +352,7 @@ module ts.formatting { // decorators this.SpaceBeforeAt = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.AtToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); this.NoSpaceAfterAt = new Rule(RuleDescriptor.create3(SyntaxKind.AtToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.SpaceAfterDecorator = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.ExportKeyword, SyntaxKind.DefaultKeyword, SyntaxKind.ClassKeyword, SyntaxKind.StaticKeyword, SyntaxKind.PublicKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword, SyntaxKind.OpenBracketToken, SyntaxKind.AsteriskToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), RuleAction.Space)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = @@ -392,6 +394,7 @@ module ts.formatting { this.NoSpaceAfterCloseAngularBracket, this.SpaceBeforeAt, this.NoSpaceAfterAt, + this.SpaceAfterDecorator, ]; // These rules are lower in priority than user-configurable rules. @@ -659,6 +662,28 @@ module ts.formatting { return context.TokensAreOnSameLine(); } + static IsEndOfDecoratorContextOnSameLine(context: FormattingContext): boolean { + return context.TokensAreOnSameLine() && + context.contextNode.decorators && + Rules.NodeIsInDecoratorContext(context.currentTokenParent) && + !Rules.NodeIsInDecoratorContext(context.nextTokenParent); + } + + static NodeIsInDecoratorContext(node: Node): boolean { + if (node.parserContextFlags & ParserContextFlags.Decorator) { + return true; + } + while (node) { + if (isExpression(node)) { + node = node.parent; + } + else { + return node.kind === SyntaxKind.Decorator; + } + } + return false; + } + static IsStartOfVariableDeclarationList(context: FormattingContext): boolean { return context.currentTokenParent.kind === SyntaxKind.VariableDeclarationList && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 609f08f3a76..5db938d63bd 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -237,9 +237,9 @@ export function delint(sourceFile: ts.SourceFile) { >sourceFile : ts.SourceFile >getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile) => number +>node.getStart : (sourceFile?: ts.SourceFile, skipDecorators?: boolean) => number >node : ts.Node ->getStart : (sourceFile?: ts.SourceFile) => number +>getStart : (sourceFile?: ts.SourceFile, skipDecorators?: boolean) => number console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); >console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any From 5b6c65ffe09bbdb150f8e8efee79b8124ed019e6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 7 Apr 2015 23:31:09 -0700 Subject: [PATCH 35/69] Added support for getOccurrences to the server. --- src/server/client.ts | 22 +++++++++++++++++++++- src/server/protocol.d.ts | 19 +++++++++++++++++++ src/server/session.ts | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/server/client.ts b/src/server/client.ts index d395d2a832c..dfda9f23ed7 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -446,6 +446,7 @@ module ts.server { if (!response.body) { return undefined; } + var helpItems: protocol.SignatureHelpItems = response.body; var span = helpItems.applicableSpan; var start = this.lineOffsetToPosition(fileName, span.start); @@ -465,7 +466,26 @@ module ts.server { } getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { - throw new Error("Not Implemented Yet."); + var lineOffset = this.positionToOneBasedLineOffset(fileName, position); + var args: protocol.FileLocationRequestArgs = { + file: fileName, + line: lineOffset.line, + offset: lineOffset.offset, + }; + + var request = this.processRequest(CommandNames.Occurrences, args); + var response = this.processResponse(request); + + return response.body.map(entry => { + var fileName = entry.file; + var start = this.lineOffsetToPosition(fileName, entry.start); + var end = this.lineOffsetToPosition(fileName, entry.end); + return { + fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + isWriteAccess: entry.isWriteAccess, + }; + }); } getOutliningSpans(fileName: string): OutliningSpan[] { diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 1d685be5d3a..5bc1ffbe4dc 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -165,6 +165,25 @@ declare module ts.server.protocol { body?: FileSpan[]; } + /** + * Get occurrences request; value of command field is + * "occurrences". Return response giving spans that are relevant + * in the file at a given line and column. + */ + export interface OccurrencesRequest extends FileLocationRequest { + } + + export interface OccurrencesResponseItem extends FileSpan { + /** + * True if the occurrence is a write location, false otherwise. + */ + isWriteAccess: boolean; + } + + export interface OccurrencesResponse extends Response { + body?: OccurrencesResponseItem[]; + } + /** * Find references request; value of command field is * "references". Return response giving the file locations that diff --git a/src/server/session.ts b/src/server/session.ts index 560f5869c08..f35235554e6 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -89,6 +89,7 @@ module ts.server { export var Geterr = "geterr"; export var NavBar = "navbar"; export var Navto = "navto"; + export var Occurrences = "occurrences"; export var Open = "open"; export var Quickinfo = "quickinfo"; export var References = "references"; From 6b997487ee077c2cd3f46248af9682b72d39fd8d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 7 Apr 2015 23:34:45 -0700 Subject: [PATCH 36/69] Fixed /// +/// //////curly braces ////module Foo [|{ diff --git a/tests/cases/fourslash/server/completions.ts b/tests/cases/fourslash/server/completions.ts index 2af0393283f..a837a74849d 100644 --- a/tests/cases/fourslash/server/completions.ts +++ b/tests/cases/fourslash/server/completions.ts @@ -1,4 +1,4 @@ -/// +/// ////var x: string[] = []; ////x.forEach(function (y) { y/*1*/ diff --git a/tests/cases/fourslash/server/completions2.ts b/tests/cases/fourslash/server/completions2.ts index 3e7e77b588c..b6c39a5c723 100644 --- a/tests/cases/fourslash/server/completions2.ts +++ b/tests/cases/fourslash/server/completions2.ts @@ -1,4 +1,4 @@ -/// +/// ////class Foo { ////} diff --git a/tests/cases/fourslash/server/definition.ts b/tests/cases/fourslash/server/definition.ts index f403965fe12..8bf6e73c840 100644 --- a/tests/cases/fourslash/server/definition.ts +++ b/tests/cases/fourslash/server/definition.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/server/format.ts b/tests/cases/fourslash/server/format.ts index 75d06eef0c2..f4541152201 100644 --- a/tests/cases/fourslash/server/format.ts +++ b/tests/cases/fourslash/server/format.ts @@ -1,4 +1,4 @@ -/// +/// /////**/module Default{var x= ( { } ) ;} diff --git a/tests/cases/fourslash/server/formatonkey.ts b/tests/cases/fourslash/server/formatonkey.ts index 64cd74ca858..73e817ce3b3 100644 --- a/tests/cases/fourslash/server/formatonkey.ts +++ b/tests/cases/fourslash/server/formatonkey.ts @@ -1,4 +1,4 @@ -/// +/// ////switch (1) { //// case 1: diff --git a/tests/cases/fourslash/server/navbar.ts b/tests/cases/fourslash/server/navbar.ts index 67e14fe1009..82ded5e6f54 100644 --- a/tests/cases/fourslash/server/navbar.ts +++ b/tests/cases/fourslash/server/navbar.ts @@ -1,4 +1,4 @@ -/// +/// ////// Interface ////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { diff --git a/tests/cases/fourslash/server/navto.ts b/tests/cases/fourslash/server/navto.ts index ba907e985fd..1072c64494f 100644 --- a/tests/cases/fourslash/server/navto.ts +++ b/tests/cases/fourslash/server/navto.ts @@ -1,4 +1,4 @@ -/// +/// /////// Module ////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { diff --git a/tests/cases/fourslash/server/quickinfo.ts b/tests/cases/fourslash/server/quickinfo.ts index 5292eb6c2c8..9008505e447 100644 --- a/tests/cases/fourslash/server/quickinfo.ts +++ b/tests/cases/fourslash/server/quickinfo.ts @@ -1,4 +1,4 @@ -/// +/// ////interface One { //// commonProperty: number; diff --git a/tests/cases/fourslash/server/references.ts b/tests/cases/fourslash/server/references.ts index 55b21615551..0ecbeb43de3 100644 --- a/tests/cases/fourslash/server/references.ts +++ b/tests/cases/fourslash/server/references.ts @@ -1,4 +1,4 @@ -/// +/// // Global class reference. diff --git a/tests/cases/fourslash/server/rename.ts b/tests/cases/fourslash/server/rename.ts index 4f8b7b98cd4..2da25f87ba7 100644 --- a/tests/cases/fourslash/server/rename.ts +++ b/tests/cases/fourslash/server/rename.ts @@ -1,4 +1,4 @@ -/// +/// /////// diff --git a/tests/cases/fourslash/server/signatureHelp.ts b/tests/cases/fourslash/server/signatureHelp.ts index 294df367f07..73303ecce4c 100644 --- a/tests/cases/fourslash/server/signatureHelp.ts +++ b/tests/cases/fourslash/server/signatureHelp.ts @@ -1,4 +1,4 @@ -/// +/// ////function foo(data: number) { ////} From de0347fa0f5da14873ae64fa988ed179b6a2d245 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 7 Apr 2015 23:39:13 -0700 Subject: [PATCH 37/69] Rename tests. --- tests/cases/fourslash/server/{brace.ts => brace01.ts} | 0 tests/cases/fourslash/server/{completions.ts => completions01.ts} | 0 .../cases/fourslash/server/{completions2.ts => completions02.ts} | 0 tests/cases/fourslash/server/{definition.ts => definition01.ts} | 0 tests/cases/fourslash/server/{format.ts => format01.ts} | 0 tests/cases/fourslash/server/{formatonkey.ts => formatonkey01.ts} | 0 tests/cases/fourslash/server/{navbar.ts => navbar01.ts} | 0 tests/cases/fourslash/server/{navto.ts => navto01.ts} | 0 tests/cases/fourslash/server/{quickinfo.ts => quickinfo01.ts} | 0 tests/cases/fourslash/server/{references.ts => references01.ts} | 0 tests/cases/fourslash/server/{rename.ts => rename01.ts} | 0 .../fourslash/server/{signatureHelp.ts => signatureHelp01.ts} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename tests/cases/fourslash/server/{brace.ts => brace01.ts} (100%) rename tests/cases/fourslash/server/{completions.ts => completions01.ts} (100%) rename tests/cases/fourslash/server/{completions2.ts => completions02.ts} (100%) rename tests/cases/fourslash/server/{definition.ts => definition01.ts} (100%) rename tests/cases/fourslash/server/{format.ts => format01.ts} (100%) rename tests/cases/fourslash/server/{formatonkey.ts => formatonkey01.ts} (100%) rename tests/cases/fourslash/server/{navbar.ts => navbar01.ts} (100%) rename tests/cases/fourslash/server/{navto.ts => navto01.ts} (100%) rename tests/cases/fourslash/server/{quickinfo.ts => quickinfo01.ts} (100%) rename tests/cases/fourslash/server/{references.ts => references01.ts} (100%) rename tests/cases/fourslash/server/{rename.ts => rename01.ts} (100%) rename tests/cases/fourslash/server/{signatureHelp.ts => signatureHelp01.ts} (100%) diff --git a/tests/cases/fourslash/server/brace.ts b/tests/cases/fourslash/server/brace01.ts similarity index 100% rename from tests/cases/fourslash/server/brace.ts rename to tests/cases/fourslash/server/brace01.ts diff --git a/tests/cases/fourslash/server/completions.ts b/tests/cases/fourslash/server/completions01.ts similarity index 100% rename from tests/cases/fourslash/server/completions.ts rename to tests/cases/fourslash/server/completions01.ts diff --git a/tests/cases/fourslash/server/completions2.ts b/tests/cases/fourslash/server/completions02.ts similarity index 100% rename from tests/cases/fourslash/server/completions2.ts rename to tests/cases/fourslash/server/completions02.ts diff --git a/tests/cases/fourslash/server/definition.ts b/tests/cases/fourslash/server/definition01.ts similarity index 100% rename from tests/cases/fourslash/server/definition.ts rename to tests/cases/fourslash/server/definition01.ts diff --git a/tests/cases/fourslash/server/format.ts b/tests/cases/fourslash/server/format01.ts similarity index 100% rename from tests/cases/fourslash/server/format.ts rename to tests/cases/fourslash/server/format01.ts diff --git a/tests/cases/fourslash/server/formatonkey.ts b/tests/cases/fourslash/server/formatonkey01.ts similarity index 100% rename from tests/cases/fourslash/server/formatonkey.ts rename to tests/cases/fourslash/server/formatonkey01.ts diff --git a/tests/cases/fourslash/server/navbar.ts b/tests/cases/fourslash/server/navbar01.ts similarity index 100% rename from tests/cases/fourslash/server/navbar.ts rename to tests/cases/fourslash/server/navbar01.ts diff --git a/tests/cases/fourslash/server/navto.ts b/tests/cases/fourslash/server/navto01.ts similarity index 100% rename from tests/cases/fourslash/server/navto.ts rename to tests/cases/fourslash/server/navto01.ts diff --git a/tests/cases/fourslash/server/quickinfo.ts b/tests/cases/fourslash/server/quickinfo01.ts similarity index 100% rename from tests/cases/fourslash/server/quickinfo.ts rename to tests/cases/fourslash/server/quickinfo01.ts diff --git a/tests/cases/fourslash/server/references.ts b/tests/cases/fourslash/server/references01.ts similarity index 100% rename from tests/cases/fourslash/server/references.ts rename to tests/cases/fourslash/server/references01.ts diff --git a/tests/cases/fourslash/server/rename.ts b/tests/cases/fourslash/server/rename01.ts similarity index 100% rename from tests/cases/fourslash/server/rename.ts rename to tests/cases/fourslash/server/rename01.ts diff --git a/tests/cases/fourslash/server/signatureHelp.ts b/tests/cases/fourslash/server/signatureHelp01.ts similarity index 100% rename from tests/cases/fourslash/server/signatureHelp.ts rename to tests/cases/fourslash/server/signatureHelp01.ts From a6788d22ef79f35e7c61a19d5055ca205e0e8eeb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 7 Apr 2015 23:53:47 -0700 Subject: [PATCH 38/69] Added occurrences tests. --- tests/cases/fourslash/server/occurrences01.ts | 27 +++++++++++++++++++ tests/cases/fourslash/server/occurrences02.ts | 16 +++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tests/cases/fourslash/server/occurrences01.ts create mode 100644 tests/cases/fourslash/server/occurrences02.ts diff --git a/tests/cases/fourslash/server/occurrences01.ts b/tests/cases/fourslash/server/occurrences01.ts new file mode 100644 index 00000000000..62f445ac693 --- /dev/null +++ b/tests/cases/fourslash/server/occurrences01.ts @@ -0,0 +1,27 @@ +/// + +////foo: [|switch|] (10) { +//// [|case|] 1: +//// [|case|] 2: +//// [|case|] 3: +//// [|break|]; +//// [|break|] foo; +//// co/*1*/ntinue; +//// contin/*2*/ue foo; +////} + +let ranges = test.ranges(); + +for (let r of ranges) { + goTo.position(r.start); + verify.occurrencesAtPositionCount(ranges.length); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +} + +for (let m of test.markers()) { + goTo.position(m.position); + verify.occurrencesAtPositionCount(0); +} \ No newline at end of file diff --git a/tests/cases/fourslash/server/occurrences02.ts b/tests/cases/fourslash/server/occurrences02.ts new file mode 100644 index 00000000000..511e7887c21 --- /dev/null +++ b/tests/cases/fourslash/server/occurrences02.ts @@ -0,0 +1,16 @@ +/// + +////function [|f|](x: typeof [|f|]) { +//// [|f|]([|f|]); +////} + +let ranges = test.ranges(); + +for (let r of ranges) { + goTo.position(r.start); + verify.occurrencesAtPositionCount(ranges.length); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +} \ No newline at end of file From 93bb224545ec753bb4c40190dd811d365b48fcb4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 8 Apr 2015 00:35:34 -0700 Subject: [PATCH 39/69] Actually implemented the session-side logic. --- src/server/session.ts | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/server/session.ts b/src/server/session.ts index f35235554e6..9c77747f349 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -285,6 +285,36 @@ module ts.server { })); } + getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] { + fileName = ts.normalizePath(fileName); + let project = this.projectService.getProjectForFile(fileName); + + if (!project) { + throw Errors.NoProject; + } + + let { compilerService } = project; + let position = compilerService.host.lineOffsetToPosition(fileName, line, offset); + + let occurrences = compilerService.languageService.getOccurrencesAtPosition(fileName, position); + + if (!occurrences) { + return undefined; + } + + return occurrences.map(occurrence => { + let { fileName, isWriteAccess, textSpan } = occurrence; + let start = compilerService.host.positionToLineOffset(fileName, textSpan.start); + let end = compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(textSpan)); + return { + start, + end, + file: fileName, + isWriteAccess + } + }); + } + getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -379,7 +409,7 @@ module ts.server { var nameSpan = nameInfo.textSpan; var nameColStart = compilerService.host.positionToLineOffset(file, nameSpan.start).offset; var nameText = compilerService.host.getScriptSnapshot(file).getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var bakedRefs: protocol.ReferencesResponseItem[] = references.map((ref) => { + var bakedRefs: protocol.ReferencesResponseItem[] = references.map(ref => { var start = compilerService.host.positionToLineOffset(ref.fileName, ref.textSpan.start); var refLineSpan = compilerService.host.lineToTextSpan(ref.fileName, start.line - 1); var snap = compilerService.host.getScriptSnapshot(ref.fileName); @@ -885,6 +915,10 @@ module ts.server { response = this.getNavigationBarItems(navBarArgs.file); break; } + case CommandNames.Occurrences: { + var occurrencesArgs = request.arguments; + response = this + } default: { this.projectService.log("Unrecognized JSON command: " + message); this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); From d8d494d4da42d8b79902affd39140f19b34acd62 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 8 Apr 2015 00:41:12 -0700 Subject: [PATCH 40/69] *Actually dispatched* on the logic. --- src/server/session.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 9c77747f349..faedce0e1af 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -916,8 +916,9 @@ module ts.server { break; } case CommandNames.Occurrences: { - var occurrencesArgs = request.arguments; - response = this + var { line, offset, file: fileName } = request.arguments; + response = this.getOccurrences(line, offset, fileName); + break; } default: { this.projectService.log("Unrecognized JSON command: " + message); From 81d62cf57d5ce411cc17883c455de6e48d5caa44 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 8 Apr 2015 01:09:54 -0700 Subject: [PATCH 41/69] Fixed 'isWriteAccess' check. --- tests/cases/fourslash/server/occurrences02.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/fourslash/server/occurrences02.ts b/tests/cases/fourslash/server/occurrences02.ts index 511e7887c21..e0d39cb92fd 100644 --- a/tests/cases/fourslash/server/occurrences02.ts +++ b/tests/cases/fourslash/server/occurrences02.ts @@ -11,6 +11,6 @@ for (let r of ranges) { verify.occurrencesAtPositionCount(ranges.length); for (let range of ranges) { - verify.occurrencesAtPositionContains(range, false); + verify.occurrencesAtPositionContains(range); } } \ No newline at end of file From 12ccdb63dbd795ab4ecec98968bdb3fde4dc427a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 8 Apr 2015 01:19:45 -0700 Subject: [PATCH 42/69] Apparently our server tests can't handle negative tests. --- src/server/client.ts | 2 +- tests/cases/fourslash/server/occurrences01.ts | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/server/client.ts b/src/server/client.ts index dfda9f23ed7..3306bd5a9d4 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -104,7 +104,7 @@ module ts.server { var response: T = JSON.parse(responseBody); } catch (e) { - throw new Error("Malformed response: Failed to parse server response: " + lastMessage + ". \r\n Error detailes: " + e.message); + throw new Error("Malformed response: Failed to parse server response: " + lastMessage + ". \r\n Error details: " + e.message); } // verify the sequence numbers diff --git a/tests/cases/fourslash/server/occurrences01.ts b/tests/cases/fourslash/server/occurrences01.ts index 62f445ac693..db2fa64f38d 100644 --- a/tests/cases/fourslash/server/occurrences01.ts +++ b/tests/cases/fourslash/server/occurrences01.ts @@ -6,8 +6,8 @@ //// [|case|] 3: //// [|break|]; //// [|break|] foo; -//// co/*1*/ntinue; -//// contin/*2*/ue foo; +//// continue; +//// continue foo; ////} let ranges = test.ranges(); @@ -17,11 +17,6 @@ for (let r of ranges) { verify.occurrencesAtPositionCount(ranges.length); for (let range of ranges) { - verify.occurrencesAtPositionContains(range, false); + verify.occurrencesAtPositionContains(range, /*isWriteAccess*/ false); } -} - -for (let m of test.markers()) { - goTo.position(m.position); - verify.occurrencesAtPositionCount(0); } \ No newline at end of file From 51acda8e1d8c7f89413f4e8e121232535612d2f6 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 8 Apr 2015 16:18:49 -0700 Subject: [PATCH 43/69] Changed isExpression logic related to decorators --- src/compiler/utilities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index cc466834cbf..7e1a840560f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -703,7 +703,6 @@ module ts { case SyntaxKind.TemplateExpression: case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.OmittedExpression: - case SyntaxKind.Decorator: return true; case SyntaxKind.QualifiedName: while (node.parent.kind === SyntaxKind.QualifiedName) { @@ -755,6 +754,8 @@ module ts { return node === (parent).expression; case SyntaxKind.ComputedPropertyName: return node === (parent).expression; + case SyntaxKind.Decorator: + return true; default: if (isExpression(parent)) { return true; From 846c2252970b9f59d9c1ea8af53549f001ebd751 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 8 Apr 2015 16:41:56 -0700 Subject: [PATCH 44/69] Update baselines for preserving newlines --- tests/baselines/reference/for-of57.js | 3 +-- .../baselines/reference/iterableArrayPattern10.js | 3 +-- .../baselines/reference/iterableArrayPattern11.js | 3 +-- .../baselines/reference/iterableArrayPattern12.js | 3 +-- .../baselines/reference/iterableArrayPattern13.js | 3 +-- .../baselines/reference/iterableArrayPattern14.js | 3 +-- .../baselines/reference/iterableArrayPattern15.js | 3 +-- .../baselines/reference/iterableArrayPattern16.js | 3 +-- .../baselines/reference/iterableArrayPattern17.js | 3 +-- .../baselines/reference/iterableArrayPattern18.js | 3 +-- .../baselines/reference/iterableArrayPattern19.js | 7 ++----- .../baselines/reference/iterableArrayPattern20.js | 9 ++------- .../baselines/reference/iterableArrayPattern21.js | 5 +---- .../baselines/reference/iterableArrayPattern22.js | 5 +---- .../baselines/reference/iterableArrayPattern23.js | 8 +------- .../baselines/reference/iterableArrayPattern24.js | 8 +------- .../baselines/reference/iterableArrayPattern25.js | 14 ++------------ .../baselines/reference/iterableArrayPattern26.js | 14 ++------------ .../baselines/reference/iterableArrayPattern27.js | 14 ++------------ .../baselines/reference/iterableArrayPattern28.js | 14 ++------------ .../baselines/reference/iterableArrayPattern29.js | 14 ++------------ tests/baselines/reference/iterableArrayPattern3.js | 5 +---- .../baselines/reference/iterableArrayPattern30.js | 11 +---------- tests/baselines/reference/iterableArrayPattern4.js | 5 +---- tests/baselines/reference/iterableArrayPattern5.js | 5 +---- tests/baselines/reference/iterableArrayPattern6.js | 5 +---- tests/baselines/reference/iterableArrayPattern7.js | 5 +---- tests/baselines/reference/iterableArrayPattern8.js | 5 +---- tests/baselines/reference/iterableArrayPattern9.js | 3 +-- tests/baselines/reference/iteratorSpreadInArray.js | 4 +--- .../baselines/reference/iteratorSpreadInArray10.js | 4 +--- .../baselines/reference/iteratorSpreadInArray11.js | 4 +--- .../baselines/reference/iteratorSpreadInArray2.js | 5 +---- .../baselines/reference/iteratorSpreadInArray3.js | 8 +------- .../baselines/reference/iteratorSpreadInArray4.js | 6 +----- .../baselines/reference/iteratorSpreadInArray5.js | 6 +----- .../baselines/reference/iteratorSpreadInArray6.js | 9 ++------- .../baselines/reference/iteratorSpreadInArray7.js | 4 +--- .../baselines/reference/iteratorSpreadInArray8.js | 4 +--- .../baselines/reference/iteratorSpreadInArray9.js | 4 +--- tests/baselines/reference/iteratorSpreadInCall.js | 3 +-- .../baselines/reference/iteratorSpreadInCall10.js | 4 +--- .../baselines/reference/iteratorSpreadInCall11.js | 4 +--- .../baselines/reference/iteratorSpreadInCall12.js | 7 +------ tests/baselines/reference/iteratorSpreadInCall2.js | 3 +-- tests/baselines/reference/iteratorSpreadInCall3.js | 3 +-- tests/baselines/reference/iteratorSpreadInCall4.js | 3 +-- tests/baselines/reference/iteratorSpreadInCall5.js | 3 +-- tests/baselines/reference/iteratorSpreadInCall6.js | 3 +-- tests/baselines/reference/iteratorSpreadInCall7.js | 4 +--- tests/baselines/reference/iteratorSpreadInCall9.js | 4 +--- 51 files changed, 59 insertions(+), 226 deletions(-) diff --git a/tests/baselines/reference/for-of57.js b/tests/baselines/reference/for-of57.js index 0dedd6c3222..5a867c332f7 100644 --- a/tests/baselines/reference/for-of57.js +++ b/tests/baselines/reference/for-of57.js @@ -4,5 +4,4 @@ for (let num of iter) { } //// [for-of57.js] var iter; -for (let num of iter) { -} +for (let num of iter) { } diff --git a/tests/baselines/reference/iterableArrayPattern10.js b/tests/baselines/reference/iterableArrayPattern10.js index 2e532e2b773..c8d37e3f894 100644 --- a/tests/baselines/reference/iterableArrayPattern10.js +++ b/tests/baselines/reference/iterableArrayPattern10.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern10.js] -function fun([a, b]) { -} +function fun([a, b]) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern11.js b/tests/baselines/reference/iterableArrayPattern11.js index a3940edc362..85ed4ab9710 100644 --- a/tests/baselines/reference/iterableArrayPattern11.js +++ b/tests/baselines/reference/iterableArrayPattern11.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern11.js] -function fun([a, b] = new FooIterator) { -} +function fun([a, b] = new FooIterator) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern12.js b/tests/baselines/reference/iterableArrayPattern12.js index 64581c54251..4856af9cb48 100644 --- a/tests/baselines/reference/iterableArrayPattern12.js +++ b/tests/baselines/reference/iterableArrayPattern12.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern12.js] -function fun([a, ...b] = new FooIterator) { -} +function fun([a, ...b] = new FooIterator) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern13.js b/tests/baselines/reference/iterableArrayPattern13.js index f4ea18d4fec..06f9901a851 100644 --- a/tests/baselines/reference/iterableArrayPattern13.js +++ b/tests/baselines/reference/iterableArrayPattern13.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern13.js] -function fun([a, ...b]) { -} +function fun([a, ...b]) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern14.js b/tests/baselines/reference/iterableArrayPattern14.js index 81b2c66f14d..a3595b0df0c 100644 --- a/tests/baselines/reference/iterableArrayPattern14.js +++ b/tests/baselines/reference/iterableArrayPattern14.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern14.js] -function fun(...[a, ...b]) { -} +function fun(...[a, ...b]) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern15.js b/tests/baselines/reference/iterableArrayPattern15.js index fcb5ec82508..1c2050129ce 100644 --- a/tests/baselines/reference/iterableArrayPattern15.js +++ b/tests/baselines/reference/iterableArrayPattern15.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern15.js] -function fun(...[a, b]) { -} +function fun(...[a, b]) { } fun(...new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern16.js b/tests/baselines/reference/iterableArrayPattern16.js index d3127991799..bda2ec37f63 100644 --- a/tests/baselines/reference/iterableArrayPattern16.js +++ b/tests/baselines/reference/iterableArrayPattern16.js @@ -30,8 +30,7 @@ class FooIteratorIterator { } //// [iterableArrayPattern16.js] -function fun(...[a, b]) { -} +function fun(...[a, b]) { } fun(...new FooIteratorIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern17.js b/tests/baselines/reference/iterableArrayPattern17.js index db5c4001c88..c6274aabcd9 100644 --- a/tests/baselines/reference/iterableArrayPattern17.js +++ b/tests/baselines/reference/iterableArrayPattern17.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern17.js] -function fun(...[a, b]) { -} +function fun(...[a, b]) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern18.js b/tests/baselines/reference/iterableArrayPattern18.js index 3e13f2ef619..e2016c47690 100644 --- a/tests/baselines/reference/iterableArrayPattern18.js +++ b/tests/baselines/reference/iterableArrayPattern18.js @@ -17,8 +17,7 @@ class FooIterator { } //// [iterableArrayPattern18.js] -function fun([a, b]) { -} +function fun([a, b]) { } fun(new FooIterator); class Bar { } diff --git a/tests/baselines/reference/iterableArrayPattern19.js b/tests/baselines/reference/iterableArrayPattern19.js index 60ace366eb7..bc3cf33afc2 100644 --- a/tests/baselines/reference/iterableArrayPattern19.js +++ b/tests/baselines/reference/iterableArrayPattern19.js @@ -17,8 +17,7 @@ class FooArrayIterator { } //// [iterableArrayPattern19.js] -function fun([[a], b]) { -} +function fun([[a], b]) { } fun(new FooArrayIterator); class Bar { } @@ -27,9 +26,7 @@ class Foo extends Bar { class FooArrayIterator { next() { return { - value: [ - new Foo - ], + value: [new Foo], done: false }; } diff --git a/tests/baselines/reference/iterableArrayPattern20.js b/tests/baselines/reference/iterableArrayPattern20.js index 271a35b791d..489f97a29f3 100644 --- a/tests/baselines/reference/iterableArrayPattern20.js +++ b/tests/baselines/reference/iterableArrayPattern20.js @@ -17,10 +17,7 @@ class FooArrayIterator { } //// [iterableArrayPattern20.js] -function fun(...[[a = new Foo], b = [ - new Foo - ]]) { -} +function fun(...[[a = new Foo], b = [new Foo]]) { } fun(...new FooArrayIterator); class Bar { } @@ -29,9 +26,7 @@ class Foo extends Bar { class FooArrayIterator { next() { return { - value: [ - new Foo - ], + value: [new Foo], done: false }; } diff --git a/tests/baselines/reference/iterableArrayPattern21.js b/tests/baselines/reference/iterableArrayPattern21.js index f226406ec63..bdc4d401e54 100644 --- a/tests/baselines/reference/iterableArrayPattern21.js +++ b/tests/baselines/reference/iterableArrayPattern21.js @@ -2,7 +2,4 @@ var [a, b] = { 0: "", 1: true }; //// [iterableArrayPattern21.js] -var [a, b] = { - 0: "", - 1: true -}; +var [a, b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern22.js b/tests/baselines/reference/iterableArrayPattern22.js index 9c3afc0ffe5..9ec41bd3076 100644 --- a/tests/baselines/reference/iterableArrayPattern22.js +++ b/tests/baselines/reference/iterableArrayPattern22.js @@ -2,7 +2,4 @@ var [...a] = { 0: "", 1: true }; //// [iterableArrayPattern22.js] -var [...a] = { - 0: "", - 1: true -}; +var [...a] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern23.js b/tests/baselines/reference/iterableArrayPattern23.js index ffeb1abe32e..d932c29506d 100644 --- a/tests/baselines/reference/iterableArrayPattern23.js +++ b/tests/baselines/reference/iterableArrayPattern23.js @@ -4,10 +4,4 @@ var a: string, b: boolean; //// [iterableArrayPattern23.js] var a, b; -[ - a, - b -] = { - 0: "", - 1: true -}; +[a, b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern24.js b/tests/baselines/reference/iterableArrayPattern24.js index 89cc3e2dc99..f089e35dad8 100644 --- a/tests/baselines/reference/iterableArrayPattern24.js +++ b/tests/baselines/reference/iterableArrayPattern24.js @@ -4,10 +4,4 @@ var a: string, b: boolean[]; //// [iterableArrayPattern24.js] var a, b; -[ - a, - ...b -] = { - 0: "", - 1: true -}; +[a, ...b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern25.js b/tests/baselines/reference/iterableArrayPattern25.js index 63686f5a39e..1dc44c0dba7 100644 --- a/tests/baselines/reference/iterableArrayPattern25.js +++ b/tests/baselines/reference/iterableArrayPattern25.js @@ -3,15 +3,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); //// [iterableArrayPattern25.js] -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} -takeFirstTwoEntries(new Map([ - [ - "", - 0 - ], - [ - "hello", - 1 - ] -])); +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern26.js b/tests/baselines/reference/iterableArrayPattern26.js index 7edcf52b6ba..63c188febb7 100644 --- a/tests/baselines/reference/iterableArrayPattern26.js +++ b/tests/baselines/reference/iterableArrayPattern26.js @@ -3,15 +3,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); //// [iterableArrayPattern26.js] -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} -takeFirstTwoEntries(new Map([ - [ - "", - 0 - ], - [ - "hello", - 1 - ] -])); +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern27.js b/tests/baselines/reference/iterableArrayPattern27.js index 2d8a7e9d76e..3e936eb51f4 100644 --- a/tests/baselines/reference/iterableArrayPattern27.js +++ b/tests/baselines/reference/iterableArrayPattern27.js @@ -3,15 +3,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); //// [iterableArrayPattern27.js] -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} -takeFirstTwoEntries(...new Map([ - [ - "", - 0 - ], - [ - "hello", - 1 - ] -])); +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern28.js b/tests/baselines/reference/iterableArrayPattern28.js index 03e9264f72d..70953475372 100644 --- a/tests/baselines/reference/iterableArrayPattern28.js +++ b/tests/baselines/reference/iterableArrayPattern28.js @@ -3,15 +3,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); //// [iterableArrayPattern28.js] -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} -takeFirstTwoEntries(...new Map([ - [ - "", - 0 - ], - [ - "hello", - true - ] -])); +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); diff --git a/tests/baselines/reference/iterableArrayPattern29.js b/tests/baselines/reference/iterableArrayPattern29.js index 926f5608bd0..912d336263f 100644 --- a/tests/baselines/reference/iterableArrayPattern29.js +++ b/tests/baselines/reference/iterableArrayPattern29.js @@ -3,15 +3,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); //// [iterableArrayPattern29.js] -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { -} -takeFirstTwoEntries(...new Map([ - [ - "", - true - ], - [ - "hello", - true - ] -])); +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); diff --git a/tests/baselines/reference/iterableArrayPattern3.js b/tests/baselines/reference/iterableArrayPattern3.js index 4180bac8960..7136c6ab209 100644 --- a/tests/baselines/reference/iterableArrayPattern3.js +++ b/tests/baselines/reference/iterableArrayPattern3.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern3.js] var a, b; -[ - a, - b -] = new FooIterator; +[a, b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern30.js b/tests/baselines/reference/iterableArrayPattern30.js index aafa09c3911..10f7df53aa3 100644 --- a/tests/baselines/reference/iterableArrayPattern30.js +++ b/tests/baselines/reference/iterableArrayPattern30.js @@ -2,13 +2,4 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) //// [iterableArrayPattern30.js] -const [[k1, v1], [k2, v2]] = new Map([ - [ - "", - true - ], - [ - "hello", - true - ] -]); +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]); diff --git a/tests/baselines/reference/iterableArrayPattern4.js b/tests/baselines/reference/iterableArrayPattern4.js index a03263e3c5e..6e60dadbd7a 100644 --- a/tests/baselines/reference/iterableArrayPattern4.js +++ b/tests/baselines/reference/iterableArrayPattern4.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern4.js] var a, b; -[ - a, - ...b -] = new FooIterator; +[a, ...b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern5.js b/tests/baselines/reference/iterableArrayPattern5.js index 84e14644aa9..77e71cac6d3 100644 --- a/tests/baselines/reference/iterableArrayPattern5.js +++ b/tests/baselines/reference/iterableArrayPattern5.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern5.js] var a, b; -[ - a, - b -] = new FooIterator; +[a, b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern6.js b/tests/baselines/reference/iterableArrayPattern6.js index b4faf6394e6..8c797e819f5 100644 --- a/tests/baselines/reference/iterableArrayPattern6.js +++ b/tests/baselines/reference/iterableArrayPattern6.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern6.js] var a, b; -[ - a, - ...b -] = new FooIterator; +[a, ...b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern7.js b/tests/baselines/reference/iterableArrayPattern7.js index 30a8d24bbd2..3f79e6bfba8 100644 --- a/tests/baselines/reference/iterableArrayPattern7.js +++ b/tests/baselines/reference/iterableArrayPattern7.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern7.js] var a, b; -[ - a, - b -] = new FooIterator; +[a, b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern8.js b/tests/baselines/reference/iterableArrayPattern8.js index 35a4a62a3df..dd1c76c1f51 100644 --- a/tests/baselines/reference/iterableArrayPattern8.js +++ b/tests/baselines/reference/iterableArrayPattern8.js @@ -18,10 +18,7 @@ class FooIterator { //// [iterableArrayPattern8.js] var a, b; -[ - a, - ...b -] = new FooIterator; +[a, ...b] = new FooIterator; class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iterableArrayPattern9.js b/tests/baselines/reference/iterableArrayPattern9.js index 558758561a4..a85ca9c347b 100644 --- a/tests/baselines/reference/iterableArrayPattern9.js +++ b/tests/baselines/reference/iterableArrayPattern9.js @@ -16,8 +16,7 @@ class FooIterator { } //// [iterableArrayPattern9.js] -function fun([a, b] = new FooIterator) { -} +function fun([a, b] = new FooIterator) { } class Bar { } class Foo extends Bar { diff --git a/tests/baselines/reference/iteratorSpreadInArray.js b/tests/baselines/reference/iteratorSpreadInArray.js index ae1a2c5916c..8e25a2e7ecf 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.js +++ b/tests/baselines/reference/iteratorSpreadInArray.js @@ -15,9 +15,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray.js] -var array = [ - ...new SymbolIterator -]; +var array = [...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray10.js b/tests/baselines/reference/iteratorSpreadInArray10.js index c33d7e8a015..1004dbd7b34 100644 --- a/tests/baselines/reference/iteratorSpreadInArray10.js +++ b/tests/baselines/reference/iteratorSpreadInArray10.js @@ -8,9 +8,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray10.js] -var array = [ - ...new SymbolIterator -]; +var array = [...new SymbolIterator]; class SymbolIterator { [Symbol.iterator]() { return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray11.js b/tests/baselines/reference/iteratorSpreadInArray11.js index 830fa04380b..fa86c152123 100644 --- a/tests/baselines/reference/iteratorSpreadInArray11.js +++ b/tests/baselines/reference/iteratorSpreadInArray11.js @@ -4,6 +4,4 @@ var array = [...iter]; //// [iteratorSpreadInArray11.js] var iter; -var array = [ - ...iter -]; +var array = [...iter]; diff --git a/tests/baselines/reference/iteratorSpreadInArray2.js b/tests/baselines/reference/iteratorSpreadInArray2.js index 4589d9bb904..aa4a1099a40 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.js +++ b/tests/baselines/reference/iteratorSpreadInArray2.js @@ -28,10 +28,7 @@ class NumberIterator { } //// [iteratorSpreadInArray2.js] -var array = [ - ...new NumberIterator, - ...new SymbolIterator -]; +var array = [...new NumberIterator, ...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray3.js b/tests/baselines/reference/iteratorSpreadInArray3.js index b9eac64b29f..1d468e4483e 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.js +++ b/tests/baselines/reference/iteratorSpreadInArray3.js @@ -15,13 +15,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray3.js] -var array = [ - ...[ - 0, - 1 - ], - ...new SymbolIterator -]; +var array = [...[0, 1], ...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray4.js b/tests/baselines/reference/iteratorSpreadInArray4.js index 22571495f05..82a08bfa964 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.js +++ b/tests/baselines/reference/iteratorSpreadInArray4.js @@ -15,11 +15,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray4.js] -var array = [ - 0, - 1, - ...new SymbolIterator -]; +var array = [0, 1, ...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray5.js b/tests/baselines/reference/iteratorSpreadInArray5.js index b5e4c95d22b..0aa158a5dc2 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.js +++ b/tests/baselines/reference/iteratorSpreadInArray5.js @@ -15,11 +15,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray5.js] -var array = [ - 0, - 1, - ...new SymbolIterator -]; +var array = [0, 1, ...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray6.js b/tests/baselines/reference/iteratorSpreadInArray6.js index df34201b827..02d1c435b8c 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.js +++ b/tests/baselines/reference/iteratorSpreadInArray6.js @@ -16,13 +16,8 @@ class SymbolIterator { } //// [iteratorSpreadInArray6.js] -var array = [ - 0, - 1 -]; -array.concat([ - ...new SymbolIterator -]); +var array = [0, 1]; +array.concat([...new SymbolIterator]); class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray7.js b/tests/baselines/reference/iteratorSpreadInArray7.js index ca7acd5a786..72a614ae4ec 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.js +++ b/tests/baselines/reference/iteratorSpreadInArray7.js @@ -17,9 +17,7 @@ class SymbolIterator { //// [iteratorSpreadInArray7.js] var array; -array.concat([ - ...new SymbolIterator -]); +array.concat([...new SymbolIterator]); class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray8.js b/tests/baselines/reference/iteratorSpreadInArray8.js index e1edeee1168..08378699129 100644 --- a/tests/baselines/reference/iteratorSpreadInArray8.js +++ b/tests/baselines/reference/iteratorSpreadInArray8.js @@ -11,9 +11,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray8.js] -var array = [ - ...new SymbolIterator -]; +var array = [...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInArray9.js b/tests/baselines/reference/iteratorSpreadInArray9.js index 93de78065fb..ed0a9b4ebe9 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.js +++ b/tests/baselines/reference/iteratorSpreadInArray9.js @@ -14,9 +14,7 @@ class SymbolIterator { } //// [iteratorSpreadInArray9.js] -var array = [ - ...new SymbolIterator -]; +var array = [...new SymbolIterator]; class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall.js b/tests/baselines/reference/iteratorSpreadInCall.js index 0dcff404f53..f3bf17c0327 100644 --- a/tests/baselines/reference/iteratorSpreadInCall.js +++ b/tests/baselines/reference/iteratorSpreadInCall.js @@ -17,8 +17,7 @@ class SymbolIterator { //// [iteratorSpreadInCall.js] foo(...new SymbolIterator); -function foo(s) { -} +function foo(s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall10.js b/tests/baselines/reference/iteratorSpreadInCall10.js index 5c400ae2c30..14a08c97009 100644 --- a/tests/baselines/reference/iteratorSpreadInCall10.js +++ b/tests/baselines/reference/iteratorSpreadInCall10.js @@ -18,9 +18,7 @@ class SymbolIterator { //// [iteratorSpreadInCall10.js] foo(...new SymbolIterator); -function foo(s) { - return s[0]; -} +function foo(s) { return s[0]; } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall11.js b/tests/baselines/reference/iteratorSpreadInCall11.js index a3cccb96409..d01eb259ef3 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.js +++ b/tests/baselines/reference/iteratorSpreadInCall11.js @@ -18,9 +18,7 @@ class SymbolIterator { //// [iteratorSpreadInCall11.js] foo(...new SymbolIterator); -function foo(...s) { - return s[0]; -} +function foo(...s) { return s[0]; } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall12.js b/tests/baselines/reference/iteratorSpreadInCall12.js index dd95cab0cf8..90b9d9b900b 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.js +++ b/tests/baselines/reference/iteratorSpreadInCall12.js @@ -32,12 +32,7 @@ class StringIterator { } //// [iteratorSpreadInCall12.js] -new Foo(...[ - ...new SymbolIterator, - ...[ - ...new StringIterator - ] -]); +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); class Foo { constructor(...s) { } diff --git a/tests/baselines/reference/iteratorSpreadInCall2.js b/tests/baselines/reference/iteratorSpreadInCall2.js index d833cd77fb0..6c3517857d5 100644 --- a/tests/baselines/reference/iteratorSpreadInCall2.js +++ b/tests/baselines/reference/iteratorSpreadInCall2.js @@ -17,8 +17,7 @@ class SymbolIterator { //// [iteratorSpreadInCall2.js] foo(...new SymbolIterator); -function foo(s) { -} +function foo(s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall3.js b/tests/baselines/reference/iteratorSpreadInCall3.js index 17d0a3ed37d..b33ceae7bfd 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.js +++ b/tests/baselines/reference/iteratorSpreadInCall3.js @@ -17,8 +17,7 @@ class SymbolIterator { //// [iteratorSpreadInCall3.js] foo(...new SymbolIterator); -function foo(...s) { -} +function foo(...s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall4.js b/tests/baselines/reference/iteratorSpreadInCall4.js index e1888f47634..7819a1ba6f9 100644 --- a/tests/baselines/reference/iteratorSpreadInCall4.js +++ b/tests/baselines/reference/iteratorSpreadInCall4.js @@ -17,8 +17,7 @@ class SymbolIterator { //// [iteratorSpreadInCall4.js] foo(...new SymbolIterator); -function foo(s1, ...s) { -} +function foo(s1, ...s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall5.js b/tests/baselines/reference/iteratorSpreadInCall5.js index 2b7be4cdce6..a4a30ee0166 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.js +++ b/tests/baselines/reference/iteratorSpreadInCall5.js @@ -30,8 +30,7 @@ class StringIterator { //// [iteratorSpreadInCall5.js] foo(...new SymbolIterator, ...new StringIterator); -function foo(...s) { -} +function foo(...s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall6.js b/tests/baselines/reference/iteratorSpreadInCall6.js index 87e96d039de..8ad60be911e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.js +++ b/tests/baselines/reference/iteratorSpreadInCall6.js @@ -30,8 +30,7 @@ class StringIterator { //// [iteratorSpreadInCall6.js] foo(...new SymbolIterator, ...new StringIterator); -function foo(...s) { -} +function foo(...s) { } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall7.js b/tests/baselines/reference/iteratorSpreadInCall7.js index 1b7e53ba47a..4a56b75d236 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.js +++ b/tests/baselines/reference/iteratorSpreadInCall7.js @@ -30,9 +30,7 @@ class StringIterator { //// [iteratorSpreadInCall7.js] foo(...new SymbolIterator, ...new StringIterator); -function foo(...s) { - return s[0]; -} +function foo(...s) { return s[0]; } class SymbolIterator { next() { return { diff --git a/tests/baselines/reference/iteratorSpreadInCall9.js b/tests/baselines/reference/iteratorSpreadInCall9.js index 2efd94683c0..2a73ee29c34 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.js +++ b/tests/baselines/reference/iteratorSpreadInCall9.js @@ -32,9 +32,7 @@ class StringIterator { } //// [iteratorSpreadInCall9.js] -new Foo(...new SymbolIterator, ...[ - ...new StringIterator -]); +new Foo(...new SymbolIterator, ...[...new StringIterator]); class Foo { constructor(...s) { } From 180f17d088215da098612f9f5b37d8ecc0ef058f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 8 Apr 2015 17:02:42 -0700 Subject: [PATCH 45/69] Destructure arguments at dispatched calls. --- src/server/session.ts | 114 +++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 69 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index faedce0e1af..09373d6bf96 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -118,7 +118,7 @@ module ts.server { constructor(private host: ServerHost, private logger: Logger) { this.projectService = - new ProjectService(host, logger, (eventName,project,fileName) => { + new ProjectService(host, logger, (eventName, project, fileName) => { this.handleEvent(eventName, project, fileName); }); } @@ -263,7 +263,7 @@ module ts.server { } } - getDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] { + getDefinition({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.FileSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -285,7 +285,7 @@ module ts.server { })); } - getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] { + getOccurrences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] { fileName = ts.normalizePath(fileName); let project = this.projectService.getProjectForFile(fileName); @@ -315,7 +315,7 @@ module ts.server { }); } - getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody { + getRenameLocations({line, offset, file: fileName, findInComments, findInStrings }: protocol.RenameRequestArgs): protocol.RenameResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -383,7 +383,7 @@ module ts.server { return { info: renameInfo, locs: bakedRenameLocs }; } - getReferences(line: number, offset: number, fileName: string): protocol.ReferencesResponseBody { + getReferences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.ReferencesResponseBody { // TODO: get all projects for this file; report refs for all projects deleting duplicates // can avoid duplicates by eliminating same ref file from subsequent projects var file = ts.normalizePath(fileName); @@ -430,12 +430,12 @@ module ts.server { }; } - openClientFile(fileName: string) { + openClientFile({ file: fileName }: protocol.OpenRequestArgs) { var file = ts.normalizePath(fileName); this.projectService.openClientFile(file); } - getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody { + getQuickInfo({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.QuickInfoResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -461,7 +461,7 @@ module ts.server { }; } - getFormattingEditsForRange(line: number, offset: number, endLine: number, endOffset: number, fileName: string): protocol.CodeEdit[] { + getFormattingEditsForRange({line, offset, endLine, endOffset, file: fileName}: protocol.FormatRequestArgs): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -488,7 +488,7 @@ module ts.server { }); } - getFormattingEditsAfterKeystroke(line: number, offset: number, key: string, fileName: string): protocol.CodeEdit[] { + getFormattingEditsAfterKeystroke({line, offset, key, file: fileName}: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -561,7 +561,7 @@ module ts.server { }); } - getCompletions(line: number, offset: number, prefix: string, fileName: string): protocol.CompletionEntry[] { + getCompletions({ line, offset, prefix, file: fileName}: protocol.CompletionsRequestArgs): protocol.CompletionEntry[] { if (!prefix) { prefix = ""; } @@ -587,8 +587,7 @@ module ts.server { }, []).sort((a, b) => a.name.localeCompare(b.name)); } - getCompletionEntryDetails(line: number, offset: number, - entryNames: string[], fileName: string): protocol.CompletionEntryDetails[] { + getCompletionEntryDetails({ line, offset, entryNames, file: fileName}: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -607,20 +606,20 @@ module ts.server { }, []); } - getSignatureHelpItems(line: number, offset: number, fileName: string): protocol.SignatureHelpItems { + getSignatureHelpItems({ line, offset, file: fileName }: protocol.SignatureHelpRequestArgs): protocol.SignatureHelpItems { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { throw Errors.NoProject; } - + var compilerService = project.compilerService; var position = compilerService.host.lineOffsetToPosition(file, line, offset); var helpItems = compilerService.languageService.getSignatureHelpItems(file, position); if (!helpItems) { return undefined; } - + var span = helpItems.applicableSpan; var result: protocol.SignatureHelpItems = { items: helpItems.items, @@ -632,11 +631,11 @@ module ts.server { argumentIndex: helpItems.argumentIndex, argumentCount: helpItems.argumentCount, } - + return result; } - - getDiagnostics(delay: number, fileNames: string[]) { + + getDiagnostics({ delay, files: fileNames }: protocol.GeterrRequestArgs): void { var checkList = fileNames.reduce((accum: PendingErrorCheck[], fileName: string) => { fileName = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(fileName); @@ -647,11 +646,11 @@ module ts.server { }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay) + this.updateErrorCheck(checkList, this.changeSeq, (n) => n == this.changeSeq, delay) } } - change(line: number, offset: number, endLine: number, endOffset: number, insertString: string, fileName: string) { + change({ line, offset, endLine, endOffset, insertString, file: fileName }: protocol.ChangeRequestArgs): void { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (project) { @@ -666,7 +665,7 @@ module ts.server { } } - reload(fileName: string, tempFileName: string, reqSeq = 0) { + reload({ file: fileName, tmpfile: tempFileName }: protocol.ReloadRequestArgs, reqSeq = 0): void { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); var project = this.projectService.getProjectForFile(file); @@ -679,7 +678,7 @@ module ts.server { } } - saveToTmp(fileName: string, tempFileName: string) { + saveToTmp({ file: fileName, tmpfile: tempFileName }: protocol.SavetoRequestArgs): void { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); @@ -689,7 +688,7 @@ module ts.server { } } - closeClientFile(fileName: string) { + closeClientFile({ file: fileName }: protocol.FileRequestArgs) { var file = ts.normalizePath(fileName); this.projectService.closeClientFile(file); } @@ -713,7 +712,7 @@ module ts.server { })); } - getNavigationBarItems(fileName: string): protocol.NavigationBarItem[] { + getNavigationBarItems({ file: fileName }: protocol.FileRequestArgs): protocol.NavigationBarItem[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -729,7 +728,7 @@ module ts.server { return this.decorateNavigationBarItem(project, fileName, items); } - getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] { + getNavigateToItems({ searchValue, file: fileName, maxResultCount }: protocol.NavtoRequestArgs): protocol.NavtoItem[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -768,7 +767,7 @@ module ts.server { }); } - getBraceMatching(line: number, offset: number, fileName: string): protocol.TextSpan[] { + getBraceMatching({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.TextSpan[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -810,114 +809,91 @@ module ts.server { break; } case CommandNames.Definition: { - var defArgs = request.arguments; - response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); + response = this.getDefinition(request.arguments); break; } case CommandNames.References: { - var refArgs = request.arguments; - response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); + response = this.getReferences(request.arguments); break; } case CommandNames.Rename: { - var renameArgs = request.arguments; - response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); + response = this.getRenameLocations(request.arguments); break; } case CommandNames.Open: { - var openArgs = request.arguments; - this.openClientFile(openArgs.file); + this.openClientFile(request.arguments); responseRequired = false; break; } case CommandNames.Quickinfo: { - var quickinfoArgs = request.arguments; - response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file); + response = this.getQuickInfo(request.arguments); break; } case CommandNames.Format: { - var formatArgs = request.arguments; - response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file); + response = this.getFormattingEditsForRange(request.arguments); break; } case CommandNames.Formatonkey: { - var formatOnKeyArgs = request.arguments; - response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file); + response = this.getFormattingEditsAfterKeystroke(request.arguments); break; } case CommandNames.Completions: { - var completionsArgs = request.arguments; - response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file); + response = this.getCompletions(request.arguments); break; } case CommandNames.CompletionDetails: { - var completionDetailsArgs = request.arguments; - response = - this.getCompletionEntryDetails(completionDetailsArgs.line,completionDetailsArgs.offset, - completionDetailsArgs.entryNames,completionDetailsArgs.file); + response = this.getCompletionEntryDetails(request.arguments); break; } case CommandNames.SignatureHelp: { - var signatureHelpArgs = request.arguments; - response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file); + response = this.getSignatureHelpItems(request.arguments); break; } case CommandNames.Geterr: { - var geterrArgs = request.arguments; - response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); + this.getDiagnostics(request.arguments); responseRequired = false; break; } case CommandNames.Change: { - var changeArgs = request.arguments; - this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset, - changeArgs.insertString, changeArgs.file); + this.change(request.arguments); responseRequired = false; break; } case CommandNames.Configure: { - var configureArgs = request.arguments; - this.projectService.setHostConfiguration(configureArgs); + this.projectService.setHostConfiguration(request.arguments); this.output(undefined, CommandNames.Configure, request.seq); responseRequired = false; break; } case CommandNames.Reload: { - var reloadArgs = request.arguments; - this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); + this.reload(request.arguments); responseRequired = false; break; } case CommandNames.Saveto: { - var savetoArgs = request.arguments; - this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + this.saveToTmp(request.arguments); responseRequired = false; break; } case CommandNames.Close: { - var closeArgs = request.arguments; - this.closeClientFile(closeArgs.file); + this.closeClientFile(request.arguments); responseRequired = false; break; } case CommandNames.Navto: { - var navtoArgs = request.arguments; - response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); + response = this.getNavigateToItems(request.arguments); break; } case CommandNames.Brace: { - var braceArguments = request.arguments; - response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file); + response = this.getBraceMatching(request.arguments); break; } case CommandNames.NavBar: { - var navBarArgs = request.arguments; - response = this.getNavigationBarItems(navBarArgs.file); + response = this.getNavigationBarItems(request.arguments); break; } case CommandNames.Occurrences: { - var { line, offset, file: fileName } = request.arguments; - response = this.getOccurrences(line, offset, fileName); + response = this.getOccurrences(request.arguments); break; } default: { From 609036a2d669572145fb18d96a213fa3f5c6e784 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 8 Apr 2015 17:06:00 -0700 Subject: [PATCH 46/69] PR feedback and baseline updates --- src/compiler/utilities.ts | 14 ++++++++------ src/services/formatting/formatting.ts | 4 ++-- src/services/formatting/rules.ts | 14 +++----------- src/services/services.ts | 6 +++--- tests/baselines/reference/APISample_linter.types | 4 ++-- tests/cases/fourslash/formattingDecorators.ts | 14 +++++++------- 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 30f392e5ded..a10be6ba225 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -150,20 +150,22 @@ module ts { return !nodeIsMissing(node); } - export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile, skipDecorators?: boolean): number { + export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. if (nodeIsMissing(node)) { return node.pos; } - let pos = node.pos; - if (skipDecorators && node.decorators) { - // Skip past decorators - pos = node.decorators.end; + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); + } + + export function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); } - return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, pos); + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); } export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string { diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index ddf2f4cad27..0f5f49f3d8f 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -330,7 +330,7 @@ module ts.formatting { let startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; let undecoratedStartLine = startLine; if (enclosingNode.decorators) { - undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile, /*skipDecorators*/ true)).line; + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; } let delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); @@ -561,7 +561,7 @@ module ts.formatting { let undecoratedChildStartLine = childStartLine; if (child.decorators) { - undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(child.getStart(sourceFile, /*skipDecorators*/ true)).line; + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(child, sourceFile)).line; } // if child is a list item - try to get its indentation diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index ac3d7fe6783..f5cb8cb4e64 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -670,18 +670,10 @@ module ts.formatting { } static NodeIsInDecoratorContext(node: Node): boolean { - if (node.parserContextFlags & ParserContextFlags.Decorator) { - return true; + while (isExpression(node)) { + node = node.parent; } - while (node) { - if (isExpression(node)) { - node = node.parent; - } - else { - return node.kind === SyntaxKind.Decorator; - } - } - return false; + return node.kind === SyntaxKind.Decorator; } static IsStartOfVariableDeclarationList(context: FormattingContext): boolean { diff --git a/src/services/services.ts b/src/services/services.ts index 042e2f4f01e..86c323f24bf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -19,7 +19,7 @@ module ts { getChildCount(sourceFile?: SourceFile): number; getChildAt(index: number, sourceFile?: SourceFile): Node; getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile, skipDecorators?: boolean): number; + getStart(sourceFile?: SourceFile): number; getFullStart(): number; getEnd(): number; getWidth(sourceFile?: SourceFile): number; @@ -149,8 +149,8 @@ module ts { return getSourceFileOfNode(this); } - public getStart(sourceFile?: SourceFile, skipDecorators?: boolean): number { - return getTokenPosOfNode(this, sourceFile, skipDecorators); + public getStart(sourceFile?: SourceFile): number { + return getTokenPosOfNode(this, sourceFile); } public getFullStart(): number { diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 5db938d63bd..609f08f3a76 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -237,9 +237,9 @@ export function delint(sourceFile: ts.SourceFile) { >sourceFile : ts.SourceFile >getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile, skipDecorators?: boolean) => number +>node.getStart : (sourceFile?: ts.SourceFile) => number >node : ts.Node ->getStart : (sourceFile?: ts.SourceFile, skipDecorators?: boolean) => number +>getStart : (sourceFile?: ts.SourceFile) => number console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); >console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any diff --git a/tests/cases/fourslash/formattingDecorators.ts b/tests/cases/fourslash/formattingDecorators.ts index 9fc63d9d47b..366b9cb7729 100644 --- a/tests/cases/fourslash/formattingDecorators.ts +++ b/tests/cases/fourslash/formattingDecorators.ts @@ -1,11 +1,11 @@ /// -/////*1*/ @ decorator1 +/////*1*/ @ decorator1 /////*2*/ @ decorator2 /////*3*/ @decorator3 /////*4*/ @ decorator4 @ decorator5 /////*5*/class C { -/////*6*/ @ decorator6 +/////*6*/ @ decorator6 /////*7*/ @ decorator7 /////*8*/ @decorator8 /////*9*/ method1() { } @@ -13,7 +13,7 @@ /////*10*/ @ decorator9 @ decorator10 @decorator11 method2() { } //// //// method3( -/////*11*/ @ decorator12 +/////*11*/ @ decorator12 /////*12*/ @ decorator13 /////*13*/ @decorator14 /////*14*/ x) { } @@ -21,21 +21,21 @@ //// method4( /////*15*/ @ decorator15 @ decorator16 @decorator17 x) { } //// -/////*16*/ @ decorator18 +/////*16*/ @ decorator18 /////*17*/ @ decorator19 -/////*18*/ @decorator20 +/////*18*/ @decorator20 /////*19*/ ["computed1"]() { } //// /////*20*/ @ decorator21 @ decorator22 @decorator23 ["computed2"]() { } //// -/////*21*/ @ decorator24 +/////*21*/ @ decorator24 /////*22*/ @ decorator25 /////*23*/ @decorator26 /////*24*/ get accessor1() { } //// /////*25*/ @ decorator27 @ decorator28 @decorator29 get accessor2() { } //// -/////*26*/ @ decorator30 +/////*26*/ @ decorator30 /////*27*/ @ decorator31 /////*28*/ @decorator32 /////*29*/ property1; From 6dee32a703e50b12a709af6bbf0e6c8b54c41865 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 21:59:50 -0700 Subject: [PATCH 47/69] Extract code for getting syntactic document highlights into its own function. --- src/harness/harnessLanguageService.ts | 3 + src/server/client.ts | 4 + src/services/services.ts | 729 ++++++++++++++------------ src/services/shims.ts | 15 + 4 files changed, 427 insertions(+), 324 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 299ba52bdeb..ccc56a6d314 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -336,6 +336,9 @@ module Harness.LanguageService { getOccurrencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] { return unwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName, position)); } + getDocumentHighlights(fileName: string, position: number): ts.DocumentHighlights[] { + return unwrapJSONCallResult(this.shim.getDocumentHighlights(fileName, position)); + } getNavigateToItems(searchValue: string): ts.NavigateToItem[] { return unwrapJSONCallResult(this.shim.getNavigateToItems(searchValue)); } diff --git a/src/server/client.ts b/src/server/client.ts index d395d2a832c..aba77c28b41 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -468,6 +468,10 @@ module ts.server { throw new Error("Not Implemented Yet."); } + getDocumentHighlights(fileName: string, position: number): DocumentHighlights[] { + throw new Error("Not Implemented Yet."); + } + getOutliningSpans(fileName: string): OutliningSpan[] { throw new Error("Not Implemented Yet."); } diff --git a/src/services/services.ts b/src/services/services.ts index 86c323f24bf..8967a8cd9f2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -944,8 +944,11 @@ module ts { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; findReferences(fileName: string, position: number): ReferencedSymbol[]; + getDocumentHighlights(fileName: string, position: number): DocumentHighlights[]; + + /** @deprecated */ + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; @@ -1011,6 +1014,16 @@ module ts { isWriteAccess: boolean; } + export interface DocumentHighlights { + fileName: string; + highlightSpans: HighlightSpan[]; + } + + export interface HighlightSpan { + textSpan: TextSpan; + isDefinition: boolean; + } + export interface NavigateToItem { name: string; kind: string; @@ -3961,18 +3974,15 @@ module ts { if (results) { let sourceFile = getCanonicalFileName(normalizeSlashes(fileName)); - // ensure the results are in the file we're interested in - results.forEach((value) => { - let targetFile = getCanonicalFileName(normalizeSlashes(value.fileName)); - Debug.assert(sourceFile == targetFile, `Unexpected file in results. Found results in ${targetFile} expected only results in ${sourceFile}.`); - }); + // Get occurrences only supports reporting occurrences for the file queried. So + // filter down to that list. + results = filter(results, r => r.fileName === fileName); } return results; } - /// References and Occurrences - function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { + function getDocumentHighlights(fileName: string, position: number): DocumentHighlights[] { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); @@ -3982,201 +3992,115 @@ module ts { return undefined; } - if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false)); + return getSyntacticDocumentHighlights(node); + } + + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node: Node, kind: SyntaxKind) { + return node !== undefined && node.kind === kind; + } + + // Null-propagating 'parent' function. + function parent(node: Node): Node { + return node && node.parent; + } + + function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { + let sourceFile = node.getSourceFile(); + let fileName = sourceFile.fileName; + + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; } - switch (node.kind) { - case SyntaxKind.IfKeyword: - case SyntaxKind.ElseKeyword: - if (hasKind(node.parent, SyntaxKind.IfStatement)) { - return getIfElseOccurrences(node.parent); - } - break; - case SyntaxKind.ReturnKeyword: - if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { - return getReturnOccurrences(node.parent); - } - break; - case SyntaxKind.ThrowKeyword: - if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { - return getThrowOccurrences(node.parent); - } - break; - case SyntaxKind.CatchKeyword: - if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case SyntaxKind.TryKeyword: - case SyntaxKind.FinallyKeyword: - if (hasKind(parent(node), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case SyntaxKind.SwitchKeyword: - if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case SyntaxKind.CaseKeyword: - case SyntaxKind.DefaultKeyword: - if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case SyntaxKind.BreakKeyword: - case SyntaxKind.ContinueKeyword: - if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case SyntaxKind.ForKeyword: - if (hasKind(node.parent, SyntaxKind.ForStatement) || - hasKind(node.parent, SyntaxKind.ForInStatement) || - hasKind(node.parent, SyntaxKind.ForOfStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.WhileKeyword: - case SyntaxKind.DoKeyword: - if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.ConstructorKeyword: - if (hasKind(node.parent, SyntaxKind.Constructor)) { - return getConstructorOccurrences(node.parent); - } - break; - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { - return getGetAndSetOccurrences(node.parent); - } - default: - if (isModifier(node.kind) && node.parent && - (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { - return getModifierOccurrences(node.kind, node.parent); - } - } + return [{ fileName, highlightSpans }]; - return undefined; - - function getIfElseOccurrences(ifStatement: IfStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - let children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); - - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (let i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { - break; - } - } - - if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { - break - } - - ifStatement = ifStatement.elseStatement; - } - - let result: ReferenceEntry[] = []; - - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (let i = 0; i < keywords.length; i++) { - if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { - let elseKeyword = keywords[i]; - let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - - let shouldHighlightNextKeyword = true; - - // Avoid recalculating getStart() by iterating backwards. - for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldHighlightNextKeyword = false; - break; + function getHighlightSpans(node: Node): HighlightSpan[] { + if (node) { + switch (node.kind) { + case SyntaxKind.IfKeyword: + case SyntaxKind.ElseKeyword: + if (hasKind(node.parent, SyntaxKind.IfStatement)) { + return getIfElseOccurrences(node.parent); + } + break; + case SyntaxKind.ReturnKeyword: + if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { + return getReturnOccurrences(node.parent); + } + break; + case SyntaxKind.ThrowKeyword: + if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { + return getThrowOccurrences(node.parent); + } + break; + case SyntaxKind.CatchKeyword: + if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case SyntaxKind.TryKeyword: + case SyntaxKind.FinallyKeyword: + if (hasKind(parent(node), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case SyntaxKind.SwitchKeyword: + if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case SyntaxKind.CaseKeyword: + case SyntaxKind.DefaultKeyword: + if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case SyntaxKind.BreakKeyword: + case SyntaxKind.ContinueKeyword: + if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case SyntaxKind.ForKeyword: + if (hasKind(node.parent, SyntaxKind.ForStatement) || + hasKind(node.parent, SyntaxKind.ForInStatement) || + hasKind(node.parent, SyntaxKind.ForOfStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.WhileKeyword: + case SyntaxKind.DoKeyword: + if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.ConstructorKeyword: + if (hasKind(node.parent, SyntaxKind.Constructor)) { + return getConstructorOccurrences(node.parent); + } + break; + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { + return getGetAndSetOccurrences(node.parent); + } + default: + if (isModifier(node.kind) && node.parent && + (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { + return getModifierOccurrences(node.kind, node.parent); } - } - - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; // skip the next keyword - continue; - } } - - // Ordinary case: just highlight the keyword. - result.push(getReferenceEntryFromNode(keywords[i])); } - return result; - } - - function getReturnOccurrences(returnStatement: ReturnStatement): ReferenceEntry[] { - let func = getContainingFunction(returnStatement); - - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, SyntaxKind.Block))) { - return undefined; - } - - let keywords: Node[] = [] - forEachReturnStatement(func.body, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - - // Include 'throw' statements that do not occur within a try block. - forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getThrowOccurrences(throwStatement: ThrowStatement) { - let owner = getThrowStatementOwner(throwStatement); - - if (!owner) { - return undefined; - } - - let keywords: Node[] = []; - - forEach(aggregateOwnedThrowStatements(owner), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (isFunctionBlock(owner)) { - forEachReturnStatement(owner, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - } - - return map(keywords, getReferenceEntryFromNode); + return undefined; } /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { let statementAccumulator: ThrowStatement[] = [] aggregate(node); @@ -4240,91 +4164,6 @@ module ts { return undefined; } - function getTryCatchFinallyOccurrences(tryStatement: TryStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); - - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); - } - - if (tryStatement.finallyBlock) { - let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); - pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); - } - - return map(keywords, getReferenceEntryFromNode); - } - - function getLoopBreakContinueOccurrences(loopNode: IterationStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { - // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === SyntaxKind.DoStatement) { - let loopTokens = loopNode.getChildren(); - - for (let i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { - break; - } - } - } - } - - let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); - } - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - forEach(switchStatement.caseBlock.clauses, clause => { - pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); - - let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); - } - }); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): ReferenceEntry[] { - let owner = getBreakOrContinueOwner(breakOrContinueStatement); - - if (owner) { - switch (owner.kind) { - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - return getLoopBreakContinueOccurrences(owner) - case SyntaxKind.SwitchStatement: - return getSwitchCaseDefaultOccurrences(owner); - - } - } - - return undefined; - } - function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { let statementAccumulator: BreakOrContinueStatement[] = [] aggregate(node); @@ -4376,38 +4215,7 @@ module ts { return undefined; } - function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): ReferenceEntry[] { - let declarations = constructorDeclaration.symbol.getDeclarations() - - let keywords: Node[] = []; - - forEach(declarations, declaration => { - forEach(declaration.getChildren(), token => { - return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); - }); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): ReferenceEntry[] { - let keywords: Node[] = []; - - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); - - return map(keywords, getReferenceEntryFromNode); - - function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { - let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); - - if (accessor) { - forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); - } - } - } - - function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): ReferenceEntry[] { + function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { let container = declaration.parent; // Make sure we only highlight the keyword when it makes sense to do so. @@ -4463,14 +4271,14 @@ module ts { default: Debug.fail("Invalid container kind.") } - + forEach(nodes, node => { if (node.modifiers && node.flags & modifierFlag) { forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); } }); - return map(keywords, getReferenceEntryFromNode); + return map(keywords, getHighlightSpanForNode); function getFlagFromModifier(modifier: SyntaxKind) { switch (modifier) { @@ -4492,16 +4300,6 @@ module ts { } } - // returns true if 'node' is defined and has a matching 'kind'. - function hasKind(node: Node, kind: SyntaxKind) { - return node !== undefined && node.kind === kind; - } - - // Null-propagating 'parent' function. - function parent(node: Node): Node { - return node && node.parent; - } - function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { if (token && contains(expected, token.kind)) { keywordList.push(token); @@ -4510,21 +4308,286 @@ module ts { return false; } + + function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { + let keywords: Node[] = []; + + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); + + return map(keywords, getHighlightSpanForNode); + + function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { + let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); + + if (accessor) { + forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); + } + } + } + + function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { + let declarations = constructorDeclaration.symbol.getDeclarations() + + let keywords: Node[] = []; + + forEach(declarations, declaration => { + forEach(declaration.getChildren(), token => { + return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { + let keywords: Node[] = []; + + if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === SyntaxKind.DoStatement) { + let loopTokens = loopNode.getChildren(); + + for (let i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + break; + } + } + } + } + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); + } + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { + let owner = getBreakOrContinueOwner(breakOrContinueStatement); + + if (owner) { + switch (owner.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return getLoopBreakContinueOccurrences(owner) + case SyntaxKind.SwitchStatement: + return getSwitchCaseDefaultOccurrences(owner); + + } + } + + return undefined; + } + + function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { + let keywords: Node[] = []; + + pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); + + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + forEach(switchStatement.caseBlock.clauses, clause => { + pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); + } + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { + let keywords: Node[] = []; + + pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); + + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); + } + + if (tryStatement.finallyBlock) { + let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); + pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { + let owner = getThrowStatementOwner(throwStatement); + + if (!owner) { + return undefined; + } + + let keywords: Node[] = []; + + forEach(aggregateOwnedThrowStatements(owner), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (isFunctionBlock(owner)) { + forEachReturnStatement(owner, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { + let func = getContainingFunction(returnStatement); + + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, SyntaxKind.Block))) { + return undefined; + } + + let keywords: Node[] = [] + forEachReturnStatement(func.body, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + + // Include 'throw' statements that do not occur within a try block. + forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { + let keywords: Node[] = []; + + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + let children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); + + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (let i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { + break; + } + } + + if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { + break + } + + ifStatement = ifStatement.elseStatement; + } + + let result: HighlightSpan[] = []; + + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (let i = 0; i < keywords.length; i++) { + if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { + let elseKeyword = keywords[i]; + let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + + let shouldHighlightNextKeyword = true; + + // Avoid recalculating getStart() by iterating backwards. + for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldHighlightNextKeyword = false; + break; + } + } + + if (shouldHighlightNextKeyword) { + result.push({ + fileName: fileName, + textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + isDefinition: false + }); + i++; // skip the next keyword + continue; + } + } + + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); + } + + return result; + } } - function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[]{ + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { + synchronizeHostData(); + + let sourceFile = getValidSourceFile(fileName); + + let node = getTouchingWord(sourceFile, position); + if (!node) { + return undefined; + } + + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return convertReferences(getReferencesForNode(node, [sourceFile], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false)); + } + + return convertDocumentHighlights(getSyntacticDocumentHighlights(node)); + } + + function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { + if (!documentHighlights) { + return undefined; + } + + let result: ReferenceEntry[] = []; + for (let entry of documentHighlights) { + for (let highlightSpan of entry.highlightSpans) { + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: false + }); + } + } + + return result; + } + + function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[] { if (!referenceSymbols) { return undefined; } let referenceEntries: ReferenceEntry[] = []; + for (let referenceSymbol of referenceSymbols) { addRange(referenceEntries, referenceSymbol.references); } + return referenceEntries; } - function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]{ + function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); return convertReferences(referencedSymbols); } @@ -5344,6 +5407,23 @@ module ts { } } + function getHighlightSpanForNode(node: Node): HighlightSpan { + let start = node.getStart(); + let end = node.getEnd(); + + if (node.kind === SyntaxKind.StringLiteral) { + start += 1; + end -= 1; + } + + return { + fileName: node.getSourceFile().fileName, + textSpan: createTextSpanFromBounds(start, end), + isDefinition: false + }; + + } + function getReferenceEntryFromNode(node: Node): ReferenceEntry { let start = node.getStart(); let end = node.getEnd(); @@ -6255,6 +6335,7 @@ module ts { getReferencesAtPosition, findReferences, getOccurrencesAtPosition, + getDocumentHighlights, getNameOrDottedNameSpan, getBreakpointStatementAtPosition, getNavigateToItems, diff --git a/src/services/shims.ts b/src/services/shims.ts index 7b5eeaf94d2..518b70591e3 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -135,11 +135,18 @@ module ts { findReferences(fileName: string, position: number): string; /** + * @deprecated * Returns a JSON-encoded value of the type: * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] */ getOccurrencesAtPosition(fileName: string, position: number): string; + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[] + */ + getDocumentHighlights(fileName: string, position: number): string; + /** * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; @@ -590,6 +597,14 @@ module ts { }); } + public getDocumentHighlights(fileName: string, position: number): string { + return this.forwardJSONCall( + "getDocumentHighlights('" + fileName + "', " + position + ")", + () => { + return this.languageService.getDocumentHighlights(fileName, position); + }); + } + /// COMPLETION LISTS /** From 02778b19b48c98685e6fe241885ff8be3c6816d7 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 22:24:59 -0700 Subject: [PATCH 48/69] Get semantic document highlights as well through the new API. --- src/services/services.ts | 1058 ++++++++++++++++++++------------------ 1 file changed, 545 insertions(+), 513 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 8967a8cd9f2..d1a5cb5a625 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1022,6 +1022,7 @@ module ts { export interface HighlightSpan { textSpan: TextSpan; isDefinition: boolean; + isWriteAccess: boolean; } export interface NavigateToItem { @@ -3992,546 +3993,606 @@ module ts { return undefined; } - return getSyntacticDocumentHighlights(node); - } + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); - // returns true if 'node' is defined and has a matching 'kind'. - function hasKind(node: Node, kind: SyntaxKind) { - return node !== undefined && node.kind === kind; - } + function getHighlightSpanForNode(node: Node): HighlightSpan { + let start = node.getStart(); + let end = node.getEnd(); - // Null-propagating 'parent' function. - function parent(node: Node): Node { - return node && node.parent; - } - - function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { - let sourceFile = node.getSourceFile(); - let fileName = sourceFile.fileName; - - var highlightSpans = getHighlightSpans(node); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - - return [{ fileName, highlightSpans }]; - - function getHighlightSpans(node: Node): HighlightSpan[] { - if (node) { - switch (node.kind) { - case SyntaxKind.IfKeyword: - case SyntaxKind.ElseKeyword: - if (hasKind(node.parent, SyntaxKind.IfStatement)) { - return getIfElseOccurrences(node.parent); - } - break; - case SyntaxKind.ReturnKeyword: - if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { - return getReturnOccurrences(node.parent); - } - break; - case SyntaxKind.ThrowKeyword: - if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { - return getThrowOccurrences(node.parent); - } - break; - case SyntaxKind.CatchKeyword: - if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case SyntaxKind.TryKeyword: - case SyntaxKind.FinallyKeyword: - if (hasKind(parent(node), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case SyntaxKind.SwitchKeyword: - if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case SyntaxKind.CaseKeyword: - case SyntaxKind.DefaultKeyword: - if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case SyntaxKind.BreakKeyword: - case SyntaxKind.ContinueKeyword: - if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case SyntaxKind.ForKeyword: - if (hasKind(node.parent, SyntaxKind.ForStatement) || - hasKind(node.parent, SyntaxKind.ForInStatement) || - hasKind(node.parent, SyntaxKind.ForOfStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.WhileKeyword: - case SyntaxKind.DoKeyword: - if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.ConstructorKeyword: - if (hasKind(node.parent, SyntaxKind.Constructor)) { - return getConstructorOccurrences(node.parent); - } - break; - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { - return getGetAndSetOccurrences(node.parent); - } - default: - if (isModifier(node.kind) && node.parent && - (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { - return getModifierOccurrences(node.kind, node.parent); - } - } + if (node.kind === SyntaxKind.StringLiteral) { + start += 1; + end -= 1; } - return undefined; - } - - /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ - function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { - let statementAccumulator: ThrowStatement[] = [] - aggregate(node); - return statementAccumulator; - - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.ThrowStatement) { - statementAccumulator.push(node); - } - else if (node.kind === SyntaxKind.TryStatement) { - let tryStatement = node; - - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(tryStatement.tryBlock); - } - - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } + return { + fileName: node.getSourceFile().fileName, + textSpan: createTextSpanFromBounds(start, end), + isDefinition: false, + isWriteAccess: false, }; } - /** - * For lack of a better name, this function takes a throw statement and returns the - * nearest ancestor that is a try-block (whose try statement has a catch clause), - * function-block, or source file. - */ - function getThrowStatementOwner(throwStatement: ThrowStatement): Node { - let child: Node = throwStatement; + function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.ThisKeyword || + node.kind === SyntaxKind.SuperKeyword || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { - while (child.parent) { - let parent = child.parent; + let referencedSymbols = getReferencedSymbolsForNodes(node, [node.getSourceFile()], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false); + return convertReferencedSymbols(referencedSymbols); + } - if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { - return parent; + return undefined; + + function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] { + if (!referencedSymbols) { + return undefined; } - - // A throw-statement is only owned by a try-statement if the try-statement has - // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === SyntaxKind.TryStatement) { - let tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; + let fileNameToDocumentHighlights: Map = {}; + let result: DocumentHighlights[] = []; + for (let referencedSymbol of referencedSymbols) { + for (let referenceEntry of referencedSymbol.references) { + let fileName = referenceEntry.fileName; + let documentHighlights = getProperty(fileNameToDocumentHighlights, fileName); + if (!documentHighlights) { + documentHighlights = { fileName, highlightSpans: [] }; + + fileNameToDocumentHighlights[fileName] = documentHighlights; + result.push(documentHighlights); + } + + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + isDefinition: false, + isWriteAccess: referenceEntry.isWriteAccess + }); } } - child = parent; + return result; } - - return undefined; } - function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { - let statementAccumulator: BreakOrContinueStatement[] = [] - aggregate(node); - return statementAccumulator; + function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { + let fileName = sourceFile.fileName; - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { - statementAccumulator.push(node); - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } - }; - } - - function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { - let actualOwner = getBreakOrContinueOwner(statement); - - return actualOwner && actualOwner === owner; - } - - function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { - for (let node = statement.parent; node; node = node.parent) { - switch (node.kind) { - case SyntaxKind.SwitchStatement: - if (statement.kind === SyntaxKind.ContinueStatement) { - continue; - } - // Fall through. - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; - } - break; - default: - // Don't cross function boundaries. - if (isFunctionLike(node)) { - return undefined; - } - break; - } - } - - return undefined; - } - - function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { - let container = declaration.parent; - - // Make sure we only highlight the keyword when it makes sense to do so. - if (isAccessibilityModifier(modifier)) { - if (!(container.kind === SyntaxKind.ClassDeclaration || - (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { - return undefined; - } - } - else if (modifier === SyntaxKind.StaticKeyword) { - if (container.kind !== SyntaxKind.ClassDeclaration) { - return undefined; - } - } - else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { - if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { - return undefined; - } - } - else { - // unsupported modifier + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { return undefined; } - let keywords: Node[] = []; - let modifierFlag: NodeFlags = getFlagFromModifier(modifier); + return [{ fileName, highlightSpans }]; - let nodes: Node[]; - switch (container.kind) { - case SyntaxKind.ModuleBlock: - case SyntaxKind.SourceFile: - nodes = (container).statements; - break; - case SyntaxKind.Constructor: - nodes = ((container).parameters).concat( - (container.parent).members); - break; - case SyntaxKind.ClassDeclaration: - nodes = (container).members; - - // If we're an accessibility modifier, we're in an instance member and should search - // the constructor's parameter list for instance members as well. - if (modifierFlag & NodeFlags.AccessibilityModifier) { - let constructor = forEach((container).members, member => { - return member.kind === SyntaxKind.Constructor && member; - }); - - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - Debug.fail("Invalid container kind.") + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node: Node, kind: SyntaxKind) { + return node !== undefined && node.kind === kind; } - forEach(nodes, node => { - if (node.modifiers && node.flags & modifierFlag) { - forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); - } - }); - - return map(keywords, getHighlightSpanForNode); - - function getFlagFromModifier(modifier: SyntaxKind) { - switch (modifier) { - case SyntaxKind.PublicKeyword: - return NodeFlags.Public; - case SyntaxKind.PrivateKeyword: - return NodeFlags.Private; - case SyntaxKind.ProtectedKeyword: - return NodeFlags.Protected; - case SyntaxKind.StaticKeyword: - return NodeFlags.Static; - case SyntaxKind.ExportKeyword: - return NodeFlags.Export; - case SyntaxKind.DeclareKeyword: - return NodeFlags.Ambient; - default: - Debug.fail(); - } - } - } - - function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { - if (token && contains(expected, token.kind)) { - keywordList.push(token); - return true; + // Null-propagating 'parent' function. + function parent(node: Node): Node { + return node && node.parent; } - return false; - } - - function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { - let keywords: Node[] = []; - - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); - - return map(keywords, getHighlightSpanForNode); - - function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { - let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); - - if (accessor) { - forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); - } - } - } - - function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { - let declarations = constructorDeclaration.symbol.getDeclarations() - - let keywords: Node[] = []; - - forEach(declarations, declaration => { - forEach(declaration.getChildren(), token => { - return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); - }); - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { - let keywords: Node[] = []; - - if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { - // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === SyntaxKind.DoStatement) { - let loopTokens = loopNode.getChildren(); - - for (let i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + function getHighlightSpans(node: Node): HighlightSpan[] { + if (node) { + switch (node.kind) { + case SyntaxKind.IfKeyword: + case SyntaxKind.ElseKeyword: + if (hasKind(node.parent, SyntaxKind.IfStatement)) { + return getIfElseOccurrences(node.parent); + } break; + case SyntaxKind.ReturnKeyword: + if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { + return getReturnOccurrences(node.parent); + } + break; + case SyntaxKind.ThrowKeyword: + if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { + return getThrowOccurrences(node.parent); + } + break; + case SyntaxKind.CatchKeyword: + if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case SyntaxKind.TryKeyword: + case SyntaxKind.FinallyKeyword: + if (hasKind(parent(node), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case SyntaxKind.SwitchKeyword: + if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case SyntaxKind.CaseKeyword: + case SyntaxKind.DefaultKeyword: + if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case SyntaxKind.BreakKeyword: + case SyntaxKind.ContinueKeyword: + if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case SyntaxKind.ForKeyword: + if (hasKind(node.parent, SyntaxKind.ForStatement) || + hasKind(node.parent, SyntaxKind.ForInStatement) || + hasKind(node.parent, SyntaxKind.ForOfStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.WhileKeyword: + case SyntaxKind.DoKeyword: + if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.ConstructorKeyword: + if (hasKind(node.parent, SyntaxKind.Constructor)) { + return getConstructorOccurrences(node.parent); + } + break; + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { + return getGetAndSetOccurrences(node.parent); + } + default: + if (isModifier(node.kind) && node.parent && + (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + + return undefined; + } + + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { + let statementAccumulator: ThrowStatement[] = [] + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.ThrowStatement) { + statementAccumulator.push(node); + } + else if (node.kind === SyntaxKind.TryStatement) { + let tryStatement = node; + + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); } + else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); + } + + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + }; + } + + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement: ThrowStatement): Node { + let child: Node = throwStatement; + + while (child.parent) { + let parent = child.parent; + + if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { + return parent; + } + + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent.kind === SyntaxKind.TryStatement) { + let tryStatement = parent; + + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + + child = parent; + } + + return undefined; + } + + function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { + let statementAccumulator: BreakOrContinueStatement[] = [] + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { + statementAccumulator.push(node); + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + }; + } + + function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { + let actualOwner = getBreakOrContinueOwner(statement); + + return actualOwner && actualOwner === owner; + } + + function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { + for (let node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case SyntaxKind.SwitchStatement: + if (statement.kind === SyntaxKind.ContinueStatement) { + continue; + } + // Fall through. + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.DoStatement: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (isFunctionLike(node)) { + return undefined; + } + break; + } + } + + return undefined; + } + + function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { + let container = declaration.parent; + + // Make sure we only highlight the keyword when it makes sense to do so. + if (isAccessibilityModifier(modifier)) { + if (!(container.kind === SyntaxKind.ClassDeclaration || + (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { + return undefined; + } + } + else if (modifier === SyntaxKind.StaticKeyword) { + if (container.kind !== SyntaxKind.ClassDeclaration) { + return undefined; + } + } + else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { + if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + + let keywords: Node[] = []; + let modifierFlag: NodeFlags = getFlagFromModifier(modifier); + + let nodes: Node[]; + switch (container.kind) { + case SyntaxKind.ModuleBlock: + case SyntaxKind.SourceFile: + nodes = (container).statements; + break; + case SyntaxKind.Constructor: + nodes = ((container).parameters).concat( + (container.parent).members); + break; + case SyntaxKind.ClassDeclaration: + nodes = (container).members; + + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & NodeFlags.AccessibilityModifier) { + let constructor = forEach((container).members, member => { + return member.kind === SyntaxKind.Constructor && member; + }); + + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + break; + default: + Debug.fail("Invalid container kind.") + } + + forEach(nodes, node => { + if (node.modifiers && node.flags & modifierFlag) { + forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); + } + }); + + return map(keywords, getHighlightSpanForNode); + + function getFlagFromModifier(modifier: SyntaxKind) { + switch (modifier) { + case SyntaxKind.PublicKeyword: + return NodeFlags.Public; + case SyntaxKind.PrivateKeyword: + return NodeFlags.Private; + case SyntaxKind.ProtectedKeyword: + return NodeFlags.Protected; + case SyntaxKind.StaticKeyword: + return NodeFlags.Static; + case SyntaxKind.ExportKeyword: + return NodeFlags.Export; + case SyntaxKind.DeclareKeyword: + return NodeFlags.Ambient; + default: + Debug.fail(); } } } - let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); + function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { + if (token && contains(expected, token.kind)) { + keywordList.push(token); + return true; } - }); - return map(keywords, getHighlightSpanForNode); - } + return false; + } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { - let owner = getBreakOrContinueOwner(breakOrContinueStatement); + function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { + let keywords: Node[] = []; - if (owner) { - switch (owner.kind) { - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - return getLoopBreakContinueOccurrences(owner) - case SyntaxKind.SwitchStatement: - return getSwitchCaseDefaultOccurrences(owner); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); + return map(keywords, getHighlightSpanForNode); + + function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { + let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); + + if (accessor) { + forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); + } } } - return undefined; - } + function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { + let declarations = constructorDeclaration.symbol.getDeclarations() - function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { - let keywords: Node[] = []; + let keywords: Node[] = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); + forEach(declarations, declaration => { + forEach(declaration.getChildren(), token => { + return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); + }); + }); - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - forEach(switchStatement.caseBlock.clauses, clause => { - pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); + return map(keywords, getHighlightSpanForNode); + } - let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { + let keywords: Node[] = []; + + if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === SyntaxKind.DoStatement) { + let loopTokens = loopNode.getChildren(); + + for (let i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + break; + } + } + } + } + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); } }); - }); - return map(keywords, getHighlightSpanForNode); - } - - function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { - let keywords: Node[] = []; - - pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); - - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); + return map(keywords, getHighlightSpanForNode); } - if (tryStatement.finallyBlock) { - let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); - pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); - } + function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { + let owner = getBreakOrContinueOwner(breakOrContinueStatement); - return map(keywords, getHighlightSpanForNode); - } + if (owner) { + switch (owner.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return getLoopBreakContinueOccurrences(owner) + case SyntaxKind.SwitchStatement: + return getSwitchCaseDefaultOccurrences(owner); - function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { - let owner = getThrowStatementOwner(throwStatement); + } + } - if (!owner) { return undefined; } - let keywords: Node[] = []; + function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { + let keywords: Node[] = []; - forEach(aggregateOwnedThrowStatements(owner), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); + pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (isFunctionBlock(owner)) { - forEachReturnStatement(owner, returnStatement => { + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + forEach(switchStatement.caseBlock.clauses, clause => { + pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); + } + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { + let keywords: Node[] = []; + + pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); + + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); + } + + if (tryStatement.finallyBlock) { + let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); + pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { + let owner = getThrowStatementOwner(throwStatement); + + if (!owner) { + return undefined; + } + + let keywords: Node[] = []; + + forEach(aggregateOwnedThrowStatements(owner), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (isFunctionBlock(owner)) { + forEachReturnStatement(owner, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { + let func = getContainingFunction(returnStatement); + + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, SyntaxKind.Block))) { + return undefined; + } + + let keywords: Node[] = [] + forEachReturnStatement(func.body, returnStatement => { pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); }); + + // Include 'throw' statements that do not occur within a try block. + forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + return map(keywords, getHighlightSpanForNode); } - return map(keywords, getHighlightSpanForNode); - } + function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { + let keywords: Node[] = []; - function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { - let func = getContainingFunction(returnStatement); - - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, SyntaxKind.Block))) { - return undefined; - } - - let keywords: Node[] = [] - forEachReturnStatement(func.body, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - - // Include 'throw' statements that do not occur within a try block. - forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { - let keywords: Node[] = []; - - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - let children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); - - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (let i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { - break; - } + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { + ifStatement = ifStatement.parent; } - if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { - break - } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + let children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); - ifStatement = ifStatement.elseStatement; - } - - let result: HighlightSpan[] = []; - - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (let i = 0; i < keywords.length; i++) { - if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { - let elseKeyword = keywords[i]; - let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - - let shouldHighlightNextKeyword = true; - - // Avoid recalculating getStart() by iterating backwards. - for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldHighlightNextKeyword = false; + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (let i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { break; } } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isDefinition: false - }); - i++; // skip the next keyword - continue; + if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { + break } + + ifStatement = ifStatement.elseStatement; } - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } + let result: HighlightSpan[] = []; - return result; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (let i = 0; i < keywords.length; i++) { + if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { + let elseKeyword = keywords[i]; + let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + + let shouldHighlightNextKeyword = true; + + // Avoid recalculating getStart() by iterating backwards. + for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldHighlightNextKeyword = false; + break; + } + } + + if (shouldHighlightNextKeyword) { + result.push({ + fileName: fileName, + textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + isDefinition: false, + isWriteAccess: false, + }); + i++; // skip the next keyword + continue; + } + } + + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); + } + + return result; + } } } @@ -4539,38 +4600,26 @@ module ts { function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { synchronizeHostData(); - let sourceFile = getValidSourceFile(fileName); + return convertDocumentHighlights(getDocumentHighlights(fileName, position)); - let node = getTouchingWord(sourceFile, position); - if (!node) { - return undefined; - } - - if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false)); - } - - return convertDocumentHighlights(getSyntacticDocumentHighlights(node)); - } - - function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { - if (!documentHighlights) { - return undefined; - } - - let result: ReferenceEntry[] = []; - for (let entry of documentHighlights) { - for (let highlightSpan of entry.highlightSpans) { - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: false - }); + function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { + if (!documentHighlights) { + return undefined; } - } - return result; + let result: ReferenceEntry[] = []; + for (let entry of documentHighlights) { + for (let highlightSpan of entry.highlightSpans) { + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.isWriteAccess + }); + } + } + + return result; + } } function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[] { @@ -4624,10 +4673,10 @@ module ts { } Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.NumericLiteral || node.kind === SyntaxKind.StringLiteral); - return getReferencesForNode(node, program.getSourceFiles(), /*searchOnlyInCurrentFile*/ false, findInStrings, findInComments); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), /*searchOnlyInCurrentFile*/ false, findInStrings, findInComments); } - function getReferencesForNode(node: Node, sourceFiles: SourceFile[], searchOnlyInCurrentFile: boolean, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{ + function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], searchOnlyInCurrentFile: boolean, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{ // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { @@ -5407,23 +5456,6 @@ module ts { } } - function getHighlightSpanForNode(node: Node): HighlightSpan { - let start = node.getStart(); - let end = node.getEnd(); - - if (node.kind === SyntaxKind.StringLiteral) { - start += 1; - end -= 1; - } - - return { - fileName: node.getSourceFile().fileName, - textSpan: createTextSpanFromBounds(start, end), - isDefinition: false - }; - - } - function getReferenceEntryFromNode(node: Node): ReferenceEntry { let start = node.getStart(); let end = node.getEnd(); From 0d233fdd17083c4b54bfe02f462e57f492e5176f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 22:26:34 -0700 Subject: [PATCH 49/69] No need to tweak spans in syntactic highlights. --- src/services/services.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index d1a5cb5a625..ba84a0b86b0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3999,11 +3999,6 @@ module ts { let start = node.getStart(); let end = node.getEnd(); - if (node.kind === SyntaxKind.StringLiteral) { - start += 1; - end -= 1; - } - return { fileName: node.getSourceFile().fileName, textSpan: createTextSpanFromBounds(start, end), From e5d0ffab15106dd06d89969322a69e3d00d94b29 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 22:28:40 -0700 Subject: [PATCH 50/69] Use the fileName that is in scope. --- src/services/services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index ba84a0b86b0..b179d0c97db 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4000,7 +4000,7 @@ module ts { let end = node.getEnd(); return { - fileName: node.getSourceFile().fileName, + fileName: sourceFile.fileName, textSpan: createTextSpanFromBounds(start, end), isDefinition: false, isWriteAccess: false, From 575ce271194f9fb83b1e55abceb47c1a8dcc238b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 23:16:16 -0700 Subject: [PATCH 51/69] Allow the host to indicate which files it would like highlighting spans for. --- src/services/services.ts | 37 ++++++++++++++++--------------------- src/services/shims.ts | 9 ++++++--- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index b179d0c97db..c4ba411f027 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -945,7 +945,7 @@ module ts { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; findReferences(fileName: string, position: number): ReferencedSymbol[]; - getDocumentHighlights(fileName: string, position: number): DocumentHighlights[]; + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; /** @deprecated */ getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; @@ -3983,9 +3983,11 @@ module ts { return results; } - function getDocumentHighlights(fileName: string, position: number): DocumentHighlights[] { + function getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] { synchronizeHostData(); + filesToSearch = map(filesToSearch, normalizeSlashes); + let sourceFilesToSearch = filter(program.getSourceFiles(), f => contains(filesToSearch, f.fileName)); let sourceFile = getValidSourceFile(fileName); let node = getTouchingWord(sourceFile, position); @@ -4014,7 +4016,7 @@ module ts { isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - let referencedSymbols = getReferencedSymbolsForNodes(node, [node.getSourceFile()], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false); + let referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, /*findInStrings:*/ false, /*findInComments:*/ false); return convertReferencedSymbols(referencedSymbols); } @@ -4595,7 +4597,7 @@ module ts { function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { synchronizeHostData(); - return convertDocumentHighlights(getDocumentHighlights(fileName, position)); + return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { if (!documentHighlights) { @@ -4668,10 +4670,10 @@ module ts { } Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.NumericLiteral || node.kind === SyntaxKind.StringLiteral); - return getReferencedSymbolsForNodes(node, program.getSourceFiles(), /*searchOnlyInCurrentFile*/ false, findInStrings, findInComments); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], searchOnlyInCurrentFile: boolean, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{ + function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{ // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { @@ -4729,23 +4731,16 @@ module ts { getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { - if (searchOnlyInCurrentFile) { - Debug.assert(sourceFiles.length === 1); - result = []; - getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - else { - let internedName = getInternedName(symbol, node, declarations) - forEach(sourceFiles, sourceFile => { - cancellationToken.throwIfCancellationRequested(); + let internedName = getInternedName(symbol, node, declarations) + for (let sourceFile of sourceFiles) { + cancellationToken.throwIfCancellationRequested(); - let nameTable = getNameTable(sourceFile); + let nameTable = getNameTable(sourceFile); - if (lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - }); + if (lookUp(nameTable, internedName)) { + result = result || []; + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + } } } diff --git a/src/services/shims.ts b/src/services/shims.ts index 518b70591e3..4872130a368 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -144,8 +144,11 @@ module ts { /** * Returns a JSON-encoded value of the type: * { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[] + * + * @param fileToSearch A JSON encoded string[] containing the file names that should be + * considered when searching. */ - getDocumentHighlights(fileName: string, position: number): string; + getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string; /** * Returns a JSON-encoded value of the type: @@ -597,11 +600,11 @@ module ts { }); } - public getDocumentHighlights(fileName: string, position: number): string { + public getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string { return this.forwardJSONCall( "getDocumentHighlights('" + fileName + "', " + position + ")", () => { - return this.languageService.getDocumentHighlights(fileName, position); + return this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); }); } From 585c6aaf65ac504f535fb10c9bb76d3f4cc1da14 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 23:24:51 -0700 Subject: [PATCH 52/69] CR feedback. --- src/services/services.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index c4ba411f027..c988ba2a818 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4154,9 +4154,9 @@ module ts { } /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { let statementAccumulator: ThrowStatement[] = [] aggregate(node); @@ -4562,17 +4562,17 @@ module ts { let elseKeyword = keywords[i]; let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - let shouldHighlightNextKeyword = true; + let shouldCombindElseAndIf = true; // Avoid recalculating getStart() by iterating backwards. for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldHighlightNextKeyword = false; + shouldCombindElseAndIf = false; break; } } - if (shouldHighlightNextKeyword) { + if (shouldCombindElseAndIf) { result.push({ fileName: fileName, textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), From 1d1ebd536a25722ba0eb16bff22edb7080d3f84f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 8 Apr 2015 23:41:22 -0700 Subject: [PATCH 53/69] Fix up the harness code. --- src/harness/harnessLanguageService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index ccc56a6d314..bce4c9828fa 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -336,8 +336,8 @@ module Harness.LanguageService { getOccurrencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] { return unwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName, position)); } - getDocumentHighlights(fileName: string, position: number): ts.DocumentHighlights[] { - return unwrapJSONCallResult(this.shim.getDocumentHighlights(fileName, position)); + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): ts.DocumentHighlights[] { + return unwrapJSONCallResult(this.shim.getDocumentHighlights(fileName, position, JSON.stringify(filesToSearch))); } getNavigateToItems(searchValue: string): ts.NavigateToItem[] { return unwrapJSONCallResult(this.shim.getNavigateToItems(searchValue)); From 55d6e1068754a3c227d5408a7a91e0952376f201 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 9 Apr 2015 15:19:17 +0200 Subject: [PATCH 54/69] support URI patterns --- src/compiler/core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 4b93081dc31..65c711475d6 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -434,7 +434,7 @@ module ts { return path.replace(/\\/g, "/"); } - // Returns length of path root (i.e. length of "/", "x:/", "//server/share/") + // Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") export function getRootLength(path: string): number { if (path.charCodeAt(0) === CharacterCodes.slash) { if (path.charCodeAt(1) !== CharacterCodes.slash) return 1; @@ -448,6 +448,8 @@ module ts { if (path.charCodeAt(2) === CharacterCodes.slash) return 3; return 2; } + let idx = path.indexOf('://'); + if (idx !== -1) return idx + 3 return 0; } From d3dd48f07b44f25bb13b4b5a79cb835c1ca0ad8a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 12:35:11 -0700 Subject: [PATCH 55/69] Remove 'isRegExp'. --- src/lib/es6.d.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 8590e2273e0..83ae724b768 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -50,11 +50,6 @@ interface SymbolConstructor { */ isConcatSpreadable: symbol; - /** - * A Boolean value that if true indicates that an object may be used as a regular expression. - */ - isRegExp: symbol; - /** * A method that returns the default iterator for an object.Called by the semantics of the * for-of statement. @@ -598,8 +593,6 @@ interface Math { } interface RegExp { - [Symbol.isRegExp]: boolean; - /** * Matches a string with a regular expression, and returns an array containing the results of * that search. From f75c9a66248d28b8cd4e879b67b6b685b347fcb6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 12:52:31 -0700 Subject: [PATCH 56/69] Added 'flags' to RegExp.prototype. --- src/lib/core.d.ts | 2 +- src/lib/es6.d.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 3d830ae5203..822b7ca5202 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -823,7 +823,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 83ae724b768..2af11c92ab9 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -624,6 +624,20 @@ interface RegExp { */ split(string: string, limit?: number): string[]; + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + /** * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular * expression. Default is false. Read-only. From 33028d5199e8d619ca76d519518bc911c60ca2fa Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 14:06:57 -0700 Subject: [PATCH 57/69] Replace uses of 'Symbol.isRegExp' with 'Symbol.toPrimitive'. --- src/lib/es6.d.ts | 10 +++++----- .../conformance/es6/Symbols/symbolDeclarationEmit1.ts | 2 +- .../conformance/es6/Symbols/symbolDeclarationEmit11.ts | 4 ++-- .../conformance/es6/Symbols/symbolDeclarationEmit12.ts | 4 ++-- .../conformance/es6/Symbols/symbolDeclarationEmit13.ts | 2 +- .../conformance/es6/Symbols/symbolDeclarationEmit14.ts | 2 +- .../conformance/es6/Symbols/symbolDeclarationEmit2.ts | 2 +- .../conformance/es6/Symbols/symbolDeclarationEmit3.ts | 6 +++--- .../conformance/es6/Symbols/symbolDeclarationEmit4.ts | 4 ++-- .../cases/conformance/es6/Symbols/symbolProperty21.ts | 2 +- tests/cases/conformance/es6/Symbols/symbolProperty5.ts | 2 +- tests/cases/conformance/es6/Symbols/symbolProperty6.ts | 2 +- tests/cases/conformance/es6/Symbols/symbolProperty8.ts | 2 +- .../ecmascript6/Symbols/parserSymbolProperty4.ts | 2 +- .../ecmascript6/Symbols/parserSymbolProperty5.ts | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 2af11c92ab9..b81a3341a6c 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -52,19 +52,19 @@ interface SymbolConstructor { /** * A method that returns the default iterator for an object.Called by the semantics of the - * for-of statement. + * for-of statement. */ iterator: symbol; /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. + * abstract operation. */ toPrimitive: symbol; /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built- in method Object.prototype.toString. + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. */ toStringTag: symbol; @@ -106,7 +106,7 @@ interface ObjectConstructor { getOwnPropertySymbols(o: any): symbol[]; /** - * Returns true if the values are the same value, false otherwise. + * Returns true if the values are the same value, false otherwise. * @param value1 The first value. * @param value2 The second value. */ diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts index b99806a1eee..1f4755e5203 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts @@ -1,5 +1,5 @@ //@target: ES6 //@declaration: true class C { - [Symbol.isRegExp]: number; + [Symbol.toPrimitive]: number; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts index 4b88ab55980..26868e60d00 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts @@ -3,6 +3,6 @@ class C { static [Symbol.iterator] = 0; static [Symbol.toPrimitive]() { } - static get [Symbol.isRegExp]() { return ""; } - static set [Symbol.isRegExp](x) { } + static get [Symbol.toPrimitive]() { return ""; } + static set [Symbol.toPrimitive](x) { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts index c18b470d35d..8422b1ec016 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts @@ -8,7 +8,7 @@ module M { [Symbol.isConcatSpreadable](): I { return undefined } - get [Symbol.isRegExp]() { return undefined; } - set [Symbol.isRegExp](x: I) { } + get [Symbol.toPrimitive]() { return undefined; } + set [Symbol.toPrimitive](x: I) { } } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts index 18568e853e8..4e65648acca 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit13.ts @@ -1,6 +1,6 @@ //@target: ES6 //@declaration: true class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } set [Symbol.toStringTag](x) { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit14.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit14.ts index 312476628b8..c31629c82df 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit14.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit14.ts @@ -1,6 +1,6 @@ //@target: ES6 //@declaration: true class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } get [Symbol.toStringTag]() { return ""; } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit2.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit2.ts index 420e1c84906..f5b00918b7e 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit2.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit2.ts @@ -1,5 +1,5 @@ //@target: ES6 //@declaration: true class C { - [Symbol.isRegExp] = ""; + [Symbol.toPrimitive] = ""; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit3.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit3.ts index b70ee3c15ac..553aa871c38 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit3.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit3.ts @@ -1,7 +1,7 @@ //@target: ES6 //@declaration: true class C { - [Symbol.isRegExp](x: number); - [Symbol.isRegExp](x: string); - [Symbol.isRegExp](x: any) { } + [Symbol.toPrimitive](x: number); + [Symbol.toPrimitive](x: string); + [Symbol.toPrimitive](x: any) { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts index dde80577fa4..01c75fd05bf 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts @@ -1,6 +1,6 @@ //@target: ES6 //@declaration: true class C { - get [Symbol.isRegExp]() { return ""; } - set [Symbol.isRegExp](x) { } + get [Symbol.toPrimitive]() { return ""; } + set [Symbol.toPrimitive](x) { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty21.ts b/tests/cases/conformance/es6/Symbols/symbolProperty21.ts index 52e84a00425..f72e93e23a4 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty21.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty21.ts @@ -8,6 +8,6 @@ declare function foo(p: I): { t: T; u: U }; foo({ [Symbol.isConcatSpreadable]: "", - [Symbol.isRegExp]: 0, + [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true }); \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty5.ts b/tests/cases/conformance/es6/Symbols/symbolProperty5.ts index 84cb12a9de8..56afcda2ed1 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty5.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty5.ts @@ -1,7 +1,7 @@ //@target: ES6 var x = { [Symbol.iterator]: 0, - [Symbol.isRegExp]() { }, + [Symbol.toPrimitive]() { }, get [Symbol.toStringTag]() { return 0; } diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty6.ts b/tests/cases/conformance/es6/Symbols/symbolProperty6.ts index ff17b977c38..24515e92a56 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty6.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty6.ts @@ -2,7 +2,7 @@ class C { [Symbol.iterator] = 0; [Symbol.unscopables]: number; - [Symbol.isRegExp]() { } + [Symbol.toPrimitive]() { } get [Symbol.toStringTag]() { return 0; } diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty8.ts b/tests/cases/conformance/es6/Symbols/symbolProperty8.ts index 14b4a32688f..19c6583777e 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty8.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty8.ts @@ -1,5 +1,5 @@ //@target: ES6 interface I { [Symbol.unscopables]: number; - [Symbol.isRegExp](); + [Symbol.toPrimitive](); } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts index 6a0962f15cb..efb5a6819b0 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts @@ -1,4 +1,4 @@ //@target: ES6 declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts index 5f3fbaeaaea..629d7ce0126 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts @@ -1,4 +1,4 @@ //@target: ES6 class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } \ No newline at end of file From 8aeff70e48dc4d9221b57e9810b0e5e4a4920af8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 14:14:55 -0700 Subject: [PATCH 58/69] Fix a test so that we don't get duplicate declaration errors. --- tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts index 26868e60d00..137ada282f3 100644 --- a/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts +++ b/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts @@ -2,7 +2,7 @@ //@declaration: true class C { static [Symbol.iterator] = 0; - static [Symbol.toPrimitive]() { } + static [Symbol.isConcatSpreadable]() { } static get [Symbol.toPrimitive]() { return ""; } static set [Symbol.toPrimitive](x) { } } \ No newline at end of file From 3d0655d0889844e7894a549908adc37420b63d7c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 14:28:29 -0700 Subject: [PATCH 59/69] Updated baselines. --- .../reference/decoratorOnClassMethod11.js | 14 ++++++------- .../reference/parserSymbolProperty4.js | 2 +- .../reference/parserSymbolProperty4.types | 6 +++--- .../reference/parserSymbolProperty5.js | 2 +- .../reference/parserSymbolProperty5.types | 6 +++--- .../reference/symbolDeclarationEmit1.js | 4 ++-- .../reference/symbolDeclarationEmit1.types | 6 +++--- .../reference/symbolDeclarationEmit11.js | 16 +++++++------- .../reference/symbolDeclarationEmit11.types | 18 ++++++++-------- .../symbolDeclarationEmit12.errors.txt | 21 +++++++++++++------ .../reference/symbolDeclarationEmit12.js | 8 +++---- .../reference/symbolDeclarationEmit13.js | 6 +++--- .../reference/symbolDeclarationEmit13.types | 6 +++--- .../reference/symbolDeclarationEmit14.js | 6 +++--- .../reference/symbolDeclarationEmit14.types | 6 +++--- .../reference/symbolDeclarationEmit2.js | 6 +++--- .../reference/symbolDeclarationEmit2.types | 6 +++--- .../reference/symbolDeclarationEmit3.js | 12 +++++------ .../reference/symbolDeclarationEmit3.types | 18 ++++++++-------- .../reference/symbolDeclarationEmit4.js | 10 ++++----- .../reference/symbolDeclarationEmit4.types | 12 +++++------ tests/baselines/reference/symbolProperty21.js | 4 ++-- .../reference/symbolProperty21.types | 10 ++++----- tests/baselines/reference/symbolProperty5.js | 4 ++-- .../baselines/reference/symbolProperty5.types | 10 ++++----- tests/baselines/reference/symbolProperty6.js | 4 ++-- .../baselines/reference/symbolProperty6.types | 6 +++--- tests/baselines/reference/symbolProperty8.js | 2 +- .../baselines/reference/symbolProperty8.types | 6 +++--- 29 files changed, 123 insertions(+), 114 deletions(-) diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index 71d4298f02c..f8276de2fe3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -1,11 +1,11 @@ //// [decoratorOnClassMethod11.ts] -module M { - class C { - decorator(target: Object, key: string): void { } - - @this.decorator - method() { } - } +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } } //// [decoratorOnClassMethod11.js] diff --git a/tests/baselines/reference/parserSymbolProperty4.js b/tests/baselines/reference/parserSymbolProperty4.js index f79db0b1d79..698798351ac 100644 --- a/tests/baselines/reference/parserSymbolProperty4.js +++ b/tests/baselines/reference/parserSymbolProperty4.js @@ -1,6 +1,6 @@ //// [parserSymbolProperty4.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } //// [parserSymbolProperty4.js] diff --git a/tests/baselines/reference/parserSymbolProperty4.types b/tests/baselines/reference/parserSymbolProperty4.types index a9070897fa8..dbf65454826 100644 --- a/tests/baselines/reference/parserSymbolProperty4.types +++ b/tests/baselines/reference/parserSymbolProperty4.types @@ -2,8 +2,8 @@ declare class C { >C : C - [Symbol.isRegExp]: string; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/parserSymbolProperty5.js b/tests/baselines/reference/parserSymbolProperty5.js index a8b1d564fa8..62a805602d1 100644 --- a/tests/baselines/reference/parserSymbolProperty5.js +++ b/tests/baselines/reference/parserSymbolProperty5.js @@ -1,6 +1,6 @@ //// [parserSymbolProperty5.ts] class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } //// [parserSymbolProperty5.js] diff --git a/tests/baselines/reference/parserSymbolProperty5.types b/tests/baselines/reference/parserSymbolProperty5.types index 8a171598e83..c854aa6a26d 100644 --- a/tests/baselines/reference/parserSymbolProperty5.types +++ b/tests/baselines/reference/parserSymbolProperty5.types @@ -2,8 +2,8 @@ class C { >C : C - [Symbol.isRegExp]: string; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/symbolDeclarationEmit1.js b/tests/baselines/reference/symbolDeclarationEmit1.js index 7c3b39b9d86..b8ca5495ba7 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.js +++ b/tests/baselines/reference/symbolDeclarationEmit1.js @@ -1,6 +1,6 @@ //// [symbolDeclarationEmit1.ts] class C { - [Symbol.isRegExp]: number; + [Symbol.toPrimitive]: number; } //// [symbolDeclarationEmit1.js] @@ -10,5 +10,5 @@ class C { //// [symbolDeclarationEmit1.d.ts] declare class C { - [Symbol.isRegExp]: number; + [Symbol.toPrimitive]: number; } diff --git a/tests/baselines/reference/symbolDeclarationEmit1.types b/tests/baselines/reference/symbolDeclarationEmit1.types index e35bbfe8861..741f2a74bd7 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.types +++ b/tests/baselines/reference/symbolDeclarationEmit1.types @@ -2,8 +2,8 @@ class C { >C : C - [Symbol.isRegExp]: number; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: number; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/symbolDeclarationEmit11.js b/tests/baselines/reference/symbolDeclarationEmit11.js index b5983177587..25af4c43064 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.js +++ b/tests/baselines/reference/symbolDeclarationEmit11.js @@ -1,16 +1,16 @@ //// [symbolDeclarationEmit11.ts] class C { static [Symbol.iterator] = 0; - static [Symbol.toPrimitive]() { } - static get [Symbol.isRegExp]() { return ""; } - static set [Symbol.isRegExp](x) { } + static [Symbol.isConcatSpreadable]() { } + static get [Symbol.toPrimitive]() { return ""; } + static set [Symbol.toPrimitive](x) { } } //// [symbolDeclarationEmit11.js] class C { - static [Symbol.toPrimitive]() { } - static get [Symbol.isRegExp]() { return ""; } - static set [Symbol.isRegExp](x) { } + static [Symbol.isConcatSpreadable]() { } + static get [Symbol.toPrimitive]() { return ""; } + static set [Symbol.toPrimitive](x) { } } C[Symbol.iterator] = 0; @@ -18,6 +18,6 @@ C[Symbol.iterator] = 0; //// [symbolDeclarationEmit11.d.ts] declare class C { static [Symbol.iterator]: number; - static [Symbol.toPrimitive](): void; - static [Symbol.isRegExp]: string; + static [Symbol.isConcatSpreadable](): void; + static [Symbol.toPrimitive]: string; } diff --git a/tests/baselines/reference/symbolDeclarationEmit11.types b/tests/baselines/reference/symbolDeclarationEmit11.types index 1bf58f205d1..9189e69dc04 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.types +++ b/tests/baselines/reference/symbolDeclarationEmit11.types @@ -7,19 +7,19 @@ class C { >Symbol : SymbolConstructor >iterator : symbol - static [Symbol.toPrimitive]() { } + static [Symbol.isConcatSpreadable]() { } +>Symbol.isConcatSpreadable : symbol +>Symbol : SymbolConstructor +>isConcatSpreadable : symbol + + static get [Symbol.toPrimitive]() { return ""; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol - static get [Symbol.isRegExp]() { return ""; } ->Symbol.isRegExp : symbol + static set [Symbol.toPrimitive](x) { } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol - - static set [Symbol.isRegExp](x) { } ->Symbol.isRegExp : symbol ->Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol >x : string } diff --git a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt index 0e2f6b828f6..cdc712f698d 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt +++ b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(4,28): error TS4031: Public property '[Symbol.iterator]' of exported class has or is using private name 'I'. +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(5,9): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(5,33): error TS4073: Parameter 'x' of public method from exported class has or is using private name 'I'. tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(6,40): error TS4055: Return type of public method from exported class has or is using private name 'I'. -tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,34): error TS4037: Parameter '[Symbol.isRegExp]' of public property setter from exported class has or is using private name 'I'. +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(9,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. +tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,37): error TS4037: Parameter '[Symbol.toPrimitive]' of public property setter from exported class has or is using private name 'I'. -==== tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts (4 errors) ==== +==== tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts (7 errors) ==== module M { interface I { } export class C { @@ -12,6 +15,8 @@ tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,34): error TS4 ~ !!! error TS4031: Public property '[Symbol.iterator]' of exported class has or is using private name 'I'. [Symbol.toPrimitive](x: I) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. ~ !!! error TS4073: Parameter 'x' of public method from exported class has or is using private name 'I'. [Symbol.isConcatSpreadable](): I { @@ -19,9 +24,13 @@ tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts(10,34): error TS4 !!! error TS4055: Return type of public method from exported class has or is using private name 'I'. return undefined } - get [Symbol.isRegExp]() { return undefined; } - set [Symbol.isRegExp](x: I) { } - ~ -!!! error TS4037: Parameter '[Symbol.isRegExp]' of public property setter from exported class has or is using private name 'I'. + get [Symbol.toPrimitive]() { return undefined; } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. + set [Symbol.toPrimitive](x: I) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. + ~ +!!! error TS4037: Parameter '[Symbol.toPrimitive]' of public property setter from exported class has or is using private name 'I'. } } \ No newline at end of file diff --git a/tests/baselines/reference/symbolDeclarationEmit12.js b/tests/baselines/reference/symbolDeclarationEmit12.js index ce7b3861b0b..bd50f6566ac 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.js +++ b/tests/baselines/reference/symbolDeclarationEmit12.js @@ -7,8 +7,8 @@ module M { [Symbol.isConcatSpreadable](): I { return undefined } - get [Symbol.isRegExp]() { return undefined; } - set [Symbol.isRegExp](x: I) { } + get [Symbol.toPrimitive]() { return undefined; } + set [Symbol.toPrimitive](x: I) { } } } @@ -20,8 +20,8 @@ var M; [Symbol.isConcatSpreadable]() { return undefined; } - get [Symbol.isRegExp]() { return undefined; } - set [Symbol.isRegExp](x) { } + get [Symbol.toPrimitive]() { return undefined; } + set [Symbol.toPrimitive](x) { } } M.C = C; })(M || (M = {})); diff --git a/tests/baselines/reference/symbolDeclarationEmit13.js b/tests/baselines/reference/symbolDeclarationEmit13.js index b309cfb2f64..8111672866a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.js +++ b/tests/baselines/reference/symbolDeclarationEmit13.js @@ -1,18 +1,18 @@ //// [symbolDeclarationEmit13.ts] class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } set [Symbol.toStringTag](x) { } } //// [symbolDeclarationEmit13.js] class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } set [Symbol.toStringTag](x) { } } //// [symbolDeclarationEmit13.d.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; [Symbol.toStringTag]: any; } diff --git a/tests/baselines/reference/symbolDeclarationEmit13.types b/tests/baselines/reference/symbolDeclarationEmit13.types index 6579e49c426..92ad2ad0f68 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.types +++ b/tests/baselines/reference/symbolDeclarationEmit13.types @@ -2,10 +2,10 @@ class C { >C : C - get [Symbol.isRegExp]() { return ""; } ->Symbol.isRegExp : symbol + get [Symbol.toPrimitive]() { return ""; } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol set [Symbol.toStringTag](x) { } >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit14.js b/tests/baselines/reference/symbolDeclarationEmit14.js index f24ce11ee77..b8a6b3e4092 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.js +++ b/tests/baselines/reference/symbolDeclarationEmit14.js @@ -1,18 +1,18 @@ //// [symbolDeclarationEmit14.ts] class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } get [Symbol.toStringTag]() { return ""; } } //// [symbolDeclarationEmit14.js] class C { - get [Symbol.isRegExp]() { return ""; } + get [Symbol.toPrimitive]() { return ""; } get [Symbol.toStringTag]() { return ""; } } //// [symbolDeclarationEmit14.d.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; [Symbol.toStringTag]: string; } diff --git a/tests/baselines/reference/symbolDeclarationEmit14.types b/tests/baselines/reference/symbolDeclarationEmit14.types index f3e7c32047c..f72bd774709 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.types +++ b/tests/baselines/reference/symbolDeclarationEmit14.types @@ -2,10 +2,10 @@ class C { >C : C - get [Symbol.isRegExp]() { return ""; } ->Symbol.isRegExp : symbol + get [Symbol.toPrimitive]() { return ""; } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol get [Symbol.toStringTag]() { return ""; } >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit2.js b/tests/baselines/reference/symbolDeclarationEmit2.js index 5558bebc64e..3fde1f6b467 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.js +++ b/tests/baselines/reference/symbolDeclarationEmit2.js @@ -1,17 +1,17 @@ //// [symbolDeclarationEmit2.ts] class C { - [Symbol.isRegExp] = ""; + [Symbol.toPrimitive] = ""; } //// [symbolDeclarationEmit2.js] class C { constructor() { - this[Symbol.isRegExp] = ""; + this[Symbol.toPrimitive] = ""; } } //// [symbolDeclarationEmit2.d.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } diff --git a/tests/baselines/reference/symbolDeclarationEmit2.types b/tests/baselines/reference/symbolDeclarationEmit2.types index 4844b2b8f84..4147eeae401 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.types +++ b/tests/baselines/reference/symbolDeclarationEmit2.types @@ -2,8 +2,8 @@ class C { >C : C - [Symbol.isRegExp] = ""; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive] = ""; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/symbolDeclarationEmit3.js b/tests/baselines/reference/symbolDeclarationEmit3.js index 88087982013..09cea3468ef 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.js +++ b/tests/baselines/reference/symbolDeclarationEmit3.js @@ -1,18 +1,18 @@ //// [symbolDeclarationEmit3.ts] class C { - [Symbol.isRegExp](x: number); - [Symbol.isRegExp](x: string); - [Symbol.isRegExp](x: any) { } + [Symbol.toPrimitive](x: number); + [Symbol.toPrimitive](x: string); + [Symbol.toPrimitive](x: any) { } } //// [symbolDeclarationEmit3.js] class C { - [Symbol.isRegExp](x) { } + [Symbol.toPrimitive](x) { } } //// [symbolDeclarationEmit3.d.ts] declare class C { - [Symbol.isRegExp](x: number): any; - [Symbol.isRegExp](x: string): any; + [Symbol.toPrimitive](x: number): any; + [Symbol.toPrimitive](x: string): any; } diff --git a/tests/baselines/reference/symbolDeclarationEmit3.types b/tests/baselines/reference/symbolDeclarationEmit3.types index 0ea55d876b3..699a7f4c864 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.types +++ b/tests/baselines/reference/symbolDeclarationEmit3.types @@ -2,21 +2,21 @@ class C { >C : C - [Symbol.isRegExp](x: number); ->Symbol.isRegExp : symbol + [Symbol.toPrimitive](x: number); +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol >x : number - [Symbol.isRegExp](x: string); ->Symbol.isRegExp : symbol + [Symbol.toPrimitive](x: string); +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol >x : string - [Symbol.isRegExp](x: any) { } ->Symbol.isRegExp : symbol + [Symbol.toPrimitive](x: any) { } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol >x : any } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.js b/tests/baselines/reference/symbolDeclarationEmit4.js index 67ec3477f7d..75680aacb66 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.js +++ b/tests/baselines/reference/symbolDeclarationEmit4.js @@ -1,17 +1,17 @@ //// [symbolDeclarationEmit4.ts] class C { - get [Symbol.isRegExp]() { return ""; } - set [Symbol.isRegExp](x) { } + get [Symbol.toPrimitive]() { return ""; } + set [Symbol.toPrimitive](x) { } } //// [symbolDeclarationEmit4.js] class C { - get [Symbol.isRegExp]() { return ""; } - set [Symbol.isRegExp](x) { } + get [Symbol.toPrimitive]() { return ""; } + set [Symbol.toPrimitive](x) { } } //// [symbolDeclarationEmit4.d.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.types b/tests/baselines/reference/symbolDeclarationEmit4.types index aeb24fc146c..5c3c0b0d6b6 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.types +++ b/tests/baselines/reference/symbolDeclarationEmit4.types @@ -2,14 +2,14 @@ class C { >C : C - get [Symbol.isRegExp]() { return ""; } ->Symbol.isRegExp : symbol + get [Symbol.toPrimitive]() { return ""; } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol - set [Symbol.isRegExp](x) { } ->Symbol.isRegExp : symbol + set [Symbol.toPrimitive](x) { } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol >x : string } diff --git a/tests/baselines/reference/symbolProperty21.js b/tests/baselines/reference/symbolProperty21.js index 13eaf06a97b..8a93cc2de78 100644 --- a/tests/baselines/reference/symbolProperty21.js +++ b/tests/baselines/reference/symbolProperty21.js @@ -8,13 +8,13 @@ declare function foo(p: I): { t: T; u: U }; foo({ [Symbol.isConcatSpreadable]: "", - [Symbol.isRegExp]: 0, + [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true }); //// [symbolProperty21.js] foo({ [Symbol.isConcatSpreadable]: "", - [Symbol.isRegExp]: 0, + [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true }); diff --git a/tests/baselines/reference/symbolProperty21.types b/tests/baselines/reference/symbolProperty21.types index 053dae46479..cb4b5e74473 100644 --- a/tests/baselines/reference/symbolProperty21.types +++ b/tests/baselines/reference/symbolProperty21.types @@ -31,19 +31,19 @@ declare function foo(p: I): { t: T; u: U }; >U : U foo({ ->foo({ [Symbol.isConcatSpreadable]: "", [Symbol.isRegExp]: 0, [Symbol.unscopables]: true}) : { t: boolean; u: string; } +>foo({ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true}) : { t: boolean; u: string; } >foo : (p: I) => { t: T; u: U; } ->{ [Symbol.isConcatSpreadable]: "", [Symbol.isRegExp]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.isRegExp]: number; [Symbol.unscopables]: boolean; } +>{ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; } [Symbol.isConcatSpreadable]: "", >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol - [Symbol.isRegExp]: 0, ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: 0, +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol [Symbol.unscopables]: true >Symbol.unscopables : symbol diff --git a/tests/baselines/reference/symbolProperty5.js b/tests/baselines/reference/symbolProperty5.js index c7c88681f8a..5726e42edf5 100644 --- a/tests/baselines/reference/symbolProperty5.js +++ b/tests/baselines/reference/symbolProperty5.js @@ -1,7 +1,7 @@ //// [symbolProperty5.ts] var x = { [Symbol.iterator]: 0, - [Symbol.isRegExp]() { }, + [Symbol.toPrimitive]() { }, get [Symbol.toStringTag]() { return 0; } @@ -10,7 +10,7 @@ var x = { //// [symbolProperty5.js] var x = { [Symbol.iterator]: 0, - [Symbol.isRegExp]() { }, + [Symbol.toPrimitive]() { }, get [Symbol.toStringTag]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty5.types b/tests/baselines/reference/symbolProperty5.types index 7d6a9f05858..e1fb096ebc4 100644 --- a/tests/baselines/reference/symbolProperty5.types +++ b/tests/baselines/reference/symbolProperty5.types @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/Symbols/symbolProperty5.ts === var x = { ->x : { [Symbol.iterator]: number; [Symbol.isRegExp](): void; [Symbol.toStringTag]: number; } ->{ [Symbol.iterator]: 0, [Symbol.isRegExp]() { }, get [Symbol.toStringTag]() { return 0; }} : { [Symbol.iterator]: number; [Symbol.isRegExp](): void; [Symbol.toStringTag]: number; } +>x : { [Symbol.iterator]: number; [Symbol.toPrimitive](): void; [Symbol.toStringTag]: number; } +>{ [Symbol.iterator]: 0, [Symbol.toPrimitive]() { }, get [Symbol.toStringTag]() { return 0; }} : { [Symbol.iterator]: number; [Symbol.toPrimitive](): void; [Symbol.toStringTag]: number; } [Symbol.iterator]: 0, >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol - [Symbol.isRegExp]() { }, ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]() { }, +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol get [Symbol.toStringTag]() { >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty6.js b/tests/baselines/reference/symbolProperty6.js index 81be3e2a927..ab9564c35e5 100644 --- a/tests/baselines/reference/symbolProperty6.js +++ b/tests/baselines/reference/symbolProperty6.js @@ -2,7 +2,7 @@ class C { [Symbol.iterator] = 0; [Symbol.unscopables]: number; - [Symbol.isRegExp]() { } + [Symbol.toPrimitive]() { } get [Symbol.toStringTag]() { return 0; } @@ -13,7 +13,7 @@ class C { constructor() { this[Symbol.iterator] = 0; } - [Symbol.isRegExp]() { } + [Symbol.toPrimitive]() { } get [Symbol.toStringTag]() { return 0; } diff --git a/tests/baselines/reference/symbolProperty6.types b/tests/baselines/reference/symbolProperty6.types index e5aac6f48da..20c5d0c6c8b 100644 --- a/tests/baselines/reference/symbolProperty6.types +++ b/tests/baselines/reference/symbolProperty6.types @@ -12,10 +12,10 @@ class C { >Symbol : SymbolConstructor >unscopables : symbol - [Symbol.isRegExp]() { } ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]() { } +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol get [Symbol.toStringTag]() { >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty8.js b/tests/baselines/reference/symbolProperty8.js index 6f3ec6cfa26..87e56802391 100644 --- a/tests/baselines/reference/symbolProperty8.js +++ b/tests/baselines/reference/symbolProperty8.js @@ -1,7 +1,7 @@ //// [symbolProperty8.ts] interface I { [Symbol.unscopables]: number; - [Symbol.isRegExp](); + [Symbol.toPrimitive](); } //// [symbolProperty8.js] diff --git a/tests/baselines/reference/symbolProperty8.types b/tests/baselines/reference/symbolProperty8.types index d6c2f464b53..647cff252ab 100644 --- a/tests/baselines/reference/symbolProperty8.types +++ b/tests/baselines/reference/symbolProperty8.types @@ -7,8 +7,8 @@ interface I { >Symbol : SymbolConstructor >unscopables : symbol - [Symbol.isRegExp](); ->Symbol.isRegExp : symbol + [Symbol.toPrimitive](); +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } From 73121ce451c6989512238fc7c4cae46b48608fa4 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 9 Apr 2015 14:37:21 -0700 Subject: [PATCH 60/69] Distinguish written vs read references. --- src/services/services.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index c988ba2a818..1f6b328b68c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1019,10 +1019,15 @@ module ts { highlightSpans: HighlightSpan[]; } + export class DocumentHighlightKind { + public static definition = "definition"; + public static reference = "reference"; + public static writtenReference = "writtenReference"; + } + export interface HighlightSpan { textSpan: TextSpan; - isDefinition: boolean; - isWriteAccess: boolean; + kind: string; } export interface NavigateToItem { @@ -4004,8 +4009,7 @@ module ts { return { fileName: sourceFile.fileName, textSpan: createTextSpanFromBounds(start, end), - isDefinition: false, - isWriteAccess: false, + kind: DocumentHighlightKind.reference }; } @@ -4042,8 +4046,7 @@ module ts { documentHighlights.highlightSpans.push({ textSpan: referenceEntry.textSpan, - isDefinition: false, - isWriteAccess: referenceEntry.isWriteAccess + kind: referenceEntry.isWriteAccess ? DocumentHighlightKind.writtenReference : DocumentHighlightKind.reference }); } } @@ -4576,8 +4579,7 @@ module ts { result.push({ fileName: fileName, textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isDefinition: false, - isWriteAccess: false, + kind: DocumentHighlightKind.reference }); i++; // skip the next keyword continue; @@ -4610,7 +4612,7 @@ module ts { result.push({ fileName: entry.fileName, textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.isWriteAccess + isWriteAccess: highlightSpan.kind === DocumentHighlightKind.writtenReference }); } } From 666765cfaa707e8b431c57542524a3eb69686ba5 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 9 Apr 2015 14:42:29 -0700 Subject: [PATCH 61/69] accept new test baselines --- .../reference/decoratorOnClassMethod11.js | 14 +++++++------- .../reference/decoratorOnClassMethod13.types | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index 71d4298f02c..f8276de2fe3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -1,11 +1,11 @@ //// [decoratorOnClassMethod11.ts] -module M { - class C { - decorator(target: Object, key: string): void { } - - @this.decorator - method() { } - } +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } } //// [decoratorOnClassMethod11.js] diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 8c34805792f..1390f5750e6 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -14,8 +14,8 @@ class C { >C : C @dec ["1"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor @dec ["b"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor } From 9627746ba94d2b1b7a7a36aadf218b066a7f24c8 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 9 Apr 2015 14:49:00 -0700 Subject: [PATCH 62/69] Add the 'none' kind. --- src/services/services.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index 1f6b328b68c..a53dd8bfb60 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1020,6 +1020,7 @@ module ts { } export class DocumentHighlightKind { + public static none = "none"; public static definition = "definition"; public static reference = "reference"; public static writtenReference = "writtenReference"; @@ -4009,7 +4010,7 @@ module ts { return { fileName: sourceFile.fileName, textSpan: createTextSpanFromBounds(start, end), - kind: DocumentHighlightKind.reference + kind: DocumentHighlightKind.none }; } From fc512b284bf5f4104aa2b90a433115502e8eaeea Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 9 Apr 2015 15:11:26 -0700 Subject: [PATCH 63/69] Use modules with const members. --- src/services/services.ts | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index a53dd8bfb60..b99e7bf44c7 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1019,11 +1019,11 @@ module ts { highlightSpans: HighlightSpan[]; } - export class DocumentHighlightKind { - public static none = "none"; - public static definition = "definition"; - public static reference = "reference"; - public static writtenReference = "writtenReference"; + export module DocumentHighlightKind { + export const none = "none"; + export const definition = "definition"; + export const reference = "reference"; + export const writtenReference = "writtenReference"; } export interface HighlightSpan { @@ -1335,92 +1335,92 @@ module ts { } // TODO: move these to enums - export class ScriptElementKind { - static unknown = ""; - static warning = "warning"; + export module ScriptElementKind { + export const unknown = ""; + export const warning = "warning"; // predefined type (void) or keyword (class) - static keyword = "keyword"; + export const keyword = "keyword"; // top level script node - static scriptElement = "script"; + export const scriptElement = "script"; // module foo {} - static moduleElement = "module"; + export const moduleElement = "module"; // class X {} - static classElement = "class"; + export const classElement = "class"; // interface Y {} - static interfaceElement = "interface"; + export const interfaceElement = "interface"; // type T = ... - static typeElement = "type"; + export const typeElement = "type"; // enum E - static enumElement = "enum"; + export const enumElement = "enum"; // Inside module and script only // let v = .. - static variableElement = "var"; + export const variableElement = "var"; // Inside function - static localVariableElement = "local var"; + export const localVariableElement = "local var"; // Inside module and script only // function f() { } - static functionElement = "function"; + export const functionElement = "function"; // Inside function - static localFunctionElement = "local function"; + export const localFunctionElement = "local function"; // class X { [public|private]* foo() {} } - static memberFunctionElement = "method"; + export const memberFunctionElement = "method"; // class X { [public|private]* [get|set] foo:number; } - static memberGetAccessorElement = "getter"; - static memberSetAccessorElement = "setter"; + export const memberGetAccessorElement = "getter"; + export const memberSetAccessorElement = "setter"; // class X { [public|private]* foo:number; } // interface Y { foo:number; } - static memberVariableElement = "property"; + export const memberVariableElement = "property"; // class X { constructor() { } } - static constructorImplementationElement = "constructor"; + export const constructorImplementationElement = "constructor"; // interface Y { ():number; } - static callSignatureElement = "call"; + export const callSignatureElement = "call"; // interface Y { []:number; } - static indexSignatureElement = "index"; + export const indexSignatureElement = "index"; // interface Y { new():Y; } - static constructSignatureElement = "construct"; + export const constructSignatureElement = "construct"; // function foo(*Y*: string) - static parameterElement = "parameter"; + export const parameterElement = "parameter"; - static typeParameterElement = "type parameter"; + export const typeParameterElement = "type parameter"; - static primitiveType = "primitive type"; + export const primitiveType = "primitive type"; - static label = "label"; + export const label = "label"; - static alias = "alias"; + export const alias = "alias"; - static constElement = "const"; + export const constElement = "const"; - static letElement = "let"; + export const letElement = "let"; } - export class ScriptElementKindModifier { - static none = ""; - static publicMemberModifier = "public"; - static privateMemberModifier = "private"; - static protectedMemberModifier = "protected"; - static exportedModifier = "export"; - static ambientModifier = "declare"; - static staticModifier = "static"; + export module ScriptElementKindModifier { + export const none = ""; + export const publicMemberModifier = "public"; + export const privateMemberModifier = "private"; + export const protectedMemberModifier = "protected"; + export const exportedModifier = "export"; + export const ambientModifier = "declare"; + export const staticModifier = "static"; } export class ClassificationTypeNames { From a34801f30b37777bef0d3ff08ef0432e2d3f942d Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Thu, 9 Apr 2015 16:05:06 -0700 Subject: [PATCH 64/69] merging with master --- src/compiler/checker.ts | 502 +- src/compiler/commandLineParser.ts | 5 + src/compiler/core.ts | 4 +- .../diagnosticInformationMap.generated.ts | 7 +- src/compiler/diagnosticMessages.json | 10 +- src/compiler/emitter.ts | 915 ++- src/compiler/parser.ts | 4 +- src/compiler/types.ts | 5 + src/compiler/utilities.ts | 39 + src/harness/harness.ts | 21 +- src/harness/typeWriter.ts | 1 + src/lib/core.d.ts | 2 +- src/lib/es6.d.ts | 36 +- src/server/client.ts | 30 +- src/server/editorServices.ts | 6 +- src/server/protocol.d.ts | 26 + src/server/server.ts | 10 +- src/server/session.ts | 159 +- src/services/services.ts | 2 +- .../baselines/reference/APISample_compile.js | 2068 +----- .../reference/APISample_compile.types | 6178 +--------------- tests/baselines/reference/APISample_linter.js | 2127 +----- .../reference/APISample_linter.types | 6195 +--------------- .../reference/APISample_transform.js | 2121 +----- .../reference/APISample_transform.types | 6381 +---------------- .../baselines/reference/APISample_watcher.js | 2198 +----- .../reference/APISample_watcher.types | 6197 +--------------- .../reference/ES5For-of30.errors.txt | 8 +- .../baselines/reference/ES5SymbolProperty1.js | 3 +- .../reference/FunctionDeclaration8_es6.js | 4 +- .../reference/FunctionDeclaration9_es6.js | 4 +- .../FunctionPropertyAssignments5_es6.js | 4 +- .../arrayBindingPatternOmittedExpressions.js | 31 + ...rrayBindingPatternOmittedExpressions.types | 43 + .../reference/arrayLiteralSpread.types | 22 + .../reference/callWithSpreadES6.types | 13 + .../classExpressionWithDecorator1.errors.txt | 10 + .../classExpressionWithDecorator1.js | 22 + ...ExpressionWithStaticProperties1.errors.txt | 7 + .../classExpressionWithStaticProperties1.js | 11 + ...ExpressionWithStaticProperties2.errors.txt | 7 + .../classExpressionWithStaticProperties2.js | 10 + ...ressionWithStaticPropertiesES61.errors.txt | 7 + ...classExpressionWithStaticPropertiesES61.js | 10 + ...ressionWithStaticPropertiesES62.errors.txt | 7 + ...classExpressionWithStaticPropertiesES62.js | 9 + ...lisionArgumentsClassConstructor.errors.txt | 101 +- .../collisionArgumentsClassMethod.errors.txt | 89 +- .../reference/computedPropertyNames10_ES5.js | 3 +- .../reference/computedPropertyNames11_ES5.js | 69 +- .../reference/computedPropertyNames18_ES5.js | 3 +- .../reference/computedPropertyNames19_ES5.js | 3 +- .../reference/computedPropertyNames1_ES5.js | 16 +- .../reference/computedPropertyNames20_ES5.js | 3 +- .../reference/computedPropertyNames22_ES5.js | 3 +- .../reference/computedPropertyNames23_ES5.js | 4 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames26_ES5.js | 4 +- .../reference/computedPropertyNames28_ES5.js | 3 +- .../reference/computedPropertyNames29_ES5.js | 3 +- .../reference/computedPropertyNames30_ES5.js | 6 +- .../reference/computedPropertyNames31_ES5.js | 3 +- .../reference/computedPropertyNames33_ES5.js | 3 +- .../reference/computedPropertyNames34_ES5.js | 3 +- .../computedPropertyNames3_ES5.errors.txt | 5 +- .../reference/computedPropertyNames46_ES5.js | 3 +- .../reference/computedPropertyNames47_ES5.js | 3 +- .../reference/computedPropertyNames48_ES5.js | 9 +- .../reference/computedPropertyNames49_ES5.js | 41 +- .../reference/computedPropertyNames4_ES5.js | 3 +- .../reference/computedPropertyNames50_ES5.js | 42 +- .../reference/computedPropertyNames5_ES5.js | 3 +- .../reference/computedPropertyNames6_ES5.js | 3 +- .../reference/computedPropertyNames7_ES5.js | 3 +- .../reference/computedPropertyNames8_ES5.js | 3 +- .../reference/computedPropertyNames9_ES5.js | 3 +- ...mputedPropertyNamesContextualType10_ES5.js | 3 +- ...omputedPropertyNamesContextualType1_ES5.js | 3 +- ...omputedPropertyNamesContextualType2_ES5.js | 3 +- ...omputedPropertyNamesContextualType3_ES5.js | 3 +- ...omputedPropertyNamesContextualType4_ES5.js | 3 +- ...omputedPropertyNamesContextualType5_ES5.js | 3 +- ...omputedPropertyNamesContextualType6_ES5.js | 11 +- ...omputedPropertyNamesContextualType7_ES5.js | 11 +- ...omputedPropertyNamesContextualType8_ES5.js | 3 +- ...omputedPropertyNamesContextualType9_ES5.js | 3 +- ...mputedPropertyNamesDeclarationEmit5_ES5.js | 15 +- .../computedPropertyNamesSourceMap2_ES5.js | 3 +- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 48 +- .../constructorStaticParamName.errors.txt | 12 + .../reference/constructorStaticParamName.js | 2 +- .../constructorStaticParamName.types | 10 - ...torWithIncompleteTypeAnnotation.errors.txt | 99 +- ...constructorWithIncompleteTypeAnnotation.js | 217 +- .../reference/convertKeywordsYes.errors.txt | 353 + .../baselines/reference/convertKeywordsYes.js | 69 +- .../reference/convertKeywordsYes.types | 879 --- .../baselines/reference/decoratorOnClass1.js | 20 +- .../baselines/reference/decoratorOnClass2.js | 20 +- .../baselines/reference/decoratorOnClass3.js | 20 +- .../baselines/reference/decoratorOnClass4.js | 20 +- .../baselines/reference/decoratorOnClass5.js | 20 +- .../baselines/reference/decoratorOnClass8.js | 20 +- .../reference/decoratorOnClassAccessor1.js | 21 +- .../reference/decoratorOnClassAccessor2.js | 21 +- .../decoratorOnClassAccessor3.errors.txt | 28 +- .../reference/decoratorOnClassAccessor3.js | 22 +- .../reference/decoratorOnClassAccessor4.js | 21 +- .../reference/decoratorOnClassAccessor5.js | 21 +- .../decoratorOnClassAccessor6.errors.txt | 37 +- .../reference/decoratorOnClassAccessor6.js | 20 +- .../decoratorOnClassConstructor1.errors.txt | 2 +- .../decoratorOnClassConstructorParameter1.js | 21 +- ...torOnClassConstructorParameter4.errors.txt | 5 +- .../decoratorOnClassConstructorParameter4.js | 23 +- .../reference/decoratorOnClassMethod1.js | 21 +- .../reference/decoratorOnClassMethod10.js | 21 +- .../decoratorOnClassMethod11.errors.txt | 14 + .../reference/decoratorOnClassMethod11.js | 32 + .../decoratorOnClassMethod12.errors.txt | 15 + .../reference/decoratorOnClassMethod12.js | 46 + .../reference/decoratorOnClassMethod13.js | 29 + .../reference/decoratorOnClassMethod13.types | 21 + .../reference/decoratorOnClassMethod2.js | 21 +- .../decoratorOnClassMethod3.errors.txt | 22 +- .../reference/decoratorOnClassMethod3.js | 15 +- .../reference/decoratorOnClassMethod4.js | 21 +- .../reference/decoratorOnClassMethod5.js | 21 +- .../reference/decoratorOnClassMethod6.js | 21 +- .../reference/decoratorOnClassMethod7.js | 21 +- .../reference/decoratorOnClassMethod8.js | 21 +- .../decoratorOnClassMethodParameter1.js | 22 +- .../reference/decoratorOnClassProperty1.js | 20 +- .../reference/decoratorOnClassProperty10.js | 20 +- .../reference/decoratorOnClassProperty11.js | 20 +- .../reference/decoratorOnClassProperty2.js | 20 +- .../decoratorOnClassProperty3.errors.txt | 19 +- .../reference/decoratorOnClassProperty3.js | 12 +- .../reference/decoratorOnClassProperty6.js | 20 +- .../reference/decoratorOnClassProperty7.js | 20 +- .../reference/decoratorOnEnum.errors.txt | 6 +- .../decoratorOnFunctionDeclaration.errors.txt | 6 +- .../decoratorOnImportEquals1.errors.txt | 5 +- .../decoratorOnImportEquals2.errors.txt | 5 +- .../reference/decoratorOnInterface.errors.txt | 6 +- .../decoratorOnInternalModule.errors.txt | 6 +- .../reference/decoratorOnTypeAlias.errors.txt | 7 +- .../reference/decoratorOnVar.errors.txt | 7 +- ...portDeclarationInInternalModule.errors.txt | 24 + .../exportDeclarationInInternalModule.js | 76 + .../exportStarFromEmptyModule.errors.txt | 30 + .../reference/exportStarFromEmptyModule.js | 65 + tests/baselines/reference/for-of14.errors.txt | 4 +- tests/baselines/reference/for-of16.errors.txt | 4 +- tests/baselines/reference/for-of57.js | 7 + tests/baselines/reference/for-of57.types | 9 + .../reference/iterableArrayPattern1.js | 28 + .../reference/iterableArrayPattern1.types | 36 + .../iterableArrayPattern10.errors.txt | 24 + .../reference/iterableArrayPattern10.js | 36 + .../reference/iterableArrayPattern11.js | 36 + .../reference/iterableArrayPattern11.types | 52 + .../reference/iterableArrayPattern12.js | 36 + .../reference/iterableArrayPattern12.types | 52 + .../reference/iterableArrayPattern13.js | 36 + .../reference/iterableArrayPattern13.types | 50 + .../reference/iterableArrayPattern14.js | 36 + .../reference/iterableArrayPattern14.types | 50 + .../reference/iterableArrayPattern15.js | 36 + .../reference/iterableArrayPattern15.types | 52 + .../iterableArrayPattern16.errors.txt | 37 + .../reference/iterableArrayPattern16.js | 60 + .../iterableArrayPattern17.errors.txt | 24 + .../reference/iterableArrayPattern17.js | 36 + .../iterableArrayPattern18.errors.txt | 24 + .../reference/iterableArrayPattern18.js | 36 + .../iterableArrayPattern19.errors.txt | 24 + .../reference/iterableArrayPattern19.js | 36 + .../reference/iterableArrayPattern2.js | 28 + .../reference/iterableArrayPattern2.types | 36 + .../reference/iterableArrayPattern20.js | 36 + .../reference/iterableArrayPattern20.types | 58 + .../iterableArrayPattern21.errors.txt | 7 + .../reference/iterableArrayPattern21.js | 5 + .../iterableArrayPattern22.errors.txt | 7 + .../reference/iterableArrayPattern22.js | 5 + .../iterableArrayPattern23.errors.txt | 8 + .../reference/iterableArrayPattern23.js | 7 + .../iterableArrayPattern24.errors.txt | 8 + .../reference/iterableArrayPattern24.js | 7 + .../iterableArrayPattern25.errors.txt | 8 + .../reference/iterableArrayPattern25.js | 7 + .../iterableArrayPattern26.errors.txt | 10 + .../reference/iterableArrayPattern26.js | 7 + .../reference/iterableArrayPattern27.js | 7 + .../reference/iterableArrayPattern27.types | 18 + .../iterableArrayPattern28.errors.txt | 10 + .../reference/iterableArrayPattern28.js | 7 + .../iterableArrayPattern29.errors.txt | 12 + .../reference/iterableArrayPattern29.js | 7 + .../reference/iterableArrayPattern3.js | 36 + .../reference/iterableArrayPattern3.types | 53 + .../reference/iterableArrayPattern30.js | 5 + .../reference/iterableArrayPattern30.types | 12 + .../reference/iterableArrayPattern4.js | 36 + .../reference/iterableArrayPattern4.types | 54 + .../iterableArrayPattern5.errors.txt | 22 + .../reference/iterableArrayPattern5.js | 36 + .../iterableArrayPattern6.errors.txt | 24 + .../reference/iterableArrayPattern6.js | 36 + .../iterableArrayPattern7.errors.txt | 24 + .../reference/iterableArrayPattern7.js | 36 + .../iterableArrayPattern8.errors.txt | 22 + .../reference/iterableArrayPattern8.js | 36 + .../reference/iterableArrayPattern9.js | 34 + .../reference/iterableArrayPattern9.types | 46 + .../reference/iteratorSpreadInArray.js | 29 + .../reference/iteratorSpreadInArray.types | 37 + .../iteratorSpreadInArray10.errors.txt | 13 + .../reference/iteratorSpreadInArray10.js | 16 + .../reference/iteratorSpreadInArray11.js | 7 + .../reference/iteratorSpreadInArray11.types | 11 + .../reference/iteratorSpreadInArray2.js | 53 + .../reference/iteratorSpreadInArray2.types | 68 + .../reference/iteratorSpreadInArray3.js | 29 + .../reference/iteratorSpreadInArray3.types | 39 + .../reference/iteratorSpreadInArray4.js | 29 + .../reference/iteratorSpreadInArray4.types | 37 + .../iteratorSpreadInArray5.errors.txt | 24 + .../reference/iteratorSpreadInArray5.js | 29 + .../iteratorSpreadInArray6.errors.txt | 21 + .../reference/iteratorSpreadInArray6.js | 31 + .../reference/iteratorSpreadInArray7.js | 31 + .../reference/iteratorSpreadInArray7.types | 43 + .../iteratorSpreadInArray8.errors.txt | 16 + .../reference/iteratorSpreadInArray8.js | 22 + .../iteratorSpreadInArray9.errors.txt | 33 + .../reference/iteratorSpreadInArray9.js | 27 + .../reference/iteratorSpreadInCall.errors.txt | 21 + .../reference/iteratorSpreadInCall.js | 31 + .../iteratorSpreadInCall10.errors.txt | 22 + .../reference/iteratorSpreadInCall10.js | 32 + .../reference/iteratorSpreadInCall11.js | 32 + .../reference/iteratorSpreadInCall11.types | 45 + .../reference/iteratorSpreadInCall12.js | 61 + .../reference/iteratorSpreadInCall12.types | 81 + .../iteratorSpreadInCall2.errors.txt | 21 + .../reference/iteratorSpreadInCall2.js | 31 + .../reference/iteratorSpreadInCall3.js | 31 + .../reference/iteratorSpreadInCall3.types | 41 + .../iteratorSpreadInCall4.errors.txt | 21 + .../reference/iteratorSpreadInCall4.js | 31 + .../reference/iteratorSpreadInCall5.js | 55 + .../reference/iteratorSpreadInCall5.types | 72 + .../iteratorSpreadInCall6.errors.txt | 36 + .../reference/iteratorSpreadInCall6.js | 55 + .../iteratorSpreadInCall7.errors.txt | 36 + .../reference/iteratorSpreadInCall7.js | 55 + .../iteratorSpreadInCall8.errors.txt | 39 + .../reference/iteratorSpreadInCall8.js | 61 + .../iteratorSpreadInCall9.errors.txt | 39 + .../reference/iteratorSpreadInCall9.js | 61 + ...ationInStrictModeByDefaultInES6.errors.txt | 12 +- .../reference/parser509668.errors.txt | 5 +- tests/baselines/reference/parser509668.js | 2 +- .../reference/parser553699.errors.txt | 4 +- tests/baselines/reference/parser553699.js | 2 +- .../reference/parser642331.errors.txt | 10 + tests/baselines/reference/parser642331.js | 2 +- tests/baselines/reference/parser642331.types | 8 - .../parserES5ComputedPropertyName2.js | 4 +- .../parserES5ComputedPropertyName3.js | 4 +- .../parserES5ComputedPropertyName4.js | 8 +- .../reference/parserRealSource11.errors.txt | 8 +- tests/baselines/reference/privateIndexer2.js | 3 +- .../sourceMapValidationDecorators.js | 59 +- .../sourceMapValidationDecorators.js.map | 2 +- ...ourceMapValidationDecorators.sourcemap.txt | 1069 +-- .../superCallsInConstructor.errors.txt | 5 +- ...arArgConstructorMemberParameter.errors.txt | 5 +- .../varArgConstructorMemberParameter.js | 2 +- tests/cases/compiler/APISample_compile.ts | 5 +- tests/cases/compiler/APISample_linter.ts | 25 +- tests/cases/compiler/APISample_transform.ts | 55 +- tests/cases/compiler/APISample_watcher.ts | 21 +- .../arrayBindingPatternOmittedExpressions.ts | 17 + .../compiler/classExpressionWithDecorator1.ts | 1 + .../classExpressionWithStaticProperties1.ts | 1 + .../classExpressionWithStaticProperties2.ts | 1 + ...classExpressionWithStaticPropertiesES61.ts | 2 + ...classExpressionWithStaticPropertiesES62.ts | 2 + .../exportDeclarationInInternalModule.ts | 20 + .../compiler/exportStarFromEmptyModule.ts | 25 + .../class/method/decoratorOnClassMethod11.ts | 9 + .../class/method/decoratorOnClassMethod12.ts | 10 + .../class/method/decoratorOnClassMethod13.ts | 7 + .../destructuring/iterableArrayPattern1.ts | 14 + .../destructuring/iterableArrayPattern10.ts | 17 + .../destructuring/iterableArrayPattern11.ts | 17 + .../destructuring/iterableArrayPattern12.ts | 17 + .../destructuring/iterableArrayPattern13.ts | 17 + .../destructuring/iterableArrayPattern14.ts | 17 + .../destructuring/iterableArrayPattern15.ts | 17 + .../destructuring/iterableArrayPattern16.ts | 30 + .../destructuring/iterableArrayPattern17.ts | 17 + .../destructuring/iterableArrayPattern18.ts | 17 + .../destructuring/iterableArrayPattern19.ts | 17 + .../destructuring/iterableArrayPattern2.ts | 14 + .../destructuring/iterableArrayPattern20.ts | 17 + .../destructuring/iterableArrayPattern21.ts | 2 + .../destructuring/iterableArrayPattern22.ts | 2 + .../destructuring/iterableArrayPattern23.ts | 3 + .../destructuring/iterableArrayPattern24.ts | 3 + .../destructuring/iterableArrayPattern25.ts | 3 + .../destructuring/iterableArrayPattern26.ts | 3 + .../destructuring/iterableArrayPattern27.ts | 3 + .../destructuring/iterableArrayPattern28.ts | 3 + .../destructuring/iterableArrayPattern29.ts | 3 + .../destructuring/iterableArrayPattern3.ts | 17 + .../destructuring/iterableArrayPattern30.ts | 2 + .../destructuring/iterableArrayPattern4.ts | 17 + .../destructuring/iterableArrayPattern5.ts | 17 + .../destructuring/iterableArrayPattern6.ts | 17 + .../destructuring/iterableArrayPattern7.ts | 17 + .../destructuring/iterableArrayPattern8.ts | 17 + .../destructuring/iterableArrayPattern9.ts | 16 + .../es6/for-ofStatements/for-of57.ts | 3 + .../es6/spread/iteratorSpreadInArray.ts | 15 + .../es6/spread/iteratorSpreadInArray10.ts | 8 + .../es6/spread/iteratorSpreadInArray11.ts | 3 + .../es6/spread/iteratorSpreadInArray2.ts | 28 + .../es6/spread/iteratorSpreadInArray3.ts | 15 + .../es6/spread/iteratorSpreadInArray4.ts | 15 + .../es6/spread/iteratorSpreadInArray5.ts | 15 + .../es6/spread/iteratorSpreadInArray6.ts | 16 + .../es6/spread/iteratorSpreadInArray7.ts | 16 + .../es6/spread/iteratorSpreadInArray8.ts | 11 + .../es6/spread/iteratorSpreadInArray9.ts | 14 + .../es6/spread/iteratorSpreadInCall.ts | 16 + .../es6/spread/iteratorSpreadInCall10.ts | 17 + .../es6/spread/iteratorSpreadInCall11.ts | 17 + .../es6/spread/iteratorSpreadInCall12.ts | 32 + .../es6/spread/iteratorSpreadInCall2.ts | 16 + .../es6/spread/iteratorSpreadInCall3.ts | 16 + .../es6/spread/iteratorSpreadInCall4.ts | 16 + .../es6/spread/iteratorSpreadInCall5.ts | 29 + .../es6/spread/iteratorSpreadInCall6.ts | 29 + .../es6/spread/iteratorSpreadInCall7.ts | 29 + .../es6/spread/iteratorSpreadInCall8.ts | 32 + .../es6/spread/iteratorSpreadInCall9.ts | 32 + .../cases/fourslash/getOccurrencesDeclare1.ts | 1 - .../cases/fourslash/getOccurrencesDeclare3.ts | 1 - .../cases/fourslash/getOccurrencesExport1.ts | 1 - .../cases/fourslash/getOccurrencesExport3.ts | 1 - .../fourslash/server/{brace.ts => brace01.ts} | 2 +- .../{completions.ts => completions01.ts} | 2 +- .../{completions2.ts => completions02.ts} | 2 +- .../server/{definition.ts => definition01.ts} | 2 +- .../server/{format.ts => format01.ts} | 2 +- .../{formatonkey.ts => formatonkey01.ts} | 2 +- .../server/{navbar.ts => navbar01.ts} | 2 +- .../fourslash/server/{navto.ts => navto01.ts} | 2 +- tests/cases/fourslash/server/occurrences01.ts | 22 + tests/cases/fourslash/server/occurrences02.ts | 16 + .../server/{quickinfo.ts => quickinfo01.ts} | 2 +- .../server/{references.ts => references01.ts} | 2 +- .../server/{rename.ts => rename01.ts} | 2 +- .../{signatureHelp.ts => signatureHelp01.ts} | 2 +- 369 files changed, 8422 insertions(+), 36024 deletions(-) create mode 100644 tests/baselines/reference/arrayBindingPatternOmittedExpressions.js create mode 100644 tests/baselines/reference/arrayBindingPatternOmittedExpressions.types create mode 100644 tests/baselines/reference/classExpressionWithDecorator1.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithDecorator1.js create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties1.js create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticProperties2.js create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES61.js create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt create mode 100644 tests/baselines/reference/classExpressionWithStaticPropertiesES62.js create mode 100644 tests/baselines/reference/constructorStaticParamName.errors.txt delete mode 100644 tests/baselines/reference/constructorStaticParamName.types create mode 100644 tests/baselines/reference/convertKeywordsYes.errors.txt delete mode 100644 tests/baselines/reference/convertKeywordsYes.types create mode 100644 tests/baselines/reference/decoratorOnClassMethod11.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassMethod11.js create mode 100644 tests/baselines/reference/decoratorOnClassMethod12.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassMethod12.js create mode 100644 tests/baselines/reference/decoratorOnClassMethod13.js create mode 100644 tests/baselines/reference/decoratorOnClassMethod13.types create mode 100644 tests/baselines/reference/exportDeclarationInInternalModule.errors.txt create mode 100644 tests/baselines/reference/exportDeclarationInInternalModule.js create mode 100644 tests/baselines/reference/exportStarFromEmptyModule.errors.txt create mode 100644 tests/baselines/reference/exportStarFromEmptyModule.js create mode 100644 tests/baselines/reference/for-of57.js create mode 100644 tests/baselines/reference/for-of57.types create mode 100644 tests/baselines/reference/iterableArrayPattern1.js create mode 100644 tests/baselines/reference/iterableArrayPattern1.types create mode 100644 tests/baselines/reference/iterableArrayPattern10.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern10.js create mode 100644 tests/baselines/reference/iterableArrayPattern11.js create mode 100644 tests/baselines/reference/iterableArrayPattern11.types create mode 100644 tests/baselines/reference/iterableArrayPattern12.js create mode 100644 tests/baselines/reference/iterableArrayPattern12.types create mode 100644 tests/baselines/reference/iterableArrayPattern13.js create mode 100644 tests/baselines/reference/iterableArrayPattern13.types create mode 100644 tests/baselines/reference/iterableArrayPattern14.js create mode 100644 tests/baselines/reference/iterableArrayPattern14.types create mode 100644 tests/baselines/reference/iterableArrayPattern15.js create mode 100644 tests/baselines/reference/iterableArrayPattern15.types create mode 100644 tests/baselines/reference/iterableArrayPattern16.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern16.js create mode 100644 tests/baselines/reference/iterableArrayPattern17.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern17.js create mode 100644 tests/baselines/reference/iterableArrayPattern18.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern18.js create mode 100644 tests/baselines/reference/iterableArrayPattern19.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern19.js create mode 100644 tests/baselines/reference/iterableArrayPattern2.js create mode 100644 tests/baselines/reference/iterableArrayPattern2.types create mode 100644 tests/baselines/reference/iterableArrayPattern20.js create mode 100644 tests/baselines/reference/iterableArrayPattern20.types create mode 100644 tests/baselines/reference/iterableArrayPattern21.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern21.js create mode 100644 tests/baselines/reference/iterableArrayPattern22.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern22.js create mode 100644 tests/baselines/reference/iterableArrayPattern23.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern23.js create mode 100644 tests/baselines/reference/iterableArrayPattern24.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern24.js create mode 100644 tests/baselines/reference/iterableArrayPattern25.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern25.js create mode 100644 tests/baselines/reference/iterableArrayPattern26.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern26.js create mode 100644 tests/baselines/reference/iterableArrayPattern27.js create mode 100644 tests/baselines/reference/iterableArrayPattern27.types create mode 100644 tests/baselines/reference/iterableArrayPattern28.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern28.js create mode 100644 tests/baselines/reference/iterableArrayPattern29.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern29.js create mode 100644 tests/baselines/reference/iterableArrayPattern3.js create mode 100644 tests/baselines/reference/iterableArrayPattern3.types create mode 100644 tests/baselines/reference/iterableArrayPattern30.js create mode 100644 tests/baselines/reference/iterableArrayPattern30.types create mode 100644 tests/baselines/reference/iterableArrayPattern4.js create mode 100644 tests/baselines/reference/iterableArrayPattern4.types create mode 100644 tests/baselines/reference/iterableArrayPattern5.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern5.js create mode 100644 tests/baselines/reference/iterableArrayPattern6.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern6.js create mode 100644 tests/baselines/reference/iterableArrayPattern7.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern7.js create mode 100644 tests/baselines/reference/iterableArrayPattern8.errors.txt create mode 100644 tests/baselines/reference/iterableArrayPattern8.js create mode 100644 tests/baselines/reference/iterableArrayPattern9.js create mode 100644 tests/baselines/reference/iterableArrayPattern9.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray10.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray10.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray11.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray11.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray2.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray2.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray3.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray3.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray4.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray4.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray5.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray5.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray6.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray6.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray7.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray7.types create mode 100644 tests/baselines/reference/iteratorSpreadInArray8.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray8.js create mode 100644 tests/baselines/reference/iteratorSpreadInArray9.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInArray9.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall10.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall10.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall11.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall11.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall12.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall12.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall2.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall2.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall3.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall3.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall4.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall4.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall5.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall5.types create mode 100644 tests/baselines/reference/iteratorSpreadInCall6.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall6.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall7.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall7.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall8.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall8.js create mode 100644 tests/baselines/reference/iteratorSpreadInCall9.errors.txt create mode 100644 tests/baselines/reference/iteratorSpreadInCall9.js create mode 100644 tests/baselines/reference/parser642331.errors.txt delete mode 100644 tests/baselines/reference/parser642331.types create mode 100644 tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts create mode 100644 tests/cases/compiler/classExpressionWithDecorator1.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticProperties1.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticProperties2.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts create mode 100644 tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts create mode 100644 tests/cases/compiler/exportDeclarationInInternalModule.ts create mode 100644 tests/cases/compiler/exportStarFromEmptyModule.ts create mode 100644 tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts create mode 100644 tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts create mode 100644 tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts create mode 100644 tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts create mode 100644 tests/cases/conformance/es6/for-ofStatements/for-of57.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts create mode 100644 tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts rename tests/cases/fourslash/server/{brace.ts => brace01.ts} (91%) rename tests/cases/fourslash/server/{completions.ts => completions01.ts} (87%) rename tests/cases/fourslash/server/{completions2.ts => completions02.ts} (84%) rename tests/cases/fourslash/server/{definition.ts => definition01.ts} (68%) rename tests/cases/fourslash/server/{format.ts => format01.ts} (75%) rename tests/cases/fourslash/server/{formatonkey.ts => formatonkey01.ts} (76%) rename tests/cases/fourslash/server/{navbar.ts => navbar01.ts} (96%) rename tests/cases/fourslash/server/{navto.ts => navto01.ts} (94%) create mode 100644 tests/cases/fourslash/server/occurrences01.ts create mode 100644 tests/cases/fourslash/server/occurrences02.ts rename tests/cases/fourslash/server/{quickinfo.ts => quickinfo01.ts} (88%) rename tests/cases/fourslash/server/{references.ts => references01.ts} (79%) rename tests/cases/fourslash/server/{rename.ts => rename01.ts} (81%) rename tests/cases/fourslash/server/{signatureHelp.ts => signatureHelp01.ts} (72%) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f0882a51c4f..ea38a8f4b31 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -126,6 +126,7 @@ module ts { let stringLiteralTypes: Map = {}; let emitExtends = false; let emitDecorate = false; + let emitParam = false; let mergedSymbols: Symbol[] = []; let symbolLinks: SymbolLinks[] = []; @@ -928,7 +929,7 @@ module ts { // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. function visit(symbol: Symbol) { - if (symbol.flags & SymbolFlags.HasExports && !contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & SymbolFlags.HasExports && !contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -2077,15 +2078,20 @@ module ts { } } else { - // For an array binding element the specified or inferred type of the parent must be an array-like type - if (!isArrayLikeType(parentType)) { - error(pattern, Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + let elementType = checkIteratedTypeOrElementType(parentType, pattern, /*allowStringInput*/ false); if (!declaration.dotDotDotToken) { + if (elementType.flags & TypeFlags.Any) { + return elementType; + } + // Use specific property type when parent is a tuple or numeric index type when parent is an array let propName = "" + indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, IndexKind.Number); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), (parentType).elementTypes.length, pattern.elements.length); @@ -2098,7 +2104,7 @@ module ts { } else { // Rest element has an array type with the same element type as the parent type - type = createArrayType(getIndexTypeOfType(parentType, IndexKind.Number)); + type = createArrayType(elementType); } } return type; @@ -2187,7 +2193,34 @@ module ts { hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + let unionOfElements = getUnionType(elementTypes); + if (languageVersion >= ScriptTarget.ES6) { + // If the user has something like: + // + // function fun(...[a, ...b]) { } + // + // Normally, in ES6, the implied type of an array binding pattern with a rest element is + // an iterable. However, there is a requirement in our type system that all rest + // parameters be array types. To satisfy this, we have an exception to the rule that + // says the type of an array binding pattern with a rest element is an array type + // if it is *itself* in a rest parameter. It will still be compatible with a spreaded + // iterable argument, but within the function it will be an array. + let parent = pattern.parent; + let isRestParameter = parent.kind === SyntaxKind.Parameter && + pattern === (parent).name && + (parent).dotDotDotToken !== undefined; + return isRestParameter ? createArrayType(unionOfElements) : createIterableType(unionOfElements); + } + + return createArrayType(unionOfElements); + } + + // If the pattern has at least one element, and no rest element, then it should imply a tuple type. + return createTupleType(elementTypes); } // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself @@ -3000,6 +3033,16 @@ module ts { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } + function typeHasCallOrConstructSignatures(type: Type): boolean { + let apparentType = getApparentType(type); + if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { + let resolved = resolveObjectOrUnionTypeMembers(type); + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } + function getIndexTypeOfObjectOrUnionType(type: Type, kind: IndexKind): Type { if (type.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { let resolved = resolveObjectOrUnionTypeMembers(type); @@ -3450,6 +3493,10 @@ module ts { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType: Type): Type { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } + function createArrayType(elementType: Type): Type { // globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if // user code augments the Array type with call or construct signatures that have an array type as the return type. @@ -5589,7 +5636,7 @@ module ts { } } - if (container.kind === SyntaxKind.ComputedPropertyName) { + if (container && container.kind === SyntaxKind.ComputedPropertyName) { error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -5957,12 +6004,14 @@ module ts { } function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type { - let type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; - } - return type; + // It is usually not safe to call checkExpressionCached if we can be contextually typing. + // You can tell that we are contextually typing because of the contextualMapper parameter. + // While it is true that a spread element can have a contextual type, it does not do anything + // with this type. It is neither affected by it, nor does it propagate it to its operand. + // So the fact that contextualMapper is passed is not important, because the operand of a spread + // element is not contextually typed. + let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function checkArrayLiteral(node: ArrayLiteralExpression, contextualMapper?: TypeMapper): Type { @@ -5970,18 +6019,13 @@ module ts { if (!elements.length) { return createArrayType(undefinedType); } - let hasSpreadElement: boolean = false; + let hasSpreadElement = false; let elementTypes: Type[] = []; - forEach(elements, e => { + for (let e of elements) { let type = checkExpression(e, contextualMapper); - if (e.kind === SyntaxKind.SpreadElementExpression) { - elementTypes.push(getIndexTypeOfType(type, IndexKind.Number) || anyType); - hasSpreadElement = true; - } - else { - elementTypes.push(type); - } - }); + elementTypes.push(type); + hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression; + } if (!hasSpreadElement) { let contextualType = getContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { @@ -6604,7 +6648,7 @@ module ts { for (let i = 0; i < args.length; i++) { let arg = args[i]; if (arg.kind !== SyntaxKind.OmittedExpression) { - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); let argType: Type; if (i === 0 && args[i].parent.kind === SyntaxKind.TaggedTemplateExpression) { argType = globalTemplateStringsArrayType; @@ -6627,7 +6671,7 @@ module ts { // No need to check for omitted args and template expressions, their exlusion value is always undefined if (excludeArgument[i] === false) { let arg = args[i]; - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -6660,7 +6704,7 @@ module ts { let arg = args[i]; if (arg.kind !== SyntaxKind.OmittedExpression) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) - let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let paramType = getTypeAtPosition(signature, i); // A tagged template expression provides a special first argument, and string literals get string literal types // unless we're reporting errors let argType = i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression ? globalTemplateStringsArrayType : @@ -7134,14 +7178,9 @@ module ts { } function getTypeAtPosition(signature: Signature, pos: number): Type { - if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; - } return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature: Signature, context: Signature, mapper: TypeMapper) { @@ -7577,11 +7616,10 @@ module ts { } function checkArrayLiteralAssignment(node: ArrayLiteralExpression, sourceType: Type, contextualMapper?: TypeMapper): Type { - // TODOO(andersh): Allow iterable source type in ES6 - if (!isArrayLikeType(sourceType)) { - error(node, Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false); let elements = node.elements; for (let i = 0; i < elements.length; i++) { let e = elements[i]; @@ -7589,8 +7627,9 @@ module ts { if (e.kind !== SyntaxKind.SpreadElementExpression) { let propName = "" + i; let type = sourceType.flags & TypeFlags.Any ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, IndexKind.Number); + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -7605,7 +7644,7 @@ module ts { } else { if (i === elements.length - 1) { - checkReferenceAssignment((e).expression, sourceType, contextualMapper); + checkReferenceAssignment((e).expression, createArrayType(elementType), contextualMapper); } else { error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); @@ -8727,24 +8766,92 @@ module ts { } } + /** Checks a type reference node as an expression. */ + function checkTypeNodeAsExpression(node: TypeNode | LiteralExpression) { + // When we are emitting type metadata for decorators, we need to try to check the type + // as if it were an expression so that we can emit the type in a value position when we + // serialize the type metadata. + if (node && node.kind === SyntaxKind.TypeReference) { + let type = getTypeFromTypeNodeOrHeritageClauseElement(node); + let shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (TypeFlags.Intrinsic | TypeFlags.NumberLike | TypeFlags.StringLike))) { + return; + } + if (shouldCheckIfUnknownType || type.symbol.valueDeclaration) { + checkExpressionOrQualifiedName((node).typeName); + } + } + } + + /** + * Checks the type annotation of an accessor declaration or property declaration as + * an expression if it is a type reference to a type with a value declaration. + */ + function checkTypeAnnotationAsExpression(node: AccessorDeclaration | PropertyDeclaration | ParameterDeclaration | MethodDeclaration) { + switch (node.kind) { + case SyntaxKind.PropertyDeclaration: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.Parameter: checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.MethodDeclaration: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.GetAccessor: + checkTypeNodeAsExpression((node).type); + break; + case SyntaxKind.SetAccessor: + checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); + break; + } + } + + /** Checks the type annotation of the parameters of a function/method or the constructor of a class as expressions */ + function checkParameterTypeAnnotationsAsExpressions(node: FunctionLikeDeclaration) { + // ensure all type annotations with a value declaration are checked as an expression + for (let parameter of node.parameters) { + checkTypeAnnotationAsExpression(parameter); + } + } + /** Check the decorators of a node */ function checkDecorators(node: Node): void { if (!node.decorators) { return; - } + } - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.Parameter: - emitDecorate = true; - break; + // skip this check for nodes that cannot have decorators. These should have already had an error reported by + // checkGrammarDecorators. + if (!nodeCanBeDecorated(node)) { + return; + } - default: - return; + if (compilerOptions.emitDecoratorMetadata) { + // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + var constructor = getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + + case SyntaxKind.MethodDeclaration: + checkParameterTypeAnnotationsAsExpressions(node); + // fall-through + + case SyntaxKind.SetAccessor: + case SyntaxKind.GetAccessor: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.Parameter: + checkTypeAnnotationAsExpression(node); + break; + } + } + + emitDecorate = true; + if (node.kind === SyntaxKind.Parameter) { + emitParam = true; } forEach(node.decorators, checkDecorator); @@ -9294,29 +9401,41 @@ module ts { function checkRightHandSideOfForOf(rhsExpression: Expression): Type { let expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= ScriptTarget.ES6 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, /*allowStringInput*/ true); + } + + function checkIteratedTypeOrElementType(inputType: Type, errorNode: Node, allowStringInput: boolean): Type { + if (languageVersion >= ScriptTarget.ES6) { + return checkIteratedType(inputType, errorNode) || anyType; + } + + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, errorNode); + } + + if (isArrayLikeType(inputType)) { + return getIndexTypeOfType(inputType, IndexKind.Number); + } + + error(errorNode, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; } /** - * When expressionForError is undefined, it means we should not report any errors. + * When errorNode is undefined, it means we should not report any errors. */ - function checkIteratedType(iterable: Type, expressionForError: Expression): Type { + function checkIteratedType(iterable: Type, errorNode: Node): Type { Debug.assert(languageVersion >= ScriptTarget.ES6); - let iteratedType = getIteratedType(iterable, expressionForError); + let iteratedType = getIteratedType(iterable, errorNode); // Now even though we have extracted the iteratedType, we will have to validate that the type // passed in is actually an Iterable. - if (expressionForError && iteratedType) { - let completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable: Type, expressionForError: Expression) { + function getIteratedType(iterable: Type, errorNode: Node) { // We want to treat type as an iterable, and get the type it is an iterable of. The iterable // must have the following structure (annotated with the names of the variables below): // @@ -9347,6 +9466,12 @@ module ts { return undefined; } + // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), + // then just grab its type argument. + if ((iterable.flags & TypeFlags.Reference) && (iterable).target === globalIterableType) { + return (iterable).typeArguments[0]; + } + let iteratorFunction = getTypeOfPropertyOfType(iterable, getPropertyNameForKnownSymbolName("iterator")); if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, TypeFlags.Any)) { return undefined; @@ -9354,8 +9479,8 @@ module ts { let iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, SignatureKind.Call) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } @@ -9372,8 +9497,8 @@ module ts { let iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, SignatureKind.Call) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + if (errorNode) { + error(errorNode, Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } @@ -9385,8 +9510,8 @@ module ts { let iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } @@ -9412,7 +9537,7 @@ module ts { * 1. Some constituent is neither a string nor an array. * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). */ - function checkElementTypeOfArrayOrString(arrayOrStringType: Type, expressionForError: Expression): Type { + function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type { Debug.assert(languageVersion < ScriptTarget.ES6); // After we remove all types that are StringLike, we will know if there was a string constituent @@ -9423,7 +9548,7 @@ module ts { let reportedError = false; if (hasStringConstituent) { if (languageVersion < ScriptTarget.ES5) { - error(expressionForError, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + error(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } @@ -9443,7 +9568,7 @@ module ts { let diagnostic = hasStringConstituent ? Diagnostics.Type_0_is_not_an_array_type : Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(expressionForError, diagnostic, typeToString(arrayType)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } @@ -10764,6 +10889,10 @@ module ts { links.flags |= NodeCheckFlags.EmitDecorate; } + if (emitParam) { + links.flags |= NodeCheckFlags.EmitParam; + } + links.flags |= NodeCheckFlags.TypeChecked; } } @@ -11442,6 +11571,201 @@ module ts { return undefined; } + /** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeEntityName(node: EntityName, getGeneratedNameForNode: (Node: Node) => string, fallbackPath?: string[]): string { + if (node.kind === SyntaxKind.Identifier) { + var substitution = getExpressionNameSubstitution(node, getGeneratedNameForNode); + var text = substitution || (node).text; + if (fallbackPath) { + fallbackPath.push(text); + } + else { + return text; + } + } + else { + var left = serializeEntityName((node).left, getGeneratedNameForNode, fallbackPath); + var right = serializeEntityName((node).right, getGeneratedNameForNode, fallbackPath); + if (!fallbackPath) { + return left + "." + right; + } + } + } + + /** Serializes a TypeReferenceNode to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeTypeReferenceNode(node: TypeReferenceNode, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of a TypeReferenceNode uses the following rules: + // + // * The serialized type of a TypeReference that is `void` is "void 0". + // * The serialized type of a TypeReference that is a `boolean` is "Boolean". + // * The serialized type of a TypeReference that is an enum or `number` is "Number". + // * The serialized type of a TypeReference that is a string literal or `string` is "String". + // * The serialized type of a TypeReference that is a tuple is "Array". + // * The serialized type of a TypeReference that is a `symbol` is "Symbol". + // * The serialized type of a TypeReference with a value declaration is its entity name. + // * The serialized type of a TypeReference with a call or construct signature is "Function". + // * The serialized type of any other type is "Object". + let type = getTypeFromTypeReference(node); + if (type.flags & TypeFlags.Void) { + return "void 0"; + } + else if (type.flags & TypeFlags.Boolean) { + return "Boolean"; + } + else if (type.flags & TypeFlags.NumberLike) { + return "Number"; + } + else if (type.flags & TypeFlags.StringLike) { + return "String"; + } + else if (type.flags & TypeFlags.Tuple) { + return "Array"; + } + else if (type.flags & TypeFlags.ESSymbol) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath: string[] = []; + serializeEntityName(node.typeName, getGeneratedNameForNode, fallbackPath); + return fallbackPath; + } + else if (type.symbol && type.symbol.valueDeclaration) { + return serializeEntityName(node.typeName, getGeneratedNameForNode); + } + else if (typeHasCallOrConstructSignatures(type)) { + return "Function"; + } + + return "Object"; + } + + /** Serializes a TypeNode to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeTypeNode(node: TypeNode | LiteralExpression, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of a TypeNode uses the following rules: + // + // * The serialized type of `void` is "void 0" (undefined). + // * The serialized type of a parenthesized type is the serialized type of its nested type. + // * The serialized type of a Function or Constructor type is "Function". + // * The serialized type of an Array or Tuple type is "Array". + // * The serialized type of `boolean` is "Boolean". + // * The serialized type of `string` or a string-literal type is "String". + // * The serialized type of a type reference is handled by `serializeTypeReferenceNode`. + // * The serialized type of any other type node is "Object". + if (node) { + switch (node.kind) { + case SyntaxKind.VoidKeyword: + return "void 0"; + case SyntaxKind.ParenthesizedType: + return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return "Function"; + case SyntaxKind.ArrayType: + case SyntaxKind.TupleType: + return "Array"; + case SyntaxKind.BooleanKeyword: + return "Boolean"; + case SyntaxKind.StringKeyword: + case SyntaxKind.StringLiteral: + return "String"; + case SyntaxKind.NumberKeyword: + return "Number"; + case SyntaxKind.TypeReference: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case SyntaxKind.TypeQuery: + case SyntaxKind.TypeLiteral: + case SyntaxKind.UnionType: + case SyntaxKind.AnyKeyword: + break; + default: + Debug.fail("Cannot serialize unexpected type node."); + break; + } + } + + return "Object"; + } + + /** Serializes the type of a declaration to an appropriate JS constructor value. Used by the __metadata decorator for a class member. */ + function serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + // serialization of the type of a declaration uses the following rules: + // + // * The serialized type of a ClassDeclaration is "Function" + // * The serialized type of a ParameterDeclaration is the serialized type of its type annotation. + // * The serialized type of a PropertyDeclaration is the serialized type of its type annotation. + // * The serialized type of an AccessorDeclaration is the serialized type of the return type annotation of its getter or parameter type annotation of its setter. + // * The serialized type of any other FunctionLikeDeclaration is "Function". + // * The serialized type of any other node is "void 0". + // + // For rules on serializing type annotations, see `serializeTypeNode`. + switch (node.kind) { + case SyntaxKind.ClassDeclaration: return "Function"; + case SyntaxKind.PropertyDeclaration: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.Parameter: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.GetAccessor: return serializeTypeNode((node).type, getGeneratedNameForNode); + case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (isFunctionLike(node)) { + return "Function"; + } + return "void 0"; + } + + /** Serializes the parameter types of a function or the constructor of a class. Used by the __metadata decorator for a method or set accessor. */ + function serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): (string | string[])[] { + // serialization of parameter types uses the following rules: + // + // * If the declaration is a class, the parameters of the first constructor with a body are used. + // * If the declaration is function-like and has a body, the parameters of the function are used. + // + // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. + if (node) { + var valueDeclaration: FunctionLikeDeclaration; + if (node.kind === SyntaxKind.ClassDeclaration) { + valueDeclaration = getFirstConstructorWithBody(node); + } + else if (isFunctionLike(node) && nodeIsPresent((node).body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result: (string | string[])[]; + var parameters = valueDeclaration.parameters; + var parameterCount = parameters.length; + if (parameterCount > 0) { + result = new Array(parameterCount); + for (var i = 0; i < parameterCount; i++) { + if (parameters[i].dotDotDotToken) { + var parameterType = parameters[i].type; + if (parameterType.kind === SyntaxKind.ArrayType) { + parameterType = (parameterType).elementType; + } + else if (parameterType.kind === SyntaxKind.TypeReference && (parameterType).typeArguments && (parameterType).typeArguments.length === 1) { + parameterType = (parameterType).typeArguments[0]; + } + else { + parameterType = undefined; + } + result[i] = serializeTypeNode(parameterType, getGeneratedNameForNode); + } + else { + result[i] = serializeTypeOfNode(parameters[i], getGeneratedNameForNode); + } + } + return result; + } + } + } + return emptyArray; + } + + /** Serializes the return type of function. Used by the __metadata decorator for a method. */ + function serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[] { + if (node && isFunctionLike(node)) { + return serializeTypeNode((node).type, getGeneratedNameForNode); + } + return "void 0"; + } + function writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) { // Get type of the symbol if this is the valid symbol otherwise get type at location let symbol = getSymbolOfNode(declaration); @@ -11529,6 +11853,9 @@ module ts { resolvesToSomeValue, collectLinkedAliases, getBlockScopedVariableId, + serializeTypeOfNode, + serializeParameterTypesOfNode, + serializeReturnTypeOfNode, }; } @@ -11593,15 +11920,15 @@ module ts { return false; } if (!nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); } else if (languageVersion < ScriptTarget.ES5) { - return grammarErrorOnNode(node, Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } else if (node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor) { let accessors = getAllAccessorDeclarations((node.parent).members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { - return grammarErrorOnNode(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); } } return false; @@ -12315,7 +12642,9 @@ module ts { else { let elements = (name).elements; for (let element of elements) { - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== SyntaxKind.OmittedExpression) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -12445,7 +12774,16 @@ module ts { let identifier = name; if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) { let nameText = declarationNameToString(identifier); - return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + + // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) + // if so, we would like to give more explicit invalid usage error. + // This will be particularly helpful in the case of "arguments" as such case is very common mistake. + if (getAncestor(name, SyntaxKind.ClassDeclaration) || getAncestor(name, SyntaxKind.ClassExpression)) { + return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + } + else { + return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } } } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 2f3b15f3777..48817798d81 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -156,6 +156,11 @@ module ts { shortName: "w", type: "boolean", description: Diagnostics.Watch_input_files, + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 4b93081dc31..65c711475d6 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -434,7 +434,7 @@ module ts { return path.replace(/\\/g, "/"); } - // Returns length of path root (i.e. length of "/", "x:/", "//server/share/") + // Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") export function getRootLength(path: string): number { if (path.charCodeAt(0) === CharacterCodes.slash) { if (path.charCodeAt(1) !== CharacterCodes.slash) return 1; @@ -448,6 +448,8 @@ module ts { if (path.charCodeAt(2) === CharacterCodes.slash) return 3; return 2; } + let idx = path.indexOf('://'); + if (idx !== -1) return idx + 3 return 0; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 64a2515e774..5062be5ed46 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -167,7 +167,8 @@ module ts { Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1210, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, @@ -343,8 +344,8 @@ module ts { The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "An iterator must have a 'next()' method." }, The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 79b652619b5..4476b0cad4a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -659,9 +659,13 @@ "category": "Error", "code": 1209 }, + "Invalid use of '{0}'. Class definitions are automatically in strict mode.": { + "category": "Error", + "code": 1210 + }, "A class declaration without the 'default' modifier must have a name": { "category": "Error", - "code": 1210 + "code": 1211 }, "Duplicate identifier '{0}'.": { "category": "Error", @@ -1363,11 +1367,11 @@ "category": "Error", "code": 2487 }, - "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator.": { + "Type must have a '[Symbol.iterator]()' method that returns an iterator.": { "category": "Error", "code": 2488 }, - "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method.": { + "An iterator must have a 'next()' method.": { "category": "Error", "code": 2489 }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 5d4bf9df3e1..940edf04191 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -23,6 +23,33 @@ module ts { // @internal // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult { + // emit output for the __extends helper function + const extendsHelper = ` +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +};`; + + // emit output for the __decorate helper function + const decorateHelper = ` +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +};`; + + // emit output for the __metadata helper function + const metadataHelper = ` +var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };`; + + // emit output for the __param helper function + const paramHelper = ` +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };`; + let compilerOptions = host.getCompilerOptions(); let languageVersion = compilerOptions.target || ScriptTarget.ES3; let sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined; @@ -98,6 +125,7 @@ module ts { let extendsEmitted = false; let decorateEmitted = false; + let paramEmitted = false; let tempFlags = 0; let tempVariables: Identifier[]; let tempParameters: Identifier[]; @@ -769,27 +797,34 @@ module ts { } } - function emitList(nodes: Node[], start: number, count: number, multiLine: boolean, trailingComma: boolean) { + function emitList(nodes: TNode[], start: number, count: number, multiLine: boolean, trailingComma: boolean, leadingComma?: boolean, noTrailingNewLine?: boolean, emitNode?: (node: TNode) => void): number { + if (!emitNode) { + emitNode = emit; + } + for (let i = 0; i < count; i++) { if (multiLine) { - if (i) { + if (i || leadingComma) { write(","); } writeLine(); } else { - if (i) { + if (i || leadingComma) { write(", "); } } - emit(nodes[start + i]); + emitNode(nodes[start + i]); + leadingComma = true; } if (trailingComma) { write(","); } - if (multiLine) { + if (multiLine && !noTrailingNewLine) { writeLine(); } + + return count; } function emitCommaList(nodes: Node[]) { @@ -1101,18 +1136,16 @@ module ts { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - - let generatedName = computedPropertyNamesToGeneratedNames[node.id]; + + let generatedName = computedPropertyNamesToGeneratedNames[getNodeId(node)]; if (generatedName) { // we have already generated a variable for this node, write that value instead. write(generatedName); return; } - let generatedVariable = createTempVariable(TempFlags.Auto); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(TempFlags.Auto).text; + computedPropertyNamesToGeneratedNames[getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -1348,211 +1381,163 @@ module ts { } } - function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number): void { - let parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); + function emitObjectLiteralBody(node: ObjectLiteralExpression, numElements: number): void { + if (numElements === 0) { + write("{}"); + return; + } + + write("{"); + + if (numElements > 0) { + var properties = node.properties; + + // If we are not doing a downlevel transformation for object literals, + // then try to preserve the original shape of the object literal. + // Otherwise just try to preserve the formatting. + if (numElements === properties.length) { + emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= ScriptTarget.ES5, /* spacesBetweenBraces */ true); + } + else { + let multiLine = (node.flags & NodeFlags.MultiLine) !== 0; + if (!multiLine) { + write(" "); + } + else { + increaseIndent(); + } + + emitList(properties, 0, numElements, /*multiLine*/ multiLine, /*trailingComma*/ false); + + if (!multiLine) { + write(" "); + } + else { + decreaseIndent(); + } + } + } + + write("}"); } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral: ObjectLiteralExpression, firstComputedPropertyIndex: number): ParenthesizedExpression { + function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number) { + let multiLine = (node.flags & NodeFlags.MultiLine) !== 0; + let properties = node.properties; + + write("("); + + if (multiLine) { + increaseIndent(); + } + // For computed properties, we need to create a unique handle to the object // literal so we can modify it without risking internal assignments tainting the object. let tempVar = createAndRecordTempVariable(TempFlags.Auto); - // Hold onto the initial non-computed properties in a new object literal, - // then create the rest through property accesses on the temp variable. - let initialObjectLiteral = createSynthesizedNode(SyntaxKind.ObjectLiteralExpression); - initialObjectLiteral.properties = >originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= NodeFlags.MultiLine; + // Write out the first non-computed properties + // (or all properties if none of them are computed), + // then emit the rest through indexing on the temp variable. + emit(tempVar) + write(" = "); + emitObjectLiteralBody(node, firstComputedPropertyIndex); - // The comma expressions that will patch the object literal. - // This will end up being something like '_a = { ... }, _a.x = 10, _a.y = 20, _a'. - let propertyPatches = createBinaryExpression(tempVar, SyntaxKind.EqualsToken, initialObjectLiteral); + for (let i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); - ts.forEach(originalObjectLiteral.properties, property => { - let patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - // TODO(drosen): Preserve comments - //let leadingComments = getLeadingCommentRanges(currentSourceFile.text, property.pos); - //let trailingComments = getTrailingCommentRanges(currentSourceFile.text, property.end); - //addCommentsToSynthesizedNode(patchedProperty, leadingComments, trailingComments); + let property = properties[i]; - propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, patchedProperty); + emitStart(property) + if (property.kind === SyntaxKind.GetAccessor || property.kind === SyntaxKind.SetAccessor) { + // TODO (drosen): Reconcile with 'emitMemberFunctions'. + let accessors = getAllAccessorDeclarations(node.properties, property); + if (property !== accessors.firstAccessor) { + continue; + } + write("Object.defineProperty("); + emit(tempVar); + write(", "); + emitStart(node.name); + emitExpressionForPropertyName(property.name); + emitEnd(property.name); + write(", {"); + increaseIndent(); + if (accessors.getAccessor) { + writeLine() + emitLeadingComments(accessors.getAccessor); + write("get: "); + emitStart(accessors.getAccessor); + write("function "); + emitSignatureAndBody(accessors.getAccessor); + emitEnd(accessors.getAccessor); + emitTrailingComments(accessors.getAccessor); + write(","); + } + if (accessors.setAccessor) { + writeLine(); + emitLeadingComments(accessors.setAccessor); + write("set: "); + emitStart(accessors.setAccessor); + write("function "); + emitSignatureAndBody(accessors.setAccessor); + emitEnd(accessors.setAccessor); + emitTrailingComments(accessors.setAccessor); + write(","); + } + writeLine(); + write("enumerable: true,"); + writeLine(); + write("configurable: true"); + decreaseIndent(); + writeLine(); + write("})"); + emitEnd(property); } - }); + else { + emitLeadingComments(property); + emitStart(property.name); + emit(tempVar); + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); - // Finally, return the temp variable. - propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, createIdentifier(tempVar.text, /*startsOnNewLine:*/ true)); + write(" = "); - let result = createParenthesizedExpression(propertyPatches); - - // TODO(drosen): Preserve comments - // let leadingComments = getLeadingCommentRanges(currentSourceFile.text, originalObjectLiteral.pos); - // let trailingComments = getTrailingCommentRanges(currentSourceFile.text, originalObjectLiteral.end); - //addCommentsToSynthesizedNode(result, leadingComments, trailingComments); - - return result; - } - - function addCommentsToSynthesizedNode(node: SynthesizedNode, leadingCommentRanges: CommentRange[], trailingCommentRanges: CommentRange[]): void { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - - // Returns 'undefined' if a property has already been accounted for - // (e.g. a 'get' accessor which has already been emitted along with its 'set' accessor). - function tryCreatePatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, tempVar: Identifier, property: ObjectLiteralElement): Expression { - let leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - let maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - - return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide, /*startsOnNewLine:*/ true); - } - - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, property: ObjectLiteralElement) { - switch (property.kind) { - case SyntaxKind.PropertyAssignment: - return (property).initializer; - - case SyntaxKind.ShorthandPropertyAssignment: - // TODO: (andersh) Technically it isn't correct to make an identifier here since getExpressionNamePrefix returns - // a string containing a dotted name. In general I'm not a fan of mini tree rewriters as this one, elsewhere we - // manage by just emitting strings (which is a lot more performant). - //let prefix = createIdentifier(resolver.getExpressionNamePrefix((property).name)); - //return createPropertyAccessExpression(prefix, (property).name); - return createIdentifier(resolver.getExpressionNameSubstitution((property).name, getGeneratedNameForNode)); - - case SyntaxKind.MethodDeclaration: - return createFunctionExpression((property).parameters, (property).body); - - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - let { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(objectLiteral.properties, property); - - // Only emit the first accessor. - if (firstAccessor !== property) { - return undefined; + if (property.kind === SyntaxKind.PropertyAssignment) { + emit((property).initializer); } - - let propertyDescriptor = createSynthesizedNode(SyntaxKind.ObjectLiteralExpression); - - let descriptorProperties = >[]; - if (getAccessor) { - let getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + else if (property.kind === SyntaxKind.ShorthandPropertyAssignment) { + emitExpressionIdentifier((property).name); } - if (setAccessor) { - let setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + else if (property.kind === SyntaxKind.MethodDeclaration) { + emitFunctionDeclaration(property); } + else { + Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } - let trueExpr = createSynthesizedNode(SyntaxKind.TrueKeyword); - - let enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - - let configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - - propertyDescriptor.properties = descriptorProperties; - - let objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - - default: - Debug.fail(`ObjectLiteralElement kind ${property.kind} not accounted for.`); + emitEnd(property); } - } - function createParenthesizedExpression(expression: Expression) { - let result = createSynthesizedNode(SyntaxKind.ParenthesizedExpression); - result.expression = expression; + writeComma(); + emit(tempVar); - return result; - } - - function createNodeArray(...elements: T[]): NodeArray { - let result = >elements; - result.pos = -1; - result.end = -1; - - return result; - } - - function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression { - let result = createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine); - result.operatorToken = createSynthesizedNode(operator); - result.left = left; - result.right = right; - - return result; - } - - function createExpressionStatement(expression: Expression): ExpressionStatement { - let result = createSynthesizedNode(SyntaxKind.ExpressionStatement); - result.expression = expression; - return result; - } - - function createMemberAccessForPropertyName(expression: LeftHandSideExpression, memberName: DeclarationName): PropertyAccessExpression | ElementAccessExpression { - if (memberName.kind === SyntaxKind.Identifier) { - return createPropertyAccessExpression(expression, memberName); + if (multiLine) { + decreaseIndent(); + writeLine(); } - else if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { - return createElementAccessExpression(expression, memberName); + + write(")"); + + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else if (memberName.kind === SyntaxKind.ComputedPropertyName) { - return createElementAccessExpression(expression, (memberName).expression); - } - else { - Debug.fail(`Kind '${memberName.kind}' not accounted for.`); - } - } - - function createPropertyAssignment(name: LiteralExpression | Identifier, initializer: Expression) { - let result = createSynthesizedNode(SyntaxKind.PropertyAssignment); - result.name = name; - result.initializer = initializer; - - return result; - } - - function createFunctionExpression(parameters: NodeArray, body: Block): FunctionExpression { - let result = createSynthesizedNode(SyntaxKind.FunctionExpression); - result.parameters = parameters; - result.body = body; - - return result; - } - - function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression { - let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression); - result.expression = expression; - result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); - result.name = name; - - return result; - } - - function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression { - let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression); - result.expression = expression; - result.argumentExpression = argumentExpression; - - return result; - } - - function createIdentifier(name: string, startsOnNewLine?: boolean) { - let result = createSynthesizedNode(SyntaxKind.Identifier, startsOnNewLine); - result.text = name; - - return result; - } - - function createCallExpression(invokedExpression: MemberExpression, arguments: NodeArray) { - let result = createSynthesizedNode(SyntaxKind.CallExpression); - result.expression = invokedExpression; - result.arguments = arguments; - - return result; } function emitObjectLiteral(node: ObjectLiteralExpression): void { @@ -1580,13 +1565,33 @@ module ts { // Ordinary case: either the object has no computed properties // or we're compiling with an ES6+ target. - write("{"); + emitObjectLiteralBody(node, properties.length); + } - if (properties.length) { - emitLinePreservingList(node, properties, /*allowTrailingComma:*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces:*/ true) - } + function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression { + let result = createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine); + result.operatorToken = createSynthesizedNode(operator); + result.left = left; + result.right = right; - write("}"); + return result; + } + + function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression { + let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression); + result.expression = expression; + result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); + result.name = name; + + return result; + } + + function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression { + let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression); + result.expression = expression; + result.argumentExpression = argumentExpression; + + return result; } function emitComputedPropertyName(node: ComputedPropertyName) { @@ -3199,28 +3204,49 @@ module ts { } } - function emitMemberAssignments(node: ClassLikeDeclaration, staticFlag: NodeFlags) { - forEach(node.members, member => { - if (member.kind === SyntaxKind.PropertyDeclaration && (member.flags & NodeFlags.Static) === staticFlag && (member).initializer) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart((member).name); - if (staticFlag) { - emitDeclarationName(node); - } - else { - write("this"); - } - emitMemberAccessForPropertyName((member).name); - emitEnd((member).name); - write(" = "); - emit((member).initializer); - write(";"); - emitEnd(member); - emitTrailingComments(member); + function getInitializedProperties(node: ClassLikeDeclaration, static: boolean) { + let properties: PropertyDeclaration[] = []; + for (let member of node.members) { + if (member.kind === SyntaxKind.PropertyDeclaration && static === ((member.flags & NodeFlags.Static) !== 0) && (member).initializer) { + properties.push(member); } - }); + } + + return properties; + } + + function emitPropertyDeclarations(node: ClassLikeDeclaration, properties: PropertyDeclaration[]) { + for (let property of properties) { + emitPropertyDeclaration(node, property); + } + } + + function emitPropertyDeclaration(node: ClassLikeDeclaration, property: PropertyDeclaration, receiver?: Identifier, isExpression?: boolean) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & NodeFlags.Static) { + emitDeclarationName(node); + } + else { + write("this"); + } + } + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); + write(" = "); + emit(property.initializer); + if (!isExpression) { + write(";"); + } + + emitEnd(property); + emitTrailingComments(property); } function emitMemberFunctionsForES5AndLower(node: ClassLikeDeclaration) { @@ -3338,6 +3364,14 @@ module ts { tempVariables = undefined; tempParameters = undefined; + emitConstructorWorker(node, baseTypeElement); + + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + + function emitConstructorWorker(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { // Check if we have property assignment inside class declaration. // If there is property assignment, we need to emit constructor whether users define it or not // If there is no property assignment, we can omit constructor if users do not define it @@ -3425,7 +3459,7 @@ module ts { emitEnd(baseTypeElement); } } - emitMemberAssignments(node, /*staticFlag*/0); + emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false)); if (ctor) { var statements: Node[] = (ctor.body).statements; if (superCall) { @@ -3445,10 +3479,6 @@ module ts { if (ctor) { emitTrailingComments(ctor); } - - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; } function emitClassExpression(node: ClassExpression) { @@ -3540,6 +3570,29 @@ module ts { } } + // If the class has static properties, and it's a class expression, then we'll need + // to specialize the emit a bit. for a class expression of the form: + // + // class C { static a = 1; static b = 2; ... } + // + // We'll emit: + // + // (_temp = class C { ... }, _temp.a = 1, _temp.b = 2, _temp) + // + // This keeps the expression as an expression, while ensuring that the static parts + // of it have been initialized by the time it is used. + let staticProperties = getInitializedProperties(node, /*static:*/ true); + let isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === SyntaxKind.ClassExpression; + let tempVariable: Identifier; + + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(TempFlags.Auto); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = ") + } + write("class"); // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. @@ -3590,9 +3643,24 @@ module ts { // From ES6 specification: // HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. - writeLine(); - emitMemberAssignments(node, NodeFlags.Static); - emitDecoratorsOfClass(node); + + if (isClassExpressionWithStaticProperties) { + for (var property of staticProperties) { + write(","); + writeLine(); + emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true); + } + write(","); + writeLine(); + emit(tempVariable); + decreaseIndent(); + write(")"); + } + else { + writeLine(); + emitPropertyDeclarations(node, staticProperties); + emitDecoratorsOfClass(node); + } // If this is an exported class, but not on the top level (i.e. on an internal // module), export it @@ -3648,7 +3716,7 @@ module ts { writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, NodeFlags.Static); + emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -3700,12 +3768,12 @@ module ts { } function emitDecoratorsOfConstructor(node: ClassLikeDeclaration) { + let decorators = node.decorators; let constructor = getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } + let hasDecoratedParameters = constructor && forEach(constructor.parameters, nodeIsDecorated); - if (!nodeIsDecorated(node)) { + // skip decoration of the constructor if neither it nor its parameters are decorated + if (!decorators && !hasDecoratedParameters) { return; } @@ -3723,8 +3791,23 @@ module ts { writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + + let decoratorCount = decorators ? decorators.length : 0; + let argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + + argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + emitSerializedTypeMetadata(node, /*leadingComma*/ argumentsWritten >= 0); + + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); @@ -3732,72 +3815,80 @@ module ts { } function emitDecoratorsOfMembers(node: ClassLikeDeclaration, staticFlag: NodeFlags) { - forEach(node.members, member => { + for (let member of node.members) { + // only emit members in the correct group if ((member.flags & NodeFlags.Static) !== staticFlag) { - return; + continue; } + // skip members that cannot be decorated (such as the constructor) + if (!nodeCanBeDecorated(member)) { + continue; + } + + // skip a member if it or any of its parameters are not decorated + if (!nodeOrChildIsDecorated(member)) { + continue; + } + + // skip an accessor declaration if it is not the first accessor let decorators: NodeArray; - switch (member.kind) { - case SyntaxKind.MethodDeclaration: - // emit decorators of the method's parameters - emitDecoratorsOfParameters(node, member); - decorators = member.decorators; - break; + let functionLikeMember: FunctionLikeDeclaration; + if (isAccessor(member)) { + let accessors = getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - let accessors = getAllAccessorDeclarations(node.members, member); - if (member !== accessors.firstAccessor) { - // skip the second accessor as we processed it with the first. - return; - } + // get the decorators from the first accessor with decorators + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } - if (accessors.setAccessor) { - // emit decorators of the set accessor parameter - emitDecoratorsOfParameters(node, accessors.setAccessor); - } - - // get the decorators from the first decorated accessor. - decorators = accessors.firstAccessor.decorators; - if (!decorators && accessors.secondAccessor) { - decorators = accessors.secondAccessor.decorators; - } - break; - - case SyntaxKind.PropertyDeclaration: - decorators = member.decorators; - break; - - default: - // Constructor cannot be decorated, and its parameters are handled in emitDecoratorsOfConstructor - // Other members (i.e. IndexSignature) cannot be decorated. - return; + // we only decorate parameters of the set accessor + functionLikeMember = accessors.setAccessor; } + else { + decorators = member.decorators; - if (!decorators) { - return; + // we only decorate the parameters here if this is a method + if (member.kind === SyntaxKind.MethodDeclaration) { + functionLikeMember = member; + } } // Emit the call to __decorate. Given the following: // // class C { - // @dec method() {} + // @dec method(@dec2 x) {} // @dec get accessor() {} // @dec prop; // } // // The emit for a method is: // - // Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + // Object.defineProperty(C.prototype, "method", + // __decorate([ + // dec, + // __param(0, dec2), + // __metadata("design:type", Function), + // __metadata("design:paramtypes", [Object]), + // __metadata("design:returntype", void 0) + // ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); // // The emit for an accessor is: // - // Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + // Object.defineProperty(C.prototype, "accessor", + // __decorate([ + // dec + // ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); // // The emit for a property is: // - // __decorate([dec], C.prototype, "prop"); + // __decorate([ + // dec + // ], C.prototype, "prop"); // writeLine(); @@ -3809,10 +3900,28 @@ module ts { write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + + let decoratorCount = decorators ? decorators.length : 0; + let argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + emitSerializedTypeMetadata(member, argumentsWritten > 0); + + decreaseIndent(); + writeLine(); + write("], "); emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); @@ -3827,78 +3936,150 @@ module ts { emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } write(");"); emitEnd(member); writeLine(); - }); - } - - function emitDecoratorsOfParameters(node: ClassLikeDeclaration, member: FunctionLikeDeclaration) { - forEach(member.parameters, (parameter, parameterIndex) => { - if (!nodeIsDecorated(parameter)) { - return; - } - - // Emit the decorators for a parameter. Given the following: - // - // class C { - // constructor(@dec p) { } - // method(@dec p) { } - // set accessor(@dec value) { } - // } - // - // The emit for a constructor is: - // - // __decorate([dec], C, void 0, 0); - // - // The emit for a parameter is: - // - // __decorate([dec], C.prototype, "method", 0); - // - // The emit for an accessor is: - // - // __decorate([dec], C.prototype, "accessor", 0); - // - - writeLine(); - emitStart(parameter); - emitDecorateStart(parameter.decorators); - emitStart(parameter.name); - - if (member.kind === SyntaxKind.Constructor) { - emitDeclarationName(node); - write(", void 0"); - } - else { - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - } - - write(", "); - write(String(parameterIndex)); - emitEnd(parameter.name); - write(");"); - emitEnd(parameter); - writeLine(); - }); - } - - function emitDecorateStart(decorators: Decorator[]): void { - write("__decorate(["); - let decoratorCount = decorators.length; - for (let i = 0; i < decoratorCount; i++) { - if (i > 0) { - write(", "); - } - let decorator = decorators[i]; - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); } - write("], "); + } + + function emitDecoratorsOfParameters(node: FunctionLikeDeclaration, leadingComma: boolean): number { + let argumentsWritten = 0; + if (node) { + let parameterIndex = 0; + for (let parameter of node.parameters) { + if (nodeIsDecorated(parameter)) { + let decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ leadingComma, /*noTrailingNewLine*/ true, decorator => { + emitStart(decorator); + write(`__param(${parameterIndex}, `); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + + function shouldEmitTypeMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:type" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.PropertyDeclaration: + return true; + } + + return false; + } + + function shouldEmitReturnTypeMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:returntype" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.MethodDeclaration: + return true; + } + return false; + } + + function shouldEmitParamTypesMetadata(node: Declaration): boolean { + // This method determines whether to emit the "design:paramtypes" metadata based on the node's kind. + // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata + // compiler option is set. + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.SetAccessor: + return true; + } + return false; + } + + function emitSerializedTypeMetadata(node: Declaration, writeComma: boolean): number { + // This method emits the serialized type metadata for a decorator target. + // The caller should have already tested whether the node has decorators. + let argumentsWritten = 0; + if (compilerOptions.emitDecoratorMetadata) { + if (shouldEmitTypeMetadata(node)) { + var serializedType = resolver.serializeTypeOfNode(node, getGeneratedNameForNode); + if (serializedType) { + if (writeComma) { + write(", "); + } + writeLine(); + write("__metadata('design:type', "); + emitSerializedType(node, serializedType); + write(")"); + argumentsWritten++; + } + } + if (shouldEmitParamTypesMetadata(node)) { + var serializedTypes = resolver.serializeParameterTypesOfNode(node, getGeneratedNameForNode); + if (serializedTypes) { + if (writeComma || argumentsWritten) { + write(", "); + } + writeLine(); + write("__metadata('design:paramtypes', ["); + for (var i = 0; i < serializedTypes.length; ++i) { + if (i > 0) { + write(", "); + } + emitSerializedType(node, serializedTypes[i]); + } + write("])"); + argumentsWritten++; + } + } + if (shouldEmitReturnTypeMetadata(node)) { + var serializedType = resolver.serializeReturnTypeOfNode(node, getGeneratedNameForNode); + if (serializedType) { + if (writeComma || argumentsWritten) { + write(", "); + } + writeLine(); + write("__metadata('design:returntype', "); + emitSerializedType(node, serializedType); + write(")"); + argumentsWritten++; + } + } + } + return argumentsWritten; + } + + function serializeTypeNameSegment(location: Node, path: string[], index: number): string { + switch (index) { + case 0: + return `typeof ${path[index]} !== 'undefined' && ${path[index]}`; + case 1: + return `${serializeTypeNameSegment(location, path, index - 1) }.${path[index]}`; + default: + let temp = createAndRecordTempVariable(TempFlags.Auto).text; + return `(${temp} = ${serializeTypeNameSegment(location, path, index - 1) }) && ${temp}.${path[index]}`; + } + } + + function emitSerializedType(location: Node, name: string | string[]): void { + if (typeof name === "string") { + write(name); + return; + } + else { + Debug.assert(name.length > 0, "Invalid serialized type name"); + write(`(${serializeTypeNameSegment(location, name, name.length - 1) }) || Object`); + } } function emitInterfaceDeclaration(node: InterfaceDeclaration) { @@ -4531,7 +4712,7 @@ module ts { return statements.length; } - function writeHelper(text: string): void { + function writeLines(text: string): void { let lines = text.split(/\r\n|\r|\n/g); for (let i = 0; i < lines.length; ++i) { let line = lines[i]; @@ -4550,41 +4731,25 @@ module ts { // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); // Only Emit __extends function when target ES5. - // For target ES6 and above, we can emit classDeclaration as if. + // For target ES6 and above, we can emit classDeclaration as is. if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends)) { - writeLine(); - write("var __extends = this.__extends || function (d, b) {"); - increaseIndent(); - writeLine(); - write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - writeLine(); - write("function __() { this.constructor = d; }"); - writeLine(); - write("__.prototype = b.prototype;"); - writeLine(); - write("d.prototype = new __();"); - decreaseIndent(); - writeLine(); - write("};"); + writeLines(extendsHelper); extendsEmitted = true; } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) { - writeHelper(` -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } - } - return value; -};`); + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + + if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) { + writeLines(paramHelper); + paramEmitted = true; + } + if (isExternalModule(node)) { if (languageVersion >= ScriptTarget.ES6) { emitES6Module(node, startIndex); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 92f0e368398..d6cf4c1a141 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4756,9 +4756,7 @@ module ts { function parseClassDeclarationOrExpression(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, kind: SyntaxKind): ClassLikeDeclaration { // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code let savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= ScriptTarget.ES6) { - setStrictModeContext(true); - } + setStrictModeContext(true); var node = createNode(kind, fullStart); node.decorators = decorators; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8afc805ccd2..34eb86440f4 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1256,6 +1256,9 @@ module ts { getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; + serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[]; + serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): (string | string[])[]; + serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[]; } export const enum SymbolFlags { @@ -1381,6 +1384,7 @@ module ts { EnumValuesComputed = 0x00000080, BlockScopedBindingInLoop = 0x00000100, EmitDecorate = 0x00000200, // Emit __decorate + EmitParam = 0x00000400, // Emit __param helper for decorators } export interface NodeLinks { @@ -1606,6 +1610,7 @@ module ts { version?: boolean; watch?: boolean; separateCompilation?: boolean; + emitDecoratorMetadata?: boolean; /* @internal */ stripInternal?: boolean; [option: string]: string | number | boolean; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 1deb9ce97e2..4df840c3241 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -449,6 +449,18 @@ module ts { return false; } + export function isAccessor(node: Node): boolean { + if (node) { + switch (node.kind) { + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return true; + } + } + + return false; + } + export function isFunctionLike(node: Node): boolean { if (node) { switch (node.kind) { @@ -514,6 +526,19 @@ module ts { // the *body* of the container. node = node.parent; break; + case SyntaxKind.Decorator: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === SyntaxKind.Parameter && isClassElement(node.parent.parent)) { + // If the decorator's parent is a Parameter, we resolve the this container from + // the grandparent class declaration. + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + // If the decorator's parent is a class element, we resolve the 'this' container + // from the parent class declaration. + node = node.parent; + } + break; case SyntaxKind.ArrowFunction: if (!includeArrowFunctions) { continue; @@ -556,6 +581,19 @@ module ts { // the *body* of the container. node = node.parent; break; + case SyntaxKind.Decorator: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === SyntaxKind.Parameter && isClassElement(node.parent.parent)) { + // If the decorator's parent is a Parameter, we resolve the this container from + // the grandparent class declaration. + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + // If the decorator's parent is a class element, we resolve the 'this' container + // from the parent class declaration. + node = node.parent; + } + break; case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: @@ -907,6 +945,7 @@ module ts { case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: + case SyntaxKind.MethodSignature: case SyntaxKind.IndexSignature: return true; default: diff --git a/src/harness/harness.ts b/src/harness/harness.ts index b9a08d6e982..784d8312d69 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -781,7 +781,7 @@ module Harness { public reset() { this.fileCollection = {}; } - public toArray(): { fileName: string; file: WriterAggregator; }[] { + public toArray(): { fileName: string; file: WriterAggregator; }[]{ var result: { fileName: string; file: WriterAggregator; }[] = []; for (var p in this.fileCollection) { if (this.fileCollection.hasOwnProperty(p)) { @@ -944,6 +944,10 @@ module Harness { var newLine = '\r\n'; + // Files from built\local that are requested by test "@includeBuiltFiles" to be in the context. + // Treat them as library files, so include them in build, but not in baselines. + var includeBuiltFiles: { unitName: string; content: string }[] = []; + var useCaseSensitiveFileNames = ts.sys.useCaseSensitiveFileNames; this.settings.forEach(setting => { switch (setting.flag.toLowerCase()) { @@ -1061,18 +1065,19 @@ module Harness { break; case 'includebuiltfile': - inputFiles.push({ unitName: setting.value, content: normalizeLineEndings(IO.readFile(libFolder + setting.value), newLine) }); + let builtFileName = libFolder + setting.value; + includeBuiltFiles.push({ unitName: builtFileName, content: normalizeLineEndings(IO.readFile(builtFileName), newLine) }); break; default: throw new Error('Unsupported compiler setting ' + setting.flag); } }); - + var fileOutputs: GeneratedFile[] = []; - var programFiles = inputFiles.map(file => file.unitName); - var program = ts.createProgram(programFiles, options, createCompilerHost(inputFiles.concat(otherFiles), + var programFiles = inputFiles.concat(includeBuiltFiles).map(file => file.unitName); + var program = ts.createProgram(programFiles, options, createCompilerHost(inputFiles.concat(includeBuiltFiles).concat(otherFiles), (fn, contents, writeByteOrderMark) => fileOutputs.push({ fileName: fn, code: contents, writeByteOrderMark: writeByteOrderMark }), options.target, useCaseSensitiveFileNames, currentDirectory)); @@ -1295,7 +1300,7 @@ module Harness { }); var numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => { - return diagnostic.fileName && isLibraryFile(diagnostic.fileName); + return diagnostic.fileName && (isLibraryFile(diagnostic.fileName) || isBuiltFile(diagnostic.fileName)); }); var numTest262HarnessDiagnostics = ts.countWhere(diagnostics, diagnostic => { @@ -1698,6 +1703,10 @@ module Harness { return (Path.getFileName(filePath) === 'lib.d.ts') || (Path.getFileName(filePath) === 'lib.core.d.ts'); } + export function isBuiltFile(filePath: string): boolean { + return filePath.indexOf(Harness.libFolder) === 0; + } + export function getDefaultLibraryFile(): { unitName: string, content: string } { var libFile = Harness.userSpecifiedroot + Harness.libFolder + "/" + "lib.d.ts"; return { diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index a83c04e6e86..4c50e0e0cad 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -52,6 +52,7 @@ class TypeWriterWalker { case ts.SyntaxKind.PostfixUnaryExpression: case ts.SyntaxKind.BinaryExpression: case ts.SyntaxKind.ConditionalExpression: + case ts.SyntaxKind.SpreadElementExpression: this.log(node, this.getTypeOfNode(node)); break; diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 2096fa839df..3d830ae5203 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -1168,4 +1168,4 @@ interface TypedPropertyDescriptor { declare type ClassDecorator = (target: TFunction) => TFunction | void; declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 3e6ac3f756c..8590e2273e0 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -3513,27 +3513,27 @@ interface ProxyHandler { interface ProxyConstructor { revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handeler: ProxyHandler): T + new (target: T, handler: ProxyHandler): T } declare var Proxy: ProxyConstructor; -declare var Reflect: { - apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - construct(target: Function, argumentsList: ArrayLike): any; - defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - deleteProperty(target: any, propertyKey: PropertyKey): boolean; - enumerate(target: any): IterableIterator; - get(target: any, propertyKey: PropertyKey, receiver?: any): any; - getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - getPrototypeOf(target: any): any; - has(target: any, propertyKey: string): boolean; - has(target: any, propertyKey: symbol): boolean; - isExtensible(target: any): boolean; - ownKeys(target: any): Array; - preventExtensions(target: any): boolean; - set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; - setPrototypeOf(target: any, proto: any): boolean; -}; +declare module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: string): boolean; + function has(target: any, propertyKey: symbol): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; +} /** * Represents the completion of an asynchronous operation diff --git a/src/server/client.ts b/src/server/client.ts index 60421421780..3306bd5a9d4 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -68,12 +68,12 @@ module ts.server { }; } - private processRequest(command: string, arguments?: any): T { + private processRequest(command: string, args?: any): T { var request: protocol.Request = { seq: this.sequence++, type: "request", - command: command, - arguments: arguments + arguments: args, + command }; this.writeMessage(JSON.stringify(request)); @@ -104,7 +104,7 @@ module ts.server { var response: T = JSON.parse(responseBody); } catch (e) { - throw new Error("Malformed response: Failed to parse server response: " + lastMessage + ". \r\n Error detailes: " + e.message); + throw new Error("Malformed response: Failed to parse server response: " + lastMessage + ". \r\n Error details: " + e.message); } // verify the sequence numbers @@ -446,6 +446,7 @@ module ts.server { if (!response.body) { return undefined; } + var helpItems: protocol.SignatureHelpItems = response.body; var span = helpItems.applicableSpan; var start = this.lineOffsetToPosition(fileName, span.start); @@ -465,7 +466,26 @@ module ts.server { } getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { - throw new Error("Not Implemented Yet."); + var lineOffset = this.positionToOneBasedLineOffset(fileName, position); + var args: protocol.FileLocationRequestArgs = { + file: fileName, + line: lineOffset.line, + offset: lineOffset.offset, + }; + + var request = this.processRequest(CommandNames.Occurrences, args); + var response = this.processResponse(request); + + return response.body.map(entry => { + var fileName = entry.file; + var start = this.lineOffsetToPosition(fileName, entry.start); + var end = this.lineOffsetToPosition(fileName, entry.end); + return { + fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + isWriteAccess: entry.isWriteAccess, + }; + }); } getOutliningSpans(fileName: string): OutliningSpan[] { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 366e4dbfd84..8b4ab2cffa8 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -458,7 +458,7 @@ module ts.server { var info = this.filenameToScriptInfo[args.file]; if (info) { info.setFormatOptions(args.formatOptions); - this.log("Host configuration update for file " + args.file); + this.log("Host configuration update for file " + args.file, "Info"); } } else { @@ -823,7 +823,6 @@ module ts.server { */ closeClientFile(filename: string) { - // TODO: tsconfig check var info = ts.lookUp(this.filenameToScriptInfo, filename); if (info) { this.closeOpenFile(info); @@ -856,6 +855,9 @@ module ts.server { } printProjects() { + if (!this.psLogger.isVerbose()) { + return; + } this.psLogger.startGroup(); for (var i = 0, len = this.inferredProjects.length; i < len; i++) { var project = this.inferredProjects[i]; diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 3a03c22d49e..5bc1ffbe4dc 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -165,6 +165,25 @@ declare module ts.server.protocol { body?: FileSpan[]; } + /** + * Get occurrences request; value of command field is + * "occurrences". Return response giving spans that are relevant + * in the file at a given line and column. + */ + export interface OccurrencesRequest extends FileLocationRequest { + } + + export interface OccurrencesResponseItem extends FileSpan { + /** + * True if the occurrence is a write location, false otherwise. + */ + isWriteAccess: boolean; + } + + export interface OccurrencesResponse extends Response { + body?: OccurrencesResponseItem[]; + } + /** * Find references request; value of command field is * "references". Return response giving the file locations that @@ -405,6 +424,13 @@ declare module ts.server.protocol { arguments: OpenRequestArgs; } + /** + * Exit request; value of command field is "exit". Ask the server process + * to exit. + */ + export interface ExitRequest extends Request { + } + /** * Close request; value of command field is "close". Notify the * server that the client has closed a previously open file. If diff --git a/src/server/server.ts b/src/server/server.ts index 4c13be80c4c..828deca2b2d 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -177,6 +177,12 @@ module ts.server { super(host, logger); } + exit() { + this.projectService.log("Exiting...","Info"); + this.projectService.closeLog(); + process.exit(0); + } + listen() { rl.on('line',(input: string) => { var message = input.trim(); @@ -184,9 +190,7 @@ module ts.server { }); rl.on('close',() => { - this.projectService.log("Exiting..."); - this.projectService.closeLog(); - process.exit(0); + this.exit(); }); } } diff --git a/src/server/session.ts b/src/server/session.ts index 80831e69284..09373d6bf96 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -76,25 +76,27 @@ module ts.server { } export module CommandNames { + export var Brace = "brace"; export var Change = "change"; export var Close = "close"; export var Completions = "completions"; export var CompletionDetails = "completionEntryDetails"; - export var SignatureHelp = "signatureHelp"; export var Configure = "configure"; export var Definition = "definition"; + export var Exit = "exit"; export var Format = "format"; export var Formatonkey = "formatonkey"; export var Geterr = "geterr"; export var NavBar = "navbar"; export var Navto = "navto"; + export var Occurrences = "occurrences"; export var Open = "open"; export var Quickinfo = "quickinfo"; export var References = "references"; export var Reload = "reload"; export var Rename = "rename"; export var Saveto = "saveto"; - export var Brace = "brace"; + export var SignatureHelp = "signatureHelp"; export var Unknown = "unknown"; } @@ -116,7 +118,7 @@ module ts.server { constructor(private host: ServerHost, private logger: Logger) { this.projectService = - new ProjectService(host, logger, (eventName,project,fileName) => { + new ProjectService(host, logger, (eventName, project, fileName) => { this.handleEvent(eventName, project, fileName); }); } @@ -261,7 +263,7 @@ module ts.server { } } - getDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] { + getDefinition({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.FileSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -283,7 +285,37 @@ module ts.server { })); } - getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody { + getOccurrences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] { + fileName = ts.normalizePath(fileName); + let project = this.projectService.getProjectForFile(fileName); + + if (!project) { + throw Errors.NoProject; + } + + let { compilerService } = project; + let position = compilerService.host.lineOffsetToPosition(fileName, line, offset); + + let occurrences = compilerService.languageService.getOccurrencesAtPosition(fileName, position); + + if (!occurrences) { + return undefined; + } + + return occurrences.map(occurrence => { + let { fileName, isWriteAccess, textSpan } = occurrence; + let start = compilerService.host.positionToLineOffset(fileName, textSpan.start); + let end = compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(textSpan)); + return { + start, + end, + file: fileName, + isWriteAccess + } + }); + } + + getRenameLocations({line, offset, file: fileName, findInComments, findInStrings }: protocol.RenameRequestArgs): protocol.RenameResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -351,7 +383,7 @@ module ts.server { return { info: renameInfo, locs: bakedRenameLocs }; } - getReferences(line: number, offset: number, fileName: string): protocol.ReferencesResponseBody { + getReferences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.ReferencesResponseBody { // TODO: get all projects for this file; report refs for all projects deleting duplicates // can avoid duplicates by eliminating same ref file from subsequent projects var file = ts.normalizePath(fileName); @@ -377,7 +409,7 @@ module ts.server { var nameSpan = nameInfo.textSpan; var nameColStart = compilerService.host.positionToLineOffset(file, nameSpan.start).offset; var nameText = compilerService.host.getScriptSnapshot(file).getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var bakedRefs: protocol.ReferencesResponseItem[] = references.map((ref) => { + var bakedRefs: protocol.ReferencesResponseItem[] = references.map(ref => { var start = compilerService.host.positionToLineOffset(ref.fileName, ref.textSpan.start); var refLineSpan = compilerService.host.lineToTextSpan(ref.fileName, start.line - 1); var snap = compilerService.host.getScriptSnapshot(ref.fileName); @@ -398,12 +430,12 @@ module ts.server { }; } - openClientFile(fileName: string) { + openClientFile({ file: fileName }: protocol.OpenRequestArgs) { var file = ts.normalizePath(fileName); this.projectService.openClientFile(file); } - getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody { + getQuickInfo({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.QuickInfoResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -429,7 +461,7 @@ module ts.server { }; } - getFormattingEditsForRange(line: number, offset: number, endLine: number, endOffset: number, fileName: string): protocol.CodeEdit[] { + getFormattingEditsForRange({line, offset, endLine, endOffset, file: fileName}: protocol.FormatRequestArgs): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -456,7 +488,7 @@ module ts.server { }); } - getFormattingEditsAfterKeystroke(line: number, offset: number, key: string, fileName: string): protocol.CodeEdit[] { + getFormattingEditsAfterKeystroke({line, offset, key, file: fileName}: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -529,7 +561,7 @@ module ts.server { }); } - getCompletions(line: number, offset: number, prefix: string, fileName: string): protocol.CompletionEntry[] { + getCompletions({ line, offset, prefix, file: fileName}: protocol.CompletionsRequestArgs): protocol.CompletionEntry[] { if (!prefix) { prefix = ""; } @@ -555,8 +587,7 @@ module ts.server { }, []).sort((a, b) => a.name.localeCompare(b.name)); } - getCompletionEntryDetails(line: number, offset: number, - entryNames: string[], fileName: string): protocol.CompletionEntryDetails[] { + getCompletionEntryDetails({ line, offset, entryNames, file: fileName}: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -575,20 +606,20 @@ module ts.server { }, []); } - getSignatureHelpItems(line: number, offset: number, fileName: string): protocol.SignatureHelpItems { + getSignatureHelpItems({ line, offset, file: fileName }: protocol.SignatureHelpRequestArgs): protocol.SignatureHelpItems { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { throw Errors.NoProject; } - + var compilerService = project.compilerService; var position = compilerService.host.lineOffsetToPosition(file, line, offset); var helpItems = compilerService.languageService.getSignatureHelpItems(file, position); if (!helpItems) { return undefined; } - + var span = helpItems.applicableSpan; var result: protocol.SignatureHelpItems = { items: helpItems.items, @@ -600,11 +631,11 @@ module ts.server { argumentIndex: helpItems.argumentIndex, argumentCount: helpItems.argumentCount, } - + return result; } - - getDiagnostics(delay: number, fileNames: string[]) { + + getDiagnostics({ delay, files: fileNames }: protocol.GeterrRequestArgs): void { var checkList = fileNames.reduce((accum: PendingErrorCheck[], fileName: string) => { fileName = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(fileName); @@ -615,11 +646,11 @@ module ts.server { }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay) + this.updateErrorCheck(checkList, this.changeSeq, (n) => n == this.changeSeq, delay) } } - change(line: number, offset: number, endLine: number, endOffset: number, insertString: string, fileName: string) { + change({ line, offset, endLine, endOffset, insertString, file: fileName }: protocol.ChangeRequestArgs): void { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (project) { @@ -634,7 +665,7 @@ module ts.server { } } - reload(fileName: string, tempFileName: string, reqSeq = 0) { + reload({ file: fileName, tmpfile: tempFileName }: protocol.ReloadRequestArgs, reqSeq = 0): void { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); var project = this.projectService.getProjectForFile(file); @@ -647,7 +678,7 @@ module ts.server { } } - saveToTmp(fileName: string, tempFileName: string) { + saveToTmp({ file: fileName, tmpfile: tempFileName }: protocol.SavetoRequestArgs): void { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); @@ -657,7 +688,7 @@ module ts.server { } } - closeClientFile(fileName: string) { + closeClientFile({ file: fileName }: protocol.FileRequestArgs) { var file = ts.normalizePath(fileName); this.projectService.closeClientFile(file); } @@ -681,7 +712,7 @@ module ts.server { })); } - getNavigationBarItems(fileName: string): protocol.NavigationBarItem[] { + getNavigationBarItems({ file: fileName }: protocol.FileRequestArgs): protocol.NavigationBarItem[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -697,7 +728,7 @@ module ts.server { return this.decorateNavigationBarItem(project, fileName, items); } - getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] { + getNavigateToItems({ searchValue, file: fileName, maxResultCount }: protocol.NavtoRequestArgs): protocol.NavtoItem[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -736,7 +767,7 @@ module ts.server { }); } - getBraceMatching(line: number, offset: number, fileName: string): protocol.TextSpan[] { + getBraceMatching({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.TextSpan[]{ var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -758,6 +789,9 @@ module ts.server { })); } + exit() { + } + onMessage(message: string) { if (this.logger.isVerbose()) { this.logger.info("request: " + message); @@ -769,110 +803,97 @@ module ts.server { var errorMessage: string; var responseRequired = true; switch (request.command) { + case CommandNames.Exit: { + this.exit(); + responseRequired = false; + break; + } case CommandNames.Definition: { - var defArgs = request.arguments; - response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); + response = this.getDefinition(request.arguments); break; } case CommandNames.References: { - var refArgs = request.arguments; - response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); + response = this.getReferences(request.arguments); break; } case CommandNames.Rename: { - var renameArgs = request.arguments; - response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); + response = this.getRenameLocations(request.arguments); break; } case CommandNames.Open: { - var openArgs = request.arguments; - this.openClientFile(openArgs.file); + this.openClientFile(request.arguments); responseRequired = false; break; } case CommandNames.Quickinfo: { - var quickinfoArgs = request.arguments; - response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file); + response = this.getQuickInfo(request.arguments); break; } case CommandNames.Format: { - var formatArgs = request.arguments; - response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file); + response = this.getFormattingEditsForRange(request.arguments); break; } case CommandNames.Formatonkey: { - var formatOnKeyArgs = request.arguments; - response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file); + response = this.getFormattingEditsAfterKeystroke(request.arguments); break; } case CommandNames.Completions: { - var completionsArgs = request.arguments; - response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file); + response = this.getCompletions(request.arguments); break; } case CommandNames.CompletionDetails: { - var completionDetailsArgs = request.arguments; - response = - this.getCompletionEntryDetails(completionDetailsArgs.line,completionDetailsArgs.offset, - completionDetailsArgs.entryNames,completionDetailsArgs.file); + response = this.getCompletionEntryDetails(request.arguments); break; } case CommandNames.SignatureHelp: { - var signatureHelpArgs = request.arguments; - response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file); + response = this.getSignatureHelpItems(request.arguments); break; } case CommandNames.Geterr: { - var geterrArgs = request.arguments; - response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); + this.getDiagnostics(request.arguments); responseRequired = false; break; } case CommandNames.Change: { - var changeArgs = request.arguments; - this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset, - changeArgs.insertString, changeArgs.file); + this.change(request.arguments); responseRequired = false; break; } case CommandNames.Configure: { - var configureArgs = request.arguments; - this.projectService.setHostConfiguration(configureArgs); + this.projectService.setHostConfiguration(request.arguments); this.output(undefined, CommandNames.Configure, request.seq); responseRequired = false; break; } case CommandNames.Reload: { - var reloadArgs = request.arguments; - this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); + this.reload(request.arguments); responseRequired = false; break; } case CommandNames.Saveto: { - var savetoArgs = request.arguments; - this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + this.saveToTmp(request.arguments); responseRequired = false; break; } case CommandNames.Close: { - var closeArgs = request.arguments; - this.closeClientFile(closeArgs.file); + this.closeClientFile(request.arguments); responseRequired = false; break; } case CommandNames.Navto: { - var navtoArgs = request.arguments; - response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); + response = this.getNavigateToItems(request.arguments); break; } case CommandNames.Brace: { - var braceArguments = request.arguments; - response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file); + response = this.getBraceMatching(request.arguments); break; } case CommandNames.NavBar: { - var navBarArgs = request.arguments; - response = this.getNavigationBarItems(navBarArgs.file); + response = this.getNavigationBarItems(request.arguments); + break; + } + case CommandNames.Occurrences: { + response = this.getOccurrences(request.arguments); break; } default: { diff --git a/src/services/services.ts b/src/services/services.ts index 12ea84eafc1..86c323f24bf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1680,7 +1680,7 @@ module ts { useCaseSensitiveFileNames: () => false, getCanonicalFileName: fileName => fileName, getCurrentDirectory: () => "", - getNewLine: () => "\r\n" + getNewLine: () => (sys && sys.newLine) || "\r\n" }; var program = createProgram([inputFileName], options, compilerHost); diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index e2025bd0da7..83414abaf6e 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1,2035 +1,38 @@ -//// [tests/cases/compiler/APISample_compile.ts] //// - //// [APISample_compile.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var os: any; - -import ts = require("typescript"); - -export function compile(fileNames: string[], options: ts.CompilerOptions): void { - var program = ts.createProgram(fileNames, options); - var emitResult = program.emit(); - - var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - - allDiagnostics.forEach(diagnostic => { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); - }); - - var exitCode = emitResult.emitSkipped ? 1 : 0; - console.log(`Process exiting with code '${exitCode}'.`); - process.exit(exitCode); -} - -compile(process.argv.slice(2), { - noEmitOnError: true, noImplicitAny: true, - target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var os: any; + +import ts = require("typescript"); + +export function compile(fileNames: string[], options: ts.CompilerOptions): void { + var program = ts.createProgram(fileNames, options); + var emitResult = program.emit(); + + var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); + + allDiagnostics.forEach(diagnostic => { + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + }); + + var exitCode = emitResult.emitSkipped ? 1 : 0; + console.log(`Process exiting with code '${exitCode}'.`); + process.exit(exitCode); +} + +compile(process.argv.slice(2), { + noEmitOnError: true, noImplicitAny: true, + target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS }); -//// [typescript.d.ts] -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface HeritageClauseElement extends Node { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - kind: SyntaxKind; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - separateCompilation?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static warning: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - //// [APISample_compile.js] /* @@ -2043,8 +46,9 @@ function compile(fileNames, options) { var emitResult = program.emit(); var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); allDiagnostics.forEach(function (diagnostic) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(diagnostic.file.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)); + var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); }); var exitCode = emitResult.emitSkipped ? 1 : 0; console.log("Process exiting with code '" + exitCode + "'."); diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index f2e63dd2048..7ccbae38212 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -56,15 +56,16 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostics : ts.Diagnostic[] allDiagnostics.forEach(diagnostic => { ->allDiagnostics.forEach(diagnostic => { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); }) : void +>allDiagnostics.forEach(diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }) : void >allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void >allDiagnostics : ts.Diagnostic[] >forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->diagnostic => { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); } : (diagnostic: ts.Diagnostic) => void +>diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } : (diagnostic: ts.Diagnostic) => void >diagnostic : ts.Diagnostic - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->lineChar : ts.LineAndCharacter + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); +>line : number +>character : number >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter >diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >diagnostic.file : ts.SourceFile @@ -75,8 +76,18 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostic : ts.Diagnostic >start : number - console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); ->console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`) : any + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); +>message : string +>ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>ts : typeof ts +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>diagnostic.messageText : string | ts.DiagnosticMessageChain +>diagnostic : ts.Diagnostic +>messageText : string | ts.DiagnosticMessageChain + + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any @@ -85,24 +96,11 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >diagnostic : ts.Diagnostic >file : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number ->ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL) : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain ->os.EOL : any ->os : any ->EOL : any +>message : string }); @@ -158,6139 +156,3 @@ compile(process.argv.slice(2), { >CommonJS : ts.ModuleKind }); -=== typescript.d.ts === -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - ClassExpression = 174, ->ClassExpression : SyntaxKind - - OmittedExpression = 175, ->OmittedExpression : SyntaxKind - - TemplateSpan = 176, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 177, ->HeritageClauseElement : SyntaxKind - - SemicolonClassElement = 178, ->SemicolonClassElement : SyntaxKind - - Block = 179, ->Block : SyntaxKind - - VariableStatement = 180, ->VariableStatement : SyntaxKind - - EmptyStatement = 181, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 182, ->ExpressionStatement : SyntaxKind - - IfStatement = 183, ->IfStatement : SyntaxKind - - DoStatement = 184, ->DoStatement : SyntaxKind - - WhileStatement = 185, ->WhileStatement : SyntaxKind - - ForStatement = 186, ->ForStatement : SyntaxKind - - ForInStatement = 187, ->ForInStatement : SyntaxKind - - ForOfStatement = 188, ->ForOfStatement : SyntaxKind - - ContinueStatement = 189, ->ContinueStatement : SyntaxKind - - BreakStatement = 190, ->BreakStatement : SyntaxKind - - ReturnStatement = 191, ->ReturnStatement : SyntaxKind - - WithStatement = 192, ->WithStatement : SyntaxKind - - SwitchStatement = 193, ->SwitchStatement : SyntaxKind - - LabeledStatement = 194, ->LabeledStatement : SyntaxKind - - ThrowStatement = 195, ->ThrowStatement : SyntaxKind - - TryStatement = 196, ->TryStatement : SyntaxKind - - DebuggerStatement = 197, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 198, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 199, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 200, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 201, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 202, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 203, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 204, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 205, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 206, ->ModuleBlock : SyntaxKind - - CaseBlock = 207, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 208, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 209, ->ImportDeclaration : SyntaxKind - - ImportClause = 210, ->ImportClause : SyntaxKind - - NamespaceImport = 211, ->NamespaceImport : SyntaxKind - - NamedImports = 212, ->NamedImports : SyntaxKind - - ImportSpecifier = 213, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 214, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 215, ->ExportDeclaration : SyntaxKind - - NamedExports = 216, ->NamedExports : SyntaxKind - - ExportSpecifier = 217, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 218, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 219, ->ExternalModuleReference : SyntaxKind - - CaseClause = 220, ->CaseClause : SyntaxKind - - DefaultClause = 221, ->DefaultClause : SyntaxKind - - HeritageClause = 222, ->HeritageClause : SyntaxKind - - CatchClause = 223, ->CatchClause : SyntaxKind - - PropertyAssignment = 224, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 225, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 226, ->EnumMember : SyntaxKind - - SourceFile = 227, ->SourceFile : SyntaxKind - - SyntaxList = 228, ->SyntaxList : SyntaxKind - - Count = 229, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface SemicolonClassElement extends ClassElement { ->SemicolonClassElement : SemicolonClassElement ->ClassElement : ClassElement - - _semicolonClassElementBrand: any; ->_semicolonClassElementBrand : any - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface HeritageClauseElement extends Node { ->HeritageClauseElement : HeritageClauseElement ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassLikeDeclaration extends Declaration { ->ClassLikeDeclaration : ClassLikeDeclaration ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { ->ClassDeclaration : ClassDeclaration ->ClassLikeDeclaration : ClassLikeDeclaration ->Statement : Statement - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { ->ClassExpression : ClassExpression ->ClassLikeDeclaration : ClassLikeDeclaration ->PrimaryExpression : PrimaryExpression - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->HeritageClauseElement : HeritageClauseElement - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends ModuleElement { ->ImportDeclaration : ImportDeclaration ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; ->getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] ->moduleSymbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | Expression | QualifiedName ->EntityName : Identifier | QualifiedName ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - separateCompilation?: boolean; ->separateCompilation : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; ->readConfigFile : (fileName: string) => any ->fileName : string - - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; ->parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine ->json : any ->basePath : string ->ParsedCommandLine : ParsedCommandLine -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - sortText: string; ->sortText : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static warning: string; ->warning : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; ->transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string ->input : string ->compilerOptions : CompilerOptions ->CompilerOptions : CompilerOptions ->fileName : string ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 2058db63e36..9e1b4cf6c0d 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1,2066 +1,68 @@ -//// [tests/cases/compiler/APISample_linter.ts] //// - //// [APISample_linter.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var fs: any; - -import ts = require("typescript"); - -export function delint(sourceFile: ts.SourceFile) { - delintNode(sourceFile); - - function delintNode(node: ts.Node) { - switch (node.kind) { - case ts.SyntaxKind.ForStatement: - case ts.SyntaxKind.ForInStatement: - case ts.SyntaxKind.WhileStatement: - case ts.SyntaxKind.DoStatement: - if ((node).statement.kind !== ts.SyntaxKind.Block) { - report(node, "A looping statement's contents should be wrapped in a block body."); - } - break; - case ts.SyntaxKind.IfStatement: - var ifStatement = (node); - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); - } - if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); - } - break; - - case ts.SyntaxKind.BinaryExpression: - var op = (node).operatorToken.kind; - - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { - report(node, "Use '===' and '!=='.") - } - break; - } - - ts.forEachChild(node, delintNode); - } - - function report(node: ts.Node, message: string) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) - } -} - -var fileNames = process.argv.slice(2); -fileNames.forEach(fileName => { - // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); - - // delint it - delint(sourceFile); -}); -//// [typescript.d.ts] -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ -declare module "typescript" { - interface Map { - [index: string]: T; +declare var process: any; +declare var console: any; +declare var readFileSync: any; + +import * as ts from "typescript"; + +export function delint(sourceFile: ts.SourceFile) { + delintNode(sourceFile); + + function delintNode(node: ts.Node) { + switch (node.kind) { + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + if ((node).statement.kind !== ts.SyntaxKind.Block) { + report(node, "A looping statement's contents should be wrapped in a block body."); + } + break; + + case ts.SyntaxKind.IfStatement: + let ifStatement = (node); + if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { + report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); + } + if (ifStatement.elseStatement && + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); + } + break; + + case ts.SyntaxKind.BinaryExpression: + let op = (node).operatorToken.kind; + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { + report(node, "Use '===' and '!=='.") + } + break; + } + + ts.forEachChild(node, delintNode); + } + + function report(node: ts.Node, message: string) { + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface HeritageClauseElement extends Node { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - kind: SyntaxKind; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - separateCompilation?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static warning: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; } +const fileNames = process.argv.slice(2); +fileNames.forEach(fileName => { + // Parse a file + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + + // delint it + delint(sourceFile); +}); //// [APISample_linter.js] /* @@ -2087,13 +89,14 @@ function delint(sourceFile) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 179 /* Block */ && ifStatement.elseStatement.kind !== 183 /* IfStatement */) { + ifStatement.elseStatement.kind !== 179 /* Block */ && + ifStatement.elseStatement.kind !== 183 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; case 169 /* BinaryExpression */: var op = node.operatorToken.kind; - if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { + if (op === 28 /* EqualsEqualsToken */ || op == 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); } break; @@ -2101,15 +104,15 @@ function delint(sourceFile) { ts.forEachChild(node, delintNode); } function report(node, message) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(sourceFile.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + message); + var _a = sourceFile.getLineAndCharacterOfPosition(node.getStart()), line = _a.line, character = _a.character; + console.log(sourceFile.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); } } exports.delint = delint; var fileNames = process.argv.slice(2); fileNames.forEach(function (fileName) { // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), 2 /* ES6 */, true); + var sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), 2 /* ES6 */, true); // delint it delint(sourceFile); }); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 0e508961216..609f08f3a76 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -12,10 +12,10 @@ declare var process: any; declare var console: any; >console : any -declare var fs: any; ->fs : any +declare var readFileSync: any; +>readFileSync : any -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts export function delint(sourceFile: ts.SourceFile) { @@ -91,6 +91,7 @@ export function delint(sourceFile: ts.SourceFile) { >node : ts.Node } break; + case ts.SyntaxKind.IfStatement: >ts.SyntaxKind.IfStatement : ts.SyntaxKind >ts.SyntaxKind : typeof ts.SyntaxKind @@ -98,7 +99,7 @@ export function delint(sourceFile: ts.SourceFile) { >SyntaxKind : typeof ts.SyntaxKind >IfStatement : ts.SyntaxKind - var ifStatement = (node); + let ifStatement = (node); >ifStatement : ts.IfStatement >(node) : ts.IfStatement >node : ts.IfStatement @@ -127,13 +128,13 @@ export function delint(sourceFile: ts.SourceFile) { >thenStatement : ts.Statement } if (ifStatement.elseStatement && ->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean +>ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean >ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean >ifStatement.elseStatement : ts.Statement >ifStatement : ts.IfStatement >elseStatement : ts.Statement - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && >ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean >ifStatement.elseStatement.kind : ts.SyntaxKind >ifStatement.elseStatement : ts.Statement @@ -145,6 +146,8 @@ export function delint(sourceFile: ts.SourceFile) { >ts : typeof ts >SyntaxKind : typeof ts.SyntaxKind >Block : ts.SyntaxKind + + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { >ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean >ifStatement.elseStatement.kind : ts.SyntaxKind >ifStatement.elseStatement : ts.Statement @@ -173,7 +176,7 @@ export function delint(sourceFile: ts.SourceFile) { >SyntaxKind : typeof ts.SyntaxKind >BinaryExpression : ts.SyntaxKind - var op = (node).operatorToken.kind; + let op = (node).operatorToken.kind; >op : ts.SyntaxKind >(node).operatorToken.kind : ts.SyntaxKind >(node).operatorToken : ts.Node @@ -185,8 +188,8 @@ export function delint(sourceFile: ts.SourceFile) { >operatorToken : ts.Node >kind : ts.SyntaxKind - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { ->op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken : boolean + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { +>op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken : boolean >op === ts.SyntaxKind.EqualsEqualsToken : boolean >op : ts.SyntaxKind >ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind @@ -194,7 +197,7 @@ export function delint(sourceFile: ts.SourceFile) { >ts : typeof ts >SyntaxKind : typeof ts.SyntaxKind >EqualsEqualsToken : ts.SyntaxKind ->op === ts.SyntaxKind.ExclamationEqualsToken : boolean +>op == ts.SyntaxKind.ExclamationEqualsToken : boolean >op : ts.SyntaxKind >ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind >ts.SyntaxKind : typeof ts.SyntaxKind @@ -226,8 +229,9 @@ export function delint(sourceFile: ts.SourceFile) { >Node : ts.Node >message : string - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); ->lineChar : ts.LineAndCharacter + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); +>line : number +>character : number >sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter >sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >sourceFile : ts.SourceFile @@ -237,27 +241,23 @@ export function delint(sourceFile: ts.SourceFile) { >node : ts.Node >getStart : (sourceFile?: ts.SourceFile) => number - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) ->console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) : any + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any >sourceFile.fileName : string >sourceFile : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number >message : string } } -var fileNames = process.argv.slice(2); +const fileNames = process.argv.slice(2); >fileNames : any >process.argv.slice(2) : any >process.argv.slice : any @@ -267,26 +267,24 @@ var fileNames = process.argv.slice(2); >slice : any fileNames.forEach(fileName => { ->fileNames.forEach(fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any +>fileNames.forEach(fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any >fileNames.forEach : any >fileNames : any >forEach : any ->fileName => { // Parse a file var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void +>fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void >fileName : any // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); >sourceFile : ts.SourceFile ->ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile +>ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile >ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile >ts : typeof ts >createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile >fileName : any ->fs.readFileSync(fileName).toString() : any ->fs.readFileSync(fileName).toString : any ->fs.readFileSync(fileName) : any ->fs.readFileSync : any ->fs : any +>readFileSync(fileName).toString() : any +>readFileSync(fileName).toString : any +>readFileSync(fileName) : any >readFileSync : any >fileName : any >toString : any @@ -303,6140 +301,3 @@ fileNames.forEach(fileName => { >sourceFile : ts.SourceFile }); - -=== typescript.d.ts === -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - ClassExpression = 174, ->ClassExpression : SyntaxKind - - OmittedExpression = 175, ->OmittedExpression : SyntaxKind - - TemplateSpan = 176, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 177, ->HeritageClauseElement : SyntaxKind - - SemicolonClassElement = 178, ->SemicolonClassElement : SyntaxKind - - Block = 179, ->Block : SyntaxKind - - VariableStatement = 180, ->VariableStatement : SyntaxKind - - EmptyStatement = 181, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 182, ->ExpressionStatement : SyntaxKind - - IfStatement = 183, ->IfStatement : SyntaxKind - - DoStatement = 184, ->DoStatement : SyntaxKind - - WhileStatement = 185, ->WhileStatement : SyntaxKind - - ForStatement = 186, ->ForStatement : SyntaxKind - - ForInStatement = 187, ->ForInStatement : SyntaxKind - - ForOfStatement = 188, ->ForOfStatement : SyntaxKind - - ContinueStatement = 189, ->ContinueStatement : SyntaxKind - - BreakStatement = 190, ->BreakStatement : SyntaxKind - - ReturnStatement = 191, ->ReturnStatement : SyntaxKind - - WithStatement = 192, ->WithStatement : SyntaxKind - - SwitchStatement = 193, ->SwitchStatement : SyntaxKind - - LabeledStatement = 194, ->LabeledStatement : SyntaxKind - - ThrowStatement = 195, ->ThrowStatement : SyntaxKind - - TryStatement = 196, ->TryStatement : SyntaxKind - - DebuggerStatement = 197, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 198, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 199, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 200, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 201, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 202, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 203, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 204, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 205, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 206, ->ModuleBlock : SyntaxKind - - CaseBlock = 207, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 208, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 209, ->ImportDeclaration : SyntaxKind - - ImportClause = 210, ->ImportClause : SyntaxKind - - NamespaceImport = 211, ->NamespaceImport : SyntaxKind - - NamedImports = 212, ->NamedImports : SyntaxKind - - ImportSpecifier = 213, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 214, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 215, ->ExportDeclaration : SyntaxKind - - NamedExports = 216, ->NamedExports : SyntaxKind - - ExportSpecifier = 217, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 218, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 219, ->ExternalModuleReference : SyntaxKind - - CaseClause = 220, ->CaseClause : SyntaxKind - - DefaultClause = 221, ->DefaultClause : SyntaxKind - - HeritageClause = 222, ->HeritageClause : SyntaxKind - - CatchClause = 223, ->CatchClause : SyntaxKind - - PropertyAssignment = 224, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 225, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 226, ->EnumMember : SyntaxKind - - SourceFile = 227, ->SourceFile : SyntaxKind - - SyntaxList = 228, ->SyntaxList : SyntaxKind - - Count = 229, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface SemicolonClassElement extends ClassElement { ->SemicolonClassElement : SemicolonClassElement ->ClassElement : ClassElement - - _semicolonClassElementBrand: any; ->_semicolonClassElementBrand : any - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface HeritageClauseElement extends Node { ->HeritageClauseElement : HeritageClauseElement ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassLikeDeclaration extends Declaration { ->ClassLikeDeclaration : ClassLikeDeclaration ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { ->ClassDeclaration : ClassDeclaration ->ClassLikeDeclaration : ClassLikeDeclaration ->Statement : Statement - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { ->ClassExpression : ClassExpression ->ClassLikeDeclaration : ClassLikeDeclaration ->PrimaryExpression : PrimaryExpression - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->HeritageClauseElement : HeritageClauseElement - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends ModuleElement { ->ImportDeclaration : ImportDeclaration ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; ->getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] ->moduleSymbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | Expression | QualifiedName ->EntityName : Identifier | QualifiedName ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - separateCompilation?: boolean; ->separateCompilation : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; ->readConfigFile : (fileName: string) => any ->fileName : string - - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; ->parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine ->json : any ->basePath : string ->ParsedCommandLine : ParsedCommandLine -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - sortText: string; ->sortText : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static warning: string; ->warning : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; ->transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string ->input : string ->compilerOptions : CompilerOptions ->CompilerOptions : CompilerOptions ->fileName : string ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index c40d33110e1..c38fe2a419b 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1,2067 +1,20 @@ -//// [tests/cases/compiler/APISample_transform.ts] //// - //// [APISample_transform.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var fs: any; -declare var path: any; -declare var os: any; - -import ts = require("typescript"); - -function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) { - // Sources - var files = { - "file.ts": contents, - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() - }; - - // Generated outputs - var outputs = []; - - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: (fileName, target) => { - return files[fileName] !== undefined ? - ts.createSourceFile(fileName, files[fileName], target) : undefined; - }, - writeFile: (name, text, writeByteOrderMark) => { - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); - }, - getDefaultLibFileName: () => "lib.d.ts", - useCaseSensitiveFileNames: () => false, - getCanonicalFileName: (fileName) => fileName, - getCurrentDirectory: () => "", - getNewLine: () => "\n" - }; - - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); - - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); - var emitResult = program.emit(); - - errors = errors.concat(emitResult.diagnostics); - - return { - outputs: outputs, - errors: errors.map(function (e) { - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); - }) - }; -} - -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; -var result = transform(source); - + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var console: any; + +import * as ts from "typescript"; + +const source = "let x: string = 'string'"; + +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); + console.log(JSON.stringify(result)); -//// [typescript.d.ts] -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface HeritageClauseElement extends Node { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - kind: SyntaxKind; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - separateCompilation?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static warning: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} - //// [APISample_transform.js] /* @@ -2070,46 +23,6 @@ declare module "typescript" { * Please log a "breaking change" issue for any API breaking change affecting this issue */ var ts = require("typescript"); -function transform(contents, compilerOptions) { - if (compilerOptions === void 0) { compilerOptions = {}; } - // Sources - var files = { - "file.ts": contents, - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() - }; - // Generated outputs - var outputs = []; - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: function (fileName, target) { - return files[fileName] !== undefined ? - ts.createSourceFile(fileName, files[fileName], target) : undefined; - }, - writeFile: function (name, text, writeByteOrderMark) { - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); - }, - getDefaultLibFileName: function () { return "lib.d.ts"; }, - useCaseSensitiveFileNames: function () { return false; }, - getCanonicalFileName: function (fileName) { return fileName; }, - getCurrentDirectory: function () { return ""; }, - getNewLine: function () { return "\n"; } - }; - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); - var emitResult = program.emit(); - errors = errors.concat(emitResult.diagnostics); - return { - outputs: outputs, - errors: errors.map(function (e) { - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); - }) - }; -} -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; -var result = transform(source); +var source = "let x: string = 'string'"; +var result = ts.transpile(source, { module: 1 /* CommonJS */ }); console.log(JSON.stringify(result)); diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 534bced2129..d98d2cfad00 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -6,242 +6,29 @@ * Please log a "breaking change" issue for any API breaking change affecting this issue */ -declare var process: any; ->process : any - declare var console: any; >console : any -declare var fs: any; ->fs : any - -declare var path: any; ->path : any - -declare var os: any; ->os : any - -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts -function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) { ->transform : (contents: string, compilerOptions?: ts.CompilerOptions) => { outputs: any[]; errors: string[]; } ->contents : string ->compilerOptions : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions ->{} : { [x: string]: undefined; } - - // Sources - var files = { ->files : { "file.ts": string; "lib.d.ts": any; } ->{ "file.ts": contents, "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() } : { "file.ts": string; "lib.d.ts": any; } - - "file.ts": contents, ->contents : string - - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() : any ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString : any ->fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)) : any ->fs.readFileSync : any ->fs : any ->readFileSync : any ->ts.getDefaultLibFilePath(compilerOptions) : string ->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->ts : typeof ts ->getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->compilerOptions : ts.CompilerOptions ->toString : any - - }; - - // Generated outputs - var outputs = []; ->outputs : any[] ->[] : undefined[] - - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { ->compilerHost : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } ->{ getSourceFile: (fileName, target) => { return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined; }, writeFile: (name, text, writeByteOrderMark) => { outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, getDefaultLibFileName: () => "lib.d.ts", useCaseSensitiveFileNames: () => false, getCanonicalFileName: (fileName) => fileName, getCurrentDirectory: () => "", getNewLine: () => "\n" } : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } - - getSourceFile: (fileName, target) => { ->getSourceFile : (fileName: any, target: any) => ts.SourceFile ->(fileName, target) => { return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined; } : (fileName: any, target: any) => ts.SourceFile ->fileName : any ->target : any - - return files[fileName] !== undefined ? ->files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined : ts.SourceFile ->files[fileName] !== undefined : boolean ->files[fileName] : any ->files : { "file.ts": string; "lib.d.ts": any; } ->fileName : any ->undefined : undefined - - ts.createSourceFile(fileName, files[fileName], target) : undefined; ->ts.createSourceFile(fileName, files[fileName], target) : ts.SourceFile ->ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->ts : typeof ts ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->fileName : any ->files[fileName] : any ->files : { "file.ts": string; "lib.d.ts": any; } ->fileName : any ->target : any ->undefined : undefined - - }, - writeFile: (name, text, writeByteOrderMark) => { ->writeFile : (name: any, text: any, writeByteOrderMark: any) => void ->(name, text, writeByteOrderMark) => { outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); } : (name: any, text: any, writeByteOrderMark: any) => void ->name : any ->text : any ->writeByteOrderMark : any - - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); ->outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }) : number ->outputs.push : (...items: any[]) => number ->outputs : any[] ->push : (...items: any[]) => number ->{ name: name, text: text, writeByteOrderMark: writeByteOrderMark } : { name: any; text: any; writeByteOrderMark: any; } ->name : any ->name : any ->text : any ->text : any ->writeByteOrderMark : any ->writeByteOrderMark : any - - }, - getDefaultLibFileName: () => "lib.d.ts", ->getDefaultLibFileName : () => string ->() => "lib.d.ts" : () => string - - useCaseSensitiveFileNames: () => false, ->useCaseSensitiveFileNames : () => boolean ->() => false : () => boolean - - getCanonicalFileName: (fileName) => fileName, ->getCanonicalFileName : (fileName: any) => any ->(fileName) => fileName : (fileName: any) => any ->fileName : any ->fileName : any - - getCurrentDirectory: () => "", ->getCurrentDirectory : () => string ->() => "" : () => string - - getNewLine: () => "\n" ->getNewLine : () => string ->() => "\n" : () => string - - }; - - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); ->program : ts.Program ->ts.createProgram(["file.ts"], compilerOptions, compilerHost) : ts.Program ->ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->ts : typeof ts ->createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->["file.ts"] : string[] ->compilerOptions : ts.CompilerOptions ->compilerHost : { getSourceFile: (fileName: any, target: any) => ts.SourceFile; writeFile: (name: any, text: any, writeByteOrderMark: any) => void; getDefaultLibFileName: () => string; useCaseSensitiveFileNames: () => boolean; getCanonicalFileName: (fileName: any) => any; getCurrentDirectory: () => string; getNewLine: () => string; } - - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); ->errors : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->ts : typeof ts ->getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->program : ts.Program - - var emitResult = program.emit(); ->emitResult : ts.EmitResult ->program.emit() : ts.EmitResult ->program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult ->program : ts.Program ->emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult - - errors = errors.concat(emitResult.diagnostics); ->errors = errors.concat(emitResult.diagnostics) : ts.Diagnostic[] ->errors : ts.Diagnostic[] ->errors.concat(emitResult.diagnostics) : ts.Diagnostic[] ->errors.concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->errors : ts.Diagnostic[] ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->emitResult.diagnostics : ts.Diagnostic[] ->emitResult : ts.EmitResult ->diagnostics : ts.Diagnostic[] - - return { ->{ outputs: outputs, errors: errors.map(function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); }) } : { outputs: any[]; errors: string[]; } - - outputs: outputs, ->outputs : any[] ->outputs : any[] - - errors: errors.map(function (e) { ->errors : string[] ->errors.map(function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); }) : string[] ->errors.map : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => U, thisArg?: any) => U[] ->errors : ts.Diagnostic[] ->map : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => U, thisArg?: any) => U[] ->function (e) { return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); } : (e: ts.Diagnostic) => string ->e : ts.Diagnostic - - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " + ts.flattenDiagnosticMessageText(e.messageText, os.EOL) : string ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " : string ->e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) : string ->e.file.fileName + "(" : string ->e.file.fileName : string ->e.file : ts.SourceFile ->e : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->(e.file.getLineAndCharacterOfPosition(e.start).line + 1) : number ->e.file.getLineAndCharacterOfPosition(e.start).line + 1 : number ->e.file.getLineAndCharacterOfPosition(e.start).line : number ->e.file.getLineAndCharacterOfPosition(e.start) : ts.LineAndCharacter ->e.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->e.file : ts.SourceFile ->e : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->e.start : number ->e : ts.Diagnostic ->start : number ->line : number - - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); ->ts.flattenDiagnosticMessageText(e.messageText, os.EOL) : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->e.messageText : string | ts.DiagnosticMessageChain ->e : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain ->os.EOL : any ->os : any ->EOL : any - - }) - }; -} - -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; +const source = "let x: string = 'string'"; >source : string -var result = transform(source); ->result : { outputs: any[]; errors: string[]; } ->transform(source) : { outputs: any[]; errors: string[]; } ->transform : (contents: string, compilerOptions?: ts.CompilerOptions) => { outputs: any[]; errors: string[]; } +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); +>result : string +>ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string +>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string +>ts : typeof ts +>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string >source : string +>{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } +>module : ts.ModuleKind +>ts.ModuleKind.CommonJS : ts.ModuleKind +>ts.ModuleKind : typeof ts.ModuleKind +>ts : typeof ts +>ModuleKind : typeof ts.ModuleKind +>CommonJS : ts.ModuleKind console.log(JSON.stringify(result)); >console.log(JSON.stringify(result)) : any @@ -252,6141 +39,5 @@ console.log(JSON.stringify(result)); >JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; } >JSON : JSON >stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; } ->result : { outputs: any[]; errors: string[]; } - -=== typescript.d.ts === -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - ClassExpression = 174, ->ClassExpression : SyntaxKind - - OmittedExpression = 175, ->OmittedExpression : SyntaxKind - - TemplateSpan = 176, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 177, ->HeritageClauseElement : SyntaxKind - - SemicolonClassElement = 178, ->SemicolonClassElement : SyntaxKind - - Block = 179, ->Block : SyntaxKind - - VariableStatement = 180, ->VariableStatement : SyntaxKind - - EmptyStatement = 181, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 182, ->ExpressionStatement : SyntaxKind - - IfStatement = 183, ->IfStatement : SyntaxKind - - DoStatement = 184, ->DoStatement : SyntaxKind - - WhileStatement = 185, ->WhileStatement : SyntaxKind - - ForStatement = 186, ->ForStatement : SyntaxKind - - ForInStatement = 187, ->ForInStatement : SyntaxKind - - ForOfStatement = 188, ->ForOfStatement : SyntaxKind - - ContinueStatement = 189, ->ContinueStatement : SyntaxKind - - BreakStatement = 190, ->BreakStatement : SyntaxKind - - ReturnStatement = 191, ->ReturnStatement : SyntaxKind - - WithStatement = 192, ->WithStatement : SyntaxKind - - SwitchStatement = 193, ->SwitchStatement : SyntaxKind - - LabeledStatement = 194, ->LabeledStatement : SyntaxKind - - ThrowStatement = 195, ->ThrowStatement : SyntaxKind - - TryStatement = 196, ->TryStatement : SyntaxKind - - DebuggerStatement = 197, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 198, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 199, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 200, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 201, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 202, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 203, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 204, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 205, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 206, ->ModuleBlock : SyntaxKind - - CaseBlock = 207, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 208, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 209, ->ImportDeclaration : SyntaxKind - - ImportClause = 210, ->ImportClause : SyntaxKind - - NamespaceImport = 211, ->NamespaceImport : SyntaxKind - - NamedImports = 212, ->NamedImports : SyntaxKind - - ImportSpecifier = 213, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 214, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 215, ->ExportDeclaration : SyntaxKind - - NamedExports = 216, ->NamedExports : SyntaxKind - - ExportSpecifier = 217, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 218, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 219, ->ExternalModuleReference : SyntaxKind - - CaseClause = 220, ->CaseClause : SyntaxKind - - DefaultClause = 221, ->DefaultClause : SyntaxKind - - HeritageClause = 222, ->HeritageClause : SyntaxKind - - CatchClause = 223, ->CatchClause : SyntaxKind - - PropertyAssignment = 224, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 225, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 226, ->EnumMember : SyntaxKind - - SourceFile = 227, ->SourceFile : SyntaxKind - - SyntaxList = 228, ->SyntaxList : SyntaxKind - - Count = 229, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface SemicolonClassElement extends ClassElement { ->SemicolonClassElement : SemicolonClassElement ->ClassElement : ClassElement - - _semicolonClassElementBrand: any; ->_semicolonClassElementBrand : any - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface HeritageClauseElement extends Node { ->HeritageClauseElement : HeritageClauseElement ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassLikeDeclaration extends Declaration { ->ClassLikeDeclaration : ClassLikeDeclaration ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { ->ClassDeclaration : ClassDeclaration ->ClassLikeDeclaration : ClassLikeDeclaration ->Statement : Statement - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { ->ClassExpression : ClassExpression ->ClassLikeDeclaration : ClassLikeDeclaration ->PrimaryExpression : PrimaryExpression - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->HeritageClauseElement : HeritageClauseElement - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends ModuleElement { ->ImportDeclaration : ImportDeclaration ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; ->getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] ->moduleSymbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | Expression | QualifiedName ->EntityName : Identifier | QualifiedName ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - separateCompilation?: boolean; ->separateCompilation : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; ->readConfigFile : (fileName: string) => any ->fileName : string - - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; ->parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine ->json : any ->basePath : string ->ParsedCommandLine : ParsedCommandLine -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - sortText: string; ->sortText : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static warning: string; ->warning : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; ->transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string ->input : string ->compilerOptions : CompilerOptions ->CompilerOptions : CompilerOptions ->fileName : string ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} +>result : string diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index a7d706de83a..704d36b6954 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1,2104 +1,107 @@ -//// [tests/cases/compiler/APISample_watcher.ts] //// - //// [APISample_watcher.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var fs: any; -declare var path: any; - -import ts = require("typescript"); - -function watch(rootFileNames: string[], options: ts.CompilerOptions) { - var files: ts.Map<{ version: number }> = {}; - - // initialize the list of files - rootFileNames.forEach(fileName => { - files[fileName] = { version: 0 }; - }); - - // Create the language service host to allow the LS to communicate with the host - var servicesHost: ts.LanguageServiceHost = { - getScriptFileNames: () => rootFileNames, - getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), - getScriptSnapshot: (fileName) => { - if (!fs.existsSync(fileName)) { - return undefined; - } - - return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); - }, - getCurrentDirectory: () => process.cwd(), - getCompilationSettings: () => options, - getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), - }; - - // Create the language service files - var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) - - // Now let's watch the files - rootFileNames.forEach(fileName => { - // First time around, emit all files - emitFile(fileName); - - // Add a watch on the file to handle next change - fs.watchFile(fileName, - { persistent: true, interval: 250 }, - (curr, prev) => { - // Check timestamp - if (+curr.mtime <= +prev.mtime) { - return; - } - - // Update the version to signal a change in the file - files[fileName].version++; - - // write the changes to disk - emitFile(fileName); - }); - }); - - function emitFile(fileName: string) { - var output = services.getEmitOutput(fileName); - - if (!output.emitSkipped) { - console.log(`Emitting ${fileName}`); - } - else { - console.log(`Emitting ${fileName} failed`); - logErrors(fileName); - } - - output.outputFiles.forEach(o => { - fs.writeFileSync(o.name, o.text, "utf8"); - }); - } - - function logErrors(fileName: string) { - var allDiagnostics = services.getCompilerOptionsDiagnostics() - .concat(services.getSyntacticDiagnostics(fileName)) - .concat(services.getSemanticDiagnostics(fileName)); - - allDiagnostics.forEach(diagnostic => { - if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); - } - else { - console.log(` Error: ${diagnostic.messageText}`); - } - }); - } -} - -// Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()). - filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); - -// Start the watcher -watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); -//// [typescript.d.ts] -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -declare module "typescript" { - interface Map { - [index: string]: T; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - AsKeyword = 102, - ImplementsKeyword = 103, - InterfaceKeyword = 104, - LetKeyword = 105, - PackageKeyword = 106, - PrivateKeyword = 107, - ProtectedKeyword = 108, - PublicKeyword = 109, - StaticKeyword = 110, - YieldKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, - FirstTypeNode = 141, - LastTypeNode = 149, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 125, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 126, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - ExportContext = 32768, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - const enum ParserContextFlags { - StrictMode = 1, - DisallowIn = 2, - Yield = 4, - GeneratorParameter = 8, - Decorator = 16, - ThisNodeHasError = 32, - ParserGeneratedFlags = 63, - ThisNodeOrAnySubNodesHasError = 64, - HasAggregatedChildData = 128, - } - const enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - id?: number; - parent?: Node; - symbol?: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface HeritageClauseElement extends Node { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node, ModuleElement { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - iterator?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ModuleElement extends Node { - _moduleElementBrand: any; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, ModuleElement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { - name: Identifier; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, ModuleElement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, ModuleElement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, ModuleElement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends ModuleElement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, ModuleElement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, ModuleElement { - isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - kind: SyntaxKind; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - amdModuleName: string; - referencedFiles: FileReference[]; - hasNoDefaultLib: boolean; - externalModuleIndicator: Node; - languageVersion: ScriptTarget; - identifiers: Map; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - } - interface SourceMapSpan { - emittedLine: number; - emittedColumn: number; - sourceLine: number; - sourceColumn: number; - nameIndex?: number; - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - const enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2, - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: AnyImportSyntax[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration): boolean; - collectLinkedAliases(node: Identifier): Node[]; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - resolvesToSomeValue(location: Node, name: string): boolean; - getBlockScopedVariableId(node: Identifier): number; - } - const enum SymbolFlags { - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasLocals = 255504, - HasExports = 1952, - HasMembers = 6240, - IsContainer = 262128, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - id?: number; - mergeId?: number; - declarations?: Declaration[]; - parent?: Symbol; - members?: SymbolTable; - exports?: SymbolTable; - exportSymbol?: Symbol; - valueDeclaration?: Declaration; - constEnumOnlyModule?: boolean; - } - interface SymbolLinks { - target?: Symbol; - type?: Type; - declaredType?: Type; - mapper?: TypeMapper; - referenced?: boolean; - unionType?: UnionType; - resolvedExports?: SymbolTable; - exportsChecked?: boolean; - } - interface TransientSymbol extends Symbol, SymbolLinks { - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - EmitExtends = 8, - SuperInstance = 16, - SuperStatic = 32, - ContextChecked = 64, - EnumValuesComputed = 128, - BlockScopedBindingInLoop = 256, - EmitDecorate = 512, - } - interface NodeLinks { - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSymbol?: Symbol; - flags?: NodeCheckFlags; - enumMemberValue?: number; - isIllegalTypeReferenceInConstraint?: boolean; - isVisible?: boolean; - generatedName?: string; - generatedNames?: Map; - assignmentChecks?: Map; - hasReportedStatementInAmbientContext?: boolean; - importOnRightSide?: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - FromSignature = 65536, - ObjectLiteral = 131072, - ContainsUndefinedOrNull = 262144, - ContainsObjectLiteral = 524288, - ESSymbol = 1048576, - Intrinsic = 1048703, - Primitive = 1049086, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - RequiresWidening = 786432, - } - interface Type { - flags: TypeFlags; - id: number; - symbol?: Symbol; - } - interface IntrinsicType extends Type { - intrinsicName: string; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - resolvedProperties: SymbolTable; - } - interface ResolvedType extends ObjectType, UnionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: Signature[]; - constructSignatures: Signature[]; - stringIndexType: Type; - numberIndexType: Type; - } - interface TypeParameter extends Type { - constraint: Type; - target?: TypeParameter; - mapper?: TypeMapper; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - resolvedReturnType: Type; - minArgumentCount: number; - hasRestParameter: boolean; - hasStringLiterals: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface TypeMapper { - (t: Type): Type; - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - noEmit?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - separateCompilation?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CommandLineOption { - name: string; - type: string | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - error?: DiagnosticMessage; - experimental?: boolean; - } - const enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11, - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function computeLineStarts(text: string): number[]; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; - function getLineStarts(sourceFile: SourceFile): number[]; - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { - line: number; - character: number; +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var fs: any; +declare var path: any; + +import * as ts from "typescript"; + +function watch(rootFileNames: string[], options: ts.CompilerOptions) { + const files: ts.Map<{ version: number }> = {}; + + // initialize the list of files + rootFileNames.forEach(fileName => { + files[fileName] = { version: 0 }; + }); + + // Create the language service host to allow the LS to communicate with the host + const servicesHost: ts.LanguageServiceHost = { + getScriptFileNames: () => rootFileNames, + getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), + getScriptSnapshot: (fileName) => { + if (!fs.existsSync(fileName)) { + return undefined; + } + + return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); + }, + getCurrentDirectory: () => process.cwd(), + getCompilationSettings: () => options, + getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function modifierToFlag(token: SyntaxKind): NodeFlags; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function isEvalOrArgumentsIdentifier(node: Node): boolean; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function isLeftHandSideExpression(expr: Expression): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; + + // Create the language service files + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + + // Now let's watch the files + rootFileNames.forEach(fileName => { + // First time around, emit all files + emitFile(fileName); + + // Add a watch on the file to handle next change + fs.watchFile(fileName, + { persistent: true, interval: 250 }, + (curr, prev) => { + // Check timestamp + if (+curr.mtime <= +prev.mtime) { + return; + } + + // Update the version to signal a change in the file + files[fileName].version++; + + // write the changes to disk + emitFile(fileName); + }); + }); + + function emitFile(fileName: string) { + let output = services.getEmitOutput(fileName); + + if (!output.emitSkipped) { + console.log(`Emitting ${fileName}`); + } + else { + console.log(`Emitting ${fileName} failed`); + logErrors(fileName); + } + + output.outputFiles.forEach(o => { + fs.writeFileSync(o.name, o.text, "utf8"); + }); } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; + + function logErrors(fileName: string) { + let allDiagnostics = services.getCompilerOptionsDiagnostics() + .concat(services.getSyntacticDiagnostics(fileName)) + .concat(services.getSemanticDiagnostics(fileName)); + + allDiagnostics.forEach(diagnostic => { + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); + if (diagnostic.file) { + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + } + else { + console.log(` Error: ${message}`); + } + }); } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getNamedDeclarations(): Declaration[]; - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - Start = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - class ScriptElementKind { - static unknown: string; - static warning: string; - static keyword: string; - static scriptElement: string; - static moduleElement: string; - static classElement: string; - static interfaceElement: string; - static typeElement: string; - static enumElement: string; - static variableElement: string; - static localVariableElement: string; - static functionElement: string; - static localFunctionElement: string; - static memberFunctionElement: string; - static memberGetAccessorElement: string; - static memberSetAccessorElement: string; - static memberVariableElement: string; - static constructorImplementationElement: string; - static callSignatureElement: string; - static indexSignatureElement: string; - static constructSignatureElement: string; - static parameterElement: string; - static typeParameterElement: string; - static primitiveType: string; - static label: string; - static alias: string; - static constElement: string; - static letElement: string; - } - class ScriptElementKindModifier { - static none: string; - static publicMemberModifier: string; - static privateMemberModifier: string; - static protectedMemberModifier: string; - static exportedModifier: string; - static ambientModifier: string; - static staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAlias: string; - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; } +// Initialize files constituting the program as all .ts files in the current directory +const currentDirectoryFiles = fs.readdirSync(process.cwd()). + filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); + +// Start the watcher +watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); //// [APISample_watcher.js] /* @@ -2163,12 +166,13 @@ function watch(rootFileNames, options) { .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)); allDiagnostics.forEach(function (diagnostic) { + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(" Error " + diagnostic.file.fileName + " (" + (lineChar.line + 1) + "," + (lineChar.character + 1) + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")); + var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; + console.log(" Error " + diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); } else { - console.log(" Error: " + diagnostic.messageText); + console.log(" Error: " + message); } }); } diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 68114fabf7c..5f123ea839b 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -18,7 +18,7 @@ declare var fs: any; declare var path: any; >path : any -import ts = require("typescript"); +import * as ts from "typescript"; >ts : typeof ts function watch(rootFileNames: string[], options: ts.CompilerOptions) { @@ -28,7 +28,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >ts : unknown >CompilerOptions : ts.CompilerOptions - var files: ts.Map<{ version: number }> = {}; + const files: ts.Map<{ version: number }> = {}; >files : ts.Map<{ version: number; }> >ts : unknown >Map : ts.Map @@ -55,7 +55,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); // Create the language service host to allow the LS to communicate with the host - var servicesHost: ts.LanguageServiceHost = { + const servicesHost: ts.LanguageServiceHost = { >servicesHost : ts.LanguageServiceHost >ts : unknown >LanguageServiceHost : ts.LanguageServiceHost @@ -143,7 +143,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }; // Create the language service files - var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) >services : ts.LanguageService >ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService >ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService @@ -225,7 +225,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >emitFile : (fileName: string) => void >fileName : string - var output = services.getEmitOutput(fileName); + let output = services.getEmitOutput(fileName); >output : ts.EmitOutput >services.getEmitOutput(fileName) : ts.EmitOutput >services.getEmitOutput : (fileName: string) => ts.EmitOutput @@ -289,7 +289,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >logErrors : (fileName: string) => void >fileName : string - var allDiagnostics = services.getCompilerOptionsDiagnostics() + let allDiagnostics = services.getCompilerOptionsDiagnostics() >allDiagnostics : ts.Diagnostic[] >services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)) : ts.Diagnostic[] >services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } @@ -317,20 +317,31 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >fileName : string allDiagnostics.forEach(diagnostic => { ->allDiagnostics.forEach(diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } }) : void +>allDiagnostics.forEach(diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } }) : void >allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void >allDiagnostics : ts.Diagnostic[] >forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } } : (diagnostic: ts.Diagnostic) => void +>diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } } : (diagnostic: ts.Diagnostic) => void >diagnostic : ts.Diagnostic + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); +>message : string +>ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>ts : typeof ts +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string +>diagnostic.messageText : string | ts.DiagnosticMessageChain +>diagnostic : ts.Diagnostic +>messageText : string | ts.DiagnosticMessageChain + if (diagnostic.file) { >diagnostic.file : ts.SourceFile >diagnostic : ts.Diagnostic >file : ts.SourceFile - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->lineChar : ts.LineAndCharacter + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); +>line : number +>character : number >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter >diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter >diagnostic.file : ts.SourceFile @@ -341,8 +352,8 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >diagnostic : ts.Diagnostic >start : number - console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); ->console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`) : any + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); +>console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any >console.log : any >console : any >log : any @@ -351,38 +362,26 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >diagnostic : ts.Diagnostic >file : ts.SourceFile >fileName : string ->lineChar.line + 1 : number ->lineChar.line : number ->lineChar : ts.LineAndCharacter +>line + 1 : number >line : number ->lineChar.character + 1 : number ->lineChar.character : number ->lineChar : ts.LineAndCharacter +>character + 1 : number >character : number ->ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain +>message : string } else { - console.log(` Error: ${diagnostic.messageText}`); ->console.log(` Error: ${diagnostic.messageText}`) : any + console.log(` Error: ${message}`); +>console.log(` Error: ${message}`) : any >console.log : any >console : any >log : any ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain +>message : string } }); } } // Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()). +const currentDirectoryFiles = fs.readdirSync(process.cwd()). >currentDirectoryFiles : any >fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts") : any >fs.readdirSync(process.cwd()). filter : any @@ -427,6139 +426,3 @@ watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); >ModuleKind : typeof ts.ModuleKind >CommonJS : ts.ModuleKind -=== typescript.d.ts === -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module "typescript" { - interface Map { ->Map : Map ->T : T - - [index: string]: T; ->index : string ->T : T - } - interface TextRange { ->TextRange : TextRange - - pos: number; ->pos : number - - end: number; ->end : number - } - const enum SyntaxKind { ->SyntaxKind : SyntaxKind - - Unknown = 0, ->Unknown : SyntaxKind - - EndOfFileToken = 1, ->EndOfFileToken : SyntaxKind - - SingleLineCommentTrivia = 2, ->SingleLineCommentTrivia : SyntaxKind - - MultiLineCommentTrivia = 3, ->MultiLineCommentTrivia : SyntaxKind - - NewLineTrivia = 4, ->NewLineTrivia : SyntaxKind - - WhitespaceTrivia = 5, ->WhitespaceTrivia : SyntaxKind - - ConflictMarkerTrivia = 6, ->ConflictMarkerTrivia : SyntaxKind - - NumericLiteral = 7, ->NumericLiteral : SyntaxKind - - StringLiteral = 8, ->StringLiteral : SyntaxKind - - RegularExpressionLiteral = 9, ->RegularExpressionLiteral : SyntaxKind - - NoSubstitutionTemplateLiteral = 10, ->NoSubstitutionTemplateLiteral : SyntaxKind - - TemplateHead = 11, ->TemplateHead : SyntaxKind - - TemplateMiddle = 12, ->TemplateMiddle : SyntaxKind - - TemplateTail = 13, ->TemplateTail : SyntaxKind - - OpenBraceToken = 14, ->OpenBraceToken : SyntaxKind - - CloseBraceToken = 15, ->CloseBraceToken : SyntaxKind - - OpenParenToken = 16, ->OpenParenToken : SyntaxKind - - CloseParenToken = 17, ->CloseParenToken : SyntaxKind - - OpenBracketToken = 18, ->OpenBracketToken : SyntaxKind - - CloseBracketToken = 19, ->CloseBracketToken : SyntaxKind - - DotToken = 20, ->DotToken : SyntaxKind - - DotDotDotToken = 21, ->DotDotDotToken : SyntaxKind - - SemicolonToken = 22, ->SemicolonToken : SyntaxKind - - CommaToken = 23, ->CommaToken : SyntaxKind - - LessThanToken = 24, ->LessThanToken : SyntaxKind - - GreaterThanToken = 25, ->GreaterThanToken : SyntaxKind - - LessThanEqualsToken = 26, ->LessThanEqualsToken : SyntaxKind - - GreaterThanEqualsToken = 27, ->GreaterThanEqualsToken : SyntaxKind - - EqualsEqualsToken = 28, ->EqualsEqualsToken : SyntaxKind - - ExclamationEqualsToken = 29, ->ExclamationEqualsToken : SyntaxKind - - EqualsEqualsEqualsToken = 30, ->EqualsEqualsEqualsToken : SyntaxKind - - ExclamationEqualsEqualsToken = 31, ->ExclamationEqualsEqualsToken : SyntaxKind - - EqualsGreaterThanToken = 32, ->EqualsGreaterThanToken : SyntaxKind - - PlusToken = 33, ->PlusToken : SyntaxKind - - MinusToken = 34, ->MinusToken : SyntaxKind - - AsteriskToken = 35, ->AsteriskToken : SyntaxKind - - SlashToken = 36, ->SlashToken : SyntaxKind - - PercentToken = 37, ->PercentToken : SyntaxKind - - PlusPlusToken = 38, ->PlusPlusToken : SyntaxKind - - MinusMinusToken = 39, ->MinusMinusToken : SyntaxKind - - LessThanLessThanToken = 40, ->LessThanLessThanToken : SyntaxKind - - GreaterThanGreaterThanToken = 41, ->GreaterThanGreaterThanToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanToken = 42, ->GreaterThanGreaterThanGreaterThanToken : SyntaxKind - - AmpersandToken = 43, ->AmpersandToken : SyntaxKind - - BarToken = 44, ->BarToken : SyntaxKind - - CaretToken = 45, ->CaretToken : SyntaxKind - - ExclamationToken = 46, ->ExclamationToken : SyntaxKind - - TildeToken = 47, ->TildeToken : SyntaxKind - - AmpersandAmpersandToken = 48, ->AmpersandAmpersandToken : SyntaxKind - - BarBarToken = 49, ->BarBarToken : SyntaxKind - - QuestionToken = 50, ->QuestionToken : SyntaxKind - - ColonToken = 51, ->ColonToken : SyntaxKind - - AtToken = 52, ->AtToken : SyntaxKind - - EqualsToken = 53, ->EqualsToken : SyntaxKind - - PlusEqualsToken = 54, ->PlusEqualsToken : SyntaxKind - - MinusEqualsToken = 55, ->MinusEqualsToken : SyntaxKind - - AsteriskEqualsToken = 56, ->AsteriskEqualsToken : SyntaxKind - - SlashEqualsToken = 57, ->SlashEqualsToken : SyntaxKind - - PercentEqualsToken = 58, ->PercentEqualsToken : SyntaxKind - - LessThanLessThanEqualsToken = 59, ->LessThanLessThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanEqualsToken = 60, ->GreaterThanGreaterThanEqualsToken : SyntaxKind - - GreaterThanGreaterThanGreaterThanEqualsToken = 61, ->GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - - AmpersandEqualsToken = 62, ->AmpersandEqualsToken : SyntaxKind - - BarEqualsToken = 63, ->BarEqualsToken : SyntaxKind - - CaretEqualsToken = 64, ->CaretEqualsToken : SyntaxKind - - Identifier = 65, ->Identifier : SyntaxKind - - BreakKeyword = 66, ->BreakKeyword : SyntaxKind - - CaseKeyword = 67, ->CaseKeyword : SyntaxKind - - CatchKeyword = 68, ->CatchKeyword : SyntaxKind - - ClassKeyword = 69, ->ClassKeyword : SyntaxKind - - ConstKeyword = 70, ->ConstKeyword : SyntaxKind - - ContinueKeyword = 71, ->ContinueKeyword : SyntaxKind - - DebuggerKeyword = 72, ->DebuggerKeyword : SyntaxKind - - DefaultKeyword = 73, ->DefaultKeyword : SyntaxKind - - DeleteKeyword = 74, ->DeleteKeyword : SyntaxKind - - DoKeyword = 75, ->DoKeyword : SyntaxKind - - ElseKeyword = 76, ->ElseKeyword : SyntaxKind - - EnumKeyword = 77, ->EnumKeyword : SyntaxKind - - ExportKeyword = 78, ->ExportKeyword : SyntaxKind - - ExtendsKeyword = 79, ->ExtendsKeyword : SyntaxKind - - FalseKeyword = 80, ->FalseKeyword : SyntaxKind - - FinallyKeyword = 81, ->FinallyKeyword : SyntaxKind - - ForKeyword = 82, ->ForKeyword : SyntaxKind - - FunctionKeyword = 83, ->FunctionKeyword : SyntaxKind - - IfKeyword = 84, ->IfKeyword : SyntaxKind - - ImportKeyword = 85, ->ImportKeyword : SyntaxKind - - InKeyword = 86, ->InKeyword : SyntaxKind - - InstanceOfKeyword = 87, ->InstanceOfKeyword : SyntaxKind - - NewKeyword = 88, ->NewKeyword : SyntaxKind - - NullKeyword = 89, ->NullKeyword : SyntaxKind - - ReturnKeyword = 90, ->ReturnKeyword : SyntaxKind - - SuperKeyword = 91, ->SuperKeyword : SyntaxKind - - SwitchKeyword = 92, ->SwitchKeyword : SyntaxKind - - ThisKeyword = 93, ->ThisKeyword : SyntaxKind - - ThrowKeyword = 94, ->ThrowKeyword : SyntaxKind - - TrueKeyword = 95, ->TrueKeyword : SyntaxKind - - TryKeyword = 96, ->TryKeyword : SyntaxKind - - TypeOfKeyword = 97, ->TypeOfKeyword : SyntaxKind - - VarKeyword = 98, ->VarKeyword : SyntaxKind - - VoidKeyword = 99, ->VoidKeyword : SyntaxKind - - WhileKeyword = 100, ->WhileKeyword : SyntaxKind - - WithKeyword = 101, ->WithKeyword : SyntaxKind - - AsKeyword = 102, ->AsKeyword : SyntaxKind - - ImplementsKeyword = 103, ->ImplementsKeyword : SyntaxKind - - InterfaceKeyword = 104, ->InterfaceKeyword : SyntaxKind - - LetKeyword = 105, ->LetKeyword : SyntaxKind - - PackageKeyword = 106, ->PackageKeyword : SyntaxKind - - PrivateKeyword = 107, ->PrivateKeyword : SyntaxKind - - ProtectedKeyword = 108, ->ProtectedKeyword : SyntaxKind - - PublicKeyword = 109, ->PublicKeyword : SyntaxKind - - StaticKeyword = 110, ->StaticKeyword : SyntaxKind - - YieldKeyword = 111, ->YieldKeyword : SyntaxKind - - AnyKeyword = 112, ->AnyKeyword : SyntaxKind - - BooleanKeyword = 113, ->BooleanKeyword : SyntaxKind - - ConstructorKeyword = 114, ->ConstructorKeyword : SyntaxKind - - DeclareKeyword = 115, ->DeclareKeyword : SyntaxKind - - GetKeyword = 116, ->GetKeyword : SyntaxKind - - ModuleKeyword = 117, ->ModuleKeyword : SyntaxKind - - RequireKeyword = 118, ->RequireKeyword : SyntaxKind - - NumberKeyword = 119, ->NumberKeyword : SyntaxKind - - SetKeyword = 120, ->SetKeyword : SyntaxKind - - StringKeyword = 121, ->StringKeyword : SyntaxKind - - SymbolKeyword = 122, ->SymbolKeyword : SyntaxKind - - TypeKeyword = 123, ->TypeKeyword : SyntaxKind - - FromKeyword = 124, ->FromKeyword : SyntaxKind - - OfKeyword = 125, ->OfKeyword : SyntaxKind - - QualifiedName = 126, ->QualifiedName : SyntaxKind - - ComputedPropertyName = 127, ->ComputedPropertyName : SyntaxKind - - TypeParameter = 128, ->TypeParameter : SyntaxKind - - Parameter = 129, ->Parameter : SyntaxKind - - Decorator = 130, ->Decorator : SyntaxKind - - PropertySignature = 131, ->PropertySignature : SyntaxKind - - PropertyDeclaration = 132, ->PropertyDeclaration : SyntaxKind - - MethodSignature = 133, ->MethodSignature : SyntaxKind - - MethodDeclaration = 134, ->MethodDeclaration : SyntaxKind - - Constructor = 135, ->Constructor : SyntaxKind - - GetAccessor = 136, ->GetAccessor : SyntaxKind - - SetAccessor = 137, ->SetAccessor : SyntaxKind - - CallSignature = 138, ->CallSignature : SyntaxKind - - ConstructSignature = 139, ->ConstructSignature : SyntaxKind - - IndexSignature = 140, ->IndexSignature : SyntaxKind - - TypeReference = 141, ->TypeReference : SyntaxKind - - FunctionType = 142, ->FunctionType : SyntaxKind - - ConstructorType = 143, ->ConstructorType : SyntaxKind - - TypeQuery = 144, ->TypeQuery : SyntaxKind - - TypeLiteral = 145, ->TypeLiteral : SyntaxKind - - ArrayType = 146, ->ArrayType : SyntaxKind - - TupleType = 147, ->TupleType : SyntaxKind - - UnionType = 148, ->UnionType : SyntaxKind - - ParenthesizedType = 149, ->ParenthesizedType : SyntaxKind - - ObjectBindingPattern = 150, ->ObjectBindingPattern : SyntaxKind - - ArrayBindingPattern = 151, ->ArrayBindingPattern : SyntaxKind - - BindingElement = 152, ->BindingElement : SyntaxKind - - ArrayLiteralExpression = 153, ->ArrayLiteralExpression : SyntaxKind - - ObjectLiteralExpression = 154, ->ObjectLiteralExpression : SyntaxKind - - PropertyAccessExpression = 155, ->PropertyAccessExpression : SyntaxKind - - ElementAccessExpression = 156, ->ElementAccessExpression : SyntaxKind - - CallExpression = 157, ->CallExpression : SyntaxKind - - NewExpression = 158, ->NewExpression : SyntaxKind - - TaggedTemplateExpression = 159, ->TaggedTemplateExpression : SyntaxKind - - TypeAssertionExpression = 160, ->TypeAssertionExpression : SyntaxKind - - ParenthesizedExpression = 161, ->ParenthesizedExpression : SyntaxKind - - FunctionExpression = 162, ->FunctionExpression : SyntaxKind - - ArrowFunction = 163, ->ArrowFunction : SyntaxKind - - DeleteExpression = 164, ->DeleteExpression : SyntaxKind - - TypeOfExpression = 165, ->TypeOfExpression : SyntaxKind - - VoidExpression = 166, ->VoidExpression : SyntaxKind - - PrefixUnaryExpression = 167, ->PrefixUnaryExpression : SyntaxKind - - PostfixUnaryExpression = 168, ->PostfixUnaryExpression : SyntaxKind - - BinaryExpression = 169, ->BinaryExpression : SyntaxKind - - ConditionalExpression = 170, ->ConditionalExpression : SyntaxKind - - TemplateExpression = 171, ->TemplateExpression : SyntaxKind - - YieldExpression = 172, ->YieldExpression : SyntaxKind - - SpreadElementExpression = 173, ->SpreadElementExpression : SyntaxKind - - ClassExpression = 174, ->ClassExpression : SyntaxKind - - OmittedExpression = 175, ->OmittedExpression : SyntaxKind - - TemplateSpan = 176, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 177, ->HeritageClauseElement : SyntaxKind - - SemicolonClassElement = 178, ->SemicolonClassElement : SyntaxKind - - Block = 179, ->Block : SyntaxKind - - VariableStatement = 180, ->VariableStatement : SyntaxKind - - EmptyStatement = 181, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 182, ->ExpressionStatement : SyntaxKind - - IfStatement = 183, ->IfStatement : SyntaxKind - - DoStatement = 184, ->DoStatement : SyntaxKind - - WhileStatement = 185, ->WhileStatement : SyntaxKind - - ForStatement = 186, ->ForStatement : SyntaxKind - - ForInStatement = 187, ->ForInStatement : SyntaxKind - - ForOfStatement = 188, ->ForOfStatement : SyntaxKind - - ContinueStatement = 189, ->ContinueStatement : SyntaxKind - - BreakStatement = 190, ->BreakStatement : SyntaxKind - - ReturnStatement = 191, ->ReturnStatement : SyntaxKind - - WithStatement = 192, ->WithStatement : SyntaxKind - - SwitchStatement = 193, ->SwitchStatement : SyntaxKind - - LabeledStatement = 194, ->LabeledStatement : SyntaxKind - - ThrowStatement = 195, ->ThrowStatement : SyntaxKind - - TryStatement = 196, ->TryStatement : SyntaxKind - - DebuggerStatement = 197, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 198, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 199, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 200, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 201, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 202, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 203, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 204, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 205, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 206, ->ModuleBlock : SyntaxKind - - CaseBlock = 207, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 208, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 209, ->ImportDeclaration : SyntaxKind - - ImportClause = 210, ->ImportClause : SyntaxKind - - NamespaceImport = 211, ->NamespaceImport : SyntaxKind - - NamedImports = 212, ->NamedImports : SyntaxKind - - ImportSpecifier = 213, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 214, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 215, ->ExportDeclaration : SyntaxKind - - NamedExports = 216, ->NamedExports : SyntaxKind - - ExportSpecifier = 217, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 218, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 219, ->ExternalModuleReference : SyntaxKind - - CaseClause = 220, ->CaseClause : SyntaxKind - - DefaultClause = 221, ->DefaultClause : SyntaxKind - - HeritageClause = 222, ->HeritageClause : SyntaxKind - - CatchClause = 223, ->CatchClause : SyntaxKind - - PropertyAssignment = 224, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 225, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 226, ->EnumMember : SyntaxKind - - SourceFile = 227, ->SourceFile : SyntaxKind - - SyntaxList = 228, ->SyntaxList : SyntaxKind - - Count = 229, ->Count : SyntaxKind - - FirstAssignment = 53, ->FirstAssignment : SyntaxKind - - LastAssignment = 64, ->LastAssignment : SyntaxKind - - FirstReservedWord = 66, ->FirstReservedWord : SyntaxKind - - LastReservedWord = 101, ->LastReservedWord : SyntaxKind - - FirstKeyword = 66, ->FirstKeyword : SyntaxKind - - LastKeyword = 125, ->LastKeyword : SyntaxKind - - FirstFutureReservedWord = 103, ->FirstFutureReservedWord : SyntaxKind - - LastFutureReservedWord = 111, ->LastFutureReservedWord : SyntaxKind - - FirstTypeNode = 141, ->FirstTypeNode : SyntaxKind - - LastTypeNode = 149, ->LastTypeNode : SyntaxKind - - FirstPunctuation = 14, ->FirstPunctuation : SyntaxKind - - LastPunctuation = 64, ->LastPunctuation : SyntaxKind - - FirstToken = 0, ->FirstToken : SyntaxKind - - LastToken = 125, ->LastToken : SyntaxKind - - FirstTriviaToken = 2, ->FirstTriviaToken : SyntaxKind - - LastTriviaToken = 6, ->LastTriviaToken : SyntaxKind - - FirstLiteralToken = 7, ->FirstLiteralToken : SyntaxKind - - LastLiteralToken = 10, ->LastLiteralToken : SyntaxKind - - FirstTemplateToken = 10, ->FirstTemplateToken : SyntaxKind - - LastTemplateToken = 13, ->LastTemplateToken : SyntaxKind - - FirstBinaryOperator = 24, ->FirstBinaryOperator : SyntaxKind - - LastBinaryOperator = 64, ->LastBinaryOperator : SyntaxKind - - FirstNode = 126, ->FirstNode : SyntaxKind - } - const enum NodeFlags { ->NodeFlags : NodeFlags - - Export = 1, ->Export : NodeFlags - - Ambient = 2, ->Ambient : NodeFlags - - Public = 16, ->Public : NodeFlags - - Private = 32, ->Private : NodeFlags - - Protected = 64, ->Protected : NodeFlags - - Static = 128, ->Static : NodeFlags - - Default = 256, ->Default : NodeFlags - - MultiLine = 512, ->MultiLine : NodeFlags - - Synthetic = 1024, ->Synthetic : NodeFlags - - DeclarationFile = 2048, ->DeclarationFile : NodeFlags - - Let = 4096, ->Let : NodeFlags - - Const = 8192, ->Const : NodeFlags - - OctalLiteral = 16384, ->OctalLiteral : NodeFlags - - ExportContext = 32768, ->ExportContext : NodeFlags - - Modifier = 499, ->Modifier : NodeFlags - - AccessibilityModifier = 112, ->AccessibilityModifier : NodeFlags - - BlockScoped = 12288, ->BlockScoped : NodeFlags - } - const enum ParserContextFlags { ->ParserContextFlags : ParserContextFlags - - StrictMode = 1, ->StrictMode : ParserContextFlags - - DisallowIn = 2, ->DisallowIn : ParserContextFlags - - Yield = 4, ->Yield : ParserContextFlags - - GeneratorParameter = 8, ->GeneratorParameter : ParserContextFlags - - Decorator = 16, ->Decorator : ParserContextFlags - - ThisNodeHasError = 32, ->ThisNodeHasError : ParserContextFlags - - ParserGeneratedFlags = 63, ->ParserGeneratedFlags : ParserContextFlags - - ThisNodeOrAnySubNodesHasError = 64, ->ThisNodeOrAnySubNodesHasError : ParserContextFlags - - HasAggregatedChildData = 128, ->HasAggregatedChildData : ParserContextFlags - } - const enum RelationComparisonResult { ->RelationComparisonResult : RelationComparisonResult - - Succeeded = 1, ->Succeeded : RelationComparisonResult - - Failed = 2, ->Failed : RelationComparisonResult - - FailedAndReported = 3, ->FailedAndReported : RelationComparisonResult - } - interface Node extends TextRange { ->Node : Node ->TextRange : TextRange - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - - flags: NodeFlags; ->flags : NodeFlags ->NodeFlags : NodeFlags - - parserContextFlags?: ParserContextFlags; ->parserContextFlags : ParserContextFlags ->ParserContextFlags : ParserContextFlags - - decorators?: NodeArray; ->decorators : NodeArray ->NodeArray : NodeArray ->Decorator : Decorator - - modifiers?: ModifiersArray; ->modifiers : ModifiersArray ->ModifiersArray : ModifiersArray - - id?: number; ->id : number - - parent?: Node; ->parent : Node ->Node : Node - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - - locals?: SymbolTable; ->locals : SymbolTable ->SymbolTable : SymbolTable - - nextContainer?: Node; ->nextContainer : Node ->Node : Node - - localSymbol?: Symbol; ->localSymbol : Symbol ->Symbol : Symbol - } - interface NodeArray extends Array, TextRange { ->NodeArray : NodeArray ->T : T ->Array : T[] ->T : T ->TextRange : TextRange - - hasTrailingComma?: boolean; ->hasTrailingComma : boolean - } - interface ModifiersArray extends NodeArray { ->ModifiersArray : ModifiersArray ->NodeArray : NodeArray ->Node : Node - - flags: number; ->flags : number - } - interface Identifier extends PrimaryExpression { ->Identifier : Identifier ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - } - interface QualifiedName extends Node { ->QualifiedName : QualifiedName ->Node : Node - - left: EntityName; ->left : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - right: Identifier; ->right : Identifier ->Identifier : Identifier - } - type EntityName = Identifier | QualifiedName; ->EntityName : Identifier | QualifiedName ->Identifier : Identifier ->QualifiedName : QualifiedName - - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->Identifier : Identifier ->LiteralExpression : LiteralExpression ->ComputedPropertyName : ComputedPropertyName ->BindingPattern : BindingPattern - - interface Declaration extends Node { ->Declaration : Declaration ->Node : Node - - _declarationBrand: any; ->_declarationBrand : any - - name?: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - } - interface ComputedPropertyName extends Node { ->ComputedPropertyName : ComputedPropertyName ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface Decorator extends Node { ->Decorator : Decorator ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - } - interface TypeParameterDeclaration extends Declaration { ->TypeParameterDeclaration : TypeParameterDeclaration ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - constraint?: TypeNode; ->constraint : TypeNode ->TypeNode : TypeNode - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface SignatureDeclaration extends Declaration { ->SignatureDeclaration : SignatureDeclaration ->Declaration : Declaration - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - parameters: NodeArray; ->parameters : NodeArray ->NodeArray : NodeArray ->ParameterDeclaration : ParameterDeclaration - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface VariableDeclaration extends Declaration { ->VariableDeclaration : VariableDeclaration ->Declaration : Declaration - - parent?: VariableDeclarationList; ->parent : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface VariableDeclarationList extends Node { ->VariableDeclarationList : VariableDeclarationList ->Node : Node - - declarations: NodeArray; ->declarations : NodeArray ->NodeArray : NodeArray ->VariableDeclaration : VariableDeclaration - } - interface ParameterDeclaration extends Declaration { ->ParameterDeclaration : ParameterDeclaration ->Declaration : Declaration - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingElement extends Declaration { ->BindingElement : BindingElement ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: Identifier | BindingPattern; ->name : Identifier | BindingPattern ->Identifier : Identifier ->BindingPattern : BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface PropertyDeclaration extends Declaration, ClassElement { ->PropertyDeclaration : PropertyDeclaration ->Declaration : Declaration ->ClassElement : ClassElement - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface ObjectLiteralElement extends Declaration { ->ObjectLiteralElement : ObjectLiteralElement ->Declaration : Declaration - - _objectLiteralBrandBrand: any; ->_objectLiteralBrandBrand : any - } - interface PropertyAssignment extends ObjectLiteralElement { ->PropertyAssignment : PropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - _propertyAssignmentBrand: any; ->_propertyAssignmentBrand : any - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - initializer: Expression; ->initializer : Expression ->Expression : Expression - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { ->ShorthandPropertyAssignment : ShorthandPropertyAssignment ->ObjectLiteralElement : ObjectLiteralElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - questionToken?: Node; ->questionToken : Node ->Node : Node - } - interface VariableLikeDeclaration extends Declaration { ->VariableLikeDeclaration : VariableLikeDeclaration ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - dotDotDotToken?: Node; ->dotDotDotToken : Node ->Node : Node - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - questionToken?: Node; ->questionToken : Node ->Node : Node - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface BindingPattern extends Node { ->BindingPattern : BindingPattern ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->BindingElement : BindingElement - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { ->FunctionLikeDeclaration : FunctionLikeDeclaration ->SignatureDeclaration : SignatureDeclaration - - _functionLikeDeclarationBrand: any; ->_functionLikeDeclarationBrand : any - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - questionToken?: Node; ->questionToken : Node ->Node : Node - - body?: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { ->FunctionDeclaration : FunctionDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->Statement : Statement - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body?: Block; ->body : Block ->Block : Block - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->MethodDeclaration : MethodDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - body?: Block; ->body : Block ->Block : Block - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { ->ConstructorDeclaration : ConstructorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement - - body?: Block; ->body : Block ->Block : Block - } - interface SemicolonClassElement extends ClassElement { ->SemicolonClassElement : SemicolonClassElement ->ClassElement : ClassElement - - _semicolonClassElementBrand: any; ->_semicolonClassElementBrand : any - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { ->AccessorDeclaration : AccessorDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration ->ClassElement : ClassElement ->ObjectLiteralElement : ObjectLiteralElement - - _accessorDeclarationBrand: any; ->_accessorDeclarationBrand : any - - body: Block; ->body : Block ->Block : Block - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { ->IndexSignatureDeclaration : IndexSignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->ClassElement : ClassElement - - _indexSignatureDeclarationBrand: any; ->_indexSignatureDeclarationBrand : any - } - interface TypeNode extends Node { ->TypeNode : TypeNode ->Node : Node - - _typeNodeBrand: any; ->_typeNodeBrand : any - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { ->FunctionOrConstructorTypeNode : FunctionOrConstructorTypeNode ->TypeNode : TypeNode ->SignatureDeclaration : SignatureDeclaration - - _functionOrConstructorTypeNodeBrand: any; ->_functionOrConstructorTypeNodeBrand : any - } - interface TypeReferenceNode extends TypeNode { ->TypeReferenceNode : TypeReferenceNode ->TypeNode : TypeNode - - typeName: EntityName; ->typeName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface TypeQueryNode extends TypeNode { ->TypeQueryNode : TypeQueryNode ->TypeNode : TypeNode - - exprName: EntityName; ->exprName : Identifier | QualifiedName ->EntityName : Identifier | QualifiedName - } - interface TypeLiteralNode extends TypeNode, Declaration { ->TypeLiteralNode : TypeLiteralNode ->TypeNode : TypeNode ->Declaration : Declaration - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Node : Node - } - interface ArrayTypeNode extends TypeNode { ->ArrayTypeNode : ArrayTypeNode ->TypeNode : TypeNode - - elementType: TypeNode; ->elementType : TypeNode ->TypeNode : TypeNode - } - interface TupleTypeNode extends TypeNode { ->TupleTypeNode : TupleTypeNode ->TypeNode : TypeNode - - elementTypes: NodeArray; ->elementTypes : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface UnionTypeNode extends TypeNode { ->UnionTypeNode : UnionTypeNode ->TypeNode : TypeNode - - types: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface ParenthesizedTypeNode extends TypeNode { ->ParenthesizedTypeNode : ParenthesizedTypeNode ->TypeNode : TypeNode - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { ->StringLiteralTypeNode : StringLiteralTypeNode ->LiteralExpression : LiteralExpression ->TypeNode : TypeNode - } - interface Expression extends Node { ->Expression : Expression ->Node : Node - - _expressionBrand: any; ->_expressionBrand : any - - contextualType?: Type; ->contextualType : Type ->Type : Type - } - interface UnaryExpression extends Expression { ->UnaryExpression : UnaryExpression ->Expression : Expression - - _unaryExpressionBrand: any; ->_unaryExpressionBrand : any - } - interface PrefixUnaryExpression extends UnaryExpression { ->PrefixUnaryExpression : PrefixUnaryExpression ->UnaryExpression : UnaryExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - - operand: UnaryExpression; ->operand : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface PostfixUnaryExpression extends PostfixExpression { ->PostfixUnaryExpression : PostfixUnaryExpression ->PostfixExpression : PostfixExpression - - operand: LeftHandSideExpression; ->operand : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - operator: SyntaxKind; ->operator : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface PostfixExpression extends UnaryExpression { ->PostfixExpression : PostfixExpression ->UnaryExpression : UnaryExpression - - _postfixExpressionBrand: any; ->_postfixExpressionBrand : any - } - interface LeftHandSideExpression extends PostfixExpression { ->LeftHandSideExpression : LeftHandSideExpression ->PostfixExpression : PostfixExpression - - _leftHandSideExpressionBrand: any; ->_leftHandSideExpressionBrand : any - } - interface MemberExpression extends LeftHandSideExpression { ->MemberExpression : MemberExpression ->LeftHandSideExpression : LeftHandSideExpression - - _memberExpressionBrand: any; ->_memberExpressionBrand : any - } - interface PrimaryExpression extends MemberExpression { ->PrimaryExpression : PrimaryExpression ->MemberExpression : MemberExpression - - _primaryExpressionBrand: any; ->_primaryExpressionBrand : any - } - interface DeleteExpression extends UnaryExpression { ->DeleteExpression : DeleteExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface TypeOfExpression extends UnaryExpression { ->TypeOfExpression : TypeOfExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface VoidExpression extends UnaryExpression { ->VoidExpression : VoidExpression ->UnaryExpression : UnaryExpression - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface YieldExpression extends Expression { ->YieldExpression : YieldExpression ->Expression : Expression - - asteriskToken?: Node; ->asteriskToken : Node ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BinaryExpression extends Expression { ->BinaryExpression : BinaryExpression ->Expression : Expression - - left: Expression; ->left : Expression ->Expression : Expression - - operatorToken: Node; ->operatorToken : Node ->Node : Node - - right: Expression; ->right : Expression ->Expression : Expression - } - interface ConditionalExpression extends Expression { ->ConditionalExpression : ConditionalExpression ->Expression : Expression - - condition: Expression; ->condition : Expression ->Expression : Expression - - questionToken: Node; ->questionToken : Node ->Node : Node - - whenTrue: Expression; ->whenTrue : Expression ->Expression : Expression - - colonToken: Node; ->colonToken : Node ->Node : Node - - whenFalse: Expression; ->whenFalse : Expression ->Expression : Expression - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { ->FunctionExpression : FunctionExpression ->PrimaryExpression : PrimaryExpression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - body: Block | Expression; ->body : Expression | Block ->Block : Block ->Expression : Expression - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { ->ArrowFunction : ArrowFunction ->Expression : Expression ->FunctionLikeDeclaration : FunctionLikeDeclaration - - equalsGreaterThanToken: Node; ->equalsGreaterThanToken : Node ->Node : Node - } - interface LiteralExpression extends PrimaryExpression { ->LiteralExpression : LiteralExpression ->PrimaryExpression : PrimaryExpression - - text: string; ->text : string - - isUnterminated?: boolean; ->isUnterminated : boolean - - hasExtendedUnicodeEscape?: boolean; ->hasExtendedUnicodeEscape : boolean - } - interface StringLiteralExpression extends LiteralExpression { ->StringLiteralExpression : StringLiteralExpression ->LiteralExpression : LiteralExpression - - _stringLiteralExpressionBrand: any; ->_stringLiteralExpressionBrand : any - } - interface TemplateExpression extends PrimaryExpression { ->TemplateExpression : TemplateExpression ->PrimaryExpression : PrimaryExpression - - head: LiteralExpression; ->head : LiteralExpression ->LiteralExpression : LiteralExpression - - templateSpans: NodeArray; ->templateSpans : NodeArray ->NodeArray : NodeArray ->TemplateSpan : TemplateSpan - } - interface TemplateSpan extends Node { ->TemplateSpan : TemplateSpan ->Node : Node - - expression: Expression; ->expression : Expression ->Expression : Expression - - literal: LiteralExpression; ->literal : LiteralExpression ->LiteralExpression : LiteralExpression - } - interface ParenthesizedExpression extends PrimaryExpression { ->ParenthesizedExpression : ParenthesizedExpression ->PrimaryExpression : PrimaryExpression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ArrayLiteralExpression extends PrimaryExpression { ->ArrayLiteralExpression : ArrayLiteralExpression ->PrimaryExpression : PrimaryExpression - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface SpreadElementExpression extends Expression { ->SpreadElementExpression : SpreadElementExpression ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { ->ObjectLiteralExpression : ObjectLiteralExpression ->PrimaryExpression : PrimaryExpression ->Declaration : Declaration - - properties: NodeArray; ->properties : NodeArray ->NodeArray : NodeArray ->ObjectLiteralElement : ObjectLiteralElement - } - interface PropertyAccessExpression extends MemberExpression { ->PropertyAccessExpression : PropertyAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - dotToken: Node; ->dotToken : Node ->Node : Node - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ElementAccessExpression extends MemberExpression { ->ElementAccessExpression : ElementAccessExpression ->MemberExpression : MemberExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - argumentExpression?: Expression; ->argumentExpression : Expression ->Expression : Expression - } - interface CallExpression extends LeftHandSideExpression { ->CallExpression : CallExpression ->LeftHandSideExpression : LeftHandSideExpression - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - - arguments: NodeArray; ->arguments : NodeArray ->NodeArray : NodeArray ->Expression : Expression - } - interface HeritageClauseElement extends Node { ->HeritageClauseElement : HeritageClauseElement ->Node : Node - - expression: LeftHandSideExpression; ->expression : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - typeArguments?: NodeArray; ->typeArguments : NodeArray ->NodeArray : NodeArray ->TypeNode : TypeNode - } - interface NewExpression extends CallExpression, PrimaryExpression { ->NewExpression : NewExpression ->CallExpression : CallExpression ->PrimaryExpression : PrimaryExpression - } - interface TaggedTemplateExpression extends MemberExpression { ->TaggedTemplateExpression : TaggedTemplateExpression ->MemberExpression : MemberExpression - - tag: LeftHandSideExpression; ->tag : LeftHandSideExpression ->LeftHandSideExpression : LeftHandSideExpression - - template: LiteralExpression | TemplateExpression; ->template : LiteralExpression | TemplateExpression ->LiteralExpression : LiteralExpression ->TemplateExpression : TemplateExpression - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->CallExpression : CallExpression ->NewExpression : NewExpression ->TaggedTemplateExpression : TaggedTemplateExpression - - interface TypeAssertion extends UnaryExpression { ->TypeAssertion : TypeAssertion ->UnaryExpression : UnaryExpression - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - - expression: UnaryExpression; ->expression : UnaryExpression ->UnaryExpression : UnaryExpression - } - interface Statement extends Node, ModuleElement { ->Statement : Statement ->Node : Node ->ModuleElement : ModuleElement - - _statementBrand: any; ->_statementBrand : any - } - interface Block extends Statement { ->Block : Block ->Statement : Statement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface VariableStatement extends Statement { ->VariableStatement : VariableStatement ->Statement : Statement - - declarationList: VariableDeclarationList; ->declarationList : VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList - } - interface ExpressionStatement extends Statement { ->ExpressionStatement : ExpressionStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface IfStatement extends Statement { ->IfStatement : IfStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - thenStatement: Statement; ->thenStatement : Statement ->Statement : Statement - - elseStatement?: Statement; ->elseStatement : Statement ->Statement : Statement - } - interface IterationStatement extends Statement { ->IterationStatement : IterationStatement ->Statement : Statement - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface DoStatement extends IterationStatement { ->DoStatement : DoStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface WhileStatement extends IterationStatement { ->WhileStatement : WhileStatement ->IterationStatement : IterationStatement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForStatement extends IterationStatement { ->ForStatement : ForStatement ->IterationStatement : IterationStatement - - initializer?: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - condition?: Expression; ->condition : Expression ->Expression : Expression - - iterator?: Expression; ->iterator : Expression ->Expression : Expression - } - interface ForInStatement extends IterationStatement { ->ForInStatement : ForInStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface ForOfStatement extends IterationStatement { ->ForOfStatement : ForOfStatement ->IterationStatement : IterationStatement - - initializer: VariableDeclarationList | Expression; ->initializer : Expression | VariableDeclarationList ->VariableDeclarationList : VariableDeclarationList ->Expression : Expression - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface BreakOrContinueStatement extends Statement { ->BreakOrContinueStatement : BreakOrContinueStatement ->Statement : Statement - - label?: Identifier; ->label : Identifier ->Identifier : Identifier - } - interface ReturnStatement extends Statement { ->ReturnStatement : ReturnStatement ->Statement : Statement - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface WithStatement extends Statement { ->WithStatement : WithStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface SwitchStatement extends Statement { ->SwitchStatement : SwitchStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - - caseBlock: CaseBlock; ->caseBlock : CaseBlock ->CaseBlock : CaseBlock - } - interface CaseBlock extends Node { ->CaseBlock : CaseBlock ->Node : Node - - clauses: NodeArray; ->clauses : NodeArray ->NodeArray : NodeArray ->CaseOrDefaultClause : CaseClause | DefaultClause - } - interface CaseClause extends Node { ->CaseClause : CaseClause ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - interface DefaultClause extends Node { ->DefaultClause : DefaultClause ->Node : Node - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->Statement : Statement - } - type CaseOrDefaultClause = CaseClause | DefaultClause; ->CaseOrDefaultClause : CaseClause | DefaultClause ->CaseClause : CaseClause ->DefaultClause : DefaultClause - - interface LabeledStatement extends Statement { ->LabeledStatement : LabeledStatement ->Statement : Statement - - label: Identifier; ->label : Identifier ->Identifier : Identifier - - statement: Statement; ->statement : Statement ->Statement : Statement - } - interface ThrowStatement extends Statement { ->ThrowStatement : ThrowStatement ->Statement : Statement - - expression: Expression; ->expression : Expression ->Expression : Expression - } - interface TryStatement extends Statement { ->TryStatement : TryStatement ->Statement : Statement - - tryBlock: Block; ->tryBlock : Block ->Block : Block - - catchClause?: CatchClause; ->catchClause : CatchClause ->CatchClause : CatchClause - - finallyBlock?: Block; ->finallyBlock : Block ->Block : Block - } - interface CatchClause extends Node { ->CatchClause : CatchClause ->Node : Node - - variableDeclaration: VariableDeclaration; ->variableDeclaration : VariableDeclaration ->VariableDeclaration : VariableDeclaration - - block: Block; ->block : Block ->Block : Block - } - interface ModuleElement extends Node { ->ModuleElement : ModuleElement ->Node : Node - - _moduleElementBrand: any; ->_moduleElementBrand : any - } - interface ClassLikeDeclaration extends Declaration { ->ClassLikeDeclaration : ClassLikeDeclaration ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->ClassElement : ClassElement - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { ->ClassDeclaration : ClassDeclaration ->ClassLikeDeclaration : ClassLikeDeclaration ->Statement : Statement - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { ->ClassExpression : ClassExpression ->ClassLikeDeclaration : ClassLikeDeclaration ->PrimaryExpression : PrimaryExpression - } - interface ClassElement extends Declaration { ->ClassElement : ClassElement ->Declaration : Declaration - - _classElementBrand: any; ->_classElementBrand : any - } - interface InterfaceDeclaration extends Declaration, ModuleElement { ->InterfaceDeclaration : InterfaceDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - typeParameters?: NodeArray; ->typeParameters : NodeArray ->NodeArray : NodeArray ->TypeParameterDeclaration : TypeParameterDeclaration - - heritageClauses?: NodeArray; ->heritageClauses : NodeArray ->NodeArray : NodeArray ->HeritageClause : HeritageClause - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->Declaration : Declaration - } - interface HeritageClause extends Node { ->HeritageClause : HeritageClause ->Node : Node - - token: SyntaxKind; ->token : SyntaxKind ->SyntaxKind : SyntaxKind - - types?: NodeArray; ->types : NodeArray ->NodeArray : NodeArray ->HeritageClauseElement : HeritageClauseElement - } - interface TypeAliasDeclaration extends Declaration, ModuleElement { ->TypeAliasDeclaration : TypeAliasDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - type: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface EnumMember extends Declaration { ->EnumMember : EnumMember ->Declaration : Declaration - - name: DeclarationName; ->name : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern ->DeclarationName : Identifier | LiteralExpression | ComputedPropertyName | BindingPattern - - initializer?: Expression; ->initializer : Expression ->Expression : Expression - } - interface EnumDeclaration extends Declaration, ModuleElement { ->EnumDeclaration : EnumDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - members: NodeArray; ->members : NodeArray ->NodeArray : NodeArray ->EnumMember : EnumMember - } - interface ModuleDeclaration extends Declaration, ModuleElement { ->ModuleDeclaration : ModuleDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier | LiteralExpression; ->name : Identifier | LiteralExpression ->Identifier : Identifier ->LiteralExpression : LiteralExpression - - body: ModuleBlock | ModuleDeclaration; ->body : ModuleDeclaration | ModuleBlock ->ModuleBlock : ModuleBlock ->ModuleDeclaration : ModuleDeclaration - } - interface ModuleBlock extends Node, ModuleElement { ->ModuleBlock : ModuleBlock ->Node : Node ->ModuleElement : ModuleElement - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - } - interface ImportEqualsDeclaration extends Declaration, ModuleElement { ->ImportEqualsDeclaration : ImportEqualsDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - name: Identifier; ->name : Identifier ->Identifier : Identifier - - moduleReference: EntityName | ExternalModuleReference; ->moduleReference : Identifier | QualifiedName | ExternalModuleReference ->EntityName : Identifier | QualifiedName ->ExternalModuleReference : ExternalModuleReference - } - interface ExternalModuleReference extends Node { ->ExternalModuleReference : ExternalModuleReference ->Node : Node - - expression?: Expression; ->expression : Expression ->Expression : Expression - } - interface ImportDeclaration extends ModuleElement { ->ImportDeclaration : ImportDeclaration ->ModuleElement : ModuleElement - - importClause?: ImportClause; ->importClause : ImportClause ->ImportClause : ImportClause - - moduleSpecifier: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface ImportClause extends Declaration { ->ImportClause : ImportClause ->Declaration : Declaration - - name?: Identifier; ->name : Identifier ->Identifier : Identifier - - namedBindings?: NamespaceImport | NamedImports; ->namedBindings : NamespaceImport | NamedImportsOrExports ->NamespaceImport : NamespaceImport ->NamedImports : NamedImportsOrExports - } - interface NamespaceImport extends Declaration { ->NamespaceImport : NamespaceImport ->Declaration : Declaration - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - interface ExportDeclaration extends Declaration, ModuleElement { ->ExportDeclaration : ExportDeclaration ->Declaration : Declaration ->ModuleElement : ModuleElement - - exportClause?: NamedExports; ->exportClause : NamedImportsOrExports ->NamedExports : NamedImportsOrExports - - moduleSpecifier?: Expression; ->moduleSpecifier : Expression ->Expression : Expression - } - interface NamedImportsOrExports extends Node { ->NamedImportsOrExports : NamedImportsOrExports ->Node : Node - - elements: NodeArray; ->elements : NodeArray ->NodeArray : NodeArray ->ImportOrExportSpecifier : ImportOrExportSpecifier - } - type NamedImports = NamedImportsOrExports; ->NamedImports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - type NamedExports = NamedImportsOrExports; ->NamedExports : NamedImportsOrExports ->NamedImportsOrExports : NamedImportsOrExports - - interface ImportOrExportSpecifier extends Declaration { ->ImportOrExportSpecifier : ImportOrExportSpecifier ->Declaration : Declaration - - propertyName?: Identifier; ->propertyName : Identifier ->Identifier : Identifier - - name: Identifier; ->name : Identifier ->Identifier : Identifier - } - type ImportSpecifier = ImportOrExportSpecifier; ->ImportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - type ExportSpecifier = ImportOrExportSpecifier; ->ExportSpecifier : ImportOrExportSpecifier ->ImportOrExportSpecifier : ImportOrExportSpecifier - - interface ExportAssignment extends Declaration, ModuleElement { ->ExportAssignment : ExportAssignment ->Declaration : Declaration ->ModuleElement : ModuleElement - - isExportEquals?: boolean; ->isExportEquals : boolean - - expression?: Expression; ->expression : Expression ->Expression : Expression - - type?: TypeNode; ->type : TypeNode ->TypeNode : TypeNode - } - interface FileReference extends TextRange { ->FileReference : FileReference ->TextRange : TextRange - - fileName: string; ->fileName : string - } - interface CommentRange extends TextRange { ->CommentRange : CommentRange ->TextRange : TextRange - - hasTrailingNewLine?: boolean; ->hasTrailingNewLine : boolean - - kind: SyntaxKind; ->kind : SyntaxKind ->SyntaxKind : SyntaxKind - } - interface SourceFile extends Declaration { ->SourceFile : SourceFile ->Declaration : Declaration - - statements: NodeArray; ->statements : NodeArray ->NodeArray : NodeArray ->ModuleElement : ModuleElement - - endOfFileToken: Node; ->endOfFileToken : Node ->Node : Node - - fileName: string; ->fileName : string - - text: string; ->text : string - - amdDependencies: { ->amdDependencies : { path: string; name: string; }[] - - path: string; ->path : string - - name: string; ->name : string - - }[]; - amdModuleName: string; ->amdModuleName : string - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - hasNoDefaultLib: boolean; ->hasNoDefaultLib : boolean - - externalModuleIndicator: Node; ->externalModuleIndicator : Node ->Node : Node - - languageVersion: ScriptTarget; ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - identifiers: Map; ->identifiers : Map ->Map : Map - } - interface ScriptReferenceHost { ->ScriptReferenceHost : ScriptReferenceHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - } - interface WriteFileCallback { ->WriteFileCallback : WriteFileCallback - - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; ->fileName : string ->data : string ->writeByteOrderMark : boolean ->onError : (message: string) => void ->message : string - } - interface Program extends ScriptReferenceHost { ->Program : Program ->ScriptReferenceHost : ScriptReferenceHost - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; ->emit : (targetSourceFile?: SourceFile, writeFile?: WriteFileCallback) => EmitResult ->targetSourceFile : SourceFile ->SourceFile : SourceFile ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback ->EmitResult : EmitResult - - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSyntacticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getGlobalDiagnostics(): Diagnostic[]; ->getGlobalDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getSemanticDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; ->getDeclarationDiagnostics : (sourceFile?: SourceFile) => Diagnostic[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Diagnostic : Diagnostic - - getTypeChecker(): TypeChecker; ->getTypeChecker : () => TypeChecker ->TypeChecker : TypeChecker - - getCommonSourceDirectory(): string; ->getCommonSourceDirectory : () => string - } - interface SourceMapSpan { ->SourceMapSpan : SourceMapSpan - - emittedLine: number; ->emittedLine : number - - emittedColumn: number; ->emittedColumn : number - - sourceLine: number; ->sourceLine : number - - sourceColumn: number; ->sourceColumn : number - - nameIndex?: number; ->nameIndex : number - - sourceIndex: number; ->sourceIndex : number - } - interface SourceMapData { ->SourceMapData : SourceMapData - - sourceMapFilePath: string; ->sourceMapFilePath : string - - jsSourceMappingURL: string; ->jsSourceMappingURL : string - - sourceMapFile: string; ->sourceMapFile : string - - sourceMapSourceRoot: string; ->sourceMapSourceRoot : string - - sourceMapSources: string[]; ->sourceMapSources : string[] - - inputSourceFileNames: string[]; ->inputSourceFileNames : string[] - - sourceMapNames?: string[]; ->sourceMapNames : string[] - - sourceMapMappings: string; ->sourceMapMappings : string - - sourceMapDecodedMappings: SourceMapSpan[]; ->sourceMapDecodedMappings : SourceMapSpan[] ->SourceMapSpan : SourceMapSpan - } - enum ExitStatus { ->ExitStatus : ExitStatus - - Success = 0, ->Success : ExitStatus - - DiagnosticsPresent_OutputsSkipped = 1, ->DiagnosticsPresent_OutputsSkipped : ExitStatus - - DiagnosticsPresent_OutputsGenerated = 2, ->DiagnosticsPresent_OutputsGenerated : ExitStatus - } - interface EmitResult { ->EmitResult : EmitResult - - emitSkipped: boolean; ->emitSkipped : boolean - - diagnostics: Diagnostic[]; ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - sourceMaps: SourceMapData[]; ->sourceMaps : SourceMapData[] ->SourceMapData : SourceMapData - } - interface TypeCheckerHost { ->TypeCheckerHost : TypeCheckerHost - - getCompilerOptions(): CompilerOptions; ->getCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getSourceFiles(): SourceFile[]; ->getSourceFiles : () => SourceFile[] ->SourceFile : SourceFile - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - } - interface TypeChecker { ->TypeChecker : TypeChecker - - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; ->getTypeOfSymbolAtLocation : (symbol: Symbol, node: Node) => Type ->symbol : Symbol ->Symbol : Symbol ->node : Node ->Node : Node ->Type : Type - - getDeclaredTypeOfSymbol(symbol: Symbol): Type; ->getDeclaredTypeOfSymbol : (symbol: Symbol) => Type ->symbol : Symbol ->Symbol : Symbol ->Type : Type - - getPropertiesOfType(type: Type): Symbol[]; ->getPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getPropertyOfType(type: Type, propertyName: string): Symbol; ->getPropertyOfType : (type: Type, propertyName: string) => Symbol ->type : Type ->Type : Type ->propertyName : string ->Symbol : Symbol - - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; ->getSignaturesOfType : (type: Type, kind: SignatureKind) => Signature[] ->type : Type ->Type : Type ->kind : SignatureKind ->SignatureKind : SignatureKind ->Signature : Signature - - getIndexTypeOfType(type: Type, kind: IndexKind): Type; ->getIndexTypeOfType : (type: Type, kind: IndexKind) => Type ->type : Type ->Type : Type ->kind : IndexKind ->IndexKind : IndexKind ->Type : Type - - getReturnTypeOfSignature(signature: Signature): Type; ->getReturnTypeOfSignature : (signature: Signature) => Type ->signature : Signature ->Signature : Signature ->Type : Type - - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; ->getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[] ->location : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->Symbol : Symbol - - getSymbolAtLocation(node: Node): Symbol; ->getSymbolAtLocation : (node: Node) => Symbol ->node : Node ->Node : Node ->Symbol : Symbol - - getShorthandAssignmentValueSymbol(location: Node): Symbol; ->getShorthandAssignmentValueSymbol : (location: Node) => Symbol ->location : Node ->Node : Node ->Symbol : Symbol - - getTypeAtLocation(node: Node): Type; ->getTypeAtLocation : (node: Node) => Type ->node : Node ->Node : Node ->Type : Type - - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; ->typeToString : (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => string ->type : Type ->Type : Type ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; ->symbolToString : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => string ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - - getSymbolDisplayBuilder(): SymbolDisplayBuilder; ->getSymbolDisplayBuilder : () => SymbolDisplayBuilder ->SymbolDisplayBuilder : SymbolDisplayBuilder - - getFullyQualifiedName(symbol: Symbol): string; ->getFullyQualifiedName : (symbol: Symbol) => string ->symbol : Symbol ->Symbol : Symbol - - getAugmentedPropertiesOfType(type: Type): Symbol[]; ->getAugmentedPropertiesOfType : (type: Type) => Symbol[] ->type : Type ->Type : Type ->Symbol : Symbol - - getRootSymbols(symbol: Symbol): Symbol[]; ->getRootSymbols : (symbol: Symbol) => Symbol[] ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getContextualType(node: Expression): Type; ->getContextualType : (node: Expression) => Type ->node : Expression ->Expression : Expression ->Type : Type - - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; ->getResolvedSignature : (node: CallExpression | NewExpression | TaggedTemplateExpression, candidatesOutArray?: Signature[]) => Signature ->node : CallExpression | NewExpression | TaggedTemplateExpression ->CallLikeExpression : CallExpression | NewExpression | TaggedTemplateExpression ->candidatesOutArray : Signature[] ->Signature : Signature ->Signature : Signature - - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; ->getSignatureFromDeclaration : (declaration: SignatureDeclaration) => Signature ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->Signature : Signature - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - isUndefinedSymbol(symbol: Symbol): boolean; ->isUndefinedSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - isArgumentsSymbol(symbol: Symbol): boolean; ->isArgumentsSymbol : (symbol: Symbol) => boolean ->symbol : Symbol ->Symbol : Symbol - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; ->isValidPropertyAccess : (node: QualifiedName | PropertyAccessExpression, propertyName: string) => boolean ->node : QualifiedName | PropertyAccessExpression ->PropertyAccessExpression : PropertyAccessExpression ->QualifiedName : QualifiedName ->propertyName : string - - getAliasedSymbol(symbol: Symbol): Symbol; ->getAliasedSymbol : (symbol: Symbol) => Symbol ->symbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; ->getExportsOfModule : (moduleSymbol: Symbol) => Symbol[] ->moduleSymbol : Symbol ->Symbol : Symbol ->Symbol : Symbol - } - interface SymbolDisplayBuilder { ->SymbolDisplayBuilder : SymbolDisplayBuilder - - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeDisplay : (type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->type : Type ->Type : Type ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; ->buildSymbolDisplay : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->flags : SymbolFormatFlags ->SymbolFormatFlags : SymbolFormatFlags - - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildSignatureDisplay : (signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signatures : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildParameterDisplay : (parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameter : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplay : (tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->tp : TypeParameter ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; ->buildTypeParameterDisplayFromSymbol : (symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) => void ->symbol : Symbol ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaraiton : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForParametersAndDelimiters : (parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->parameters : Symbol[] ->Symbol : Symbol ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildDisplayForTypeParametersAndDelimiters : (typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; ->buildReturnTypeDisplay : (signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void ->signature : Signature ->Signature : Signature ->writer : SymbolWriter ->SymbolWriter : SymbolWriter ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags - } - interface SymbolWriter { ->SymbolWriter : SymbolWriter - - writeKeyword(text: string): void; ->writeKeyword : (text: string) => void ->text : string - - writeOperator(text: string): void; ->writeOperator : (text: string) => void ->text : string - - writePunctuation(text: string): void; ->writePunctuation : (text: string) => void ->text : string - - writeSpace(text: string): void; ->writeSpace : (text: string) => void ->text : string - - writeStringLiteral(text: string): void; ->writeStringLiteral : (text: string) => void ->text : string - - writeParameter(text: string): void; ->writeParameter : (text: string) => void ->text : string - - writeSymbol(text: string, symbol: Symbol): void; ->writeSymbol : (text: string, symbol: Symbol) => void ->text : string ->symbol : Symbol ->Symbol : Symbol - - writeLine(): void; ->writeLine : () => void - - increaseIndent(): void; ->increaseIndent : () => void - - decreaseIndent(): void; ->decreaseIndent : () => void - - clear(): void; ->clear : () => void - - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; ->trackSymbol : (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) => void ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags - } - const enum TypeFormatFlags { ->TypeFormatFlags : TypeFormatFlags - - None = 0, ->None : TypeFormatFlags - - WriteArrayAsGenericType = 1, ->WriteArrayAsGenericType : TypeFormatFlags - - UseTypeOfFunction = 2, ->UseTypeOfFunction : TypeFormatFlags - - NoTruncation = 4, ->NoTruncation : TypeFormatFlags - - WriteArrowStyleSignature = 8, ->WriteArrowStyleSignature : TypeFormatFlags - - WriteOwnNameForAnyLike = 16, ->WriteOwnNameForAnyLike : TypeFormatFlags - - WriteTypeArgumentsOfSignature = 32, ->WriteTypeArgumentsOfSignature : TypeFormatFlags - - InElementType = 64, ->InElementType : TypeFormatFlags - - UseFullyQualifiedType = 128, ->UseFullyQualifiedType : TypeFormatFlags - } - const enum SymbolFormatFlags { ->SymbolFormatFlags : SymbolFormatFlags - - None = 0, ->None : SymbolFormatFlags - - WriteTypeParametersOrArguments = 1, ->WriteTypeParametersOrArguments : SymbolFormatFlags - - UseOnlyExternalAliasing = 2, ->UseOnlyExternalAliasing : SymbolFormatFlags - } - const enum SymbolAccessibility { ->SymbolAccessibility : SymbolAccessibility - - Accessible = 0, ->Accessible : SymbolAccessibility - - NotAccessible = 1, ->NotAccessible : SymbolAccessibility - - CannotBeNamed = 2, ->CannotBeNamed : SymbolAccessibility - } - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration ->ImportDeclaration : ImportDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - interface SymbolVisibilityResult { ->SymbolVisibilityResult : SymbolVisibilityResult - - accessibility: SymbolAccessibility; ->accessibility : SymbolAccessibility ->SymbolAccessibility : SymbolAccessibility - - aliasesToMakeVisible?: AnyImportSyntax[]; ->aliasesToMakeVisible : (ImportEqualsDeclaration | ImportDeclaration)[] ->AnyImportSyntax : ImportEqualsDeclaration | ImportDeclaration - - errorSymbolName?: string; ->errorSymbolName : string - - errorNode?: Node; ->errorNode : Node ->Node : Node - } - interface SymbolAccessiblityResult extends SymbolVisibilityResult { ->SymbolAccessiblityResult : SymbolAccessiblityResult ->SymbolVisibilityResult : SymbolVisibilityResult - - errorModuleName?: string; ->errorModuleName : string - } - interface EmitResolver { ->EmitResolver : EmitResolver - - hasGlobalName(name: string): boolean; ->hasGlobalName : (name: string) => boolean ->name : string - - getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; ->getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string ->node : Identifier ->Identifier : Identifier ->getGeneratedNameForNode : (node: Node) => string ->node : Node ->Node : Node - - isValueAliasDeclaration(node: Node): boolean; ->isValueAliasDeclaration : (node: Node) => boolean ->node : Node ->Node : Node - - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; ->isReferencedAliasDeclaration : (node: Node, checkChildren?: boolean) => boolean ->node : Node ->Node : Node ->checkChildren : boolean - - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; ->isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean ->node : ImportEqualsDeclaration ->ImportEqualsDeclaration : ImportEqualsDeclaration - - getNodeCheckFlags(node: Node): NodeCheckFlags; ->getNodeCheckFlags : (node: Node) => NodeCheckFlags ->node : Node ->Node : Node ->NodeCheckFlags : NodeCheckFlags - - isDeclarationVisible(node: Declaration): boolean; ->isDeclarationVisible : (node: Declaration) => boolean ->node : Declaration ->Declaration : Declaration - - collectLinkedAliases(node: Identifier): Node[]; ->collectLinkedAliases : (node: Identifier) => Node[] ->node : Identifier ->Identifier : Identifier ->Node : Node - - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; ->isImplementationOfOverload : (node: FunctionLikeDeclaration) => boolean ->node : FunctionLikeDeclaration ->FunctionLikeDeclaration : FunctionLikeDeclaration - - writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfDeclaration : (declaration: VariableLikeDeclaration | AccessorDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->declaration : VariableLikeDeclaration | AccessorDeclaration ->AccessorDeclaration : AccessorDeclaration ->VariableLikeDeclaration : VariableLikeDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeReturnTypeOfSignatureDeclaration : (signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->signatureDeclaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; ->writeTypeOfExpression : (expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) => void ->expr : Expression ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->flags : TypeFormatFlags ->TypeFormatFlags : TypeFormatFlags ->writer : SymbolWriter ->SymbolWriter : SymbolWriter - - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; ->isSymbolAccessible : (symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) => SymbolAccessiblityResult ->symbol : Symbol ->Symbol : Symbol ->enclosingDeclaration : Node ->Node : Node ->meaning : SymbolFlags ->SymbolFlags : SymbolFlags ->SymbolAccessiblityResult : SymbolAccessiblityResult - - isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | Expression | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | Expression | QualifiedName ->EntityName : Identifier | QualifiedName ->Expression : Expression ->enclosingDeclaration : Node ->Node : Node ->SymbolVisibilityResult : SymbolVisibilityResult - - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; ->getConstantValue : (node: PropertyAccessExpression | ElementAccessExpression | EnumMember) => number ->node : PropertyAccessExpression | ElementAccessExpression | EnumMember ->EnumMember : EnumMember ->PropertyAccessExpression : PropertyAccessExpression ->ElementAccessExpression : ElementAccessExpression - - resolvesToSomeValue(location: Node, name: string): boolean; ->resolvesToSomeValue : (location: Node, name: string) => boolean ->location : Node ->Node : Node ->name : string - - getBlockScopedVariableId(node: Identifier): number; ->getBlockScopedVariableId : (node: Identifier) => number ->node : Identifier ->Identifier : Identifier - } - const enum SymbolFlags { ->SymbolFlags : SymbolFlags - - FunctionScopedVariable = 1, ->FunctionScopedVariable : SymbolFlags - - BlockScopedVariable = 2, ->BlockScopedVariable : SymbolFlags - - Property = 4, ->Property : SymbolFlags - - EnumMember = 8, ->EnumMember : SymbolFlags - - Function = 16, ->Function : SymbolFlags - - Class = 32, ->Class : SymbolFlags - - Interface = 64, ->Interface : SymbolFlags - - ConstEnum = 128, ->ConstEnum : SymbolFlags - - RegularEnum = 256, ->RegularEnum : SymbolFlags - - ValueModule = 512, ->ValueModule : SymbolFlags - - NamespaceModule = 1024, ->NamespaceModule : SymbolFlags - - TypeLiteral = 2048, ->TypeLiteral : SymbolFlags - - ObjectLiteral = 4096, ->ObjectLiteral : SymbolFlags - - Method = 8192, ->Method : SymbolFlags - - Constructor = 16384, ->Constructor : SymbolFlags - - GetAccessor = 32768, ->GetAccessor : SymbolFlags - - SetAccessor = 65536, ->SetAccessor : SymbolFlags - - Signature = 131072, ->Signature : SymbolFlags - - TypeParameter = 262144, ->TypeParameter : SymbolFlags - - TypeAlias = 524288, ->TypeAlias : SymbolFlags - - ExportValue = 1048576, ->ExportValue : SymbolFlags - - ExportType = 2097152, ->ExportType : SymbolFlags - - ExportNamespace = 4194304, ->ExportNamespace : SymbolFlags - - Alias = 8388608, ->Alias : SymbolFlags - - Instantiated = 16777216, ->Instantiated : SymbolFlags - - Merged = 33554432, ->Merged : SymbolFlags - - Transient = 67108864, ->Transient : SymbolFlags - - Prototype = 134217728, ->Prototype : SymbolFlags - - UnionProperty = 268435456, ->UnionProperty : SymbolFlags - - Optional = 536870912, ->Optional : SymbolFlags - - ExportStar = 1073741824, ->ExportStar : SymbolFlags - - Enum = 384, ->Enum : SymbolFlags - - Variable = 3, ->Variable : SymbolFlags - - Value = 107455, ->Value : SymbolFlags - - Type = 793056, ->Type : SymbolFlags - - Namespace = 1536, ->Namespace : SymbolFlags - - Module = 1536, ->Module : SymbolFlags - - Accessor = 98304, ->Accessor : SymbolFlags - - FunctionScopedVariableExcludes = 107454, ->FunctionScopedVariableExcludes : SymbolFlags - - BlockScopedVariableExcludes = 107455, ->BlockScopedVariableExcludes : SymbolFlags - - ParameterExcludes = 107455, ->ParameterExcludes : SymbolFlags - - PropertyExcludes = 107455, ->PropertyExcludes : SymbolFlags - - EnumMemberExcludes = 107455, ->EnumMemberExcludes : SymbolFlags - - FunctionExcludes = 106927, ->FunctionExcludes : SymbolFlags - - ClassExcludes = 899583, ->ClassExcludes : SymbolFlags - - InterfaceExcludes = 792992, ->InterfaceExcludes : SymbolFlags - - RegularEnumExcludes = 899327, ->RegularEnumExcludes : SymbolFlags - - ConstEnumExcludes = 899967, ->ConstEnumExcludes : SymbolFlags - - ValueModuleExcludes = 106639, ->ValueModuleExcludes : SymbolFlags - - NamespaceModuleExcludes = 0, ->NamespaceModuleExcludes : SymbolFlags - - MethodExcludes = 99263, ->MethodExcludes : SymbolFlags - - GetAccessorExcludes = 41919, ->GetAccessorExcludes : SymbolFlags - - SetAccessorExcludes = 74687, ->SetAccessorExcludes : SymbolFlags - - TypeParameterExcludes = 530912, ->TypeParameterExcludes : SymbolFlags - - TypeAliasExcludes = 793056, ->TypeAliasExcludes : SymbolFlags - - AliasExcludes = 8388608, ->AliasExcludes : SymbolFlags - - ModuleMember = 8914931, ->ModuleMember : SymbolFlags - - ExportHasLocal = 944, ->ExportHasLocal : SymbolFlags - - HasLocals = 255504, ->HasLocals : SymbolFlags - - HasExports = 1952, ->HasExports : SymbolFlags - - HasMembers = 6240, ->HasMembers : SymbolFlags - - IsContainer = 262128, ->IsContainer : SymbolFlags - - PropertyOrAccessor = 98308, ->PropertyOrAccessor : SymbolFlags - - Export = 7340032, ->Export : SymbolFlags - } - interface Symbol { ->Symbol : Symbol - - flags: SymbolFlags; ->flags : SymbolFlags ->SymbolFlags : SymbolFlags - - name: string; ->name : string - - id?: number; ->id : number - - mergeId?: number; ->mergeId : number - - declarations?: Declaration[]; ->declarations : Declaration[] ->Declaration : Declaration - - parent?: Symbol; ->parent : Symbol ->Symbol : Symbol - - members?: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - exports?: SymbolTable; ->exports : SymbolTable ->SymbolTable : SymbolTable - - exportSymbol?: Symbol; ->exportSymbol : Symbol ->Symbol : Symbol - - valueDeclaration?: Declaration; ->valueDeclaration : Declaration ->Declaration : Declaration - - constEnumOnlyModule?: boolean; ->constEnumOnlyModule : boolean - } - interface SymbolLinks { ->SymbolLinks : SymbolLinks - - target?: Symbol; ->target : Symbol ->Symbol : Symbol - - type?: Type; ->type : Type ->Type : Type - - declaredType?: Type; ->declaredType : Type ->Type : Type - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - referenced?: boolean; ->referenced : boolean - - unionType?: UnionType; ->unionType : UnionType ->UnionType : UnionType - - resolvedExports?: SymbolTable; ->resolvedExports : SymbolTable ->SymbolTable : SymbolTable - - exportsChecked?: boolean; ->exportsChecked : boolean - } - interface TransientSymbol extends Symbol, SymbolLinks { ->TransientSymbol : TransientSymbol ->Symbol : Symbol ->SymbolLinks : SymbolLinks - } - interface SymbolTable { ->SymbolTable : SymbolTable - - [index: string]: Symbol; ->index : string ->Symbol : Symbol - } - const enum NodeCheckFlags { ->NodeCheckFlags : NodeCheckFlags - - TypeChecked = 1, ->TypeChecked : NodeCheckFlags - - LexicalThis = 2, ->LexicalThis : NodeCheckFlags - - CaptureThis = 4, ->CaptureThis : NodeCheckFlags - - EmitExtends = 8, ->EmitExtends : NodeCheckFlags - - SuperInstance = 16, ->SuperInstance : NodeCheckFlags - - SuperStatic = 32, ->SuperStatic : NodeCheckFlags - - ContextChecked = 64, ->ContextChecked : NodeCheckFlags - - EnumValuesComputed = 128, ->EnumValuesComputed : NodeCheckFlags - - BlockScopedBindingInLoop = 256, ->BlockScopedBindingInLoop : NodeCheckFlags - - EmitDecorate = 512, ->EmitDecorate : NodeCheckFlags - } - interface NodeLinks { ->NodeLinks : NodeLinks - - resolvedType?: Type; ->resolvedType : Type ->Type : Type - - resolvedSignature?: Signature; ->resolvedSignature : Signature ->Signature : Signature - - resolvedSymbol?: Symbol; ->resolvedSymbol : Symbol ->Symbol : Symbol - - flags?: NodeCheckFlags; ->flags : NodeCheckFlags ->NodeCheckFlags : NodeCheckFlags - - enumMemberValue?: number; ->enumMemberValue : number - - isIllegalTypeReferenceInConstraint?: boolean; ->isIllegalTypeReferenceInConstraint : boolean - - isVisible?: boolean; ->isVisible : boolean - - generatedName?: string; ->generatedName : string - - generatedNames?: Map; ->generatedNames : Map ->Map : Map - - assignmentChecks?: Map; ->assignmentChecks : Map ->Map : Map - - hasReportedStatementInAmbientContext?: boolean; ->hasReportedStatementInAmbientContext : boolean - - importOnRightSide?: Symbol; ->importOnRightSide : Symbol ->Symbol : Symbol - } - const enum TypeFlags { ->TypeFlags : TypeFlags - - Any = 1, ->Any : TypeFlags - - String = 2, ->String : TypeFlags - - Number = 4, ->Number : TypeFlags - - Boolean = 8, ->Boolean : TypeFlags - - Void = 16, ->Void : TypeFlags - - Undefined = 32, ->Undefined : TypeFlags - - Null = 64, ->Null : TypeFlags - - Enum = 128, ->Enum : TypeFlags - - StringLiteral = 256, ->StringLiteral : TypeFlags - - TypeParameter = 512, ->TypeParameter : TypeFlags - - Class = 1024, ->Class : TypeFlags - - Interface = 2048, ->Interface : TypeFlags - - Reference = 4096, ->Reference : TypeFlags - - Tuple = 8192, ->Tuple : TypeFlags - - Union = 16384, ->Union : TypeFlags - - Anonymous = 32768, ->Anonymous : TypeFlags - - FromSignature = 65536, ->FromSignature : TypeFlags - - ObjectLiteral = 131072, ->ObjectLiteral : TypeFlags - - ContainsUndefinedOrNull = 262144, ->ContainsUndefinedOrNull : TypeFlags - - ContainsObjectLiteral = 524288, ->ContainsObjectLiteral : TypeFlags - - ESSymbol = 1048576, ->ESSymbol : TypeFlags - - Intrinsic = 1048703, ->Intrinsic : TypeFlags - - Primitive = 1049086, ->Primitive : TypeFlags - - StringLike = 258, ->StringLike : TypeFlags - - NumberLike = 132, ->NumberLike : TypeFlags - - ObjectType = 48128, ->ObjectType : TypeFlags - - RequiresWidening = 786432, ->RequiresWidening : TypeFlags - } - interface Type { ->Type : Type - - flags: TypeFlags; ->flags : TypeFlags ->TypeFlags : TypeFlags - - id: number; ->id : number - - symbol?: Symbol; ->symbol : Symbol ->Symbol : Symbol - } - interface IntrinsicType extends Type { ->IntrinsicType : IntrinsicType ->Type : Type - - intrinsicName: string; ->intrinsicName : string - } - interface StringLiteralType extends Type { ->StringLiteralType : StringLiteralType ->Type : Type - - text: string; ->text : string - } - interface ObjectType extends Type { ->ObjectType : ObjectType ->Type : Type - } - interface InterfaceType extends ObjectType { ->InterfaceType : InterfaceType ->ObjectType : ObjectType - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - baseTypes: ObjectType[]; ->baseTypes : ObjectType[] ->ObjectType : ObjectType - - declaredProperties: Symbol[]; ->declaredProperties : Symbol[] ->Symbol : Symbol - - declaredCallSignatures: Signature[]; ->declaredCallSignatures : Signature[] ->Signature : Signature - - declaredConstructSignatures: Signature[]; ->declaredConstructSignatures : Signature[] ->Signature : Signature - - declaredStringIndexType: Type; ->declaredStringIndexType : Type ->Type : Type - - declaredNumberIndexType: Type; ->declaredNumberIndexType : Type ->Type : Type - } - interface TypeReference extends ObjectType { ->TypeReference : TypeReference ->ObjectType : ObjectType - - target: GenericType; ->target : GenericType ->GenericType : GenericType - - typeArguments: Type[]; ->typeArguments : Type[] ->Type : Type - } - interface GenericType extends InterfaceType, TypeReference { ->GenericType : GenericType ->InterfaceType : InterfaceType ->TypeReference : TypeReference - - instantiations: Map; ->instantiations : Map ->Map : Map ->TypeReference : TypeReference - } - interface TupleType extends ObjectType { ->TupleType : TupleType ->ObjectType : ObjectType - - elementTypes: Type[]; ->elementTypes : Type[] ->Type : Type - - baseArrayType: TypeReference; ->baseArrayType : TypeReference ->TypeReference : TypeReference - } - interface UnionType extends Type { ->UnionType : UnionType ->Type : Type - - types: Type[]; ->types : Type[] ->Type : Type - - resolvedProperties: SymbolTable; ->resolvedProperties : SymbolTable ->SymbolTable : SymbolTable - } - interface ResolvedType extends ObjectType, UnionType { ->ResolvedType : ResolvedType ->ObjectType : ObjectType ->UnionType : UnionType - - members: SymbolTable; ->members : SymbolTable ->SymbolTable : SymbolTable - - properties: Symbol[]; ->properties : Symbol[] ->Symbol : Symbol - - callSignatures: Signature[]; ->callSignatures : Signature[] ->Signature : Signature - - constructSignatures: Signature[]; ->constructSignatures : Signature[] ->Signature : Signature - - stringIndexType: Type; ->stringIndexType : Type ->Type : Type - - numberIndexType: Type; ->numberIndexType : Type ->Type : Type - } - interface TypeParameter extends Type { ->TypeParameter : TypeParameter ->Type : Type - - constraint: Type; ->constraint : Type ->Type : Type - - target?: TypeParameter; ->target : TypeParameter ->TypeParameter : TypeParameter - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - } - const enum SignatureKind { ->SignatureKind : SignatureKind - - Call = 0, ->Call : SignatureKind - - Construct = 1, ->Construct : SignatureKind - } - interface Signature { ->Signature : Signature - - declaration: SignatureDeclaration; ->declaration : SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - typeParameters: TypeParameter[]; ->typeParameters : TypeParameter[] ->TypeParameter : TypeParameter - - parameters: Symbol[]; ->parameters : Symbol[] ->Symbol : Symbol - - resolvedReturnType: Type; ->resolvedReturnType : Type ->Type : Type - - minArgumentCount: number; ->minArgumentCount : number - - hasRestParameter: boolean; ->hasRestParameter : boolean - - hasStringLiterals: boolean; ->hasStringLiterals : boolean - - target?: Signature; ->target : Signature ->Signature : Signature - - mapper?: TypeMapper; ->mapper : TypeMapper ->TypeMapper : TypeMapper - - unionSignatures?: Signature[]; ->unionSignatures : Signature[] ->Signature : Signature - - erasedSignatureCache?: Signature; ->erasedSignatureCache : Signature ->Signature : Signature - - isolatedSignatureType?: ObjectType; ->isolatedSignatureType : ObjectType ->ObjectType : ObjectType - } - const enum IndexKind { ->IndexKind : IndexKind - - String = 0, ->String : IndexKind - - Number = 1, ->Number : IndexKind - } - interface TypeMapper { ->TypeMapper : TypeMapper - - (t: Type): Type; ->t : Type ->Type : Type ->Type : Type - } - interface DiagnosticMessage { ->DiagnosticMessage : DiagnosticMessage - - key: string; ->key : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - interface DiagnosticMessageChain { ->DiagnosticMessageChain : DiagnosticMessageChain - - messageText: string; ->messageText : string - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - - next?: DiagnosticMessageChain; ->next : DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - } - interface Diagnostic { ->Diagnostic : Diagnostic - - file: SourceFile; ->file : SourceFile ->SourceFile : SourceFile - - start: number; ->start : number - - length: number; ->length : number - - messageText: string | DiagnosticMessageChain; ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain - - category: DiagnosticCategory; ->category : DiagnosticCategory ->DiagnosticCategory : DiagnosticCategory - - code: number; ->code : number - } - enum DiagnosticCategory { ->DiagnosticCategory : DiagnosticCategory - - Warning = 0, ->Warning : DiagnosticCategory - - Error = 1, ->Error : DiagnosticCategory - - Message = 2, ->Message : DiagnosticCategory - } - interface CompilerOptions { ->CompilerOptions : CompilerOptions - - allowNonTsExtensions?: boolean; ->allowNonTsExtensions : boolean - - charset?: string; ->charset : string - - declaration?: boolean; ->declaration : boolean - - diagnostics?: boolean; ->diagnostics : boolean - - emitBOM?: boolean; ->emitBOM : boolean - - help?: boolean; ->help : boolean - - listFiles?: boolean; ->listFiles : boolean - - locale?: string; ->locale : string - - mapRoot?: string; ->mapRoot : string - - module?: ModuleKind; ->module : ModuleKind ->ModuleKind : ModuleKind - - noEmit?: boolean; ->noEmit : boolean - - noEmitOnError?: boolean; ->noEmitOnError : boolean - - noErrorTruncation?: boolean; ->noErrorTruncation : boolean - - noImplicitAny?: boolean; ->noImplicitAny : boolean - - noLib?: boolean; ->noLib : boolean - - noResolve?: boolean; ->noResolve : boolean - - out?: string; ->out : string - - outDir?: string; ->outDir : string - - preserveConstEnums?: boolean; ->preserveConstEnums : boolean - - project?: string; ->project : string - - removeComments?: boolean; ->removeComments : boolean - - sourceMap?: boolean; ->sourceMap : boolean - - sourceRoot?: string; ->sourceRoot : string - - suppressImplicitAnyIndexErrors?: boolean; ->suppressImplicitAnyIndexErrors : boolean - - target?: ScriptTarget; ->target : ScriptTarget ->ScriptTarget : ScriptTarget - - version?: boolean; ->version : boolean - - watch?: boolean; ->watch : boolean - - separateCompilation?: boolean; ->separateCompilation : boolean - - [option: string]: string | number | boolean; ->option : string - } - const enum ModuleKind { ->ModuleKind : ModuleKind - - None = 0, ->None : ModuleKind - - CommonJS = 1, ->CommonJS : ModuleKind - - AMD = 2, ->AMD : ModuleKind - } - interface LineAndCharacter { ->LineAndCharacter : LineAndCharacter - - line: number; ->line : number - - character: number; ->character : number - } - const enum ScriptTarget { ->ScriptTarget : ScriptTarget - - ES3 = 0, ->ES3 : ScriptTarget - - ES5 = 1, ->ES5 : ScriptTarget - - ES6 = 2, ->ES6 : ScriptTarget - - Latest = 2, ->Latest : ScriptTarget - } - interface ParsedCommandLine { ->ParsedCommandLine : ParsedCommandLine - - options: CompilerOptions; ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - fileNames: string[]; ->fileNames : string[] - - errors: Diagnostic[]; ->errors : Diagnostic[] ->Diagnostic : Diagnostic - } - interface CommandLineOption { ->CommandLineOption : CommandLineOption - - name: string; ->name : string - - type: string | Map; ->type : string | Map ->Map : Map - - isFilePath?: boolean; ->isFilePath : boolean - - shortName?: string; ->shortName : string - - description?: DiagnosticMessage; ->description : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - paramType?: DiagnosticMessage; ->paramType : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - error?: DiagnosticMessage; ->error : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage - - experimental?: boolean; ->experimental : boolean - } - const enum CharacterCodes { ->CharacterCodes : CharacterCodes - - nullCharacter = 0, ->nullCharacter : CharacterCodes - - maxAsciiCharacter = 127, ->maxAsciiCharacter : CharacterCodes - - lineFeed = 10, ->lineFeed : CharacterCodes - - carriageReturn = 13, ->carriageReturn : CharacterCodes - - lineSeparator = 8232, ->lineSeparator : CharacterCodes - - paragraphSeparator = 8233, ->paragraphSeparator : CharacterCodes - - nextLine = 133, ->nextLine : CharacterCodes - - space = 32, ->space : CharacterCodes - - nonBreakingSpace = 160, ->nonBreakingSpace : CharacterCodes - - enQuad = 8192, ->enQuad : CharacterCodes - - emQuad = 8193, ->emQuad : CharacterCodes - - enSpace = 8194, ->enSpace : CharacterCodes - - emSpace = 8195, ->emSpace : CharacterCodes - - threePerEmSpace = 8196, ->threePerEmSpace : CharacterCodes - - fourPerEmSpace = 8197, ->fourPerEmSpace : CharacterCodes - - sixPerEmSpace = 8198, ->sixPerEmSpace : CharacterCodes - - figureSpace = 8199, ->figureSpace : CharacterCodes - - punctuationSpace = 8200, ->punctuationSpace : CharacterCodes - - thinSpace = 8201, ->thinSpace : CharacterCodes - - hairSpace = 8202, ->hairSpace : CharacterCodes - - zeroWidthSpace = 8203, ->zeroWidthSpace : CharacterCodes - - narrowNoBreakSpace = 8239, ->narrowNoBreakSpace : CharacterCodes - - ideographicSpace = 12288, ->ideographicSpace : CharacterCodes - - mathematicalSpace = 8287, ->mathematicalSpace : CharacterCodes - - ogham = 5760, ->ogham : CharacterCodes - - _ = 95, ->_ : CharacterCodes - - $ = 36, ->$ : CharacterCodes - - _0 = 48, ->_0 : CharacterCodes - - _1 = 49, ->_1 : CharacterCodes - - _2 = 50, ->_2 : CharacterCodes - - _3 = 51, ->_3 : CharacterCodes - - _4 = 52, ->_4 : CharacterCodes - - _5 = 53, ->_5 : CharacterCodes - - _6 = 54, ->_6 : CharacterCodes - - _7 = 55, ->_7 : CharacterCodes - - _8 = 56, ->_8 : CharacterCodes - - _9 = 57, ->_9 : CharacterCodes - - a = 97, ->a : CharacterCodes - - b = 98, ->b : CharacterCodes - - c = 99, ->c : CharacterCodes - - d = 100, ->d : CharacterCodes - - e = 101, ->e : CharacterCodes - - f = 102, ->f : CharacterCodes - - g = 103, ->g : CharacterCodes - - h = 104, ->h : CharacterCodes - - i = 105, ->i : CharacterCodes - - j = 106, ->j : CharacterCodes - - k = 107, ->k : CharacterCodes - - l = 108, ->l : CharacterCodes - - m = 109, ->m : CharacterCodes - - n = 110, ->n : CharacterCodes - - o = 111, ->o : CharacterCodes - - p = 112, ->p : CharacterCodes - - q = 113, ->q : CharacterCodes - - r = 114, ->r : CharacterCodes - - s = 115, ->s : CharacterCodes - - t = 116, ->t : CharacterCodes - - u = 117, ->u : CharacterCodes - - v = 118, ->v : CharacterCodes - - w = 119, ->w : CharacterCodes - - x = 120, ->x : CharacterCodes - - y = 121, ->y : CharacterCodes - - z = 122, ->z : CharacterCodes - - A = 65, ->A : CharacterCodes - - B = 66, ->B : CharacterCodes - - C = 67, ->C : CharacterCodes - - D = 68, ->D : CharacterCodes - - E = 69, ->E : CharacterCodes - - F = 70, ->F : CharacterCodes - - G = 71, ->G : CharacterCodes - - H = 72, ->H : CharacterCodes - - I = 73, ->I : CharacterCodes - - J = 74, ->J : CharacterCodes - - K = 75, ->K : CharacterCodes - - L = 76, ->L : CharacterCodes - - M = 77, ->M : CharacterCodes - - N = 78, ->N : CharacterCodes - - O = 79, ->O : CharacterCodes - - P = 80, ->P : CharacterCodes - - Q = 81, ->Q : CharacterCodes - - R = 82, ->R : CharacterCodes - - S = 83, ->S : CharacterCodes - - T = 84, ->T : CharacterCodes - - U = 85, ->U : CharacterCodes - - V = 86, ->V : CharacterCodes - - W = 87, ->W : CharacterCodes - - X = 88, ->X : CharacterCodes - - Y = 89, ->Y : CharacterCodes - - Z = 90, ->Z : CharacterCodes - - ampersand = 38, ->ampersand : CharacterCodes - - asterisk = 42, ->asterisk : CharacterCodes - - at = 64, ->at : CharacterCodes - - backslash = 92, ->backslash : CharacterCodes - - backtick = 96, ->backtick : CharacterCodes - - bar = 124, ->bar : CharacterCodes - - caret = 94, ->caret : CharacterCodes - - closeBrace = 125, ->closeBrace : CharacterCodes - - closeBracket = 93, ->closeBracket : CharacterCodes - - closeParen = 41, ->closeParen : CharacterCodes - - colon = 58, ->colon : CharacterCodes - - comma = 44, ->comma : CharacterCodes - - dot = 46, ->dot : CharacterCodes - - doubleQuote = 34, ->doubleQuote : CharacterCodes - - equals = 61, ->equals : CharacterCodes - - exclamation = 33, ->exclamation : CharacterCodes - - greaterThan = 62, ->greaterThan : CharacterCodes - - hash = 35, ->hash : CharacterCodes - - lessThan = 60, ->lessThan : CharacterCodes - - minus = 45, ->minus : CharacterCodes - - openBrace = 123, ->openBrace : CharacterCodes - - openBracket = 91, ->openBracket : CharacterCodes - - openParen = 40, ->openParen : CharacterCodes - - percent = 37, ->percent : CharacterCodes - - plus = 43, ->plus : CharacterCodes - - question = 63, ->question : CharacterCodes - - semicolon = 59, ->semicolon : CharacterCodes - - singleQuote = 39, ->singleQuote : CharacterCodes - - slash = 47, ->slash : CharacterCodes - - tilde = 126, ->tilde : CharacterCodes - - backspace = 8, ->backspace : CharacterCodes - - formFeed = 12, ->formFeed : CharacterCodes - - byteOrderMark = 65279, ->byteOrderMark : CharacterCodes - - tab = 9, ->tab : CharacterCodes - - verticalTab = 11, ->verticalTab : CharacterCodes - } - interface CancellationToken { ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - } - interface CompilerHost { ->CompilerHost : CompilerHost - - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; ->getSourceFile : (fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void) => SourceFile ->fileName : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->onError : (message: string) => void ->message : string ->SourceFile : SourceFile - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - writeFile: WriteFileCallback; ->writeFile : WriteFileCallback ->WriteFileCallback : WriteFileCallback - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getCanonicalFileName(fileName: string): string; ->getCanonicalFileName : (fileName: string) => string ->fileName : string - - useCaseSensitiveFileNames(): boolean; ->useCaseSensitiveFileNames : () => boolean - - getNewLine(): string; ->getNewLine : () => string - } - interface TextSpan { ->TextSpan : TextSpan - - start: number; ->start : number - - length: number; ->length : number - } - interface TextChangeRange { ->TextChangeRange : TextChangeRange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newLength: number; ->newLength : number - } -} -declare module "typescript" { - interface ErrorCallback { ->ErrorCallback : ErrorCallback - - (message: DiagnosticMessage, length: number): void; ->message : DiagnosticMessage ->DiagnosticMessage : DiagnosticMessage ->length : number - } - interface Scanner { ->Scanner : Scanner - - getStartPos(): number; ->getStartPos : () => number - - getToken(): SyntaxKind; ->getToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - getTextPos(): number; ->getTextPos : () => number - - getTokenPos(): number; ->getTokenPos : () => number - - getTokenText(): string; ->getTokenText : () => string - - getTokenValue(): string; ->getTokenValue : () => string - - hasExtendedUnicodeEscape(): boolean; ->hasExtendedUnicodeEscape : () => boolean - - hasPrecedingLineBreak(): boolean; ->hasPrecedingLineBreak : () => boolean - - isIdentifier(): boolean; ->isIdentifier : () => boolean - - isReservedWord(): boolean; ->isReservedWord : () => boolean - - isUnterminated(): boolean; ->isUnterminated : () => boolean - - reScanGreaterToken(): SyntaxKind; ->reScanGreaterToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanSlashToken(): SyntaxKind; ->reScanSlashToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - reScanTemplateToken(): SyntaxKind; ->reScanTemplateToken : () => SyntaxKind ->SyntaxKind : SyntaxKind - - scan(): SyntaxKind; ->scan : () => SyntaxKind ->SyntaxKind : SyntaxKind - - setText(text: string): void; ->setText : (text: string) => void ->text : string - - setTextPos(textPos: number): void; ->setTextPos : (textPos: number) => void ->textPos : number - - lookAhead(callback: () => T): T; ->lookAhead : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - - tryScan(callback: () => T): T; ->tryScan : (callback: () => T) => T ->T : T ->callback : () => T ->T : T ->T : T - } - function tokenToString(t: SyntaxKind): string; ->tokenToString : (t: SyntaxKind) => string ->t : SyntaxKind ->SyntaxKind : SyntaxKind - - function computeLineStarts(text: string): number[]; ->computeLineStarts : (text: string) => number[] ->text : string - - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; ->getPositionOfLineAndCharacter : (sourceFile: SourceFile, line: number, character: number) => number ->sourceFile : SourceFile ->SourceFile : SourceFile ->line : number ->character : number - - function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number; ->computePositionOfLineAndCharacter : (lineStarts: number[], line: number, character: number) => number ->lineStarts : number[] ->line : number ->character : number - - function getLineStarts(sourceFile: SourceFile): number[]; ->getLineStarts : (sourceFile: SourceFile) => number[] ->sourceFile : SourceFile ->SourceFile : SourceFile - - function computeLineAndCharacterOfPosition(lineStarts: number[], position: number): { ->computeLineAndCharacterOfPosition : (lineStarts: number[], position: number) => { line: number; character: number; } ->lineStarts : number[] ->position : number - - line: number; ->line : number - - character: number; ->character : number - - }; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (sourceFile: SourceFile, position: number) => LineAndCharacter ->sourceFile : SourceFile ->SourceFile : SourceFile ->position : number ->LineAndCharacter : LineAndCharacter - - function isWhiteSpace(ch: number): boolean; ->isWhiteSpace : (ch: number) => boolean ->ch : number - - function isLineBreak(ch: number): boolean; ->isLineBreak : (ch: number) => boolean ->ch : number - - function isOctalDigit(ch: number): boolean; ->isOctalDigit : (ch: number) => boolean ->ch : number - - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number; ->skipTrivia : (text: string, pos: number, stopAfterLineBreak?: boolean) => number ->text : string ->pos : number ->stopAfterLineBreak : boolean - - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; ->getLeadingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; ->getTrailingCommentRanges : (text: string, pos: number) => CommentRange[] ->text : string ->pos : number ->CommentRange : CommentRange - - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierStart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; ->isIdentifierPart : (ch: number, languageVersion: ScriptTarget) => boolean ->ch : number ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget - - function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner; ->createScanner : (languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback) => Scanner ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->skipTrivia : boolean ->text : string ->onError : ErrorCallback ->ErrorCallback : ErrorCallback ->Scanner : Scanner -} -declare module "typescript" { - function getNodeConstructor(kind: SyntaxKind): new () => Node; ->getNodeConstructor : (kind: SyntaxKind) => new () => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function createNode(kind: SyntaxKind): Node; ->createNode : (kind: SyntaxKind) => Node ->kind : SyntaxKind ->SyntaxKind : SyntaxKind ->Node : Node - - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; ->forEachChild : (node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T) => T ->T : T ->node : Node ->Node : Node ->cbNode : (node: Node) => T ->node : Node ->Node : Node ->T : T ->cbNodeArray : (nodes: Node[]) => T ->nodes : Node[] ->Node : Node ->T : T ->T : T - - function modifierToFlag(token: SyntaxKind): NodeFlags; ->modifierToFlag : (token: SyntaxKind) => NodeFlags ->token : SyntaxKind ->SyntaxKind : SyntaxKind ->NodeFlags : NodeFlags - - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateSourceFile : (sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function isEvalOrArgumentsIdentifier(node: Node): boolean; ->isEvalOrArgumentsIdentifier : (node: Node) => boolean ->node : Node ->Node : Node - - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean) => SourceFile ->fileName : string ->sourceText : string ->languageVersion : ScriptTarget ->ScriptTarget : ScriptTarget ->setParentNodes : boolean ->SourceFile : SourceFile - - function isLeftHandSideExpression(expr: Expression): boolean; ->isLeftHandSideExpression : (expr: Expression) => boolean ->expr : Expression ->Expression : Expression - - function isAssignmentOperator(token: SyntaxKind): boolean; ->isAssignmentOperator : (token: SyntaxKind) => boolean ->token : SyntaxKind ->SyntaxKind : SyntaxKind -} -declare module "typescript" { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; ->createTypeChecker : (host: TypeCheckerHost, produceDiagnostics: boolean) => TypeChecker ->host : TypeCheckerHost ->TypeCheckerHost : TypeCheckerHost ->produceDiagnostics : boolean ->TypeChecker : TypeChecker -} -declare module "typescript" { - /** The version of the TypeScript compiler release */ - let version: string; ->version : string - - function findConfigFile(searchPath: string): string; ->findConfigFile : (searchPath: string) => string ->searchPath : string - - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; ->createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->setParentNodes : boolean ->CompilerHost : CompilerHost - - function getPreEmitDiagnostics(program: Program): Diagnostic[]; ->getPreEmitDiagnostics : (program: Program) => Diagnostic[] ->program : Program ->Program : Program ->Diagnostic : Diagnostic - - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; ->flattenDiagnosticMessageText : (messageText: string | DiagnosticMessageChain, newLine: string) => string ->messageText : string | DiagnosticMessageChain ->DiagnosticMessageChain : DiagnosticMessageChain ->newLine : string - - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; ->createProgram : (rootNames: string[], options: CompilerOptions, host?: CompilerHost) => Program ->rootNames : string[] ->options : CompilerOptions ->CompilerOptions : CompilerOptions ->host : CompilerHost ->CompilerHost : CompilerHost ->Program : Program -} -declare module "typescript" { - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): any; ->readConfigFile : (fileName: string) => any ->fileName : string - - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; ->parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine ->json : any ->basePath : string ->ParsedCommandLine : ParsedCommandLine -} -declare module "typescript" { - /** The version of the language service API */ - let servicesVersion: string; ->servicesVersion : string - - interface Node { ->Node : Node - - getSourceFile(): SourceFile; ->getSourceFile : () => SourceFile ->SourceFile : SourceFile - - getChildCount(sourceFile?: SourceFile): number; ->getChildCount : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getChildAt(index: number, sourceFile?: SourceFile): Node; ->getChildAt : (index: number, sourceFile?: SourceFile) => Node ->index : number ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getChildren(sourceFile?: SourceFile): Node[]; ->getChildren : (sourceFile?: SourceFile) => Node[] ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getStart(sourceFile?: SourceFile): number; ->getStart : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullStart(): number; ->getFullStart : () => number - - getEnd(): number; ->getEnd : () => number - - getWidth(sourceFile?: SourceFile): number; ->getWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullWidth(): number; ->getFullWidth : () => number - - getLeadingTriviaWidth(sourceFile?: SourceFile): number; ->getLeadingTriviaWidth : (sourceFile?: SourceFile) => number ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFullText(sourceFile?: SourceFile): string; ->getFullText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getText(sourceFile?: SourceFile): string; ->getText : (sourceFile?: SourceFile) => string ->sourceFile : SourceFile ->SourceFile : SourceFile - - getFirstToken(sourceFile?: SourceFile): Node; ->getFirstToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - - getLastToken(sourceFile?: SourceFile): Node; ->getLastToken : (sourceFile?: SourceFile) => Node ->sourceFile : SourceFile ->SourceFile : SourceFile ->Node : Node - } - interface Symbol { ->Symbol : Symbol - - getFlags(): SymbolFlags; ->getFlags : () => SymbolFlags ->SymbolFlags : SymbolFlags - - getName(): string; ->getName : () => string - - getDeclarations(): Declaration[]; ->getDeclarations : () => Declaration[] ->Declaration : Declaration - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface Type { ->Type : Type - - getFlags(): TypeFlags; ->getFlags : () => TypeFlags ->TypeFlags : TypeFlags - - getSymbol(): Symbol; ->getSymbol : () => Symbol ->Symbol : Symbol - - getProperties(): Symbol[]; ->getProperties : () => Symbol[] ->Symbol : Symbol - - getProperty(propertyName: string): Symbol; ->getProperty : (propertyName: string) => Symbol ->propertyName : string ->Symbol : Symbol - - getApparentProperties(): Symbol[]; ->getApparentProperties : () => Symbol[] ->Symbol : Symbol - - getCallSignatures(): Signature[]; ->getCallSignatures : () => Signature[] ->Signature : Signature - - getConstructSignatures(): Signature[]; ->getConstructSignatures : () => Signature[] ->Signature : Signature - - getStringIndexType(): Type; ->getStringIndexType : () => Type ->Type : Type - - getNumberIndexType(): Type; ->getNumberIndexType : () => Type ->Type : Type - } - interface Signature { ->Signature : Signature - - getDeclaration(): SignatureDeclaration; ->getDeclaration : () => SignatureDeclaration ->SignatureDeclaration : SignatureDeclaration - - getTypeParameters(): Type[]; ->getTypeParameters : () => Type[] ->Type : Type - - getParameters(): Symbol[]; ->getParameters : () => Symbol[] ->Symbol : Symbol - - getReturnType(): Type; ->getReturnType : () => Type ->Type : Type - - getDocumentationComment(): SymbolDisplayPart[]; ->getDocumentationComment : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface SourceFile { ->SourceFile : SourceFile - - getNamedDeclarations(): Declaration[]; ->getNamedDeclarations : () => Declaration[] ->Declaration : Declaration - - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; ->getLineAndCharacterOfPosition : (pos: number) => LineAndCharacter ->pos : number ->LineAndCharacter : LineAndCharacter - - getLineStarts(): number[]; ->getLineStarts : () => number[] - - getPositionOfLineAndCharacter(line: number, character: number): number; ->getPositionOfLineAndCharacter : (line: number, character: number) => number ->line : number ->character : number - - update(newText: string, textChangeRange: TextChangeRange): SourceFile; ->update : (newText: string, textChangeRange: TextChangeRange) => SourceFile ->newText : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->SourceFile : SourceFile - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { ->IScriptSnapshot : IScriptSnapshot - - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; ->getText : (start: number, end: number) => string ->start : number ->end : number - - /** Gets the length of this script snapshot. */ - getLength(): number; ->getLength : () => number - - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; ->getChangeRange : (oldSnapshot: IScriptSnapshot) => TextChangeRange ->oldSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->TextChangeRange : TextChangeRange - } - module ScriptSnapshot { ->ScriptSnapshot : typeof ScriptSnapshot - - function fromString(text: string): IScriptSnapshot; ->fromString : (text: string) => IScriptSnapshot ->text : string ->IScriptSnapshot : IScriptSnapshot - } - interface PreProcessedFileInfo { ->PreProcessedFileInfo : PreProcessedFileInfo - - referencedFiles: FileReference[]; ->referencedFiles : FileReference[] ->FileReference : FileReference - - importedFiles: FileReference[]; ->importedFiles : FileReference[] ->FileReference : FileReference - - isLibFile: boolean; ->isLibFile : boolean - } - interface LanguageServiceHost { ->LanguageServiceHost : LanguageServiceHost - - getCompilationSettings(): CompilerOptions; ->getCompilationSettings : () => CompilerOptions ->CompilerOptions : CompilerOptions - - getNewLine?(): string; ->getNewLine : () => string - - getScriptFileNames(): string[]; ->getScriptFileNames : () => string[] - - getScriptVersion(fileName: string): string; ->getScriptVersion : (fileName: string) => string ->fileName : string - - getScriptSnapshot(fileName: string): IScriptSnapshot; ->getScriptSnapshot : (fileName: string) => IScriptSnapshot ->fileName : string ->IScriptSnapshot : IScriptSnapshot - - getLocalizedDiagnosticMessages?(): any; ->getLocalizedDiagnosticMessages : () => any - - getCancellationToken?(): CancellationToken; ->getCancellationToken : () => CancellationToken ->CancellationToken : CancellationToken - - getCurrentDirectory(): string; ->getCurrentDirectory : () => string - - getDefaultLibFileName(options: CompilerOptions): string; ->getDefaultLibFileName : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions - - log?(s: string): void; ->log : (s: string) => void ->s : string - - trace?(s: string): void; ->trace : (s: string) => void ->s : string - - error?(s: string): void; ->error : (s: string) => void ->s : string - } - interface LanguageService { ->LanguageService : LanguageService - - cleanupSemanticCache(): void; ->cleanupSemanticCache : () => void - - getSyntacticDiagnostics(fileName: string): Diagnostic[]; ->getSyntacticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getSemanticDiagnostics(fileName: string): Diagnostic[]; ->getSemanticDiagnostics : (fileName: string) => Diagnostic[] ->fileName : string ->Diagnostic : Diagnostic - - getCompilerOptionsDiagnostics(): Diagnostic[]; ->getCompilerOptionsDiagnostics : () => Diagnostic[] ->Diagnostic : Diagnostic - - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSyntacticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; ->getSemanticClassifications : (fileName: string, span: TextSpan) => ClassifiedSpan[] ->fileName : string ->span : TextSpan ->TextSpan : TextSpan ->ClassifiedSpan : ClassifiedSpan - - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; ->getCompletionsAtPosition : (fileName: string, position: number) => CompletionInfo ->fileName : string ->position : number ->CompletionInfo : CompletionInfo - - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; ->getCompletionEntryDetails : (fileName: string, position: number, entryName: string) => CompletionEntryDetails ->fileName : string ->position : number ->entryName : string ->CompletionEntryDetails : CompletionEntryDetails - - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; ->getQuickInfoAtPosition : (fileName: string, position: number) => QuickInfo ->fileName : string ->position : number ->QuickInfo : QuickInfo - - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; ->getNameOrDottedNameSpan : (fileName: string, startPos: number, endPos: number) => TextSpan ->fileName : string ->startPos : number ->endPos : number ->TextSpan : TextSpan - - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; ->getBreakpointStatementAtPosition : (fileName: string, position: number) => TextSpan ->fileName : string ->position : number ->TextSpan : TextSpan - - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; ->getSignatureHelpItems : (fileName: string, position: number) => SignatureHelpItems ->fileName : string ->position : number ->SignatureHelpItems : SignatureHelpItems - - getRenameInfo(fileName: string, position: number): RenameInfo; ->getRenameInfo : (fileName: string, position: number) => RenameInfo ->fileName : string ->position : number ->RenameInfo : RenameInfo - - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; ->findRenameLocations : (fileName: string, position: number, findInStrings: boolean, findInComments: boolean) => RenameLocation[] ->fileName : string ->position : number ->findInStrings : boolean ->findInComments : boolean ->RenameLocation : RenameLocation - - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; ->getDefinitionAtPosition : (fileName: string, position: number) => DefinitionInfo[] ->fileName : string ->position : number ->DefinitionInfo : DefinitionInfo - - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getReferencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; ->getOccurrencesAtPosition : (fileName: string, position: number) => ReferenceEntry[] ->fileName : string ->position : number ->ReferenceEntry : ReferenceEntry - - findReferences(fileName: string, position: number): ReferencedSymbol[]; ->findReferences : (fileName: string, position: number) => ReferencedSymbol[] ->fileName : string ->position : number ->ReferencedSymbol : ReferencedSymbol - - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; ->getNavigateToItems : (searchValue: string, maxResultCount?: number) => NavigateToItem[] ->searchValue : string ->maxResultCount : number ->NavigateToItem : NavigateToItem - - getNavigationBarItems(fileName: string): NavigationBarItem[]; ->getNavigationBarItems : (fileName: string) => NavigationBarItem[] ->fileName : string ->NavigationBarItem : NavigationBarItem - - getOutliningSpans(fileName: string): OutliningSpan[]; ->getOutliningSpans : (fileName: string) => OutliningSpan[] ->fileName : string ->OutliningSpan : OutliningSpan - - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; ->getTodoComments : (fileName: string, descriptors: TodoCommentDescriptor[]) => TodoComment[] ->fileName : string ->descriptors : TodoCommentDescriptor[] ->TodoCommentDescriptor : TodoCommentDescriptor ->TodoComment : TodoComment - - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; ->getBraceMatchingAtPosition : (fileName: string, position: number) => TextSpan[] ->fileName : string ->position : number ->TextSpan : TextSpan - - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; ->getIndentationAtPosition : (fileName: string, position: number, options: EditorOptions) => number ->fileName : string ->position : number ->options : EditorOptions ->EditorOptions : EditorOptions - - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForRange : (fileName: string, start: number, end: number, options: FormatCodeOptions) => TextChange[] ->fileName : string ->start : number ->end : number ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsForDocument : (fileName: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; ->getFormattingEditsAfterKeystroke : (fileName: string, position: number, key: string, options: FormatCodeOptions) => TextChange[] ->fileName : string ->position : number ->key : string ->options : FormatCodeOptions ->FormatCodeOptions : FormatCodeOptions ->TextChange : TextChange - - getEmitOutput(fileName: string): EmitOutput; ->getEmitOutput : (fileName: string) => EmitOutput ->fileName : string ->EmitOutput : EmitOutput - - getProgram(): Program; ->getProgram : () => Program ->Program : Program - - getSourceFile(fileName: string): SourceFile; ->getSourceFile : (fileName: string) => SourceFile ->fileName : string ->SourceFile : SourceFile - - dispose(): void; ->dispose : () => void - } - interface ClassifiedSpan { ->ClassifiedSpan : ClassifiedSpan - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - classificationType: string; ->classificationType : string - } - interface NavigationBarItem { ->NavigationBarItem : NavigationBarItem - - text: string; ->text : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - spans: TextSpan[]; ->spans : TextSpan[] ->TextSpan : TextSpan - - childItems: NavigationBarItem[]; ->childItems : NavigationBarItem[] ->NavigationBarItem : NavigationBarItem - - indent: number; ->indent : number - - bolded: boolean; ->bolded : boolean - - grayed: boolean; ->grayed : boolean - } - interface TodoCommentDescriptor { ->TodoCommentDescriptor : TodoCommentDescriptor - - text: string; ->text : string - - priority: number; ->priority : number - } - interface TodoComment { ->TodoComment : TodoComment - - descriptor: TodoCommentDescriptor; ->descriptor : TodoCommentDescriptor ->TodoCommentDescriptor : TodoCommentDescriptor - - message: string; ->message : string - - position: number; ->position : number - } - class TextChange { ->TextChange : TextChange - - span: TextSpan; ->span : TextSpan ->TextSpan : TextSpan - - newText: string; ->newText : string - } - interface RenameLocation { ->RenameLocation : RenameLocation - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - } - interface ReferenceEntry { ->ReferenceEntry : ReferenceEntry - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - fileName: string; ->fileName : string - - isWriteAccess: boolean; ->isWriteAccess : boolean - } - interface NavigateToItem { ->NavigateToItem : NavigateToItem - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - matchKind: string; ->matchKind : string - - isCaseSensitive: boolean; ->isCaseSensitive : boolean - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - containerName: string; ->containerName : string - - containerKind: string; ->containerKind : string - } - interface EditorOptions { ->EditorOptions : EditorOptions - - IndentSize: number; ->IndentSize : number - - TabSize: number; ->TabSize : number - - NewLineCharacter: string; ->NewLineCharacter : string - - ConvertTabsToSpaces: boolean; ->ConvertTabsToSpaces : boolean - } - interface FormatCodeOptions extends EditorOptions { ->FormatCodeOptions : FormatCodeOptions ->EditorOptions : EditorOptions - - InsertSpaceAfterCommaDelimiter: boolean; ->InsertSpaceAfterCommaDelimiter : boolean - - InsertSpaceAfterSemicolonInForStatements: boolean; ->InsertSpaceAfterSemicolonInForStatements : boolean - - InsertSpaceBeforeAndAfterBinaryOperators: boolean; ->InsertSpaceBeforeAndAfterBinaryOperators : boolean - - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; ->InsertSpaceAfterKeywordsInControlFlowStatements : boolean - - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; ->InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean - - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; ->InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean - - PlaceOpenBraceOnNewLineForFunctions: boolean; ->PlaceOpenBraceOnNewLineForFunctions : boolean - - PlaceOpenBraceOnNewLineForControlBlocks: boolean; ->PlaceOpenBraceOnNewLineForControlBlocks : boolean - - [s: string]: boolean | number | string; ->s : string - } - interface DefinitionInfo { ->DefinitionInfo : DefinitionInfo - - fileName: string; ->fileName : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - kind: string; ->kind : string - - name: string; ->name : string - - containerKind: string; ->containerKind : string - - containerName: string; ->containerName : string - } - interface ReferencedSymbol { ->ReferencedSymbol : ReferencedSymbol - - definition: DefinitionInfo; ->definition : DefinitionInfo ->DefinitionInfo : DefinitionInfo - - references: ReferenceEntry[]; ->references : ReferenceEntry[] ->ReferenceEntry : ReferenceEntry - } - enum SymbolDisplayPartKind { ->SymbolDisplayPartKind : SymbolDisplayPartKind - - aliasName = 0, ->aliasName : SymbolDisplayPartKind - - className = 1, ->className : SymbolDisplayPartKind - - enumName = 2, ->enumName : SymbolDisplayPartKind - - fieldName = 3, ->fieldName : SymbolDisplayPartKind - - interfaceName = 4, ->interfaceName : SymbolDisplayPartKind - - keyword = 5, ->keyword : SymbolDisplayPartKind - - lineBreak = 6, ->lineBreak : SymbolDisplayPartKind - - numericLiteral = 7, ->numericLiteral : SymbolDisplayPartKind - - stringLiteral = 8, ->stringLiteral : SymbolDisplayPartKind - - localName = 9, ->localName : SymbolDisplayPartKind - - methodName = 10, ->methodName : SymbolDisplayPartKind - - moduleName = 11, ->moduleName : SymbolDisplayPartKind - - operator = 12, ->operator : SymbolDisplayPartKind - - parameterName = 13, ->parameterName : SymbolDisplayPartKind - - propertyName = 14, ->propertyName : SymbolDisplayPartKind - - punctuation = 15, ->punctuation : SymbolDisplayPartKind - - space = 16, ->space : SymbolDisplayPartKind - - text = 17, ->text : SymbolDisplayPartKind - - typeParameterName = 18, ->typeParameterName : SymbolDisplayPartKind - - enumMemberName = 19, ->enumMemberName : SymbolDisplayPartKind - - functionName = 20, ->functionName : SymbolDisplayPartKind - - regularExpressionLiteral = 21, ->regularExpressionLiteral : SymbolDisplayPartKind - } - interface SymbolDisplayPart { ->SymbolDisplayPart : SymbolDisplayPart - - text: string; ->text : string - - kind: string; ->kind : string - } - interface QuickInfo { ->QuickInfo : QuickInfo - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface RenameInfo { ->RenameInfo : RenameInfo - - canRename: boolean; ->canRename : boolean - - localizedErrorMessage: string; ->localizedErrorMessage : string - - displayName: string; ->displayName : string - - fullDisplayName: string; ->fullDisplayName : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - triggerSpan: TextSpan; ->triggerSpan : TextSpan ->TextSpan : TextSpan - } - interface SignatureHelpParameter { ->SignatureHelpParameter : SignatureHelpParameter - - name: string; ->name : string - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - isOptional: boolean; ->isOptional : boolean - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { ->SignatureHelpItem : SignatureHelpItem - - isVariadic: boolean; ->isVariadic : boolean - - prefixDisplayParts: SymbolDisplayPart[]; ->prefixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - suffixDisplayParts: SymbolDisplayPart[]; ->suffixDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - separatorDisplayParts: SymbolDisplayPart[]; ->separatorDisplayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - parameters: SignatureHelpParameter[]; ->parameters : SignatureHelpParameter[] ->SignatureHelpParameter : SignatureHelpParameter - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { ->SignatureHelpItems : SignatureHelpItems - - items: SignatureHelpItem[]; ->items : SignatureHelpItem[] ->SignatureHelpItem : SignatureHelpItem - - applicableSpan: TextSpan; ->applicableSpan : TextSpan ->TextSpan : TextSpan - - selectedItemIndex: number; ->selectedItemIndex : number - - argumentIndex: number; ->argumentIndex : number - - argumentCount: number; ->argumentCount : number - } - interface CompletionInfo { ->CompletionInfo : CompletionInfo - - isMemberCompletion: boolean; ->isMemberCompletion : boolean - - isNewIdentifierLocation: boolean; ->isNewIdentifierLocation : boolean - - entries: CompletionEntry[]; ->entries : CompletionEntry[] ->CompletionEntry : CompletionEntry - } - interface CompletionEntry { ->CompletionEntry : CompletionEntry - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - sortText: string; ->sortText : string - } - interface CompletionEntryDetails { ->CompletionEntryDetails : CompletionEntryDetails - - name: string; ->name : string - - kind: string; ->kind : string - - kindModifiers: string; ->kindModifiers : string - - displayParts: SymbolDisplayPart[]; ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - documentation: SymbolDisplayPart[]; ->documentation : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - interface OutliningSpan { ->OutliningSpan : OutliningSpan - - /** The span of the document to actually collapse. */ - textSpan: TextSpan; ->textSpan : TextSpan ->TextSpan : TextSpan - - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; ->hintSpan : TextSpan ->TextSpan : TextSpan - - /** The text to display in the editor for the collapsed region. */ - bannerText: string; ->bannerText : string - - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; ->autoCollapse : boolean - } - interface EmitOutput { ->EmitOutput : EmitOutput - - outputFiles: OutputFile[]; ->outputFiles : OutputFile[] ->OutputFile : OutputFile - - emitSkipped: boolean; ->emitSkipped : boolean - } - const enum OutputFileType { ->OutputFileType : OutputFileType - - JavaScript = 0, ->JavaScript : OutputFileType - - SourceMap = 1, ->SourceMap : OutputFileType - - Declaration = 2, ->Declaration : OutputFileType - } - interface OutputFile { ->OutputFile : OutputFile - - name: string; ->name : string - - writeByteOrderMark: boolean; ->writeByteOrderMark : boolean - - text: string; ->text : string - } - const enum EndOfLineState { ->EndOfLineState : EndOfLineState - - Start = 0, ->Start : EndOfLineState - - InMultiLineCommentTrivia = 1, ->InMultiLineCommentTrivia : EndOfLineState - - InSingleQuoteStringLiteral = 2, ->InSingleQuoteStringLiteral : EndOfLineState - - InDoubleQuoteStringLiteral = 3, ->InDoubleQuoteStringLiteral : EndOfLineState - - InTemplateHeadOrNoSubstitutionTemplate = 4, ->InTemplateHeadOrNoSubstitutionTemplate : EndOfLineState - - InTemplateMiddleOrTail = 5, ->InTemplateMiddleOrTail : EndOfLineState - - InTemplateSubstitutionPosition = 6, ->InTemplateSubstitutionPosition : EndOfLineState - } - enum TokenClass { ->TokenClass : TokenClass - - Punctuation = 0, ->Punctuation : TokenClass - - Keyword = 1, ->Keyword : TokenClass - - Operator = 2, ->Operator : TokenClass - - Comment = 3, ->Comment : TokenClass - - Whitespace = 4, ->Whitespace : TokenClass - - Identifier = 5, ->Identifier : TokenClass - - NumberLiteral = 6, ->NumberLiteral : TokenClass - - StringLiteral = 7, ->StringLiteral : TokenClass - - RegExpLiteral = 8, ->RegExpLiteral : TokenClass - } - interface ClassificationResult { ->ClassificationResult : ClassificationResult - - finalLexState: EndOfLineState; ->finalLexState : EndOfLineState ->EndOfLineState : EndOfLineState - - entries: ClassificationInfo[]; ->entries : ClassificationInfo[] ->ClassificationInfo : ClassificationInfo - } - interface ClassificationInfo { ->ClassificationInfo : ClassificationInfo - - length: number; ->length : number - - classification: TokenClass; ->classification : TokenClass ->TokenClass : TokenClass - } - interface Classifier { ->Classifier : Classifier - - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; ->getClassificationsForLine : (text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean) => ClassificationResult ->text : string ->lexState : EndOfLineState ->EndOfLineState : EndOfLineState ->syntacticClassifierAbsent : boolean ->ClassificationResult : ClassificationResult - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { ->DocumentRegistry : DocumentRegistry - - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->acquireDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; ->updateDocument : (fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string) => SourceFile ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->SourceFile : SourceFile - - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; ->releaseDocument : (fileName: string, compilationSettings: CompilerOptions) => void ->fileName : string ->compilationSettings : CompilerOptions ->CompilerOptions : CompilerOptions - } - class ScriptElementKind { ->ScriptElementKind : ScriptElementKind - - static unknown: string; ->unknown : string - - static warning: string; ->warning : string - - static keyword: string; ->keyword : string - - static scriptElement: string; ->scriptElement : string - - static moduleElement: string; ->moduleElement : string - - static classElement: string; ->classElement : string - - static interfaceElement: string; ->interfaceElement : string - - static typeElement: string; ->typeElement : string - - static enumElement: string; ->enumElement : string - - static variableElement: string; ->variableElement : string - - static localVariableElement: string; ->localVariableElement : string - - static functionElement: string; ->functionElement : string - - static localFunctionElement: string; ->localFunctionElement : string - - static memberFunctionElement: string; ->memberFunctionElement : string - - static memberGetAccessorElement: string; ->memberGetAccessorElement : string - - static memberSetAccessorElement: string; ->memberSetAccessorElement : string - - static memberVariableElement: string; ->memberVariableElement : string - - static constructorImplementationElement: string; ->constructorImplementationElement : string - - static callSignatureElement: string; ->callSignatureElement : string - - static indexSignatureElement: string; ->indexSignatureElement : string - - static constructSignatureElement: string; ->constructSignatureElement : string - - static parameterElement: string; ->parameterElement : string - - static typeParameterElement: string; ->typeParameterElement : string - - static primitiveType: string; ->primitiveType : string - - static label: string; ->label : string - - static alias: string; ->alias : string - - static constElement: string; ->constElement : string - - static letElement: string; ->letElement : string - } - class ScriptElementKindModifier { ->ScriptElementKindModifier : ScriptElementKindModifier - - static none: string; ->none : string - - static publicMemberModifier: string; ->publicMemberModifier : string - - static privateMemberModifier: string; ->privateMemberModifier : string - - static protectedMemberModifier: string; ->protectedMemberModifier : string - - static exportedModifier: string; ->exportedModifier : string - - static ambientModifier: string; ->ambientModifier : string - - static staticModifier: string; ->staticModifier : string - } - class ClassificationTypeNames { ->ClassificationTypeNames : ClassificationTypeNames - - static comment: string; ->comment : string - - static identifier: string; ->identifier : string - - static keyword: string; ->keyword : string - - static numericLiteral: string; ->numericLiteral : string - - static operator: string; ->operator : string - - static stringLiteral: string; ->stringLiteral : string - - static whiteSpace: string; ->whiteSpace : string - - static text: string; ->text : string - - static punctuation: string; ->punctuation : string - - static className: string; ->className : string - - static enumName: string; ->enumName : string - - static interfaceName: string; ->interfaceName : string - - static moduleName: string; ->moduleName : string - - static typeParameterName: string; ->typeParameterName : string - - static typeAlias: string; ->typeAlias : string - } - interface DisplayPartsSymbolWriter extends SymbolWriter { ->DisplayPartsSymbolWriter : DisplayPartsSymbolWriter ->SymbolWriter : SymbolWriter - - displayParts(): SymbolDisplayPart[]; ->displayParts : () => SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; ->displayPartsToString : (displayParts: SymbolDisplayPart[]) => string ->displayParts : SymbolDisplayPart[] ->SymbolDisplayPart : SymbolDisplayPart - - function getDefaultCompilerOptions(): CompilerOptions; ->getDefaultCompilerOptions : () => CompilerOptions ->CompilerOptions : CompilerOptions - - class OperationCanceledException { ->OperationCanceledException : OperationCanceledException - } - class CancellationTokenObject { ->CancellationTokenObject : CancellationTokenObject - - private cancellationToken; ->cancellationToken : any - - static None: CancellationTokenObject; ->None : CancellationTokenObject ->CancellationTokenObject : CancellationTokenObject - - constructor(cancellationToken: CancellationToken); ->cancellationToken : CancellationToken ->CancellationToken : CancellationToken - - isCancellationRequested(): boolean; ->isCancellationRequested : () => boolean - - throwIfCancellationRequested(): void; ->throwIfCancellationRequested : () => void - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string; ->transpile : (input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]) => string ->input : string ->compilerOptions : CompilerOptions ->CompilerOptions : CompilerOptions ->fileName : string ->diagnostics : Diagnostic[] ->Diagnostic : Diagnostic - - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; ->createLanguageServiceSourceFile : (fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean) => SourceFile ->fileName : string ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->scriptTarget : ScriptTarget ->ScriptTarget : ScriptTarget ->version : string ->setNodeParents : boolean ->SourceFile : SourceFile - - let disableIncrementalParsing: boolean; ->disableIncrementalParsing : boolean - - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; ->updateLanguageServiceSourceFile : (sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean) => SourceFile ->sourceFile : SourceFile ->SourceFile : SourceFile ->scriptSnapshot : IScriptSnapshot ->IScriptSnapshot : IScriptSnapshot ->version : string ->textChangeRange : TextChangeRange ->TextChangeRange : TextChangeRange ->aggressiveChecks : boolean ->SourceFile : SourceFile - - function createDocumentRegistry(): DocumentRegistry; ->createDocumentRegistry : () => DocumentRegistry ->DocumentRegistry : DocumentRegistry - - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; ->preProcessFile : (sourceText: string, readImportFiles?: boolean) => PreProcessedFileInfo ->sourceText : string ->readImportFiles : boolean ->PreProcessedFileInfo : PreProcessedFileInfo - - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; ->createLanguageService : (host: LanguageServiceHost, documentRegistry?: DocumentRegistry) => LanguageService ->host : LanguageServiceHost ->LanguageServiceHost : LanguageServiceHost ->documentRegistry : DocumentRegistry ->DocumentRegistry : DocumentRegistry ->LanguageService : LanguageService - - function createClassifier(): Classifier; ->createClassifier : () => Classifier ->Classifier : Classifier - - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; ->getDefaultLibFilePath : (options: CompilerOptions) => string ->options : CompilerOptions ->CompilerOptions : CompilerOptions -} - diff --git a/tests/baselines/reference/ES5For-of30.errors.txt b/tests/baselines/reference/ES5For-of30.errors.txt index 0b02a55ba3f..e99b8284bf3 100644 --- a/tests/baselines/reference/ES5For-of30.errors.txt +++ b/tests/baselines/reference/ES5For-of30.errors.txt @@ -1,12 +1,18 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (1 errors) ==== +==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (3 errors) ==== var a: string, b: number; var tuple: [number, string] = [2, "3"]; for ([a = 1, b = ""] of tuple) { ~~~~~~~~~~~~~~~ !!! error TS2461: Type 'string | number' is not an array type. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/ES5SymbolProperty1.js b/tests/baselines/reference/ES5SymbolProperty1.js index ab3f420c95c..1073a33163d 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.js +++ b/tests/baselines/reference/ES5SymbolProperty1.js @@ -14,6 +14,7 @@ obj[Symbol.foo]; var Symbol; var obj = (_a = {}, _a[Symbol.foo] = 0, - _a); + _a +); obj[Symbol.foo]; var _a; diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.js b/tests/baselines/reference/FunctionDeclaration8_es6.js index 62692997a91..64f6bff50c0 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.js +++ b/tests/baselines/reference/FunctionDeclaration8_es6.js @@ -2,7 +2,5 @@ var v = { [yield]: foo } //// [FunctionDeclaration8_es6.js] -var v = (_a = {}, - _a[yield] = foo, - _a); +var v = (_a = {}, _a[yield] = foo, _a); var _a; diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.js b/tests/baselines/reference/FunctionDeclaration9_es6.js index c63cf5bb458..bca309d2d62 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.js +++ b/tests/baselines/reference/FunctionDeclaration9_es6.js @@ -5,8 +5,6 @@ function * foo() { //// [FunctionDeclaration9_es6.js] function foo() { - var v = (_a = {}, - _a[] = foo, - _a); + var v = (_a = {}, _a[] = foo, _a); var _a; } diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js index 51e5d0000e4..188a843f751 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js @@ -2,7 +2,5 @@ var v = { *[foo()]() { } } //// [FunctionPropertyAssignments5_es6.js] -var v = (_a = {}, - _a[foo()] = function () { }, - _a); +var v = (_a = {}, _a[foo()] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js new file mode 100644 index 00000000000..a6f01d7b75c --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js @@ -0,0 +1,31 @@ +//// [arrayBindingPatternOmittedExpressions.ts] + +var results: string[]; + +{ + let [, b, , a] = results; + let x = { + a, + b + } +} + + +function f([, a, , b, , , , s, , , ] = results) { + a = s[1]; + b = s[2]; +} + +//// [arrayBindingPatternOmittedExpressions.js] +var results; +{ + let [, b, , a] = results; + let x = { + a, + b + }; +} +function f([, a, , b, , , , s, , ,] = results) { + a = s[1]; + b = s[2]; +} diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types new file mode 100644 index 00000000000..ba1ac955b85 --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -0,0 +1,43 @@ +=== tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts === + +var results: string[]; +>results : string[] + +{ + let [, b, , a] = results; +>b : string +>a : string +>results : string[] + + let x = { +>x : { a: string; b: string; } +>{ a, b } : { a: string; b: string; } + + a, +>a : string + + b +>b : string + } +} + + +function f([, a, , b, , , , s, , , ] = results) { +>f : ([, a, , b, , , , s, , , ]?: string[]) => void +>a : string +>b : string +>s : string +>results : string[] + + a = s[1]; +>a = s[1] : string +>a : string +>s[1] : string +>s : string + + b = s[2]; +>b = s[2] : string +>b : string +>s[2] : string +>s : string +} diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 0dae59521bf..73d4f6013ed 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -9,44 +9,55 @@ function f0() { var a1 = [...a]; >a1 : number[] >[...a] : number[] +>...a : number >a : number[] var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] +>...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] +>...a : number >a : number[] var a4 = [...a, 1]; >a4 : number[] >[...a, 1] : number[] +>...a : number >a : number[] var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] +>...a : number >a : number[] var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] +>...a : number >a : number[] var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] +>...a : number >a : number[] +>...a : number >a : number[] var a8 = [...a, ...a, ...a]; >a8 : number[] >[...a, ...a, ...a] : number[] +>...a : number >a : number[] +>...a : number >a : number[] +>...a : number >a : number[] } @@ -60,6 +71,7 @@ function f1() { var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] +>...a : number >a : number[] var b: (string | number | boolean)[]; @@ -72,19 +84,29 @@ function f2() { var a = [...[...[...[...[...[]]]]]]; >a : any[] >[...[...[...[...[...[]]]]]] : undefined[] +>...[...[...[...[...[]]]]] : undefined >[...[...[...[...[]]]]] : undefined[] +>...[...[...[...[]]]] : undefined >[...[...[...[]]]] : undefined[] +>...[...[...[]]] : undefined >[...[...[]]] : undefined[] +>...[...[]] : undefined >[...[]] : undefined[] +>...[] : undefined >[] : undefined[] var b = [...[...[...[...[...[5]]]]]]; >b : number[] >[...[...[...[...[...[5]]]]]] : number[] +>...[...[...[...[...[5]]]]] : number >[...[...[...[...[5]]]]] : number[] +>...[...[...[...[5]]]] : number >[...[...[...[5]]]] : number[] +>...[...[...[5]]] : number >[...[...[5]]] : number[] +>...[...[5]] : number >[...[5]] : number[] +>...[5] : number >[5] : number[] } diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 8a75d21e4ef..10dd611d213 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -38,11 +38,13 @@ foo(1, 2, "abc"); foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void +>...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>...a : string >a : string[] obj.foo(1, 2, "abc"); @@ -56,6 +58,7 @@ obj.foo(1, 2, ...a); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] obj.foo(1, 2, ...a, "abc"); @@ -63,6 +66,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] (obj.foo)(1, 2, "abc"); @@ -78,6 +82,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] (obj.foo)(1, 2, ...a, "abc"); @@ -86,6 +91,7 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] xa[1].foo(1, 2, "abc"); @@ -101,6 +107,7 @@ xa[1].foo(1, 2, ...a); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] xa[1].foo(1, 2, ...a, "abc"); @@ -109,6 +116,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...a : string >a : string[] (xa[1].foo)(...[1, 2, "abc"]); @@ -120,6 +128,7 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1] : X >xa : X[] >foo : (x: number, y: number, ...z: string[]) => any +>...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] class C { @@ -145,6 +154,7 @@ class C { >foo : (x: number, y: number, ...z: string[]) => void >x : number >y : number +>...z : string >z : string[] } foo(x: number, y: number, ...z: string[]) { @@ -167,6 +177,7 @@ class D extends C { super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C +>...a : string >a : string[] } foo() { @@ -183,6 +194,7 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>...a : string >a : string[] } } @@ -192,5 +204,6 @@ var c = new C(1, 2, ...a); >c : C >new C(1, 2, ...a) : C >C : typeof C +>...a : string >a : string[] diff --git a/tests/baselines/reference/classExpressionWithDecorator1.errors.txt b/tests/baselines/reference/classExpressionWithDecorator1.errors.txt new file mode 100644 index 00000000000..10f0d8aa376 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithDecorator1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/classExpressionWithDecorator1.ts(1,9): error TS1109: Expression expected. +tests/cases/compiler/classExpressionWithDecorator1.ts(1,10): error TS2304: Cannot find name 'decorate'. + + +==== tests/cases/compiler/classExpressionWithDecorator1.ts (2 errors) ==== + var v = @decorate class C { static p = 1 }; + ~ +!!! error TS1109: Expression expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'decorate'. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js new file mode 100644 index 00000000000..3e255398904 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -0,0 +1,22 @@ +//// [classExpressionWithDecorator1.ts] +var v = @decorate class C { static p = 1 }; + +//// [classExpressionWithDecorator1.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var v = ; +var C = (function () { + function C() { + } + C.p = 1; + C = __decorate([ + decorate + ], C); + return C; +})(); +; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt new file mode 100644 index 00000000000..28e42dd33f1 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties1.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties1.ts (1 errors) ==== + var v = class C { static a = 1; static b = 2 }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.js b/tests/baselines/reference/classExpressionWithStaticProperties1.js new file mode 100644 index 00000000000..344dbff50ed --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.js @@ -0,0 +1,11 @@ +//// [classExpressionWithStaticProperties1.ts] +var v = class C { static a = 1; static b = 2 }; + +//// [classExpressionWithStaticProperties1.js] +var v = (function () { + function C() { + } + C.a = 1; + C.b = 2; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt new file mode 100644 index 00000000000..9a915f70193 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticProperties2.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticProperties2.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.js b/tests/baselines/reference/classExpressionWithStaticProperties2.js new file mode 100644 index 00000000000..9ff9c06ffe4 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.js @@ -0,0 +1,10 @@ +//// [classExpressionWithStaticProperties2.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticProperties2.js] +var v = (function () { + function C() { + } + C.a = 1; + return C; +})(); diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt new file mode 100644 index 00000000000..bc015a3d8f0 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts (1 errors) ==== + var v = class C { static a = 1; static b = 2 }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js new file mode 100644 index 00000000000..43f5e7415c4 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js @@ -0,0 +1,10 @@ +//// [classExpressionWithStaticPropertiesES61.ts] +var v = class C { static a = 1; static b = 2 }; + +//// [classExpressionWithStaticPropertiesES61.js] +var v = (_a = class C { + }, + _a.a = 1, + _a.b = 2, + _a); +var _a; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt new file mode 100644 index 00000000000..bed4b2c01aa --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts (1 errors) ==== + var v = class C { static a = 1; static b }; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js new file mode 100644 index 00000000000..1efa56ecaa2 --- /dev/null +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js @@ -0,0 +1,9 @@ +//// [classExpressionWithStaticPropertiesES62.ts] +var v = class C { static a = 1; static b }; + +//// [classExpressionWithStaticPropertiesES62.js] +var v = (_a = class C { + }, + _a.a = 1, + _a); +var _a; diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt index f2ec9429eb7..03bf4f9e38b 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt @@ -1,40 +1,89 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,28): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(4,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(9,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(13,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(14,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(20,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(25,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,24): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(31,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(35,24): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(36,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(41,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(44,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(47,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(51,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(52,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,28): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(54,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(59,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(60,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(62,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(67,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(68,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(69,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(70,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(75,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(76,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(79,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(80,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(84,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(85,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (5 errors) ==== +==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (38 errors) ==== // Constructors class c1 { constructor(i: number, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c12 { constructor(arguments: number, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c1NoError { constructor(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c2 { constructor(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c2NoError { constructor() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } @@ -42,63 +91,113 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: constructor(public arguments: number, ...restParameters) { //arguments is error ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c3NoError { constructor(public arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c4 { constructor(i: number, ...arguments); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c42 { constructor(arguments: number, ...rest); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c4NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } class c5 { constructor(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c52 { constructor(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } class c5NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c6 { constructor(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c62 { constructor(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } declare class c6NoError { constructor(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. constructor(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt index 38ad6867200..ea699414f17 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt @@ -1,63 +1,150 @@ tests/cases/compiler/collisionArgumentsClassMethod.ts(2,27): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(2,30): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(3,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(5,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(5,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(6,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(8,23): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(9,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(11,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(12,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(13,23): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(13,26): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(14,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(16,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(17,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(18,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/compiler/collisionArgumentsClassMethod.ts(18,16): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(19,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(21,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(22,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(23,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(24,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(29,30): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(30,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(31,23): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(33,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(34,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(35,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(36,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(37,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(38,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(43,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/compiler/collisionArgumentsClassMethod.ts(46,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -==== tests/cases/compiler/collisionArgumentsClassMethod.ts (4 errors) ==== +==== tests/cases/compiler/collisionArgumentsClassMethod.ts (33 errors) ==== class c1 { public foo(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public foo1(arguments: number, ...rest) { //arguments is error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public fooNoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f4(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f41(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. var arguments: any; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } declare class c2 { public foo(i: number, ...arguments); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public foo1(arguments: number, ...rest); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public fooNoError(arguments: number); // No error - no code gen + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f41(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. public f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } class c3 { public foo(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } public fooNoError() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.js b/tests/baselines/reference/computedPropertyNames10_ES5.js index 302f9355be8..14d9235b12b 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.js +++ b/tests/baselines/reference/computedPropertyNames10_ES5.js @@ -32,5 +32,6 @@ var v = (_a = {}, _a[true] = function () { }, _a["hello bye"] = function () { }, _a["hello " + a + " bye"] = function () { }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index 69902003342..64c0b0bd67e 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -21,16 +21,61 @@ var s; var n; var a; var v = (_a = {}, - _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a); + Object.defineProperty(_a, s, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, n, { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, s + s, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, s + n, { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, +s, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, "", { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 0, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, a, { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, true, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, "hello bye", { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, "hello " + a + " bye", { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.js b/tests/baselines/reference/computedPropertyNames18_ES5.js index a62af506531..b65c7fd4f7d 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.js +++ b/tests/baselines/reference/computedPropertyNames18_ES5.js @@ -9,6 +9,7 @@ function foo() { function foo() { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.js b/tests/baselines/reference/computedPropertyNames19_ES5.js index bda3e01bbed..36f3e66c7c2 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.js +++ b/tests/baselines/reference/computedPropertyNames19_ES5.js @@ -10,6 +10,7 @@ var M; (function (M) { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; })(M || (M = {})); diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.js b/tests/baselines/reference/computedPropertyNames1_ES5.js index 37e06616c2f..4fdec28c7aa 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.js +++ b/tests/baselines/reference/computedPropertyNames1_ES5.js @@ -6,7 +6,17 @@ var v = { //// [computedPropertyNames1_ES5.js] var v = (_a = {}, - _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), - _a); + Object.defineProperty(_a, 0 + 1, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 0 + 1, { + set: function (v) { } //No error + , + enumerable: true, + configurable: true + }), + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.js b/tests/baselines/reference/computedPropertyNames20_ES5.js index 1eec0a7bcdb..65acd7fa08f 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.js +++ b/tests/baselines/reference/computedPropertyNames20_ES5.js @@ -6,5 +6,6 @@ var obj = { //// [computedPropertyNames20_ES5.js] var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.js b/tests/baselines/reference/computedPropertyNames22_ES5.js index df12193250b..e82bf673b52 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.js +++ b/tests/baselines/reference/computedPropertyNames22_ES5.js @@ -15,7 +15,8 @@ var C = (function () { C.prototype.bar = function () { var obj = (_a = {}, _a[this.bar()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.js b/tests/baselines/reference/computedPropertyNames23_ES5.js index 8f68d9f3102..8e42a29f7e7 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.js +++ b/tests/baselines/reference/computedPropertyNames23_ES5.js @@ -15,9 +15,7 @@ var C = (function () { C.prototype.bar = function () { return 0; }; - C.prototype[(_a = {}, - _a[this.bar()] = 1, - _a)[0]] = function () { }; + C.prototype[(_a = {}, _a[this.bar()] = 1, _a)[0]] = function () { }; return C; var _a; })(); diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index f8196dd1307..b6a8d254b26 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -36,7 +36,8 @@ var C = (function (_super) { C.prototype.foo = function () { var obj = (_a = {}, _a[_super.prototype.bar.call(this)] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 884d5c0f664..7a0a982eb41 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -30,9 +30,7 @@ var C = (function (_super) { function C() { _super.apply(this, arguments); } - C.prototype[(_a = {}, - _a[_super.bar.call(this)] = 1, - _a)[0]] = function () { }; + C.prototype[(_a = {}, _a[_super.bar.call(this)] = 1, _a)[0]] = function () { }; return C; var _a; })(Base); diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index b88cb0dfaf9..5940c498db8 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -28,7 +28,8 @@ var C = (function (_super) { _super.call(this); var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { }, - _a); + _a + ); var _a; } return C; diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.js b/tests/baselines/reference/computedPropertyNames29_ES5.js index 022c930ab67..4682ae9105e 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.js +++ b/tests/baselines/reference/computedPropertyNames29_ES5.js @@ -19,7 +19,8 @@ var C = (function () { (function () { var obj = (_a = {}, _a[_this.bar()] = function () { }, - _a); + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index fd63a192d07..05196e23c5b 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -33,8 +33,12 @@ var C = (function (_super) { _super.call(this); (function () { var obj = (_a = {}, + // Ideally, we would capture this. But the reference is + // illegal, and not capturing this is consistent with + //treatment of other similar violations. _a[(_super.call(this), "prop")] = function () { }, - _a); + _a + ); var _a; }); } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 8a3c1a3f6c5..173e3c7222b 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -40,7 +40,8 @@ var C = (function (_super) { (function () { var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { }, - _a); + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.js b/tests/baselines/reference/computedPropertyNames33_ES5.js index 3d7c70a9256..38029893bb1 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.js +++ b/tests/baselines/reference/computedPropertyNames33_ES5.js @@ -17,7 +17,8 @@ var C = (function () { C.prototype.bar = function () { var obj = (_a = {}, _a[foo()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.js b/tests/baselines/reference/computedPropertyNames34_ES5.js index fd46b144fa5..4e5790c53b1 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.js +++ b/tests/baselines/reference/computedPropertyNames34_ES5.js @@ -17,7 +17,8 @@ var C = (function () { C.bar = function () { var obj = (_a = {}, _a[foo()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt index 82e4b71b33b..a31965dc69e 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt @@ -1,12 +1,13 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,17): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (6 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (7 errors) ==== var id; class C { [0 + 1]() { } @@ -18,6 +19,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,1 !!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. ~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + ~~ +!!! error TS1102: 'delete' cannot be called on an identifier in strict mode. set [[0, 1]](v) { } ~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.js b/tests/baselines/reference/computedPropertyNames46_ES5.js index 815f5769f3b..307dadcbe91 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.js +++ b/tests/baselines/reference/computedPropertyNames46_ES5.js @@ -6,5 +6,6 @@ var o = { //// [computedPropertyNames46_ES5.js] var o = (_a = {}, _a["" || 0] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.js b/tests/baselines/reference/computedPropertyNames47_ES5.js index a2fff2110b4..d03b614b29b 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.js +++ b/tests/baselines/reference/computedPropertyNames47_ES5.js @@ -16,5 +16,6 @@ var E2; })(E2 || (E2 = {})); var o = (_a = {}, _a[E1.x || E2.x] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.js b/tests/baselines/reference/computedPropertyNames48_ES5.js index 55b08ef8301..15123a98f30 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.js +++ b/tests/baselines/reference/computedPropertyNames48_ES5.js @@ -25,11 +25,14 @@ var E; var a; extractIndexer((_a = {}, _a[a] = "", - _a)); // Should return string + _a +)); // Should return string extractIndexer((_b = {}, _b[E.x] = "", - _b)); // Should return string + _b +)); // Should return string extractIndexer((_c = {}, _c["" || 0] = "", - _c)); // Should return any (widened form of undefined) + _c +)); // Should return any (widened form of undefined) var _a, _b, _c; diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.js b/tests/baselines/reference/computedPropertyNames49_ES5.js index 5f952c6f3f1..3427ea665a0 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.js +++ b/tests/baselines/reference/computedPropertyNames49_ES5.js @@ -27,24 +27,41 @@ var x = { //// [computedPropertyNames49_ES5.js] var x = (_a = { - p1: 10 -}, - _a.p1 = 10, - _a[1 + 1] = Object.defineProperty({ get: function () { + p1: 10 + }, + Object.defineProperty(_a, 1 + 1, { + get: function () { throw 10; - }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ get: function () { + }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 1 + 1, { + get: function () { return 10; - }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ set: function () { + }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 1 + 1, { + set: function () { // just throw throw 10; - }, enumerable: true, configurable: true }), - _a.foo = Object.defineProperty({ get: function () { + }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, "foo", { + get: function () { if (1 == 1) { return 10; } - }, enumerable: true, configurable: true }), + }, + enumerable: true, + configurable: true + }), + , _a.p2 = 20, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.js b/tests/baselines/reference/computedPropertyNames4_ES5.js index ac0fa8ec937..f91476c79c1 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.js +++ b/tests/baselines/reference/computedPropertyNames4_ES5.js @@ -32,5 +32,6 @@ var v = (_a = {}, _a[true] = 0, _a["hello bye"] = 0, _a["hello " + a + " bye"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.js b/tests/baselines/reference/computedPropertyNames50_ES5.js index 32502d80e0a..a74561295be 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.js +++ b/tests/baselines/reference/computedPropertyNames50_ES5.js @@ -27,29 +27,37 @@ var x = { //// [computedPropertyNames50_ES5.js] var x = (_a = { - p1: 10, - get foo() { - if (1 == 1) { - return 10; - } - } -}, - _a.p1 = 10, - _a.foo = Object.defineProperty({ get: function () { + p1: 10, + get foo() { if (1 == 1) { return 10; } - }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ get: function () { + } + }, + Object.defineProperty(_a, 1 + 1, { + get: function () { throw 10; - }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ set: function () { + }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 1 + 1, { + set: function () { // just throw throw 10; - }, enumerable: true, configurable: true }), - _a[1 + 1] = Object.defineProperty({ get: function () { + }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 1 + 1, { + get: function () { return 10; - }, enumerable: true, configurable: true }), + }, + enumerable: true, + configurable: true + }), + , _a.p2 = 20, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.js b/tests/baselines/reference/computedPropertyNames5_ES5.js index 3367faa2c20..58c5af2efa3 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.js +++ b/tests/baselines/reference/computedPropertyNames5_ES5.js @@ -18,5 +18,6 @@ var v = (_a = {}, _a[{}] = 0, _a[undefined] = undefined, _a[null] = null, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.js b/tests/baselines/reference/computedPropertyNames6_ES5.js index 29d035bfcbf..7e9c6202940 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.js +++ b/tests/baselines/reference/computedPropertyNames6_ES5.js @@ -16,5 +16,6 @@ var v = (_a = {}, _a[p1] = 0, _a[p2] = 1, _a[p3] = 2, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.js b/tests/baselines/reference/computedPropertyNames7_ES5.js index 01cf2efc030..3311ec7e092 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.js +++ b/tests/baselines/reference/computedPropertyNames7_ES5.js @@ -13,5 +13,6 @@ var E; })(E || (E = {})); var v = (_a = {}, _a[E.member] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.js b/tests/baselines/reference/computedPropertyNames8_ES5.js index 82d262c7e4e..6eceee81adb 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.js +++ b/tests/baselines/reference/computedPropertyNames8_ES5.js @@ -15,6 +15,7 @@ function f() { var v = (_a = {}, _a[t] = 0, _a[u] = 1, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.js b/tests/baselines/reference/computedPropertyNames9_ES5.js index b1ac6c9e3b6..6c1d7bcb4d0 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.js +++ b/tests/baselines/reference/computedPropertyNames9_ES5.js @@ -16,5 +16,6 @@ var v = (_a = {}, _a[f("")] = 0, _a[f(0)] = 0, _a[f(true)] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js index d8a33951d4a..1f7a3ae123e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js @@ -12,5 +12,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js index 1ee88351154..c4bfde03531 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + 0] = function (y) { return y.length; }, _a["" + 1] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js index 6be09e4bef3..945475f8533 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js index b510cda2916..98042f201e3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js @@ -12,5 +12,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js index 0c319a526f4..b17f91be38b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js index 51d78be59d4..c7a728e5ef8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js index f50231e3f0f..c97b7c5b1f8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js @@ -15,13 +15,12 @@ foo({ //// [computedPropertyNamesContextualType6_ES5.js] foo((_a = { - p: "", - 0: function () { } -}, - _a.p = "", - _a[0] = function () { }, + p: "", + 0: function () { } + }, _a["hi" + "bye"] = true, _a[0 + 1] = 0, _a[+"hi"] = [0], - _a)); + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js index e1c567c62d9..9ca7e826aa7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js @@ -15,13 +15,12 @@ foo({ //// [computedPropertyNamesContextualType7_ES5.js] foo((_a = { - p: "", - 0: function () { } -}, - _a.p = "", - _a[0] = function () { }, + p: "", + 0: function () { } + }, _a["hi" + "bye"] = true, _a[0 + 1] = 0, _a[+"hi"] = [0], - _a)); + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js index 24f6218864c..419ea906550 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js index 340802da2af..d3beb8b8deb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js index 58c3133e6ee..e77eb79dc70 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js @@ -10,9 +10,18 @@ var v = { var v = (_a = {}, _a["" + ""] = 0, _a["" + ""] = function () { }, - _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), - _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }), - _a); + Object.defineProperty(_a, "" + "", { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, "" + "", { + set: function (x) { }, + enumerable: true, + configurable: true + }), + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 972aaf9b52f..39e393c46cc 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -10,6 +10,7 @@ var v = (_a = {}, _a["hello"] = function () { debugger; }, - _a); + _a +); var _a; //# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index 413c98fa456..d36428a0379 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;OACH,OAAO;QACJ,QAAQ,CAAC;IACb,CAAC;OACJ,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index 03eec606718..74d69f566a0 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -24,45 +24,53 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) --- >>> _a["hello"] = function () { -1->^^^^^^^ -2 > ^^^^^^^ -3 > ^^^^-> +1->^^^^ +2 > ^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^-> 1->{ - > [ -2 > "hello" -1->Emitted(2, 8) Source(2, 6) + SourceIndex(0) -2 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) + > +2 > [ +3 > "hello" +4 > ] +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0) +3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ -1->]() { +1->() { > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"]) +2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (["hello"]) +3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) name (["hello"]) --- >>> }, 1 >^^^^ 2 > ^ -3 > ^^^^-> +3 > ^^-> 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (["hello"]) +2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) name (["hello"]) --- ->>> _a); -1->^^^^^^^ -2 > ^ +>>> _a +>>>); +1->^ +2 > ^ +3 > ^^^^^^-> 1-> >} -2 > -1->Emitted(5, 8) Source(5, 2) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) +2 > +1->Emitted(6, 2) Source(5, 2) + SourceIndex(0) +2 >Emitted(6, 3) Source(5, 2) + SourceIndex(0) --- >>>var _a; >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/constructorStaticParamName.errors.txt b/tests/baselines/reference/constructorStaticParamName.errors.txt new file mode 100644 index 00000000000..ac50edd22f1 --- /dev/null +++ b/tests/baselines/reference/constructorStaticParamName.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/constructorStaticParamName.ts(4,18): error TS1003: Identifier expected. + + +==== tests/cases/compiler/constructorStaticParamName.ts (1 errors) ==== + // static as constructor parameter name should only give error if 'use strict' + + class test { + constructor (static) { } + ~~~~~~ +!!! error TS1003: Identifier expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js index cf74aed2ebc..85b22867442 100644 --- a/tests/baselines/reference/constructorStaticParamName.js +++ b/tests/baselines/reference/constructorStaticParamName.js @@ -9,7 +9,7 @@ class test { //// [constructorStaticParamName.js] // static as constructor parameter name should only give error if 'use strict' var test = (function () { - function test(static) { + function test() { } return test; })(); diff --git a/tests/baselines/reference/constructorStaticParamName.types b/tests/baselines/reference/constructorStaticParamName.types deleted file mode 100644 index 9fdc94e4a73..00000000000 --- a/tests/baselines/reference/constructorStaticParamName.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/constructorStaticParamName.ts === -// static as constructor parameter name should only give error if 'use strict' - -class test { ->test : test - - constructor (static) { } ->static : any -} - diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index fa1c6bea381..75de7c32ebc 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -21,27 +21,47 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(65,29): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(94,17): error TS1134: Variable declaration expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(95,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2304: Cannot find name 'any'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,30): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,37): error TS2304: Cannot find name 'declare'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,47): error TS2304: Cannot find name 'constructor'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,61): error TS2304: Cannot find name 'get'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,67): error TS2304: Cannot find name 'implements'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(111,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,9): error TS2304: Cannot find name 'STATEMENTS'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,21): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,30): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(118,39): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,16): error TS2304: Cannot find name 'TYPES'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,23): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(155,32): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,16): error TS2304: Cannot find name 'OPERATOR'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(176,35): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(210,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,29): error TS2304: Cannot find name 'yield'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. @@ -49,7 +69,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. @@ -64,27 +83,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (84 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (99 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -199,6 +214,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// public VARIABLES(): number { + ~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. var local = Number.MAX_VALUE; var min = Number.MIN_VALUE; var inf = Number.NEGATIVE_INFINITY - @@ -238,7 +255,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS var constructor = 0; var get = 0; var implements = 0; + ~~~~~~~~~~ +!!! error TS1134: Variable declaration expected. var interface = 0; + ~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. var let = 0; var module = 0; var number = 0; @@ -256,11 +277,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1109: Expression expected. var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. + ~~~ +!!! error TS2304: Cannot find name 'any'. + ~~~~ +!!! error TS2304: Cannot find name 'bool'. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'constructor'. + ~~~ +!!! error TS2304: Cannot find name 'get'. + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'implements'. return 0; } + ~ +!!! error TS1128: Declaration or statement expected. /// /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally @@ -268,6 +301,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// STATEMENTS(i: number): number { + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'STATEMENTS'. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var retVal = 0; if (i == 1) retVal = 1; @@ -311,6 +352,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS /// /// public TYPES(): number { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'TYPES'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var retVal = 0; var c = new CLASS(); var xx: IF = c; @@ -340,6 +389,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ///// ///// public OPERATOR(): number { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'OPERATOR'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. var a: number[] = [1, 2, 3, 4, 5, ];/*[] bug*/ // YES [] var i = a[1];/*[]*/ i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ @@ -378,6 +435,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS } } + ~ +!!! error TS1128: Declaration or statement expected. interface IF { Foo(): bool; @@ -390,10 +449,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS case d = () => { yield 0; }; ~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~ -!!! error TS2304: Cannot find name 'yield'. - ~ -!!! error TS1005: ';' expected. public get Property() { return 0; } public Member() { return 0; @@ -425,8 +480,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS2304: Cannot find name 'val'. ~ !!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'number'. ~ !!! error TS1005: ';' expected. return val; @@ -476,8 +529,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS2304: Cannot find name 'value'. ~ !!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. public Overloads( while : string, ...rest: string[]) { & ~~~~~~ !!! error TS1128: Declaration or statement expected. @@ -487,20 +538,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1135: Argument expression expected. ~ !!! error TS1005: '(' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. ~~~ !!! error TS1109: Expression expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'string'. ~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. public DefaultValue(value?: string = "Hello") { } - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. ~~~~~~~~~~~~ !!! error TS1005: ';' expected. ~~~~~~~~~~~~ @@ -510,7 +555,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2304: Cannot find name 'string'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 64c70273872..4fb940bc9ec 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -342,6 +342,7 @@ var TypeScriptAllInOne; })(TypeScriptAllInOne || (TypeScriptAllInOne = {})); var BasicFeatures = (function () { function BasicFeatures() { + this.implements = 0; } /// /// Test various of variables. Including nullable,key world as variable,special format @@ -374,120 +375,118 @@ var BasicFeatures = (function () { var declare = 0; var constructor = 0; var get = 0; - var implements = 0; - var interface = 0; - var let = 0; - var module = 0; - var number = 0; - var package = 0; - var private = 0; - var protected = 0; - var public = 0; - var set = 0; - var static = 0; - var string = 0 / > - ; - var yield = 0; - var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; - return 0; - }; - /// - /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally - /// - /// - /// - BasicFeatures.prototype.STATEMENTS = function (i) { - var retVal = 0; - if (i == 1) - retVal = 1; - else - retVal = 0; - switch (i) { - case 2: - retVal = 1; - break; - case 3: - retVal = 1; - break; - default: - break; - } - for (var x in { x: 0, y: 1 }) { - !; - try { - throw null; - } - catch (Exception) { } - } - try { - } - finally { - try { } - catch (Exception) { } - } - return retVal; - }; - /// - /// Test types in ts language. Including class,struct,interface,delegate,anonymous type - /// - /// - BasicFeatures.prototype.TYPES = function () { - var retVal = 0; - var c = new CLASS(); - var xx = c; - retVal += ; - try { } - catch () { } - Property; - retVal += c.Member(); - retVal += xx.Foo() ? 0 : 1; - //anonymous type - var anony = { a: new CLASS() }; - retVal += anony.a.d(); - return retVal; - }; - ///// - ///// Test different operators - ///// - ///// - BasicFeatures.prototype.OPERATOR = function () { - var a = [1, 2, 3, 4, 5,]; /*[] bug*/ // YES [] - var i = a[1]; /*[]*/ - i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ - var b = true && false || true ^ false; /*& | ^*/ - b = !b; /*!*/ - i = ~i; /*~i*/ - b = i < (i - 1) && (i + 1) > i; /*< && >*/ - var f = true ? 1 : 0; /*? :*/ // YES : - i++; /*++*/ - i--; /*--*/ - b = true && false || true; /*&& ||*/ - i = i << 5; /*<<*/ - i = i >> 5; /*>>*/ - var j = i; - b = i == j && i != j && i <= j && i >= j; /*= == && != <= >=*/ - i += 5.0; /*+=*/ - i -= i; /*-=*/ - i *= i; /**=*/ - if (i == 0) - i++; - i /= i; /*/=*/ - i %= i; /*%=*/ - i &= i; /*&=*/ - i |= i; /*|=*/ - i ^= i; /*^=*/ - i <<= i; /*<<=*/ - i >>= i; /*>>=*/ - if (i == 0 && != b && f == 1) - return 0; - else - return 1; + var ; }; return BasicFeatures; })(); +var interface = 0; +var let = 0; +var module = 0; +var number = 0; +var package = 0; +var private = 0; +var protected = 0; +var public = 0; +var set = 0; +var static = 0; +var string = 0 / > +; +var yield = 0; +var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; +return 0; +/// +/// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally +/// +/// +/// +STATEMENTS(i, number); +number; +{ + var retVal = 0; + if (i == 1) + retVal = 1; + else + retVal = 0; + switch (i) { + case 2: + retVal = 1; + break; + case 3: + retVal = 1; + break; + default: + break; + } + for (var x in { x: 0, y: 1 }) { + !; + try { + throw null; + } + catch (Exception) { } + } + try { + } + finally { + try { } + catch (Exception) { } + } + return retVal; +} +TYPES(); +number; +{ + var retVal = 0; + var c = new CLASS(); + var xx = c; + retVal += ; + try { } + catch () { } + Property; + retVal += c.Member(); + retVal += xx.Foo() ? 0 : 1; + //anonymous type + var anony = { a: new CLASS() }; + retVal += anony.a.d(); + return retVal; +} +OPERATOR(); +number; +{ + var a = [1, 2, 3, 4, 5,]; /*[] bug*/ // YES [] + var i = a[1]; /*[]*/ + i = i + i - i * i / i % i & i | i ^ i; /*+ - * / % & | ^*/ + var b = true && false || true ^ false; /*& | ^*/ + b = !b; /*!*/ + i = ~i; /*~i*/ + b = i < (i - 1) && (i + 1) > i; /*< && >*/ + var f = true ? 1 : 0; /*? :*/ // YES : + i++; /*++*/ + i--; /*--*/ + b = true && false || true; /*&& ||*/ + i = i << 5; /*<<*/ + i = i >> 5; /*>>*/ + var j = i; + b = i == j && i != j && i <= j && i >= j; /*= == && != <= >=*/ + i += 5.0; /*+=*/ + i -= i; /*-=*/ + i *= i; /**=*/ + if (i == 0) + i++; + i /= i; /*/=*/ + i %= i; /*%=*/ + i &= i; /*&=*/ + i |= i; /*|=*/ + i ^= i; /*^=*/ + i <<= i; /*<<=*/ + i >>= i; /*>>=*/ + if (i == 0 && != b && f == 1) + return 0; + else + return 1; +} var CLASS = (function () { function CLASS() { - this.d = function () { yield; 0; }; + this.d = function () { ; }; } Object.defineProperty(CLASS.prototype, "Property", { get: function () { return 0; }, diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt new file mode 100644 index 00000000000..932fda09be8 --- /dev/null +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -0,0 +1,353 @@ +tests/cases/compiler/convertKeywordsYes.ts(293,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(293,21): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(294,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(296,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(296,19): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(297,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(297,19): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(298,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(298,21): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(299,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(299,18): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(301,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(301,18): error TS1005: ';' expected. +tests/cases/compiler/convertKeywordsYes.ts(303,11): error TS1005: '{' expected. +tests/cases/compiler/convertKeywordsYes.ts(303,17): error TS1005: ';' expected. + + +==== tests/cases/compiler/convertKeywordsYes.ts (15 errors) ==== + // reserved ES5 future in strict mode + + var constructor = 0; + var any = 0; + var boolean = 0; + var implements = 0; + var interface = 0; + var let = 0; + var module = 0; + var number = 0; + var package = 0; + var private = 0; + var protected = 0; + var public = 0; + var set = 0; + var static = 0; + var string = 0; + var get = 0; + var yield = 0; + var declare = 0; + + function bigGeneric< + constructor, + implements , + interface , + let, + module , + package, + private , + protected, + public , + set , + static , + get , + yield, + declare + >(c: constructor, + a: any, + b2: boolean, + i: implements , + i2: interface , + l: let, + m: module , + n: number, + p: package, + p2: private , + p3: protected, + p4: public , + s: set , + s2: static , + s3: string, + g: get , + y: yield, + d: declare ) { } + + var bigObject = { + constructor: 0, + any: 0, + boolean: 0, + implements: 0, + interface: 0, + let: 0, + module: 0, + number: 0, + package: 0, + private: 0, + protected: 0, + public: 0, + set: 0, + static: 0, + string: 0, + get: 0, + yield: 0, + break: 0, + case: 0, + catch: 0, + class: 0, + continue: 0, + const: 0, + + debugger: 0, + declare: 0, + default: 0, + delete: 0, + do: 0, + else: 0, + enum: 0, + export: 0, + extends: 0, + false: 0, + finally: 0, + for: 0, + function: 0, + if: 0, + + import: 0, + in: 0, + instanceof: 0, + new: 0, + null: 0, + return: 0, + super: 0, + switch: 0, + this: 0, + throw: 0, + true: 0, + try: 0, + typeof: 0, + var: 0, + void: 0, + while: 0, + with: 0, + }; + + interface bigInterface { + constructor; + any; + boolean; + implements; + interface; + let; + module; + number; + package; + private; + protected; + public; + set; + static; + string; + get; + yield; + break; + case; + catch; + class; + continue; + const; + + debugger; + declare; + default; + delete; + do; + else; + enum; + export; + extends; + false; + finally; + for; + function; + if; + + import; + in; + instanceof; + new; + null; + return; + super; + switch; + this; + throw; + true; + try; + typeof; + var; + void; + while; + with; + } + + class bigClass { + public "constructor" = 0; + public any = 0; + public boolean = 0; + public implements = 0; + public interface = 0; + public let = 0; + public module = 0; + public number = 0; + public package = 0; + public private = 0; + public protected = 0; + public public = 0; + public set = 0; + public static = 0; + public string = 0; + public get = 0; + public yield = 0; + public break = 0; + public case = 0; + public catch = 0; + public class = 0; + public continue = 0; + public const = 0; + public debugger = 0; + public declare = 0; + public default = 0; + public delete = 0; + public do = 0; + public else = 0; + public enum = 0; + public export = 0; + public extends = 0; + public false = 0; + public finally = 0; + public for = 0; + public function = 0; + public if = 0; + public import = 0; + public in = 0; + public instanceof = 0; + public new = 0; + public null = 0; + public return = 0; + public super = 0; + public switch = 0; + public this = 0; + public throw = 0; + public true = 0; + public try = 0; + public typeof = 0; + public var = 0; + public void = 0; + public while = 0; + public with = 0; + } + + enum bigEnum { + constructor, + any, + boolean, + implements, + interface, + let, + module, + number, + package, + private, + protected, + public, + set, + static, + string, + get, + yield, + break, + case, + catch, + class, + continue, + const, + + debugger, + declare, + default, + delete, + do, + else, + enum, + export, + extends, + false, + finally, + for, + function, + if, + + import, + in, + instanceof, + new, + null, + return, + super, + switch, + this, + throw, + true, + try, + typeof, + var, + void, + while, + with, + } + + module bigModule { + class constructor { } + class implements { } + class interface { } + ~~~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class let { } + ~~~ +!!! error TS1005: '{' expected. + class module { } + class package { } + ~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class private { } + ~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class protected { } + ~~~~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class public { } + ~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class set { } + class static { } + ~~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class get { } + class yield { } + ~~~~~ +!!! error TS1005: '{' expected. + ~ +!!! error TS1005: ';' expected. + class declare { } + } \ No newline at end of file diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index a68f751f434..2b17e744b66 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -505,66 +505,81 @@ var bigModule; } return constructor; })(); - var implements = (function () { - function implements() { + var default_1 = (function () { + function default_1() { } - return implements; + return default_1; })(); - var interface = (function () { - function interface() { + var default_2 = (function () { + function default_2() { } - return interface; + return default_2; })(); - var let = (function () { - function let() { + interface; + { } + var default_3 = (function () { + function default_3() { } - return let; + return default_3; })(); + var _a = void 0; var module = (function () { function module() { } return module; })(); - var package = (function () { - function package() { + var default_4 = (function () { + function default_4() { } - return package; + return default_4; })(); - var private = (function () { - function private() { + package; + { } + var default_5 = (function () { + function default_5() { } - return private; + return default_5; })(); - var protected = (function () { - function protected() { + private; + { } + var default_6 = (function () { + function default_6() { } - return protected; + return default_6; })(); - var public = (function () { - function public() { + protected; + { } + var default_7 = (function () { + function default_7() { } - return public; + return default_7; })(); + public; + { } var set = (function () { function set() { } return set; })(); - var static = (function () { - function static() { + var default_8 = (function () { + function default_8() { } - return static; + return default_8; })(); + static; + { } var get = (function () { function get() { } return get; })(); - var yield = (function () { - function yield() { + var default_9 = (function () { + function default_9() { } - return yield; + return default_9; })(); + yield; + { } var declare = (function () { function declare() { } diff --git a/tests/baselines/reference/convertKeywordsYes.types b/tests/baselines/reference/convertKeywordsYes.types deleted file mode 100644 index af2e0766181..00000000000 --- a/tests/baselines/reference/convertKeywordsYes.types +++ /dev/null @@ -1,879 +0,0 @@ -=== tests/cases/compiler/convertKeywordsYes.ts === -// reserved ES5 future in strict mode - -var constructor = 0; ->constructor : number - -var any = 0; ->any : number - -var boolean = 0; ->boolean : number - -var implements = 0; ->implements : number - -var interface = 0; ->interface : number - -var let = 0; ->let : number - -var module = 0; ->module : number - -var number = 0; ->number : number - -var package = 0; ->package : number - -var private = 0; ->private : number - -var protected = 0; ->protected : number - -var public = 0; ->public : number - -var set = 0; ->set : number - -var static = 0; ->static : number - -var string = 0; ->string : number - -var get = 0; ->get : number - -var yield = 0; ->yield : number - -var declare = 0; ->declare : number - -function bigGeneric< ->bigGeneric : (c: constructor, a: any, b2: boolean, i: implements, i2: interface, l: let, m: module, n: number, p: package, p2: private, p3: protected, p4: public, s: set, s2: static, s3: string, g: get, y: yield, d: declare) => void - - constructor, ->constructor : constructor - - implements , ->implements : implements - - interface , ->interface : interface - - let, ->let : let - - module , ->module : module - - package, ->package : package - - private , ->private : private - - protected, ->protected : protected - - public , ->public : public - - set , ->set : set - - static , ->static : static - - get , ->get : get - - yield, ->yield : yield - - declare ->declare : declare - - >(c: constructor, ->c : constructor ->constructor : constructor - - a: any, ->a : any - - b2: boolean, ->b2 : boolean - - i: implements , ->i : implements ->implements : implements - - i2: interface , ->i2 : interface ->interface : interface - - l: let, ->l : let ->let : let - - m: module , ->m : module ->module : module - - n: number, ->n : number - - p: package, ->p : package ->package : package - - p2: private , ->p2 : private ->private : private - - p3: protected, ->p3 : protected ->protected : protected - - p4: public , ->p4 : public ->public : public - - s: set , ->s : set ->set : set - - s2: static , ->s2 : static ->static : static - - s3: string, ->s3 : string - - g: get , ->g : get ->get : get - - y: yield, ->y : yield ->yield : yield - - d: declare ) { } ->d : declare ->declare : declare - -var bigObject = { ->bigObject : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } ->{ constructor: 0, any: 0, boolean: 0, implements: 0, interface: 0, let: 0, module: 0, number: 0, package: 0, private: 0, protected: 0, public: 0, set: 0, static: 0, string: 0, get: 0, yield: 0, break: 0, case: 0, catch: 0, class: 0, continue: 0, const: 0, debugger: 0, declare: 0, default: 0, delete: 0, do: 0, else: 0, enum: 0, export: 0, extends: 0, false: 0, finally: 0, for: 0, function: 0, if: 0, import: 0, in: 0, instanceof: 0, new: 0, null: 0, return: 0, super: 0, switch: 0, this: 0, throw: 0, true: 0, try: 0, typeof: 0, var: 0, void: 0, while: 0, with: 0,} : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } - - constructor: 0, ->constructor : number - - any: 0, ->any : number - - boolean: 0, ->boolean : number - - implements: 0, ->implements : number - - interface: 0, ->interface : number - - let: 0, ->let : number - - module: 0, ->module : number - - number: 0, ->number : number - - package: 0, ->package : number - - private: 0, ->private : number - - protected: 0, ->protected : number - - public: 0, ->public : number - - set: 0, ->set : number - - static: 0, ->static : number - - string: 0, ->string : number - - get: 0, ->get : number - - yield: 0, ->yield : number - - break: 0, ->break : number - - case: 0, ->case : number - - catch: 0, ->catch : number - - class: 0, ->class : number - - continue: 0, ->continue : number - - const: 0, ->const : number - - debugger: 0, ->debugger : number - - declare: 0, ->declare : number - - default: 0, ->default : number - - delete: 0, ->delete : number - - do: 0, ->do : number - - else: 0, ->else : number - - enum: 0, ->enum : number - - export: 0, ->export : number - - extends: 0, ->extends : number - - false: 0, ->false : number - - finally: 0, ->finally : number - - for: 0, ->for : number - - function: 0, ->function : number - - if: 0, ->if : number - - import: 0, ->import : number - - in: 0, ->in : number - - instanceof: 0, ->instanceof : number - - new: 0, ->new : number - - null: 0, ->null : number - - return: 0, ->return : number - - super: 0, ->super : number - - switch: 0, ->switch : number - - this: 0, ->this : number - - throw: 0, ->throw : number - - true: 0, ->true : number - - try: 0, ->try : number - - typeof: 0, ->typeof : number - - var: 0, ->var : number - - void: 0, ->void : number - - while: 0, ->while : number - - with: 0, ->with : number - -}; - -interface bigInterface { ->bigInterface : bigInterface - - constructor; ->constructor : any - - any; ->any : any - - boolean; ->boolean : any - - implements; ->implements : any - - interface; ->interface : any - - let; ->let : any - - module; ->module : any - - number; ->number : any - - package; ->package : any - - private; ->private : any - - protected; ->protected : any - - public; ->public : any - - set; ->set : any - - static; ->static : any - - string; ->string : any - - get; ->get : any - - yield; ->yield : any - - break; ->break : any - - case; ->case : any - - catch; ->catch : any - - class; ->class : any - - continue; ->continue : any - - const; ->const : any - - debugger; ->debugger : any - - declare; ->declare : any - - default; ->default : any - - delete; ->delete : any - - do; ->do : any - - else; ->else : any - - enum; ->enum : any - - export; ->export : any - - extends; ->extends : any - - false; ->false : any - - finally; ->finally : any - - for; ->for : any - - function; ->function : any - - if; ->if : any - - import; ->import : any - - in; ->in : any - - instanceof; ->instanceof : any - - new; ->new : any - - null; ->null : any - - return; ->return : any - - super; ->super : any - - switch; ->switch : any - - this; ->this : any - - throw; ->throw : any - - true; ->true : any - - try; ->try : any - - typeof; ->typeof : any - - var; ->var : any - - void; ->void : any - - while; ->while : any - - with; ->with : any -} - -class bigClass { ->bigClass : bigClass - - public "constructor" = 0; - public any = 0; ->any : number - - public boolean = 0; ->boolean : number - - public implements = 0; ->implements : number - - public interface = 0; ->interface : number - - public let = 0; ->let : number - - public module = 0; ->module : number - - public number = 0; ->number : number - - public package = 0; ->package : number - - public private = 0; ->private : number - - public protected = 0; ->protected : number - - public public = 0; ->public : number - - public set = 0; ->set : number - - public static = 0; ->static : number - - public string = 0; ->string : number - - public get = 0; ->get : number - - public yield = 0; ->yield : number - - public break = 0; ->break : number - - public case = 0; ->case : number - - public catch = 0; ->catch : number - - public class = 0; ->class : number - - public continue = 0; ->continue : number - - public const = 0; ->const : number - - public debugger = 0; ->debugger : number - - public declare = 0; ->declare : number - - public default = 0; ->default : number - - public delete = 0; ->delete : number - - public do = 0; ->do : number - - public else = 0; ->else : number - - public enum = 0; ->enum : number - - public export = 0; ->export : number - - public extends = 0; ->extends : number - - public false = 0; ->false : number - - public finally = 0; ->finally : number - - public for = 0; ->for : number - - public function = 0; ->function : number - - public if = 0; ->if : number - - public import = 0; ->import : number - - public in = 0; ->in : number - - public instanceof = 0; ->instanceof : number - - public new = 0; ->new : number - - public null = 0; ->null : number - - public return = 0; ->return : number - - public super = 0; ->super : number - - public switch = 0; ->switch : number - - public this = 0; ->this : number - - public throw = 0; ->throw : number - - public true = 0; ->true : number - - public try = 0; ->try : number - - public typeof = 0; ->typeof : number - - public var = 0; ->var : number - - public void = 0; ->void : number - - public while = 0; ->while : number - - public with = 0; ->with : number -} - -enum bigEnum { ->bigEnum : bigEnum - - constructor, ->constructor : bigEnum - - any, ->any : bigEnum - - boolean, ->boolean : bigEnum - - implements, ->implements : bigEnum - - interface, ->interface : bigEnum - - let, ->let : bigEnum - - module, ->module : bigEnum - - number, ->number : bigEnum - - package, ->package : bigEnum - - private, ->private : bigEnum - - protected, ->protected : bigEnum - - public, ->public : bigEnum - - set, ->set : bigEnum - - static, ->static : bigEnum - - string, ->string : bigEnum - - get, ->get : bigEnum - - yield, ->yield : bigEnum - - break, ->break : bigEnum - - case, ->case : bigEnum - - catch, ->catch : bigEnum - - class, ->class : bigEnum - - continue, ->continue : bigEnum - - const, ->const : bigEnum - - debugger, ->debugger : bigEnum - - declare, ->declare : bigEnum - - default, ->default : bigEnum - - delete, ->delete : bigEnum - - do, ->do : bigEnum - - else, ->else : bigEnum - - enum, ->enum : bigEnum - - export, ->export : bigEnum - - extends, ->extends : bigEnum - - false, ->false : bigEnum - - finally, ->finally : bigEnum - - for, ->for : bigEnum - - function, ->function : bigEnum - - if, ->if : bigEnum - - import, ->import : bigEnum - - in, ->in : bigEnum - - instanceof, ->instanceof : bigEnum - - new, ->new : bigEnum - - null, ->null : bigEnum - - return, ->return : bigEnum - - super, ->super : bigEnum - - switch, ->switch : bigEnum - - this, ->this : bigEnum - - throw, ->throw : bigEnum - - true, ->true : bigEnum - - try, ->try : bigEnum - - typeof, ->typeof : bigEnum - - var, ->var : bigEnum - - void, ->void : bigEnum - - while, ->while : bigEnum - - with, ->with : bigEnum -} - -module bigModule { ->bigModule : typeof bigModule - - class constructor { } ->constructor : constructor - - class implements { } ->implements : implements - - class interface { } ->interface : interface - - class let { } ->let : let - - class module { } ->module : module - - class package { } ->package : package - - class private { } ->private : private - - class protected { } ->protected : protected - - class public { } ->public : public - - class set { } ->set : set - - class static { } ->static : static - - class get { } ->get : get - - class yield { } ->yield : yield - - class declare { } ->declare : declare -} diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js index 24be2517469..cd5c51e7a93 100644 --- a/tests/baselines/reference/decoratorOnClass1.js +++ b/tests/baselines/reference/decoratorOnClass1.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js index 92741819e94..fbd9a106ddf 100644 --- a/tests/baselines/reference/decoratorOnClass2.js +++ b/tests/baselines/reference/decoratorOnClass2.js @@ -6,23 +6,19 @@ export class C { } //// [decoratorOnClass2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); exports.C = C; diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js index 766acc42072..21536028091 100644 --- a/tests/baselines/reference/decoratorOnClass3.js +++ b/tests/baselines/reference/decoratorOnClass3.js @@ -7,22 +7,18 @@ class C { } //// [decoratorOnClass3.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec], C); + C = __decorate([ + dec + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js index 95bde549379..5099d16b5b4 100644 --- a/tests/baselines/reference/decoratorOnClass4.js +++ b/tests/baselines/reference/decoratorOnClass4.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js index a93d625f491..0555f618e7e 100644 --- a/tests/baselines/reference/decoratorOnClass5.js +++ b/tests/baselines/reference/decoratorOnClass5.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js index 0e782d45e11..fad73c0c8fc 100644 --- a/tests/baselines/reference/decoratorOnClass8.js +++ b/tests/baselines/reference/decoratorOnClass8.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClass8.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - C = __decorate([dec()], C); + C = __decorate([ + dec() + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js index c8a96c40721..68fa7ccec0a 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.js @@ -6,18 +6,12 @@ class C { } //// [decoratorOnClassAccessor1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { @@ -27,6 +21,9 @@ var C = (function () { enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js index bffbfb4b700..17d3e2e422d 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.js +++ b/tests/baselines/reference/decoratorOnClassAccessor2.js @@ -6,18 +6,12 @@ class C { } //// [decoratorOnClassAccessor2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { @@ -27,6 +21,9 @@ var C = (function () { enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt index b75b7e0d8b6..1a1e6503355 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt @@ -1,35 +1,11 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,17): error TS2304: Cannot find name 'get'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,21): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,21): error TS2304: Cannot find name 'accessor'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,32): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (9 errors) ==== +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec get accessor() { return 1; } ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~ -!!! error TS2304: Cannot find name 'get'. - ~~~~~~~~ -!!! error TS1005: ';' expected. - ~~~~~~~~ -!!! error TS2304: Cannot find name 'accessor'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js index f48a755953f..23e689f3114 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.js +++ b/tests/baselines/reference/decoratorOnClassAccessor3.js @@ -6,14 +6,24 @@ class C { } //// [decoratorOnClassAccessor3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + Object.defineProperty(C.prototype, "accessor", { + get: function () { return 1; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); -public; -get; -accessor(); -{ - return 1; -} diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js index 1b4853b69bc..77bcb568fe1 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.js +++ b/tests/baselines/reference/decoratorOnClassAccessor4.js @@ -6,18 +6,12 @@ class C { } //// [decoratorOnClassAccessor4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { @@ -27,6 +21,9 @@ var C = (function () { enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js index eec246c7ead..37fc33abefd 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.js +++ b/tests/baselines/reference/decoratorOnClassAccessor5.js @@ -6,18 +6,12 @@ class C { } //// [decoratorOnClassAccessor5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { @@ -27,6 +21,9 @@ var C = (function () { enumerable: true, configurable: true }); - Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt index ec22ae0b3e1..f43827c0e4b 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt @@ -1,44 +1,11 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,17): error TS2304: Cannot find name 'set'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,21): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,21): error TS2304: Cannot find name 'accessor'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,30): error TS2304: Cannot find name 'value'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,35): error TS1005: ',' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,37): error TS2304: Cannot find name 'number'. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,45): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (12 errors) ==== +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec set accessor(value: number) { } ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~ -!!! error TS2304: Cannot find name 'set'. - ~~~~~~~~ -!!! error TS1005: ';' expected. - ~~~~~~~~ -!!! error TS2304: Cannot find name 'accessor'. - ~~~~~ -!!! error TS2304: Cannot find name 'value'. - ~ -!!! error TS1005: ',' expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'number'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js index 771d937634f..465e13ebb1d 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor6.js @@ -6,12 +6,24 @@ class C { } //// [decoratorOnClassAccessor6.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + Object.defineProperty(C.prototype, "accessor", { + set: function (value) { }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "accessor", + __decorate([ + dec + ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); return C; })(); -public; -set; -accessor(value, number); -{ } diff --git a/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt b/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt index 14a164eccb4..279cf38894f 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt +++ b/tests/baselines/reference/decoratorOnClassConstructor1.errors.txt @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor class C { @dec constructor() {} - ~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js index 0c86a1ccf7a..a1748a725ba 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js @@ -6,22 +6,19 @@ class C { } //// [decoratorOnClassConstructorParameter1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { function C(p) { } - __decorate([dec], C, void 0, 0); + C = __decorate([ + __param(0, dec) + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt index 5969cfca069..61ff1433662 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt @@ -1,11 +1,14 @@ +tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts(4,17): error TS1003: Identifier expected. tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts(4,24): error TS1005: ',' expected. -==== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts (1 errors) ==== +==== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts (2 errors) ==== declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; class C { constructor(public @dec p: number) {} + ~~~~~~ +!!! error TS1003: Identifier expected. ~ !!! error TS1005: ',' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js index 07dc7cae075..638cb1cda7e 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -6,22 +6,19 @@ class C { } //// [decoratorOnClassConstructorParameter4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { - function C(public, p) { + function C(, p) { } - __decorate([dec], C, void 0, 1); + C = __decorate([ + __param(1, dec) + ], C); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js index b7230cca8b1..23be1094305 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.js @@ -6,23 +6,20 @@ class C { } //// [decoratorOnClassMethod1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } C.prototype.method = function () { }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js index 137a0c2839f..f87e3137777 100644 --- a/tests/baselines/reference/decoratorOnClassMethod10.js +++ b/tests/baselines/reference/decoratorOnClassMethod10.js @@ -6,23 +6,20 @@ class C { } //// [decoratorOnClassMethod10.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } C.prototype.method = function () { }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt new file mode 100644 index 00000000000..5e56c0b62a8 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts(5,10): error TS2331: 'this' cannot be referenced in a module body. + + +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts (1 errors) ==== + module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + ~~~~ +!!! error TS2331: 'this' cannot be referenced in a module body. + method() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js new file mode 100644 index 00000000000..71d4298f02c --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -0,0 +1,32 @@ +//// [decoratorOnClassMethod11.ts] +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } +} + +//// [decoratorOnClassMethod11.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var M; +(function (M) { + var C = (function () { + function C() { + } + C.prototype.decorator = function (target, key) { }; + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + this.decorator + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + return C; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.errors.txt b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt new file mode 100644 index 00000000000..14845839089 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts(6,10): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + + +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts (1 errors) ==== + module M { + class S { + decorator(target: Object, key: string): void { } + } + class C extends S { + @super.decorator + ~~~~~ +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + method() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js new file mode 100644 index 00000000000..7f23947929c --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -0,0 +1,46 @@ +//// [decoratorOnClassMethod12.ts] +module M { + class S { + decorator(target: Object, key: string): void { } + } + class C extends S { + @super.decorator + method() { } + } +} + +//// [decoratorOnClassMethod12.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var M; +(function (M) { + var S = (function () { + function S() { + } + S.prototype.decorator = function (target, key) { }; + return S; + })(); + var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + _super.decorator + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + return C; + })(S); +})(M || (M = {})); diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js new file mode 100644 index 00000000000..4321bbb0156 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.js @@ -0,0 +1,29 @@ +//// [decoratorOnClassMethod13.ts] +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; + +class C { + @dec ["1"]() { } + @dec ["b"]() { } +} + +//// [decoratorOnClassMethod13.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +class C { + [_a = "1"]() { } + [_b = "b"]() { } +} +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _b, + __decorate([ + dec + ], C.prototype, _b, Object.getOwnPropertyDescriptor(C.prototype, _b))); +var _a, _b; diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types new file mode 100644 index 00000000000..8c34805792f --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -0,0 +1,21 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>T : T +>target : any +>propertyKey : string +>descriptor : TypedPropertyDescriptor +>TypedPropertyDescriptor : TypedPropertyDescriptor +>T : T +>TypedPropertyDescriptor : TypedPropertyDescriptor +>T : T + +class C { +>C : C + + @dec ["1"]() { } +>dec : unknown + + @dec ["b"]() { } +>dec : unknown +} diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js index ceddff2f150..33a22f419d4 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.js +++ b/tests/baselines/reference/decoratorOnClassMethod2.js @@ -6,23 +6,20 @@ class C { } //// [decoratorOnClassMethod2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } C.prototype.method = function () { }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt index b2173dedf9e..2775ab9f144 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt @@ -1,29 +1,11 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,17): error TS2304: Cannot find name 'method'. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,26): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (7 errors) ==== +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { public @dec method() {} ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'method'. - ~ -!!! error TS1005: ';' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js index 3ac97697e80..f93b7d7a6b2 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.js +++ b/tests/baselines/reference/decoratorOnClassMethod3.js @@ -6,11 +6,20 @@ class C { } //// [decoratorOnClassMethod3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + C.prototype.method = function () { }; + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); -public; -method(); -{ } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js index 55798a2e1db..038432f2cf0 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.js +++ b/tests/baselines/reference/decoratorOnClassMethod4.js @@ -6,21 +6,18 @@ class C { } //// [decoratorOnClassMethod4.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js index 2fe671e1b52..460c11f145b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.js +++ b/tests/baselines/reference/decoratorOnClassMethod5.js @@ -6,21 +6,18 @@ class C { } //// [decoratorOnClassMethod5.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec()], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec() + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js index 2e828d6ad4d..9f120599183 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.js +++ b/tests/baselines/reference/decoratorOnClassMethod6.js @@ -6,21 +6,18 @@ class C { } //// [decoratorOnClassMethod6.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js index 0b0f5abc4fa..6ab01e68bba 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.js +++ b/tests/baselines/reference/decoratorOnClassMethod7.js @@ -6,21 +6,18 @@ class C { } //// [decoratorOnClassMethod7.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; class C { [_a = "method"]() { } } -Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); +Object.defineProperty(C.prototype, _a, + __decorate([ + dec + ], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); var _a; diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js index 89afc665143..3e88f8c2793 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.js +++ b/tests/baselines/reference/decoratorOnClassMethod8.js @@ -6,23 +6,20 @@ class C { } //// [decoratorOnClassMethod8.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } C.prototype.method = function () { }; - Object.defineProperty(C.prototype, "method", __decorate([dec], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); + Object.defineProperty(C.prototype, "method", + __decorate([ + dec + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js index dcd6c123527..d228ed9302b 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js @@ -6,23 +6,21 @@ class C { } //// [decoratorOnClassMethodParameter1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { function C() { } C.prototype.method = function (p) { }; - __decorate([dec], C.prototype, "method", 0); + Object.defineProperty(C.prototype, "method", + __decorate([ + __param(0, dec) + ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js index efc6a2c04db..aa38252b995 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty1.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js index d55eb71e3c6..bccbc0bb737 100644 --- a/tests/baselines/reference/decoratorOnClassProperty10.js +++ b/tests/baselines/reference/decoratorOnClassProperty10.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty10.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec()], C.prototype, "prop"); + __decorate([ + dec() + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js index 63e5f8d02e9..f31e40d3c40 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.js +++ b/tests/baselines/reference/decoratorOnClassProperty11.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty11.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js index d52baa79202..477320b40fa 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.js +++ b/tests/baselines/reference/decoratorOnClassProperty2.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty2.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt index 29438bd67a9..a6321c55426 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt @@ -1,26 +1,11 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,5): error TS2304: Cannot find name 'public'. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,12): error TS1005: ';' expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,16): error TS1146: Declaration expected. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,17): error TS2304: Cannot find name 'prop'. -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(5,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (6 errors) ==== +==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (1 errors) ==== declare function dec(target: any, propertyKey: string): void; class C { public @dec prop; ~~~~~~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~ -!!! error TS2304: Cannot find name 'public'. - ~ -!!! error TS1005: ';' expected. - -!!! error TS1146: Declaration expected. - ~~~~ -!!! error TS2304: Cannot find name 'prop'. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js index 6c9945677ca..05476c66e7d 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.js +++ b/tests/baselines/reference/decoratorOnClassProperty3.js @@ -6,10 +6,18 @@ class C { } //// [decoratorOnClassProperty3.js] +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; var C = (function () { function C() { } + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); -public; -prop; diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js index 7f087156bc7..46e2d5fc069 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.js +++ b/tests/baselines/reference/decoratorOnClassProperty6.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty6.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js index ba2c8383a2c..14ca0612cb1 100644 --- a/tests/baselines/reference/decoratorOnClassProperty7.js +++ b/tests/baselines/reference/decoratorOnClassProperty7.js @@ -6,22 +6,18 @@ class C { } //// [decoratorOnClassProperty7.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; var C = (function () { function C() { } - __decorate([dec], C.prototype, "prop"); + __decorate([ + dec + ], C.prototype, "prop"); return C; })(); diff --git a/tests/baselines/reference/decoratorOnEnum.errors.txt b/tests/baselines/reference/decoratorOnEnum.errors.txt index 21a6d39aab5..8adf03e548c 100644 --- a/tests/baselines/reference/decoratorOnEnum.errors.txt +++ b/tests/baselines/reference/decoratorOnEnum.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts(4,6): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnEnum.ts (1 errors) ==== declare function dec(target: T): T; @dec - enum E { - ~ + ~ !!! error TS1206: Decorators are not valid here. + enum E { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt b/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt index bda00f1a85f..24d5eb35092 100644 --- a/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt +++ b/tests/baselines/reference/decoratorOnFunctionDeclaration.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts(4,10): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnFunctionDeclaration.ts (1 errors) ==== declare function dec(target: T): T; @dec - function F() { - ~ + ~ !!! error TS1206: Decorators are not valid here. + function F() { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt index a09a0b01427..cc75018ca49 100644 --- a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt +++ b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt @@ -10,8 +10,7 @@ tests/cases/conformance/decorators/invalid/decoratorOnImportEquals1.ts(8,5): err module M2 { @dec - ~~~~ - import X = M1.X; - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. + import X = M1.X; } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnImportEquals2.errors.txt b/tests/baselines/reference/decoratorOnImportEquals2.errors.txt index 5701afe569b..0c64db354e8 100644 --- a/tests/baselines/reference/decoratorOnImportEquals2.errors.txt +++ b/tests/baselines/reference/decoratorOnImportEquals2.errors.txt @@ -3,10 +3,9 @@ tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_1.ts(1,1): e ==== tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_1.ts (1 errors) ==== @dec - ~~~~ - import lib = require('./decoratorOnImportEquals2_0'); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS1206: Decorators are not valid here. + import lib = require('./decoratorOnImportEquals2_0'); declare function dec(target: T): T; ==== tests/cases/conformance/decorators/invalid/decoratorOnImportEquals2_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/decoratorOnInterface.errors.txt b/tests/baselines/reference/decoratorOnInterface.errors.txt index 055b43fa877..65aec166d70 100644 --- a/tests/baselines/reference/decoratorOnInterface.errors.txt +++ b/tests/baselines/reference/decoratorOnInterface.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts(4,11): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnInterface.ts (1 errors) ==== declare function dec(target: T): T; @dec - interface I { - ~ + ~ !!! error TS1206: Decorators are not valid here. + interface I { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnInternalModule.errors.txt b/tests/baselines/reference/decoratorOnInternalModule.errors.txt index 2fd92dfb250..e34e381d9e5 100644 --- a/tests/baselines/reference/decoratorOnInternalModule.errors.txt +++ b/tests/baselines/reference/decoratorOnInternalModule.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts(4,8): error TS1206: Decorators are not valid here. +tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts(3,1): error TS1206: Decorators are not valid here. ==== tests/cases/conformance/decorators/invalid/decoratorOnInternalModule.ts (1 errors) ==== declare function dec(target: T): T; @dec - module M { - ~ + ~ !!! error TS1206: Decorators are not valid here. + module M { } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt b/tests/baselines/reference/decoratorOnTypeAlias.errors.txt index 0d3109fe463..6d76a0b30d6 100644 --- a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt +++ b/tests/baselines/reference/decoratorOnTypeAlias.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/decorators/invalid/decoratorOnTypeAlias.ts(3,1): error T declare function dec(target: T): T; @dec - ~~~~ - type T = number; - ~~~~~~~~~~~~~~~~ -!!! error TS1206: Decorators are not valid here. \ No newline at end of file + ~ +!!! error TS1206: Decorators are not valid here. + type T = number; \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnVar.errors.txt b/tests/baselines/reference/decoratorOnVar.errors.txt index bd87357edad..a2262adf748 100644 --- a/tests/baselines/reference/decoratorOnVar.errors.txt +++ b/tests/baselines/reference/decoratorOnVar.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/decorators/invalid/decoratorOnVar.ts(3,1): error TS1206: declare function dec(target: T): T; @dec - ~~~~ - var x: number; - ~~~~~~~~~~~~~~ -!!! error TS1206: Decorators are not valid here. \ No newline at end of file + ~ +!!! error TS1206: Decorators are not valid here. + var x: number; \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt new file mode 100644 index 00000000000..58973f2a096 --- /dev/null +++ b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt @@ -0,0 +1,24 @@ +tests/cases/compiler/exportDeclarationInInternalModule.ts(14,19): error TS1141: String literal expected. + + +==== tests/cases/compiler/exportDeclarationInInternalModule.ts (1 errors) ==== + + class Bbb { + } + + class Aaa extends Bbb { } + + module Aaa { + export class SomeType { } + } + + module Bbb { + export class SomeType { } + + export * from Aaa; // this line causes the nullref + ~~~ +!!! error TS1141: String literal expected. + } + + var a: Bbb.SomeType; + \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js new file mode 100644 index 00000000000..97011f2425f --- /dev/null +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -0,0 +1,76 @@ +//// [exportDeclarationInInternalModule.ts] + +class Bbb { +} + +class Aaa extends Bbb { } + +module Aaa { + export class SomeType { } +} + +module Bbb { + export class SomeType { } + + export * from Aaa; // this line causes the nullref +} + +var a: Bbb.SomeType; + + +//// [exportDeclarationInInternalModule.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Bbb = (function () { + function Bbb() { + } + return Bbb; +})(); +var Aaa = (function (_super) { + __extends(Aaa, _super); + function Aaa() { + _super.apply(this, arguments); + } + return Aaa; +})(Bbb); +var Aaa; +(function (Aaa) { + var SomeType = (function () { + function SomeType() { + } + return SomeType; + })(); + Aaa.SomeType = SomeType; +})(Aaa || (Aaa = {})); +var Bbb; +(function (Bbb) { + var SomeType = (function () { + function SomeType() { + } + return SomeType; + })(); + Bbb.SomeType = SomeType; + __export(require()); // this line causes the nullref +})(Bbb || (Bbb = {})); +var a; + + +//// [exportDeclarationInInternalModule.d.ts] +declare class Bbb { +} +declare class Aaa extends Bbb { +} +declare module Aaa { + class SomeType { + } +} +declare module Bbb { + class SomeType { + } + export * from Aaa; +} +declare var a: Bbb.SomeType; diff --git a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt new file mode 100644 index 00000000000..598eb8bc029 --- /dev/null +++ b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/exportStarFromEmptyModule_module3.ts(1,15): error TS2306: File 'tests/cases/compiler/exportStarFromEmptyModule_module2.ts' is not an external module. +tests/cases/compiler/exportStarFromEmptyModule_module4.ts(4,5): error TS2339: Property 'r' does not exist on type 'typeof A'. + + +==== tests/cases/compiler/exportStarFromEmptyModule_module1.ts (0 errors) ==== + + export class A { + static r; + } + +==== tests/cases/compiler/exportStarFromEmptyModule_module2.ts (0 errors) ==== + // empty + +==== tests/cases/compiler/exportStarFromEmptyModule_module3.ts (1 errors) ==== + export * from "exportStarFromEmptyModule_module2"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not an external module. + export * from "exportStarFromEmptyModule_module1"; + + export class A { + static q; + } + +==== tests/cases/compiler/exportStarFromEmptyModule_module4.ts (1 errors) ==== + import * as X from "exportStarFromEmptyModule_module3"; + var s: X.A; + X.A.q; + X.A.r; // Error + ~ +!!! error TS2339: Property 'r' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/exportStarFromEmptyModule.js b/tests/baselines/reference/exportStarFromEmptyModule.js new file mode 100644 index 00000000000..9b486af4eae --- /dev/null +++ b/tests/baselines/reference/exportStarFromEmptyModule.js @@ -0,0 +1,65 @@ +//// [tests/cases/compiler/exportStarFromEmptyModule.ts] //// + +//// [exportStarFromEmptyModule_module1.ts] + +export class A { + static r; +} + +//// [exportStarFromEmptyModule_module2.ts] +// empty + +//// [exportStarFromEmptyModule_module3.ts] +export * from "exportStarFromEmptyModule_module2"; +export * from "exportStarFromEmptyModule_module1"; + +export class A { + static q; +} + +//// [exportStarFromEmptyModule_module4.ts] +import * as X from "exportStarFromEmptyModule_module3"; +var s: X.A; +X.A.q; +X.A.r; // Error + +//// [exportStarFromEmptyModule_module1.js] +var A = (function () { + function A() { + } + return A; +})(); +exports.A = A; +//// [exportStarFromEmptyModule_module2.js] +// empty +//// [exportStarFromEmptyModule_module3.js] +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require("exportStarFromEmptyModule_module2")); +__export(require("exportStarFromEmptyModule_module1")); +var A = (function () { + function A() { + } + return A; +})(); +exports.A = A; +//// [exportStarFromEmptyModule_module4.js] +var X = require("exportStarFromEmptyModule_module3"); +var s; +X.A.q; +X.A.r; // Error + + +//// [exportStarFromEmptyModule_module1.d.ts] +export declare class A { + static r: any; +} +//// [exportStarFromEmptyModule_module2.d.ts] +//// [exportStarFromEmptyModule_module3.d.ts] +export * from "exportStarFromEmptyModule_module2"; +export * from "exportStarFromEmptyModule_module1"; +export declare class A { + static q: any; +} +//// [exportStarFromEmptyModule_module4.d.ts] diff --git a/tests/baselines/reference/for-of14.errors.txt b/tests/baselines/reference/for-of14.errors.txt index 5e8223381c7..ab95d042689 100644 --- a/tests/baselines/reference/for-of14.errors.txt +++ b/tests/baselines/reference/for-of14.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator. +tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. ==== tests/cases/conformance/es6/for-ofStatements/for-of14.ts (1 errors) ==== var v: string; for (v of new StringIterator) { } // Should fail because the iterator is not iterable ~~~~~~~~~~~~~~~~~~ -!!! error TS2488: The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. class StringIterator { next() { diff --git a/tests/baselines/reference/for-of16.errors.txt b/tests/baselines/reference/for-of16.errors.txt index e3ecca1a256..20e3e876537 100644 --- a/tests/baselines/reference/for-of16.errors.txt +++ b/tests/baselines/reference/for-of16.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of16.ts(2,11): error TS2489: The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method. +tests/cases/conformance/es6/for-ofStatements/for-of16.ts(2,11): error TS2489: An iterator must have a 'next()' method. ==== tests/cases/conformance/es6/for-ofStatements/for-of16.ts (1 errors) ==== var v: string; for (v of new StringIterator) { } // Should fail ~~~~~~~~~~~~~~~~~~ -!!! error TS2489: The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method. +!!! error TS2489: An iterator must have a 'next()' method. class StringIterator { [Symbol.iterator]() { diff --git a/tests/baselines/reference/for-of57.js b/tests/baselines/reference/for-of57.js new file mode 100644 index 00000000000..5a867c332f7 --- /dev/null +++ b/tests/baselines/reference/for-of57.js @@ -0,0 +1,7 @@ +//// [for-of57.ts] +var iter: Iterable; +for (let num of iter) { } + +//// [for-of57.js] +var iter; +for (let num of iter) { } diff --git a/tests/baselines/reference/for-of57.types b/tests/baselines/reference/for-of57.types new file mode 100644 index 00000000000..cfd4f68cfca --- /dev/null +++ b/tests/baselines/reference/for-of57.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of57.ts === +var iter: Iterable; +>iter : Iterable +>Iterable : Iterable + +for (let num of iter) { } +>num : number +>iter : Iterable + diff --git a/tests/baselines/reference/iterableArrayPattern1.js b/tests/baselines/reference/iterableArrayPattern1.js new file mode 100644 index 00000000000..b45ac92d1fd --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.js @@ -0,0 +1,28 @@ +//// [iterableArrayPattern1.ts] +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern1.js] +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types new file mode 100644 index 00000000000..8be8521c684 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts === +var [a, b] = new SymbolIterator; +>a : symbol +>b : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern10.errors.txt b/tests/baselines/reference/iterableArrayPattern10.errors.txt new file mode 100644 index 00000000000..f06c4d7de17 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern10.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. + Property '0' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts (1 errors) ==== + function fun([a, b]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. +!!! error TS2345: Property '0' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern10.js b/tests/baselines/reference/iterableArrayPattern10.js new file mode 100644 index 00000000000..c8d37e3f894 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern10.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern10.ts] +function fun([a, b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern10.js] +function fun([a, b]) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.js b/tests/baselines/reference/iterableArrayPattern11.js new file mode 100644 index 00000000000..85ed4ab9710 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern11.ts] +function fun([a, b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern11.js] +function fun([a, b] = new FooIterator) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types new file mode 100644 index 00000000000..2b6f1d67336 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts === +function fun([a, b] = new FooIterator) { } +>fun : ([a, b]?: FooIterator) => void +>a : Foo +>b : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, b]?: FooIterator) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.js b/tests/baselines/reference/iterableArrayPattern12.js new file mode 100644 index 00000000000..4856af9cb48 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern12.ts] +function fun([a, ...b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern12.js] +function fun([a, ...b] = new FooIterator) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types new file mode 100644 index 00000000000..a415539b91c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts === +function fun([a, ...b] = new FooIterator) { } +>fun : ([a, ...b]?: FooIterator) => void +>a : Foo +>b : Foo[] +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, ...b]?: FooIterator) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.js b/tests/baselines/reference/iterableArrayPattern13.js new file mode 100644 index 00000000000..06f9901a851 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern13.ts] +function fun([a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern13.js] +function fun([a, ...b]) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types new file mode 100644 index 00000000000..dbfbf9a1ebc --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts === +function fun([a, ...b]) { } +>fun : ([a, ...b]: Iterable) => void +>a : any +>b : any[] + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : ([a, ...b]: Iterable) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern14.js b/tests/baselines/reference/iterableArrayPattern14.js new file mode 100644 index 00000000000..a3595b0df0c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern14.ts] +function fun(...[a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern14.js] +function fun(...[a, ...b]) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern14.types b/tests/baselines/reference/iterableArrayPattern14.types new file mode 100644 index 00000000000..3f73f2973d1 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts === +function fun(...[a, ...b]) { } +>fun : (...[a, ...b]: any[]) => void +>a : any +>b : any[] + +fun(new FooIterator); +>fun(new FooIterator) : void +>fun : (...[a, ...b]: any[]) => void +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern15.js b/tests/baselines/reference/iterableArrayPattern15.js new file mode 100644 index 00000000000..1c2050129ce --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern15.ts] +function fun(...[a, b]: Bar[]) { } +fun(...new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern15.js] +function fun(...[a, b]) { } +fun(...new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern15.types b/tests/baselines/reference/iterableArrayPattern15.types new file mode 100644 index 00000000000..de548a91c26 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.types @@ -0,0 +1,52 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts === +function fun(...[a, b]: Bar[]) { } +>fun : (...[a, b]: Bar[]) => void +>a : Bar +>b : Bar +>Bar : Bar + +fun(...new FooIterator); +>fun(...new FooIterator) : void +>fun : (...[a, b]: Bar[]) => void +>...new FooIterator : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt new file mode 100644 index 00000000000..42236140be7 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. + Property '0' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (1 errors) ==== + function fun(...[a, b]: [Bar, Bar][]) { } + fun(...new FooIteratorIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. +!!! error TS2345: Property '0' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern16.js b/tests/baselines/reference/iterableArrayPattern16.js new file mode 100644 index 00000000000..bda2ec37f63 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern16.js @@ -0,0 +1,60 @@ +//// [iterableArrayPattern16.ts] +function fun(...[a, b]: [Bar, Bar][]) { } +fun(...new FooIteratorIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern16.js] +function fun(...[a, b]) { } +fun(...new FooIteratorIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern17.errors.txt b/tests/baselines/reference/iterableArrayPattern17.errors.txt new file mode 100644 index 00000000000..306b00ea990 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern17.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. + Property 'x' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (1 errors) ==== + function fun(...[a, b]: Bar[]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. +!!! error TS2345: Property 'x' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern17.js b/tests/baselines/reference/iterableArrayPattern17.js new file mode 100644 index 00000000000..c6274aabcd9 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern17.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern17.ts] +function fun(...[a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern17.js] +function fun(...[a, b]) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern18.errors.txt b/tests/baselines/reference/iterableArrayPattern18.errors.txt new file mode 100644 index 00000000000..c6f8c5e28bd --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern18.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'. + Property 'length' is missing in type 'FooIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts (1 errors) ==== + function fun([a, b]: Bar[]) { } + fun(new FooIterator); + ~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'. +!!! error TS2345: Property 'length' is missing in type 'FooIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern18.js b/tests/baselines/reference/iterableArrayPattern18.js new file mode 100644 index 00000000000..e2016c47690 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern18.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern18.ts] +function fun([a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern18.js] +function fun([a, b]) { } +fun(new FooIterator); +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern19.errors.txt b/tests/baselines/reference/iterableArrayPattern19.errors.txt new file mode 100644 index 00000000000..3f8b550d287 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern19.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts(2,5): error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'. + Property 'length' is missing in type 'FooArrayIterator'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts (1 errors) ==== + function fun([[a], b]: Bar[][]) { } + fun(new FooArrayIterator); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'. +!!! error TS2345: Property 'length' is missing in type 'FooArrayIterator'. + class Bar { x } + class Foo extends Bar { y } + class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern19.js b/tests/baselines/reference/iterableArrayPattern19.js new file mode 100644 index 00000000000..bc3cf33afc2 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern19.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern19.ts] +function fun([[a], b]: Bar[][]) { } +fun(new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern19.js] +function fun([[a], b]) { } +fun(new FooArrayIterator); +class Bar { +} +class Foo extends Bar { +} +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.js b/tests/baselines/reference/iterableArrayPattern2.js new file mode 100644 index 00000000000..7392db7d6b2 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.js @@ -0,0 +1,28 @@ +//// [iterableArrayPattern2.ts] +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern2.js] +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types new file mode 100644 index 00000000000..819516dfe05 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts === +var [a, ...b] = new SymbolIterator; +>a : symbol +>b : symbol[] +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern20.js b/tests/baselines/reference/iterableArrayPattern20.js new file mode 100644 index 00000000000..489f97a29f3 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern20.ts] +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +fun(...new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern20.js] +function fun(...[[a = new Foo], b = [new Foo]]) { } +fun(...new FooArrayIterator); +class Bar { +} +class Foo extends Bar { +} +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern20.types b/tests/baselines/reference/iterableArrayPattern20.types new file mode 100644 index 00000000000..055dfa95859 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.types @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts === +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +>fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void +>a : Bar +>new Foo : Foo +>Foo : typeof Foo +>b : Bar[] +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo +>Bar : Bar + +fun(...new FooArrayIterator); +>fun(...new FooArrayIterator) : void +>fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void +>...new FooArrayIterator : Foo[] +>new FooArrayIterator : FooArrayIterator +>FooArrayIterator : typeof FooArrayIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooArrayIterator { +>FooArrayIterator : FooArrayIterator + + next() { +>next : () => { value: Foo[]; done: boolean; } + + return { +>{ value: [new Foo], done: false } : { value: Foo[]; done: boolean; } + + value: [new Foo], +>value : Foo[] +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooArrayIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern21.errors.txt b/tests/baselines/reference/iterableArrayPattern21.errors.txt new file mode 100644 index 00000000000..7e853c90b24 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern21.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts(1,5): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts (1 errors) ==== + var [a, b] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern21.js b/tests/baselines/reference/iterableArrayPattern21.js new file mode 100644 index 00000000000..bdc4d401e54 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern21.js @@ -0,0 +1,5 @@ +//// [iterableArrayPattern21.ts] +var [a, b] = { 0: "", 1: true }; + +//// [iterableArrayPattern21.js] +var [a, b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern22.errors.txt b/tests/baselines/reference/iterableArrayPattern22.errors.txt new file mode 100644 index 00000000000..3e40e4fd602 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern22.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts(1,5): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts (1 errors) ==== + var [...a] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern22.js b/tests/baselines/reference/iterableArrayPattern22.js new file mode 100644 index 00000000000..9ec41bd3076 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern22.js @@ -0,0 +1,5 @@ +//// [iterableArrayPattern22.ts] +var [...a] = { 0: "", 1: true }; + +//// [iterableArrayPattern22.js] +var [...a] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern23.errors.txt b/tests/baselines/reference/iterableArrayPattern23.errors.txt new file mode 100644 index 00000000000..1df5d909aed --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern23.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts(2,1): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts (1 errors) ==== + var a: string, b: boolean; + [a, b] = { 0: "", 1: true }; + ~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern23.js b/tests/baselines/reference/iterableArrayPattern23.js new file mode 100644 index 00000000000..d932c29506d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern23.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern23.ts] +var a: string, b: boolean; +[a, b] = { 0: "", 1: true }; + +//// [iterableArrayPattern23.js] +var a, b; +[a, b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern24.errors.txt b/tests/baselines/reference/iterableArrayPattern24.errors.txt new file mode 100644 index 00000000000..e954c59f2ea --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern24.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts(2,1): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts (1 errors) ==== + var a: string, b: boolean[]; + [a, ...b] = { 0: "", 1: true }; + ~~~~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern24.js b/tests/baselines/reference/iterableArrayPattern24.js new file mode 100644 index 00000000000..f089e35dad8 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern24.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern24.ts] +var a: string, b: boolean[]; +[a, ...b] = { 0: "", 1: true }; + +//// [iterableArrayPattern24.js] +var a, b; +[a, ...b] = { 0: "", 1: true }; diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt new file mode 100644 index 00000000000..cc901523b55 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,30): error TS2370: A rest parameter must be of an array type. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2370: A rest parameter must be of an array type. + takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern25.js b/tests/baselines/reference/iterableArrayPattern25.js new file mode 100644 index 00000000000..1dc44c0dba7 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern25.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern25.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern25.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt new file mode 100644 index 00000000000..9fb3e688039 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. + Property '0' is missing in type 'Map'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. +!!! error TS2345: Property '0' is missing in type 'Map'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern26.js b/tests/baselines/reference/iterableArrayPattern26.js new file mode 100644 index 00000000000..63c188febb7 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern26.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern26.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern26.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern27.js b/tests/baselines/reference/iterableArrayPattern27.js new file mode 100644 index 00000000000..3e936eb51f4 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern27.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); + +//// [iterableArrayPattern27.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); diff --git a/tests/baselines/reference/iterableArrayPattern27.types b/tests/baselines/reference/iterableArrayPattern27.types new file mode 100644 index 00000000000..72d13ee0e00 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts === +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +>takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void +>k1 : string +>v1 : number +>k2 : string +>v2 : number + +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); +>takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])) : void +>takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void +>...new Map([["", 0], ["hello", 1]]) : [string, number] +>new Map([["", 0], ["hello", 1]]) : Map +>Map : MapConstructor +>[["", 0], ["hello", 1]] : [string, number][] +>["", 0] : [string, number] +>["hello", 1] : [string, number] + diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt new file mode 100644 index 00000000000..0190dd939e8 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,28): error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); + ~~~ +!!! error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.js b/tests/baselines/reference/iterableArrayPattern28.js new file mode 100644 index 00000000000..70953475372 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern28.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern28.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); + +//// [iterableArrayPattern28.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); diff --git a/tests/baselines/reference/iterableArrayPattern29.errors.txt b/tests/baselines/reference/iterableArrayPattern29.errors.txt new file mode 100644 index 00000000000..632854ae952 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern29.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(2,21): error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. +!!! error TS2345: Types of property '1' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern29.js b/tests/baselines/reference/iterableArrayPattern29.js new file mode 100644 index 00000000000..912d336263f --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern29.js @@ -0,0 +1,7 @@ +//// [iterableArrayPattern29.ts] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); + +//// [iterableArrayPattern29.js] +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); diff --git a/tests/baselines/reference/iterableArrayPattern3.js b/tests/baselines/reference/iterableArrayPattern3.js new file mode 100644 index 00000000000..7136c6ab209 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern3.ts] +var a: Bar, b: Bar; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern3.js] +var a, b; +[a, b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types new file mode 100644 index 00000000000..291eed9723a --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -0,0 +1,53 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts === +var a: Bar, b: Bar; +>a : Bar +>Bar : Bar +>b : Bar +>Bar : Bar + +[a, b] = new FooIterator; +>[a, b] = new FooIterator : FooIterator +>[a, b] : [Bar, Bar] +>a : Bar +>b : Bar +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern30.js b/tests/baselines/reference/iterableArrayPattern30.js new file mode 100644 index 00000000000..10f7df53aa3 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.js @@ -0,0 +1,5 @@ +//// [iterableArrayPattern30.ts] +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) + +//// [iterableArrayPattern30.js] +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]); diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types new file mode 100644 index 00000000000..998da11d651 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts === +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) +>k1 : string +>v1 : boolean +>k2 : string +>v2 : boolean +>new Map([["", true], ["hello", true]]) : Map +>Map : MapConstructor +>[["", true], ["hello", true]] : [string, boolean][] +>["", true] : [string, boolean] +>["hello", true] : [string, boolean] + diff --git a/tests/baselines/reference/iterableArrayPattern4.js b/tests/baselines/reference/iterableArrayPattern4.js new file mode 100644 index 00000000000..6e60dadbd7a --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern4.ts] +var a: Bar, b: Bar[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern4.js] +var a, b; +[a, ...b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types new file mode 100644 index 00000000000..531b2aa8275 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -0,0 +1,54 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts === +var a: Bar, b: Bar[]; +>a : Bar +>Bar : Bar +>b : Bar[] +>Bar : Bar + +[a, ...b] = new FooIterator; +>[a, ...b] = new FooIterator : FooIterator +>[a, ...b] : Bar[] +>a : Bar +>...b : Bar +>b : Bar[] +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iterableArrayPattern5.errors.txt b/tests/baselines/reference/iterableArrayPattern5.errors.txt new file mode 100644 index 00000000000..ca540d805be --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern5.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts (1 errors) ==== + var a: Bar, b: string; + [a, b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern5.js b/tests/baselines/reference/iterableArrayPattern5.js new file mode 100644 index 00000000000..77e71cac6d3 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern5.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern5.ts] +var a: Bar, b: string; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern5.js] +var a, b; +[a, b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern6.errors.txt b/tests/baselines/reference/iterableArrayPattern6.errors.txt new file mode 100644 index 00000000000..e0a546d154c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern6.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string[]'. + Type 'Foo' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts (1 errors) ==== + var a: Bar, b: string[]; + [a, ...b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'Foo' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern6.js b/tests/baselines/reference/iterableArrayPattern6.js new file mode 100644 index 00000000000..8c797e819f5 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern6.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern6.ts] +var a: Bar, b: string[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern6.js] +var a, b; +[a, ...b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern7.errors.txt b/tests/baselines/reference/iterableArrayPattern7.errors.txt new file mode 100644 index 00000000000..997cc21f38b --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern7.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string[]'. + Property 'length' is missing in type 'Foo'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts (1 errors) ==== + var a: Bar, b: string[]; + [a, b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Foo'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern7.js b/tests/baselines/reference/iterableArrayPattern7.js new file mode 100644 index 00000000000..3f79e6bfba8 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern7.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern7.ts] +var a: Bar, b: string[]; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern7.js] +var a, b; +[a, b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern8.errors.txt b/tests/baselines/reference/iterableArrayPattern8.errors.txt new file mode 100644 index 00000000000..c06e0c9543f --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern8.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts (1 errors) ==== + var a: Bar, b: string; + [a, ...b] = new FooIterator; + ~ +!!! error TS2322: Type 'Foo[]' is not assignable to type 'string'. + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern8.js b/tests/baselines/reference/iterableArrayPattern8.js new file mode 100644 index 00000000000..dd1c76c1f51 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern8.js @@ -0,0 +1,36 @@ +//// [iterableArrayPattern8.ts] +var a: Bar, b: string; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern8.js] +var a, b; +[a, ...b] = new FooIterator; +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.js b/tests/baselines/reference/iterableArrayPattern9.js new file mode 100644 index 00000000000..a85ca9c347b --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.js @@ -0,0 +1,34 @@ +//// [iterableArrayPattern9.ts] +function fun([a, b] = new FooIterator) { } +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iterableArrayPattern9.js] +function fun([a, b] = new FooIterator) { } +class Bar { +} +class Foo extends Bar { +} +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types new file mode 100644 index 00000000000..67d4bab1a83 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts === +function fun([a, b] = new FooIterator) { } +>fun : ([a, b]?: FooIterator) => void +>a : Foo +>b : Foo +>new FooIterator : FooIterator +>FooIterator : typeof FooIterator + +class Bar { x } +>Bar : Bar +>x : any + +class Foo extends Bar { y } +>Foo : Foo +>Bar : Bar +>y : any + +class FooIterator { +>FooIterator : FooIterator + + next() { +>next : () => { value: Foo; done: boolean; } + + return { +>{ value: new Foo, done: false } : { value: Foo; done: boolean; } + + value: new Foo, +>value : Foo +>new Foo : Foo +>Foo : typeof Foo + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : FooIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray.js b/tests/baselines/reference/iteratorSpreadInArray.js new file mode 100644 index 00000000000..8e25a2e7ecf --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.js @@ -0,0 +1,29 @@ +//// [iteratorSpreadInArray.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray.js] +var array = [...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types new file mode 100644 index 00000000000..13b1a458eb9 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts === +var array = [...new SymbolIterator]; +>array : symbol[] +>[...new SymbolIterator] : symbol[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray10.errors.txt b/tests/baselines/reference/iteratorSpreadInArray10.errors.txt new file mode 100644 index 00000000000..90cde7d03b1 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray10.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts(1,17): error TS2489: An iterator must have a 'next()' method. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2489: An iterator must have a 'next()' method. + + class SymbolIterator { + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray10.js b/tests/baselines/reference/iteratorSpreadInArray10.js new file mode 100644 index 00000000000..1004dbd7b34 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray10.js @@ -0,0 +1,16 @@ +//// [iteratorSpreadInArray10.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray10.js] +var array = [...new SymbolIterator]; +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray11.js b/tests/baselines/reference/iteratorSpreadInArray11.js new file mode 100644 index 00000000000..fa86c152123 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.js @@ -0,0 +1,7 @@ +//// [iteratorSpreadInArray11.ts] +var iter: Iterable; +var array = [...iter]; + +//// [iteratorSpreadInArray11.js] +var iter; +var array = [...iter]; diff --git a/tests/baselines/reference/iteratorSpreadInArray11.types b/tests/baselines/reference/iteratorSpreadInArray11.types new file mode 100644 index 00000000000..a3ed7826e07 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === +var iter: Iterable; +>iter : Iterable +>Iterable : Iterable + +var array = [...iter]; +>array : number[] +>[...iter] : number[] +>...iter : number +>iter : Iterable + diff --git a/tests/baselines/reference/iteratorSpreadInArray2.js b/tests/baselines/reference/iteratorSpreadInArray2.js new file mode 100644 index 00000000000..aa4a1099a40 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.js @@ -0,0 +1,53 @@ +//// [iteratorSpreadInArray2.ts] +var array = [...new NumberIterator, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray2.js] +var array = [...new NumberIterator, ...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types new file mode 100644 index 00000000000..3cb27445f57 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts === +var array = [...new NumberIterator, ...new SymbolIterator]; +>array : (number | symbol)[] +>[...new NumberIterator, ...new SymbolIterator] : (number | symbol)[] +>...new NumberIterator : number +>new NumberIterator : NumberIterator +>NumberIterator : typeof NumberIterator +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class NumberIterator { +>NumberIterator : NumberIterator + + next() { +>next : () => { value: number; done: boolean; } + + return { +>{ value: 0, done: false } : { value: number; done: boolean; } + + value: 0, +>value : number + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : NumberIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.js b/tests/baselines/reference/iteratorSpreadInArray3.js new file mode 100644 index 00000000000..1d468e4483e --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.js @@ -0,0 +1,29 @@ +//// [iteratorSpreadInArray3.ts] +var array = [...[0, 1], ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray3.js] +var array = [...[0, 1], ...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types new file mode 100644 index 00000000000..e5c25daabc7 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts === +var array = [...[0, 1], ...new SymbolIterator]; +>array : (number | symbol)[] +>[...[0, 1], ...new SymbolIterator] : (number | symbol)[] +>...[0, 1] : number +>[0, 1] : number[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.js b/tests/baselines/reference/iteratorSpreadInArray4.js new file mode 100644 index 00000000000..82a08bfa964 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.js @@ -0,0 +1,29 @@ +//// [iteratorSpreadInArray4.ts] +var array = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray4.js] +var array = [0, 1, ...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types new file mode 100644 index 00000000000..790fc9db1ba --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts === +var array = [0, 1, ...new SymbolIterator]; +>array : (number | symbol)[] +>[0, 1, ...new SymbolIterator] : (number | symbol)[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray5.errors.txt b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt new file mode 100644 index 00000000000..498cc7d48ef --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts(1,5): error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. + Type 'number | symbol' is not assignable to type 'number'. + Type 'symbol' is not assignable to type 'number'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts (1 errors) ==== + var array: number[] = [0, 1, ...new SymbolIterator]; + ~~~~~ +!!! error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. +!!! error TS2322: Type 'number | symbol' is not assignable to type 'number'. +!!! error TS2322: Type 'symbol' is not assignable to type 'number'. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray5.js b/tests/baselines/reference/iteratorSpreadInArray5.js new file mode 100644 index 00000000000..0aa158a5dc2 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray5.js @@ -0,0 +1,29 @@ +//// [iteratorSpreadInArray5.ts] +var array: number[] = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray5.js] +var array = [0, 1, ...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt new file mode 100644 index 00000000000..b90ac5f203c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(2,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== + var array: number[] = [0, 1]; + array.concat([...new SymbolIterator]); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number'. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.js b/tests/baselines/reference/iteratorSpreadInArray6.js new file mode 100644 index 00000000000..02d1c435b8c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray6.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInArray6.ts] +var array: number[] = [0, 1]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray6.js] +var array = [0, 1]; +array.concat([...new SymbolIterator]); +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.js b/tests/baselines/reference/iteratorSpreadInArray7.js new file mode 100644 index 00000000000..72a614ae4ec --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInArray7.ts] +var array: symbol[]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray7.js] +var array; +array.concat([...new SymbolIterator]); +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types new file mode 100644 index 00000000000..c58d01f098b --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -0,0 +1,43 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts === +var array: symbol[]; +>array : symbol[] + +array.concat([...new SymbolIterator]); +>array.concat([...new SymbolIterator]) : symbol[] +>array.concat : { (...items: U[]): symbol[]; (...items: symbol[]): symbol[]; } +>array : symbol[] +>concat : { (...items: U[]): symbol[]; (...items: symbol[]): symbol[]; } +>[...new SymbolIterator] : symbol[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray8.errors.txt b/tests/baselines/reference/iteratorSpreadInArray8.errors.txt new file mode 100644 index 00000000000..365bc8db9c2 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray8.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts(1,17): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator. + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray8.js b/tests/baselines/reference/iteratorSpreadInArray8.js new file mode 100644 index 00000000000..08378699129 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray8.js @@ -0,0 +1,22 @@ +//// [iteratorSpreadInArray8.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} + +//// [iteratorSpreadInArray8.js] +var array = [...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt new file mode 100644 index 00000000000..e0e3d061f16 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => SymbolIterator' is not assignable to type '() => Iterator'. + Type 'SymbolIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. + Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. + Property 'done' is missing in type '{ value: symbol; }'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ==== + var array = [...new SymbolIterator]; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. +!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator'. +!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. +!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. +!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'. + + class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray9.js b/tests/baselines/reference/iteratorSpreadInArray9.js new file mode 100644 index 00000000000..ed0a9b4ebe9 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray9.js @@ -0,0 +1,27 @@ +//// [iteratorSpreadInArray9.ts] +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInArray9.js] +var array = [...new SymbolIterator]; +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall.errors.txt b/tests/baselines/reference/iteratorSpreadInCall.errors.txt new file mode 100644 index 00000000000..614153192d7 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: symbol) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall.js b/tests/baselines/reference/iteratorSpreadInCall.js new file mode 100644 index 00000000000..f3bf17c0327 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInCall.ts] +foo(...new SymbolIterator); + +function foo(s: symbol) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall.js] +foo(...new SymbolIterator); +function foo(s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall10.errors.txt b/tests/baselines/reference/iteratorSpreadInCall10.errors.txt new file mode 100644 index 00000000000..04d9045e86c --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall10.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: T[]) { return s[0] } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall10.js b/tests/baselines/reference/iteratorSpreadInCall10.js new file mode 100644 index 00000000000..14a08c97009 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall10.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall10.ts] +foo(...new SymbolIterator); + +function foo(s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall10.js] +foo(...new SymbolIterator); +function foo(s) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.js b/tests/baselines/reference/iteratorSpreadInCall11.js new file mode 100644 index 00000000000..d01eb259ef3 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.js @@ -0,0 +1,32 @@ +//// [iteratorSpreadInCall11.ts] +foo(...new SymbolIterator); + +function foo(...s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall11.js] +foo(...new SymbolIterator); +function foo(...s) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types new file mode 100644 index 00000000000..a37fc6e2232 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts === +foo(...new SymbolIterator); +>foo(...new SymbolIterator) : symbol +>foo : (...s: T[]) => T +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +function foo(...s: T[]) { return s[0] } +>foo : (...s: T[]) => T +>T : T +>s : T[] +>T : T +>s[0] : T +>s : T[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.js b/tests/baselines/reference/iteratorSpreadInCall12.js new file mode 100644 index 00000000000..90b9d9b900b --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.js @@ -0,0 +1,61 @@ +//// [iteratorSpreadInCall12.ts] +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall12.js] +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types new file mode 100644 index 00000000000..78ce973a532 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -0,0 +1,81 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts === +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +>new Foo(...[...new SymbolIterator, ...[...new StringIterator]]) : Foo +>Foo : typeof Foo +>...[...new SymbolIterator, ...[...new StringIterator]] : string | symbol +>[...new SymbolIterator, ...[...new StringIterator]] : (string | symbol)[] +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator +>...[...new StringIterator] : string +>[...new StringIterator] : string[] +>...new StringIterator : string +>new StringIterator : StringIterator +>StringIterator : typeof StringIterator + +class Foo { +>Foo : Foo +>T : T + + constructor(...s: T[]) { } +>s : T[] +>T : T +} + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class StringIterator { +>StringIterator : StringIterator + + next() { +>next : () => { value: string; done: boolean; } + + return { +>{ value: "", done: false } : { value: string; done: boolean; } + + value: "", +>value : string + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : StringIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall2.errors.txt b/tests/baselines/reference/iteratorSpreadInCall2.errors.txt new file mode 100644 index 00000000000..bd994ab37b0 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s: symbol[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall2.js b/tests/baselines/reference/iteratorSpreadInCall2.js new file mode 100644 index 00000000000..6c3517857d5 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall2.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInCall2.ts] +foo(...new SymbolIterator); + +function foo(s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall2.js] +foo(...new SymbolIterator); +function foo(s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.js b/tests/baselines/reference/iteratorSpreadInCall3.js new file mode 100644 index 00000000000..b33ceae7bfd --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInCall3.ts] +foo(...new SymbolIterator); + +function foo(...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall3.js] +foo(...new SymbolIterator); +function foo(...s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types new file mode 100644 index 00000000000..07eb149ba31 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -0,0 +1,41 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts === +foo(...new SymbolIterator); +>foo(...new SymbolIterator) : void +>foo : (...s: symbol[]) => void +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator + +function foo(...s: symbol[]) { } +>foo : (...s: symbol[]) => void +>s : symbol[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall4.errors.txt b/tests/baselines/reference/iteratorSpreadInCall4.errors.txt new file mode 100644 index 00000000000..0e0a40a512f --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall4.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(1,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts (1 errors) ==== + foo(...new SymbolIterator); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + function foo(s1: symbol, ...s: symbol[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall4.js b/tests/baselines/reference/iteratorSpreadInCall4.js new file mode 100644 index 00000000000..7819a1ba6f9 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall4.js @@ -0,0 +1,31 @@ +//// [iteratorSpreadInCall4.ts] +foo(...new SymbolIterator); + +function foo(s1: symbol, ...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall4.js] +foo(...new SymbolIterator); +function foo(s1, ...s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.js b/tests/baselines/reference/iteratorSpreadInCall5.js new file mode 100644 index 00000000000..a4a30ee0166 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.js @@ -0,0 +1,55 @@ +//// [iteratorSpreadInCall5.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | string)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall5.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types new file mode 100644 index 00000000000..6e924a1ef42 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -0,0 +1,72 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts === +foo(...new SymbolIterator, ...new StringIterator); +>foo(...new SymbolIterator, ...new StringIterator) : void +>foo : (...s: (string | symbol)[]) => void +>...new SymbolIterator : symbol +>new SymbolIterator : SymbolIterator +>SymbolIterator : typeof SymbolIterator +>...new StringIterator : string +>new StringIterator : StringIterator +>StringIterator : typeof StringIterator + +function foo(...s: (symbol | string)[]) { } +>foo : (...s: (string | symbol)[]) => void +>s : (string | symbol)[] + +class SymbolIterator { +>SymbolIterator : SymbolIterator + + next() { +>next : () => { value: symbol; done: boolean; } + + return { +>{ value: Symbol(), done: false } : { value: symbol; done: boolean; } + + value: Symbol(), +>value : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : SymbolIterator + } +} + +class StringIterator { +>StringIterator : StringIterator + + next() { +>next : () => { value: string; done: boolean; } + + return { +>{ value: "", done: false } : { value: string; done: boolean; } + + value: "", +>value : string + + done: false +>done : boolean + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : symbol +>Symbol : SymbolConstructor +>iterator : symbol + + return this; +>this : StringIterator + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall6.errors.txt b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt new file mode 100644 index 00000000000..be085beb632 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall6.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(1,28): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'. + Type 'string' is not assignable to type 'symbol'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts (1 errors) ==== + foo(...new SymbolIterator, ...new StringIterator); + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'. +!!! error TS2345: Type 'string' is not assignable to type 'symbol'. + + function foo(...s: (symbol | number)[]) { } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall6.js b/tests/baselines/reference/iteratorSpreadInCall6.js new file mode 100644 index 00000000000..8ad60be911e --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall6.js @@ -0,0 +1,55 @@ +//// [iteratorSpreadInCall6.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | number)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall6.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall7.errors.txt b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt new file mode 100644 index 00000000000..51cae1d72b2 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall7.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts(1,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts (1 errors) ==== + foo(...new SymbolIterator, ...new StringIterator); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + function foo(...s: T[]) { return s[0]; } + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall7.js b/tests/baselines/reference/iteratorSpreadInCall7.js new file mode 100644 index 00000000000..4a56b75d236 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall7.js @@ -0,0 +1,55 @@ +//// [iteratorSpreadInCall7.ts] +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: T[]) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall7.js] +foo(...new SymbolIterator, ...new StringIterator); +function foo(...s) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall8.errors.txt b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt new file mode 100644 index 00000000000..d7913458b6a --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall8.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts(1,5): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts (1 errors) ==== + new Foo(...new SymbolIterator, ...new StringIterator); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + class Foo { + constructor(...s: T[]) { } + } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall8.js b/tests/baselines/reference/iteratorSpreadInCall8.js new file mode 100644 index 00000000000..ac22bbcf5a3 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall8.js @@ -0,0 +1,61 @@ +//// [iteratorSpreadInCall8.ts] +new Foo(...new SymbolIterator, ...new StringIterator); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall8.js] +new Foo(...new SymbolIterator, ...new StringIterator); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall9.errors.txt b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt new file mode 100644 index 00000000000..da2ee7f8efc --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall9.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts(1,5): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + +==== tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts (1 errors) ==== + new Foo(...new SymbolIterator, ...[...new StringIterator]); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'. + + class Foo { + constructor(...s: T[]) { } + } + + class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } + + class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInCall9.js b/tests/baselines/reference/iteratorSpreadInCall9.js new file mode 100644 index 00000000000..2a73ee29c34 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall9.js @@ -0,0 +1,61 @@ +//// [iteratorSpreadInCall9.ts] +new Foo(...new SymbolIterator, ...[...new StringIterator]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +//// [iteratorSpreadInCall9.js] +new Foo(...new SymbolIterator, ...[...new StringIterator]); +class Foo { + constructor(...s) { + } +} +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + [Symbol.iterator]() { + return this; + } +} diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index d109b048085..e1b0bb34529 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1100: Invalid use of 'arguments' in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1100: Invalid use of 'arguments' in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. Property 'callee' is missing in type 'String'. @@ -11,13 +11,13 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy public implements() { } public foo(arguments: any) { } ~~~~~~~~~ -!!! error TS1100: Invalid use of 'arguments' in strict mode. +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. private bar(eval:any) { ~~~~ -!!! error TS1100: Invalid use of 'eval' in strict mode. +!!! error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. arguments = "hello"; ~~~~~~~~~ -!!! error TS1100: Invalid use of 'arguments' in strict mode. +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'IArguments'. !!! error TS2322: Property 'callee' is missing in type 'String'. diff --git a/tests/baselines/reference/parser509668.errors.txt b/tests/baselines/reference/parser509668.errors.txt index 5ea380592ef..588bda6d91c 100644 --- a/tests/baselines/reference/parser509668.errors.txt +++ b/tests/baselines/reference/parser509668.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,16): error TS1003: Identifier expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,23): error TS1005: ',' expected. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (2 errors) ==== class Foo3 { // Doesn't work, but should constructor (public ...args: string[]) { } + ~~~~~~ +!!! error TS1003: Identifier expected. ~~~ !!! error TS1005: ',' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parser509668.js b/tests/baselines/reference/parser509668.js index 63c5d8a1a95..a64c9c7b5b0 100644 --- a/tests/baselines/reference/parser509668.js +++ b/tests/baselines/reference/parser509668.js @@ -7,7 +7,7 @@ class Foo3 { //// [parser509668.js] var Foo3 = (function () { // Doesn't work, but should - function Foo3(public) { + function Foo3() { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; diff --git a/tests/baselines/reference/parser553699.errors.txt b/tests/baselines/reference/parser553699.errors.txt index 5a0b9e2fba9..84bc6e60707 100644 --- a/tests/baselines/reference/parser553699.errors.txt +++ b/tests/baselines/reference/parser553699.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS2304: Cannot find name 'public'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS1110: Type expected. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21) constructor() { } public banana (x: public) { } ~~~~~~ -!!! error TS2304: Cannot find name 'public'. +!!! error TS1110: Type expected. } class Bar { diff --git a/tests/baselines/reference/parser553699.js b/tests/baselines/reference/parser553699.js index 8570780e74a..c4cc51bf5af 100644 --- a/tests/baselines/reference/parser553699.js +++ b/tests/baselines/reference/parser553699.js @@ -12,7 +12,7 @@ class Bar { var Foo = (function () { function Foo() { } - Foo.prototype.banana = function (x) { }; + Foo.prototype.banana = function (x, ) { }; return Foo; })(); var Bar = (function () { diff --git a/tests/baselines/reference/parser642331.errors.txt b/tests/baselines/reference/parser642331.errors.txt new file mode 100644 index 00000000000..fad38e66513 --- /dev/null +++ b/tests/baselines/reference/parser642331.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts(2,18): error TS1003: Identifier expected. + + +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts (1 errors) ==== + class test { + constructor (static) { } + ~~~~~~ +!!! error TS1003: Identifier expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/parser642331.js b/tests/baselines/reference/parser642331.js index 056ea7dd384..3d88c096af3 100644 --- a/tests/baselines/reference/parser642331.js +++ b/tests/baselines/reference/parser642331.js @@ -6,7 +6,7 @@ class test { //// [parser642331.js] var test = (function () { - function test(static) { + function test() { } return test; })(); diff --git a/tests/baselines/reference/parser642331.types b/tests/baselines/reference/parser642331.types deleted file mode 100644 index 19cd40b76b8..00000000000 --- a/tests/baselines/reference/parser642331.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts === -class test { ->test : test - - constructor (static) { } ->static : any -} - diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.js b/tests/baselines/reference/parserES5ComputedPropertyName2.js index d8a5bb45fac..4569c00d7b3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName2.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.js @@ -2,7 +2,5 @@ var v = { [e]: 1 }; //// [parserES5ComputedPropertyName2.js] -var v = (_a = {}, - _a[e] = 1, - _a); +var v = (_a = {}, _a[e] = 1, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.js b/tests/baselines/reference/parserES5ComputedPropertyName3.js index 26067467953..1fdb5ced65d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName3.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.js @@ -2,7 +2,5 @@ var v = { [e]() { } }; //// [parserES5ComputedPropertyName3.js] -var v = (_a = {}, - _a[e] = function () { }, - _a); +var v = (_a = {}, _a[e] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.js b/tests/baselines/reference/parserES5ComputedPropertyName4.js index 378624af08b..499e9a426d9 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.js @@ -2,7 +2,9 @@ var v = { get [e]() { } }; //// [parserES5ComputedPropertyName4.js] -var v = (_a = {}, - _a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }), - _a); +var v = (_a = {}, Object.defineProperty(_a, e, { + get: function () { }, + enumerable: true, + configurable: true +}), _a); var _a; diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index bf5432062b0..718bda19a67 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -115,6 +115,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(504,58): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(506,22): error TS2304: Cannot find name 'NodeType'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(507,58): error TS2304: Cannot find name 'TokenID'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(518,32): error TS2304: Cannot find name 'NodeType'. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(520,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(525,27): error TS2304: Cannot find name 'Signature'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(527,36): error TS2304: Cannot find name 'TypeFlow'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(528,34): error TS2304: Cannot find name 'NodeType'. @@ -246,6 +247,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(963,27): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(969,31): error TS2304: Cannot find name 'Symbol'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(977,32): error TS2304: Cannot find name 'Symbol'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(981,27): error TS2304: Cannot find name 'Type'. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(985,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1004,44): error TS2304: Cannot find name 'hasFlag'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1004,67): error TS2304: Cannot find name 'FncFlags'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1005,57): error TS2304: Cannot find name 'FncFlags'. @@ -515,7 +517,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,30): error tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (515 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (517 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -1270,6 +1272,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'NodeType'. public target: AST, public arguments: ASTList) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. super(nodeType); this.minChar = this.target.minChar; } @@ -1997,6 +2001,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error constructor (public name: Identifier, public bod: ASTList, public isConstructor: boolean, public arguments: ASTList, public vars: ASTList, public scopes: ASTList, public statics: ASTList, + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. nodeType: number) { super(nodeType); diff --git a/tests/baselines/reference/privateIndexer2.js b/tests/baselines/reference/privateIndexer2.js index a90e03a5bc2..1268c6e4c25 100644 --- a/tests/baselines/reference/privateIndexer2.js +++ b/tests/baselines/reference/privateIndexer2.js @@ -14,6 +14,7 @@ var y: { var x = (_a = {}, _a[x] = string, _a.string = , - _a); + _a +); var y; var _a; diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js index 81ce9bc60ff..5577a6967cd 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js +++ b/tests/baselines/reference/sourceMapValidationDecorators.js @@ -55,19 +55,14 @@ class Greeter { } //// [sourceMapValidationDecorators.js] -var __decorate = this.__decorate || function (decorators, target, key, value) { - var kind = typeof (arguments.length == 2 ? value = target : value); - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - switch (kind) { - case "function": value = decorator(value) || value; break; - case "number": decorator(target, key, value); break; - case "undefined": decorator(target, key); break; - case "object": value = decorator(target, key, value) || value; break; - } +var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } - return value; }; +var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var Greeter = (function () { function Greeter(greeting) { var b = []; @@ -93,15 +88,39 @@ var Greeter = (function () { configurable: true }); Greeter.x1 = 10; - Object.defineProperty(Greeter.prototype, "greet", __decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); - __decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x"); - __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype, "fn", 0); - __decorate([ParameterDecorator1, ParameterDecorator2(90)], Greeter.prototype, "greetings", 0); - Object.defineProperty(Greeter.prototype, "greetings", __decorate([PropertyDecorator1, PropertyDecorator2(80)], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); - __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1"); - __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, void 0, 0); - __decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, void 0, 1); - Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter); + Object.defineProperty(Greeter.prototype, "greet", + __decorate([ + PropertyDecorator1, + PropertyDecorator2(40) + ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); + __decorate([ + PropertyDecorator1, + PropertyDecorator2(50) + ], Greeter.prototype, "x"); + Object.defineProperty(Greeter.prototype, "fn", + __decorate([ + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(70)) + ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn"))); + Object.defineProperty(Greeter.prototype, "greetings", + __decorate([ + PropertyDecorator1, + PropertyDecorator2(80), + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(90)) + ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); + __decorate([ + PropertyDecorator1, + PropertyDecorator2(60) + ], Greeter, "x1"); + Greeter = __decorate([ + ClassDecorator1, + ClassDecorator2(10), + __param(0, ParameterDecorator1), + __param(0, ParameterDecorator2(20)), + __param(1, ParameterDecorator1), + __param(1, ParameterDecorator2(30)) + ], Greeter); return Greeter; })(); //# sourceMappingURL=sourceMapValidationDecorators.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js.map b/tests/baselines/reference/sourceMapValidationDecorators.js.map index 4cca04a1e3c..84ebad316fa 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js.map +++ b/tests/baselines/reference/sourceMapValidationDecorators.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDecorators.js.map] -{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA,cAFJA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACfA,sBAACA,EAASA;IAOhBA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACxBA,0BAACA,EAAQA;IAWTA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACxBA,iCAASA,EAAQA;IATnBA,sBAEIA,8BAASA,cAFZA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACnBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,GACRA,aAAEA,EAAcA;IArB7BA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACjBA,kBAAQA,EAAQA;IAEvBA,YAACA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,GACrBA,kBAACA,EAAUA;IAVpBA,sBAACA,eAAeA,EACfA,eAAeA,CAACA,EAAEA,CAACA,YA6CnBA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index c0b9d97e6f0..f4c64c49579 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -8,19 +8,14 @@ sources: sourceMapValidationDecorators.ts emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js sourceFile:sourceMapValidationDecorators.ts ------------------------------------------------------------------- ->>>var __decorate = this.__decorate || function (decorators, target, key, value) { ->>> var kind = typeof (arguments.length == 2 ? value = target : value); ->>> for (var i = decorators.length - 1; i >= 0; --i) { ->>> var decorator = decorators[i]; ->>> switch (kind) { ->>> case "function": value = decorator(value) || value; break; ->>> case "number": decorator(target, key, value); break; ->>> case "undefined": decorator(target, key); break; ->>> case "object": value = decorator(target, key, value) || value; break; ->>> } +>>>var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +>>> switch (arguments.length) { +>>> case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); +>>> case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); +>>> case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); >>> } ->>> return value; >>>}; +>>>var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; >>>var Greeter = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> @@ -32,7 +27,7 @@ sourceFile:sourceMapValidationDecorators.ts >declare function ParameterDecorator2(x: number): (target: Function, key: string | symbol, paramIndex: number) => void; > > -1 >Emitted(14, 1) Source(8, 1) + SourceIndex(0) +1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) --- >>> function Greeter(greeting) { 1->^^^^ @@ -47,9 +42,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(20) > public 3 > greeting: string -1->Emitted(15, 5) Source(11, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(15, 22) Source(14, 14) + SourceIndex(0) name (Greeter) -3 >Emitted(15, 30) Source(14, 30) + SourceIndex(0) name (Greeter) +1->Emitted(10, 5) Source(11, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(10, 22) Source(14, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(10, 30) Source(14, 30) + SourceIndex(0) name (Greeter) --- >>> var b = []; 1 >^^^^^^^^ @@ -61,8 +56,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(16, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(16, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(11, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(11, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> for (var _i = 1; _i < arguments.length; _i++) { 1->^^^^^^^^^^^^^ @@ -83,12 +78,12 @@ sourceFile:sourceMapValidationDecorators.ts 6 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1->Emitted(17, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(17, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(17, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(17, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(17, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -6 >Emitted(17, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1->Emitted(12, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(12, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(12, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(12, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(12, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(12, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> b[_i - 1] = arguments[_i]; 1 >^^^^^^^^^^^^ @@ -97,8 +92,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(18, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(18, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(13, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(13, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> } >>> this.greeting = greeting; @@ -112,11 +107,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > 4 > greeting 5 > : string -1 >Emitted(20, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(20, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(20, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(20, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(20, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(15, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(15, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(15, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(15, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(15, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) --- >>> } 1 >^^^^ @@ -129,8 +124,8 @@ sourceFile:sourceMapValidationDecorators.ts > ...b: string[]) { > 2 > } -1 >Emitted(21, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(21, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(16, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(16, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) --- >>> Greeter.prototype.greet = function () { 1->^^^^ @@ -144,9 +139,9 @@ sourceFile:sourceMapValidationDecorators.ts > 2 > greet 3 > -1->Emitted(22, 5) Source(23, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(22, 28) Source(23, 10) + SourceIndex(0) name (Greeter) -3 >Emitted(22, 31) Source(21, 5) + SourceIndex(0) name (Greeter) +1->Emitted(17, 5) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(17, 28) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(17, 31) Source(21, 5) + SourceIndex(0) name (Greeter) --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^ @@ -174,17 +169,17 @@ sourceFile:sourceMapValidationDecorators.ts 9 > + 10> "" 11> ; -1->Emitted(23, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(23, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) -3 >Emitted(23, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) -4 >Emitted(23, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) -5 >Emitted(23, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) -6 >Emitted(23, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) -7 >Emitted(23, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) -8 >Emitted(23, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) -9 >Emitted(23, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) -10>Emitted(23, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) -11>Emitted(23, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) +1->Emitted(18, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(18, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) +3 >Emitted(18, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) +4 >Emitted(18, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) +5 >Emitted(18, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) +6 >Emitted(18, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) +7 >Emitted(18, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) +8 >Emitted(18, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) +9 >Emitted(18, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) +10>Emitted(18, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) +11>Emitted(18, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) --- >>> }; 1 >^^^^ @@ -193,8 +188,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(24, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(24, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(19, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) --- >>> Greeter.prototype.fn = function (x) { 1->^^^^ @@ -220,11 +215,11 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(70) > 5 > x: number -1->Emitted(25, 5) Source(35, 13) + SourceIndex(0) name (Greeter) -2 >Emitted(25, 25) Source(35, 15) + SourceIndex(0) name (Greeter) -3 >Emitted(25, 28) Source(35, 5) + SourceIndex(0) name (Greeter) -4 >Emitted(25, 38) Source(38, 7) + SourceIndex(0) name (Greeter) -5 >Emitted(25, 39) Source(38, 16) + SourceIndex(0) name (Greeter) +1->Emitted(20, 5) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(20, 25) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(20, 28) Source(35, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(20, 38) Source(38, 7) + SourceIndex(0) name (Greeter) +5 >Emitted(20, 39) Source(38, 16) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1 >^^^^^^^^ @@ -242,13 +237,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1 >Emitted(26, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(26, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) -3 >Emitted(26, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) -4 >Emitted(26, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) -5 >Emitted(26, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) -6 >Emitted(26, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) -7 >Emitted(26, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(21, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(21, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) +3 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) +4 >Emitted(21, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) +5 >Emitted(21, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) +6 >Emitted(21, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) +7 >Emitted(21, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) --- >>> }; 1 >^^^^ @@ -257,8 +252,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(27, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(27, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(22, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(22, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) --- >>> Object.defineProperty(Greeter.prototype, "greetings", { 1->^^^^ @@ -271,15 +266,15 @@ sourceFile:sourceMapValidationDecorators.ts > @PropertyDecorator2(80) > get 3 > greetings -1->Emitted(28, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(28, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(28, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +1->Emitted(23, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(23, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(23, 57) Source(44, 18) + SourceIndex(0) name (Greeter) --- >>> get: function () { 1 >^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(29, 14) Source(42, 5) + SourceIndex(0) name (Greeter) +1 >Emitted(24, 14) Source(42, 5) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1->^^^^^^^^^^^^ @@ -299,13 +294,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1->Emitted(30, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(30, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(30, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(30, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(30, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(30, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(30, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(25, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(25, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(25, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(25, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(25, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(25, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(25, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -314,8 +309,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(31, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(31, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(26, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(26, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> set: function (greetings) { 1->^^^^^^^^^^^^^ @@ -330,9 +325,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(90) > 3 > greetings: string -1->Emitted(32, 14) Source(48, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(32, 24) Source(51, 7) + SourceIndex(0) name (Greeter) -3 >Emitted(32, 33) Source(51, 24) + SourceIndex(0) name (Greeter) +1->Emitted(27, 14) Source(48, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(27, 24) Source(51, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(27, 33) Source(51, 24) + SourceIndex(0) name (Greeter) --- >>> this.greeting = greetings; 1->^^^^^^^^^^^^ @@ -350,13 +345,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > = 6 > greetings 7 > ; -1->Emitted(33, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(33, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(33, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(33, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(33, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(33, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(33, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(28, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(28, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(28, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(28, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(28, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(28, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(28, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -365,8 +360,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(34, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(34, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(29, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(29, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> enumerable: true, >>> configurable: true @@ -374,7 +369,7 @@ sourceFile:sourceMapValidationDecorators.ts 1->^^^^^^^ 2 > ^^^^^^^^^^^^^^-> 1-> -1->Emitted(37, 8) Source(46, 6) + SourceIndex(0) name (Greeter) +1->Emitted(32, 8) Source(46, 6) + SourceIndex(0) name (Greeter) --- >>> Greeter.x1 = 10; 1->^^^^ @@ -382,170 +377,508 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^ 4 > ^^ 5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > x1 3 > : number = 4 > 10 5 > ; -1->Emitted(38, 5) Source(33, 20) + SourceIndex(0) name (Greeter) -2 >Emitted(38, 15) Source(33, 22) + SourceIndex(0) name (Greeter) -3 >Emitted(38, 18) Source(33, 33) + SourceIndex(0) name (Greeter) -4 >Emitted(38, 20) Source(33, 35) + SourceIndex(0) name (Greeter) -5 >Emitted(38, 21) Source(33, 36) + SourceIndex(0) name (Greeter) +1->Emitted(33, 5) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(33, 15) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(33, 18) Source(33, 33) + SourceIndex(0) name (Greeter) +4 >Emitted(33, 20) Source(33, 35) + SourceIndex(0) name (Greeter) +5 >Emitted(33, 21) Source(33, 36) + SourceIndex(0) name (Greeter) --- ->>> Object.defineProperty(Greeter.prototype, "greet", __decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); +>>> Object.defineProperty(Greeter.prototype, "greet", 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^^^ 1-> 2 > @PropertyDecorator1 > @PropertyDecorator2(40) > 3 > greet -4 > -5 > PropertyDecorator1 -6 > - > @ -7 > PropertyDecorator2 -8 > ( -9 > 40 -10> ) -11> - > -12> greet -13> -14> greet -15> () { - > return "

" + this.greeting + "

"; - > } -1->Emitted(39, 5) Source(21, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(39, 27) Source(23, 5) + SourceIndex(0) name (Greeter) -3 >Emitted(39, 53) Source(23, 10) + SourceIndex(0) name (Greeter) -4 >Emitted(39, 67) Source(21, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(39, 85) Source(21, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(39, 87) Source(22, 6) + SourceIndex(0) name (Greeter) -7 >Emitted(39, 105) Source(22, 24) + SourceIndex(0) name (Greeter) -8 >Emitted(39, 106) Source(22, 25) + SourceIndex(0) name (Greeter) -9 >Emitted(39, 108) Source(22, 27) + SourceIndex(0) name (Greeter) -10>Emitted(39, 109) Source(22, 28) + SourceIndex(0) name (Greeter) -11>Emitted(39, 112) Source(23, 5) + SourceIndex(0) name (Greeter) -12>Emitted(39, 138) Source(23, 10) + SourceIndex(0) name (Greeter) -13>Emitted(39, 172) Source(23, 5) + SourceIndex(0) name (Greeter) -14>Emitted(39, 198) Source(23, 10) + SourceIndex(0) name (Greeter) -15>Emitted(39, 202) Source(25, 6) + SourceIndex(0) name (Greeter) +1->Emitted(34, 5) Source(21, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(34, 27) Source(23, 5) + SourceIndex(0) name (Greeter) +3 >Emitted(34, 53) Source(23, 10) + SourceIndex(0) name (Greeter) --- ->>> __decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x"); +>>> __decorate([ +>>> PropertyDecorator1, +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1 > +2 > PropertyDecorator1 +1 >Emitted(36, 13) Source(21, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(36, 31) Source(21, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(40) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 40 +5 > ) +1->Emitted(37, 13) Source(22, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(37, 31) Source(22, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(37, 32) Source(22, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(37, 34) Source(22, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(37, 35) Source(22, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> + > +2 > greet +3 > +4 > greet +5 > () { + > return "

" + this.greeting + "

"; + > } +1->Emitted(38, 12) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(38, 38) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(38, 72) Source(23, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(38, 98) Source(23, 10) + SourceIndex(0) name (Greeter) +5 >Emitted(38, 102) Source(25, 6) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ 1 >^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > > -2 > @ -3 > PropertyDecorator1 -4 > - > @ -5 > PropertyDecorator2 -6 > ( -7 > 50 -8 > ) -9 > - > private -10> x -11> : string; -1 >Emitted(40, 5) Source(27, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(40, 17) Source(27, 6) + SourceIndex(0) name (Greeter) -3 >Emitted(40, 35) Source(27, 24) + SourceIndex(0) name (Greeter) -4 >Emitted(40, 37) Source(28, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(40, 55) Source(28, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(40, 56) Source(28, 25) + SourceIndex(0) name (Greeter) -7 >Emitted(40, 58) Source(28, 27) + SourceIndex(0) name (Greeter) -8 >Emitted(40, 59) Source(28, 28) + SourceIndex(0) name (Greeter) -9 >Emitted(40, 62) Source(29, 13) + SourceIndex(0) name (Greeter) -10>Emitted(40, 84) Source(29, 14) + SourceIndex(0) name (Greeter) -11>Emitted(40, 86) Source(29, 23) + SourceIndex(0) name (Greeter) +1 >Emitted(39, 5) Source(27, 5) + SourceIndex(0) name (Greeter) --- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype, "fn", 0); +>>> PropertyDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1->@ +2 > PropertyDecorator1 +1->Emitted(40, 9) Source(27, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(40, 27) Source(27, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(50) +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 50 +5 > ) +1->Emitted(41, 9) Source(28, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(41, 27) Source(28, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(41, 28) Source(28, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(41, 30) Source(28, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(41, 31) Source(28, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "x"); +1->^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + > private +2 > x +3 > : string; +1->Emitted(42, 8) Source(29, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(42, 30) Source(29, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(42, 32) Source(29, 23) + SourceIndex(0) name (Greeter) +--- +>>> Object.defineProperty(Greeter.prototype, "fn", 1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^ 1-> > > @PropertyDecorator1 > @PropertyDecorator2(60) > private static x1: number = 10; > - > private fn( - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 70 -8 > ) -9 > - > -10> x -11> : number -1->Emitted(41, 5) Source(36, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(41, 17) Source(36, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(41, 36) Source(36, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(41, 38) Source(37, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(41, 57) Source(37, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(41, 58) Source(37, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(41, 60) Source(37, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(41, 61) Source(37, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(41, 64) Source(38, 7) + SourceIndex(0) name (Greeter) -10>Emitted(41, 90) Source(38, 8) + SourceIndex(0) name (Greeter) -11>Emitted(41, 92) Source(38, 16) + SourceIndex(0) name (Greeter) + > +2 > private +3 > fn +1->Emitted(43, 5) Source(35, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(43, 27) Source(35, 13) + SourceIndex(0) name (Greeter) +3 >Emitted(43, 50) Source(35, 15) + SourceIndex(0) name (Greeter) --- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(90)], Greeter.prototype, "greetings", 0); +>>> __decorate([ +>>> __param(0, ParameterDecorator1), +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1 >( + > +2 > @ +3 > ParameterDecorator1 +4 > +1 >Emitted(45, 13) Source(36, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(45, 24) Source(36, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(45, 43) Source(36, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(45, 44) Source(36, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(70)) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 70 +6 > ) +7 > +1->Emitted(46, 13) Source(37, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(46, 24) Source(37, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(46, 43) Source(37, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(46, 44) Source(37, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(46, 46) Source(37, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(46, 47) Source(37, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(46, 48) Source(37, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> +2 > fn +3 > +4 > fn +5 > ( + > @ParameterDecorator1 + > @ParameterDecorator2(70) + > x: number) { + > return this.greeting; + > } +1->Emitted(47, 12) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(47, 35) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(47, 69) Source(35, 13) + SourceIndex(0) name (Greeter) +4 >Emitted(47, 92) Source(35, 15) + SourceIndex(0) name (Greeter) +5 >Emitted(47, 96) Source(40, 6) + SourceIndex(0) name (Greeter) +--- +>>> Object.defineProperty(Greeter.prototype, "greetings", +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > + > + > +2 > @PropertyDecorator1 + > @PropertyDecorator2(80) + > get +3 > greetings +1 >Emitted(48, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(48, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(48, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ +>>> PropertyDecorator1, +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^-> +1 > +2 > PropertyDecorator1 +1 >Emitted(50, 13) Source(42, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(50, 31) Source(42, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(80), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 80 +5 > ) +1->Emitted(51, 13) Source(43, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(51, 31) Source(43, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(51, 32) Source(43, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(51, 34) Source(43, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(51, 35) Source(43, 28) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator1), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1-> + > get greetings() { + > return this.greeting; + > } + > + > set greetings( + > +2 > @ +3 > ParameterDecorator1 +4 > +1->Emitted(52, 13) Source(49, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(52, 24) Source(49, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(52, 43) Source(49, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(52, 44) Source(49, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(90)) +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 90 +6 > ) +7 > +1->Emitted(53, 13) Source(50, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(53, 24) Source(50, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(53, 43) Source(50, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(53, 44) Source(50, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(53, 46) Source(50, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(53, 47) Source(50, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(53, 48) Source(50, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); +1->^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^^^ +1-> +2 > greetings +3 > +4 > greetings +5 > () { + > return this.greeting; + > } +1->Emitted(54, 12) Source(44, 9) + SourceIndex(0) name (Greeter) +2 >Emitted(54, 42) Source(44, 18) + SourceIndex(0) name (Greeter) +3 >Emitted(54, 76) Source(44, 9) + SourceIndex(0) name (Greeter) +4 >Emitted(54, 106) Source(44, 18) + SourceIndex(0) name (Greeter) +5 >Emitted(54, 110) Source(46, 6) + SourceIndex(0) name (Greeter) +--- +>>> __decorate([ +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(55, 5) Source(31, 5) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^-> +1->@ +2 > PropertyDecorator1 +1->Emitted(56, 9) Source(31, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(56, 27) Source(31, 24) + SourceIndex(0) name (Greeter) +--- +>>> PropertyDecorator2(60) +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1-> + > @ +2 > PropertyDecorator2 +3 > ( +4 > 60 +5 > ) +1->Emitted(57, 9) Source(32, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(57, 27) Source(32, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(57, 28) Source(32, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(57, 30) Source(32, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(57, 31) Source(32, 28) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter, "x1"); +1 >^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^-> +1 > + > private static +2 > x1 +3 > : number = 10; +1 >Emitted(58, 8) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(58, 21) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(58, 23) Source(33, 36) + SourceIndex(0) name (Greeter) +--- +>>> Greeter = __decorate([ 1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->) { +2 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> +1->Emitted(59, 5) Source(8, 1) + SourceIndex(0) name (Greeter) +--- +>>> ClassDecorator1, +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^^^^-> +1->@ +2 > ClassDecorator1 +1->Emitted(60, 9) Source(8, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(60, 24) Source(8, 17) + SourceIndex(0) name (Greeter) +--- +>>> ClassDecorator2(10), +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> + >@ +2 > ClassDecorator2 +3 > ( +4 > 10 +5 > ) +1->Emitted(61, 9) Source(9, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(61, 24) Source(9, 17) + SourceIndex(0) name (Greeter) +3 >Emitted(61, 25) Source(9, 18) + SourceIndex(0) name (Greeter) +4 >Emitted(61, 27) Source(9, 20) + SourceIndex(0) name (Greeter) +5 >Emitted(61, 28) Source(9, 21) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator1), +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^-> +1-> + >class Greeter { + > constructor( + > +2 > @ +3 > ParameterDecorator1 +4 > +1->Emitted(62, 9) Source(12, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(62, 20) Source(12, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(62, 39) Source(12, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(62, 40) Source(12, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(0, ParameterDecorator2(20)), +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 20 +6 > ) +7 > +1->Emitted(63, 9) Source(13, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(63, 20) Source(13, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(63, 39) Source(13, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(63, 40) Source(13, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(63, 42) Source(13, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(63, 43) Source(13, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(63, 44) Source(13, 31) + SourceIndex(0) name (Greeter) +--- +>>> __param(1, ParameterDecorator1), +1 >^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^-> +1 > + > public greeting: string, + > + > +2 > @ +3 > ParameterDecorator1 +4 > +1 >Emitted(64, 9) Source(16, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(64, 20) Source(16, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(64, 39) Source(16, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(64, 40) Source(16, 27) + SourceIndex(0) name (Greeter) +--- +>>> __param(1, ParameterDecorator2(30)) +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1-> + > +2 > @ +3 > ParameterDecorator2 +4 > ( +5 > 30 +6 > ) +7 > +1->Emitted(65, 9) Source(17, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(65, 20) Source(17, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(65, 39) Source(17, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(65, 40) Source(17, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(65, 42) Source(17, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(65, 43) Source(17, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(65, 44) Source(17, 31) + SourceIndex(0) name (Greeter) +--- +>>> ], Greeter); +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^-> +1 > + > ...b: string[]) { + > } + > + > @PropertyDecorator1 + > @PropertyDecorator2(40) + > greet() { + > return "

" + this.greeting + "

"; + > } + > + > @PropertyDecorator1 + > @PropertyDecorator2(50) + > private x: string; + > + > @PropertyDecorator1 + > @PropertyDecorator2(60) + > private static x1: number = 10; + > + > private fn( + > @ParameterDecorator1 + > @ParameterDecorator2(70) + > x: number) { > return this.greeting; > } > @@ -556,281 +889,21 @@ sourceFile:sourceMapValidationDecorators.ts > } > > set greetings( - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 90 -8 > ) -9 > - > -10> greetings -11> : string -1->Emitted(42, 5) Source(49, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(42, 17) Source(49, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(42, 36) Source(49, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(42, 38) Source(50, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(42, 57) Source(50, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(42, 58) Source(50, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(42, 60) Source(50, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(42, 61) Source(50, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(42, 64) Source(51, 7) + SourceIndex(0) name (Greeter) -10>Emitted(42, 97) Source(51, 16) + SourceIndex(0) name (Greeter) -11>Emitted(42, 99) Source(51, 24) + SourceIndex(0) name (Greeter) ---- ->>> Object.defineProperty(Greeter.prototype, "greetings", __decorate([PropertyDecorator1, PropertyDecorator2(80)], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^^^ -1-> -2 > @PropertyDecorator1 - > @PropertyDecorator2(80) - > get -3 > greetings -4 > -5 > PropertyDecorator1 -6 > - > @ -7 > PropertyDecorator2 -8 > ( -9 > 80 -10> ) -11> - > get -12> greetings -13> -14> greetings -15> () { - > return this.greeting; - > } -1->Emitted(43, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(43, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(43, 57) Source(44, 18) + SourceIndex(0) name (Greeter) -4 >Emitted(43, 71) Source(42, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(43, 89) Source(42, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(43, 91) Source(43, 6) + SourceIndex(0) name (Greeter) -7 >Emitted(43, 109) Source(43, 24) + SourceIndex(0) name (Greeter) -8 >Emitted(43, 110) Source(43, 25) + SourceIndex(0) name (Greeter) -9 >Emitted(43, 112) Source(43, 27) + SourceIndex(0) name (Greeter) -10>Emitted(43, 113) Source(43, 28) + SourceIndex(0) name (Greeter) -11>Emitted(43, 116) Source(44, 9) + SourceIndex(0) name (Greeter) -12>Emitted(43, 146) Source(44, 18) + SourceIndex(0) name (Greeter) -13>Emitted(43, 180) Source(44, 9) + SourceIndex(0) name (Greeter) -14>Emitted(43, 210) Source(44, 18) + SourceIndex(0) name (Greeter) -15>Emitted(43, 214) Source(46, 6) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1"); -1 >^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^-> -1 > -2 > @ -3 > PropertyDecorator1 -4 > - > @ -5 > PropertyDecorator2 -6 > ( -7 > 60 -8 > ) -9 > - > private static -10> x1 -11> : number = 10; -1 >Emitted(44, 5) Source(31, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(44, 17) Source(31, 6) + SourceIndex(0) name (Greeter) -3 >Emitted(44, 35) Source(31, 24) + SourceIndex(0) name (Greeter) -4 >Emitted(44, 37) Source(32, 6) + SourceIndex(0) name (Greeter) -5 >Emitted(44, 55) Source(32, 24) + SourceIndex(0) name (Greeter) -6 >Emitted(44, 56) Source(32, 25) + SourceIndex(0) name (Greeter) -7 >Emitted(44, 58) Source(32, 27) + SourceIndex(0) name (Greeter) -8 >Emitted(44, 59) Source(32, 28) + SourceIndex(0) name (Greeter) -9 >Emitted(44, 62) Source(33, 20) + SourceIndex(0) name (Greeter) -10>Emitted(44, 75) Source(33, 22) + SourceIndex(0) name (Greeter) -11>Emitted(44, 77) Source(33, 36) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, void 0, 0); -1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^-> -1-> -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 20 -8 > ) -9 > - > public -10> greeting -11> : string -1->Emitted(45, 5) Source(12, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(45, 17) Source(12, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(45, 36) Source(12, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(45, 38) Source(13, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(45, 57) Source(13, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(45, 58) Source(13, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(45, 60) Source(13, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(45, 61) Source(13, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(45, 64) Source(14, 14) + SourceIndex(0) name (Greeter) -10>Emitted(45, 82) Source(14, 22) + SourceIndex(0) name (Greeter) -11>Emitted(45, 84) Source(14, 30) + SourceIndex(0) name (Greeter) ---- ->>> __decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, void 0, 1); -1->^^^^ -2 > ^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^^^^^^^^^^^^^^^^^^ -11> ^^ -1->, - > - > -2 > @ -3 > ParameterDecorator1 -4 > - > @ -5 > ParameterDecorator2 -6 > ( -7 > 30 -8 > ) -9 > - > ... -10> b -11> : string[] -1->Emitted(46, 5) Source(16, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(46, 17) Source(16, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(46, 36) Source(16, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(46, 38) Source(17, 8) + SourceIndex(0) name (Greeter) -5 >Emitted(46, 57) Source(17, 27) + SourceIndex(0) name (Greeter) -6 >Emitted(46, 58) Source(17, 28) + SourceIndex(0) name (Greeter) -7 >Emitted(46, 60) Source(17, 30) + SourceIndex(0) name (Greeter) -8 >Emitted(46, 61) Source(17, 31) + SourceIndex(0) name (Greeter) -9 >Emitted(46, 64) Source(18, 10) + SourceIndex(0) name (Greeter) -10>Emitted(46, 82) Source(18, 11) + SourceIndex(0) name (Greeter) -11>Emitted(46, 84) Source(18, 21) + SourceIndex(0) name (Greeter) ---- ->>> Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter); -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^ -8 > ^ -9 > ^^^^^^^^^^^^ -1 > -2 > @ -3 > ClassDecorator1 -4 > - > @ -5 > ClassDecorator2 -6 > ( -7 > 10 -8 > ) -9 > - > class Greeter { - > constructor( - > @ParameterDecorator1 - > @ParameterDecorator2(20) - > public greeting: string, - > - > @ParameterDecorator1 - > @ParameterDecorator2(30) - > ...b: string[]) { - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(40) - > greet() { - > return "

" + this.greeting + "

"; - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(50) - > private x: string; - > - > @PropertyDecorator1 - > @PropertyDecorator2(60) - > private static x1: number = 10; - > - > private fn( - > @ParameterDecorator1 - > @ParameterDecorator2(70) - > x: number) { - > return this.greeting; - > } - > - > @PropertyDecorator1 - > @PropertyDecorator2(80) - > get greetings() { - > return this.greeting; - > } - > - > set greetings( - > @ParameterDecorator1 - > @ParameterDecorator2(90) - > greetings: string) { - > this.greeting = greetings; - > } - > } -1 >Emitted(47, 5) Source(8, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(47, 27) Source(8, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(47, 42) Source(8, 17) + SourceIndex(0) name (Greeter) -4 >Emitted(47, 44) Source(9, 2) + SourceIndex(0) name (Greeter) -5 >Emitted(47, 59) Source(9, 17) + SourceIndex(0) name (Greeter) -6 >Emitted(47, 60) Source(9, 18) + SourceIndex(0) name (Greeter) -7 >Emitted(47, 62) Source(9, 20) + SourceIndex(0) name (Greeter) -8 >Emitted(47, 63) Source(9, 21) + SourceIndex(0) name (Greeter) -9 >Emitted(47, 75) Source(54, 2) + SourceIndex(0) name (Greeter) + > @ParameterDecorator1 + > @ParameterDecorator2(90) + > greetings: string) { + > this.greeting = greetings; + > } + >} +1 >Emitted(66, 17) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>> return Greeter; -1 >^^^^ +1->^^^^ 2 > ^^^^^^^^^^^^^^ -1 > +1-> 2 > } -1 >Emitted(48, 5) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(48, 19) Source(54, 2) + SourceIndex(0) name (Greeter) +1->Emitted(67, 5) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(67, 19) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>>})(); 1 > @@ -888,9 +961,9 @@ sourceFile:sourceMapValidationDecorators.ts > this.greeting = greetings; > } > } -1 >Emitted(49, 1) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(49, 2) Source(54, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(49, 2) Source(8, 1) + SourceIndex(0) -4 >Emitted(49, 6) Source(54, 2) + SourceIndex(0) +1 >Emitted(68, 1) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(68, 2) Source(54, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(68, 2) Source(8, 1) + SourceIndex(0) +4 >Emitted(68, 6) Source(54, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDecorators.js.map \ No newline at end of file diff --git a/tests/baselines/reference/superCallsInConstructor.errors.txt b/tests/baselines/reference/superCallsInConstructor.errors.txt index 0e7b1577bc0..eee7c06b671 100644 --- a/tests/baselines/reference/superCallsInConstructor.errors.txt +++ b/tests/baselines/reference/superCallsInConstructor.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/superCallsInConstructor.ts(12,9): error TS1101: 'with' statements are not allowed in strict mode. tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/superCallsInConstructor.ts (1 errors) ==== +==== tests/cases/compiler/superCallsInConstructor.ts (2 errors) ==== class C { foo() {} bar() {} @@ -14,6 +15,8 @@ tests/cases/compiler/superCallsInConstructor.ts(12,14): error TS2410: All symbol class Derived extends Base { constructor() { with(new C()) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~ !!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. foo(); diff --git a/tests/baselines/reference/varArgConstructorMemberParameter.errors.txt b/tests/baselines/reference/varArgConstructorMemberParameter.errors.txt index e3257b870d6..19bd0396bed 100644 --- a/tests/baselines/reference/varArgConstructorMemberParameter.errors.txt +++ b/tests/baselines/reference/varArgConstructorMemberParameter.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/varArgConstructorMemberParameter.ts(10,18): error TS1003: Identifier expected. tests/cases/compiler/varArgConstructorMemberParameter.ts(10,25): error TS1005: ',' expected. -==== tests/cases/compiler/varArgConstructorMemberParameter.ts (1 errors) ==== +==== tests/cases/compiler/varArgConstructorMemberParameter.ts (2 errors) ==== class Foo1 { constructor (...args: string[]) { } } @@ -12,6 +13,8 @@ tests/cases/compiler/varArgConstructorMemberParameter.ts(10,25): error TS1005: ' class Foo3 { constructor (public ...args: string[]) { } + ~~~~~~ +!!! error TS1003: Identifier expected. ~~~ !!! error TS1005: ',' expected. } diff --git a/tests/baselines/reference/varArgConstructorMemberParameter.js b/tests/baselines/reference/varArgConstructorMemberParameter.js index 7f1ef8d5b3a..100a4b07899 100644 --- a/tests/baselines/reference/varArgConstructorMemberParameter.js +++ b/tests/baselines/reference/varArgConstructorMemberParameter.js @@ -29,7 +29,7 @@ var Foo2 = (function () { return Foo2; })(); var Foo3 = (function () { - function Foo3(public) { + function Foo3() { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; diff --git a/tests/cases/compiler/APISample_compile.ts b/tests/cases/compiler/APISample_compile.ts index f1703835380..d3cc650dd2a 100644 --- a/tests/cases/compiler/APISample_compile.ts +++ b/tests/cases/compiler/APISample_compile.ts @@ -21,8 +21,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); allDiagnostics.forEach(diagnostic => { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(`${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`); + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }); var exitCode = emitResult.emitSkipped ? 1 : 0; diff --git a/tests/cases/compiler/APISample_linter.ts b/tests/cases/compiler/APISample_linter.ts index 287a2a56dee..9f9b55a0a67 100644 --- a/tests/cases/compiler/APISample_linter.ts +++ b/tests/cases/compiler/APISample_linter.ts @@ -10,9 +10,9 @@ declare var process: any; declare var console: any; -declare var fs: any; +declare var readFileSync: any; -import ts = require("typescript"); +import * as ts from "typescript"; export function delint(sourceFile: ts.SourceFile) { delintNode(sourceFile); @@ -27,21 +27,22 @@ export function delint(sourceFile: ts.SourceFile) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; + case ts.SyntaxKind.IfStatement: - var ifStatement = (node); + let ifStatement = (node); if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; case ts.SyntaxKind.BinaryExpression: - var op = (node).operatorToken.kind; - - if (op === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken) { + let op = (node).operatorToken.kind; + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { report(node, "Use '===' and '!=='.") } break; @@ -51,16 +52,16 @@ export function delint(sourceFile: ts.SourceFile) { } function report(node: ts.Node, message: string) { - var lineChar = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(`${sourceFile.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${message}`) + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); } } -var fileNames = process.argv.slice(2); +const fileNames = process.argv.slice(2); fileNames.forEach(fileName => { // Parse a file - var sourceFile = ts.createSourceFile(fileName, fs.readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile); -}); +}); \ No newline at end of file diff --git a/tests/cases/compiler/APISample_transform.ts b/tests/cases/compiler/APISample_transform.ts index 438b9520010..48e27c4e008 100644 --- a/tests/cases/compiler/APISample_transform.ts +++ b/tests/cases/compiler/APISample_transform.ts @@ -8,61 +8,12 @@ * Please log a "breaking change" issue for any API breaking change affecting this issue */ -declare var process: any; declare var console: any; -declare var fs: any; -declare var path: any; -declare var os: any; -import ts = require("typescript"); +import * as ts from "typescript"; -function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) { - // Sources - var files = { - "file.ts": contents, - "lib.d.ts": fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString() - }; +const source = "let x: string = 'string'"; - // Generated outputs - var outputs = []; - - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: (fileName, target) => { - return files[fileName] !== undefined ? - ts.createSourceFile(fileName, files[fileName], target) : undefined; - }, - writeFile: (name, text, writeByteOrderMark) => { - outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); - }, - getDefaultLibFileName: () => "lib.d.ts", - useCaseSensitiveFileNames: () => false, - getCanonicalFileName: (fileName) => fileName, - getCurrentDirectory: () => "", - getNewLine: () => "\n" - }; - - // Create a program from inputs - var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost); - - // Query for early errors - var errors = ts.getPreEmitDiagnostics(program); - var emitResult = program.emit(); - - errors = errors.concat(emitResult.diagnostics); - - return { - outputs: outputs, - errors: errors.map(function (e) { - return e.file.fileName + "(" + (e.file.getLineAndCharacterOfPosition(e.start).line + 1) + "): " - + ts.flattenDiagnosticMessageText(e.messageText, os.EOL); - }) - }; -} - -// Calling our transform function using a simple TypeScript variable declarations, -// and loading the default library like: -var source = "var x: number = 'string'"; -var result = transform(source); +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); console.log(JSON.stringify(result)); \ No newline at end of file diff --git a/tests/cases/compiler/APISample_watcher.ts b/tests/cases/compiler/APISample_watcher.ts index 3b1c83419bf..b152f86c378 100644 --- a/tests/cases/compiler/APISample_watcher.ts +++ b/tests/cases/compiler/APISample_watcher.ts @@ -13,10 +13,10 @@ declare var console: any; declare var fs: any; declare var path: any; -import ts = require("typescript"); +import * as ts from "typescript"; function watch(rootFileNames: string[], options: ts.CompilerOptions) { - var files: ts.Map<{ version: number }> = {}; + const files: ts.Map<{ version: number }> = {}; // initialize the list of files rootFileNames.forEach(fileName => { @@ -24,7 +24,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); // Create the language service host to allow the LS to communicate with the host - var servicesHost: ts.LanguageServiceHost = { + const servicesHost: ts.LanguageServiceHost = { getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { @@ -40,7 +40,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }; // Create the language service files - var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) // Now let's watch the files rootFileNames.forEach(fileName => { @@ -65,7 +65,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { }); function emitFile(fileName: string) { - var output = services.getEmitOutput(fileName); + let output = services.getEmitOutput(fileName); if (!output.emitSkipped) { console.log(`Emitting ${fileName}`); @@ -81,24 +81,25 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { } function logErrors(fileName: string) { - var allDiagnostics = services.getCompilerOptionsDiagnostics() + let allDiagnostics = services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)); allDiagnostics.forEach(diagnostic => { + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(` Error ${diagnostic.file.fileName} (${lineChar.line + 1},${lineChar.character + 1}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { - console.log(` Error: ${diagnostic.messageText}`); + console.log(` Error: ${message}`); } }); } } // Initialize files constituting the program as all .ts files in the current directory -var currentDirectoryFiles = fs.readdirSync(process.cwd()). +const currentDirectoryFiles = fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); // Start the watcher diff --git a/tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts b/tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts new file mode 100644 index 00000000000..61d8c6f7dda --- /dev/null +++ b/tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts @@ -0,0 +1,17 @@ +// @target: ES6 + +var results: string[]; + +{ + let [, b, , a] = results; + let x = { + a, + b + } +} + + +function f([, a, , b, , , , s, , , ] = results) { + a = s[1]; + b = s[2]; +} \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithDecorator1.ts b/tests/cases/compiler/classExpressionWithDecorator1.ts new file mode 100644 index 00000000000..74b49456a36 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithDecorator1.ts @@ -0,0 +1 @@ +var v = @decorate class C { static p = 1 }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticProperties1.ts b/tests/cases/compiler/classExpressionWithStaticProperties1.ts new file mode 100644 index 00000000000..19fe035e6a7 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticProperties1.ts @@ -0,0 +1 @@ +var v = class C { static a = 1; static b = 2 }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticProperties2.ts b/tests/cases/compiler/classExpressionWithStaticProperties2.ts new file mode 100644 index 00000000000..f7b9606b6e0 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticProperties2.ts @@ -0,0 +1 @@ +var v = class C { static a = 1; static b }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts b/tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts new file mode 100644 index 00000000000..8df07b9569a --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticPropertiesES61.ts @@ -0,0 +1,2 @@ +//@target: es6 +var v = class C { static a = 1; static b = 2 }; \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts b/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts new file mode 100644 index 00000000000..ee0430eb793 --- /dev/null +++ b/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts @@ -0,0 +1,2 @@ +//@target: es6 +var v = class C { static a = 1; static b }; \ No newline at end of file diff --git a/tests/cases/compiler/exportDeclarationInInternalModule.ts b/tests/cases/compiler/exportDeclarationInInternalModule.ts new file mode 100644 index 00000000000..0b9ba7600a4 --- /dev/null +++ b/tests/cases/compiler/exportDeclarationInInternalModule.ts @@ -0,0 +1,20 @@ +// @target: es5 +// @module: commonjs +// @declaration: true + +class Bbb { +} + +class Aaa extends Bbb { } + +module Aaa { + export class SomeType { } +} + +module Bbb { + export class SomeType { } + + export * from Aaa; // this line causes the nullref +} + +var a: Bbb.SomeType; diff --git a/tests/cases/compiler/exportStarFromEmptyModule.ts b/tests/cases/compiler/exportStarFromEmptyModule.ts new file mode 100644 index 00000000000..163576f1c08 --- /dev/null +++ b/tests/cases/compiler/exportStarFromEmptyModule.ts @@ -0,0 +1,25 @@ +// @target: es5 +// @module: commonjs +// @declaration: true + +// @filename: exportStarFromEmptyModule_module1.ts +export class A { + static r; +} + +// @filename:exportStarFromEmptyModule_module2.ts +// empty + +// @filename: exportStarFromEmptyModule_module3.ts +export * from "exportStarFromEmptyModule_module2"; +export * from "exportStarFromEmptyModule_module1"; + +export class A { + static q; +} + +// @filename: exportStarFromEmptyModule_module4.ts +import * as X from "exportStarFromEmptyModule_module3"; +var s: X.A; +X.A.q; +X.A.r; // Error \ No newline at end of file diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts new file mode 100644 index 00000000000..e3d94ff25d2 --- /dev/null +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts @@ -0,0 +1,9 @@ +// @target: ES5 +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts new file mode 100644 index 00000000000..a9a2607c39b --- /dev/null +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts @@ -0,0 +1,10 @@ +// @target: ES5 +module M { + class S { + decorator(target: Object, key: string): void { } + } + class C extends S { + @super.decorator + method() { } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts new file mode 100644 index 00000000000..df0b847e99d --- /dev/null +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts @@ -0,0 +1,7 @@ +// @target: ES6 +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; + +class C { + @dec ["1"]() { } + @dec ["b"]() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts new file mode 100644 index 00000000000..7b3be0365e9 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var [a, b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts new file mode 100644 index 00000000000..35d05ef1f9c --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts new file mode 100644 index 00000000000..ed93b5175d0 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts new file mode 100644 index 00000000000..b7e763694ea --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, ...b] = new FooIterator) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts new file mode 100644 index 00000000000..f0b9b142f40 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts new file mode 100644 index 00000000000..c327efa3ec2 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, ...b]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts new file mode 100644 index 00000000000..21d632fd541 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, b]: Bar[]) { } +fun(...new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts new file mode 100644 index 00000000000..ba2c74681fe --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts @@ -0,0 +1,30 @@ +//@target: ES6 +function fun(...[a, b]: [Bar, Bar][]) { } +fun(...new FooIteratorIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class FooIteratorIterator { + next() { + return { + value: new FooIterator, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts new file mode 100644 index 00000000000..90db0e5edb5 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts new file mode 100644 index 00000000000..e6e5ad617b2 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([a, b]: Bar[]) { } +fun(new FooIterator); +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts new file mode 100644 index 00000000000..8513dd07649 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun([[a], b]: Bar[][]) { } +fun(new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts new file mode 100644 index 00000000000..587f1f0b056 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var [a, ...b] = new SymbolIterator; +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts new file mode 100644 index 00000000000..b5be67b393f --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts @@ -0,0 +1,17 @@ +//@target: ES6 +function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } +fun(...new FooArrayIterator); +class Bar { x } +class Foo extends Bar { y } +class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts new file mode 100644 index 00000000000..c8f17395d14 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var [a, b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts new file mode 100644 index 00000000000..8cf60df5597 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var [...a] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts new file mode 100644 index 00000000000..91ce911b04c --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var a: string, b: boolean; +[a, b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts new file mode 100644 index 00000000000..462b3663b8b --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern24.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var a: string, b: boolean[]; +[a, ...b] = { 0: "", 1: true }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts new file mode 100644 index 00000000000..a47edb4e987 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts new file mode 100644 index 00000000000..be295333b2e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts new file mode 100644 index 00000000000..fcf6967cd4e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts new file mode 100644 index 00000000000..111abd70ac3 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts new file mode 100644 index 00000000000..403347d61e5 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts @@ -0,0 +1,3 @@ +//@target: ES6 +function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } +takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts new file mode 100644 index 00000000000..31656b5661f --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: Bar; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts new file mode 100644 index 00000000000..075ff3fd467 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts @@ -0,0 +1,2 @@ +//@target: ES6 +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts new file mode 100644 index 00000000000..edd95be1598 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: Bar[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts new file mode 100644 index 00000000000..b51d0f09d08 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts new file mode 100644 index 00000000000..fc9395ed6a4 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string[]; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts new file mode 100644 index 00000000000..85b2f2e54e3 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string[]; +[a, b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts new file mode 100644 index 00000000000..dd49205d6e0 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts @@ -0,0 +1,17 @@ +//@target: ES6 +var a: Bar, b: string; +[a, ...b] = new FooIterator; +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts new file mode 100644 index 00000000000..1573c55ca8e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts @@ -0,0 +1,16 @@ +//@target: ES6 +function fun([a, b] = new FooIterator) { } +class Bar { x } +class Foo extends Bar { y } +class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of57.ts b/tests/cases/conformance/es6/for-ofStatements/for-of57.ts new file mode 100644 index 00000000000..f3c8dd97822 --- /dev/null +++ b/tests/cases/conformance/es6/for-ofStatements/for-of57.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var iter: Iterable; +for (let num of iter) { } \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts new file mode 100644 index 00000000000..4b4f3e8cc1c --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts new file mode 100644 index 00000000000..f8549b82b76 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray10.ts @@ -0,0 +1,8 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts new file mode 100644 index 00000000000..0c0108433aa --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts @@ -0,0 +1,3 @@ +//@target: ES6 +var iter: Iterable; +var array = [...iter]; \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts new file mode 100644 index 00000000000..9db5d010874 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts @@ -0,0 +1,28 @@ +//@target: ES6 +var array = [...new NumberIterator, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class NumberIterator { + next() { + return { + value: 0, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts new file mode 100644 index 00000000000..174c97de7cc --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [...[0, 1], ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts new file mode 100644 index 00000000000..47c2e633702 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts new file mode 100644 index 00000000000..e6a8041a961 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts @@ -0,0 +1,15 @@ +//@target: ES6 +var array: number[] = [0, 1, ...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts new file mode 100644 index 00000000000..7495ca6aac6 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts @@ -0,0 +1,16 @@ +//@target: ES6 +var array: number[] = [0, 1]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts new file mode 100644 index 00000000000..12ca478c738 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts @@ -0,0 +1,16 @@ +//@target: ES6 +var array: symbol[]; +array.concat([...new SymbolIterator]); + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts new file mode 100644 index 00000000000..0e2258aa5ea --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray8.ts @@ -0,0 +1,11 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts new file mode 100644 index 00000000000..2b8d93c9ccb --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts @@ -0,0 +1,14 @@ +//@target: ES6 +var array = [...new SymbolIterator]; + +class SymbolIterator { + next() { + return { + value: Symbol() + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts new file mode 100644 index 00000000000..85d07e56996 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: symbol) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts new file mode 100644 index 00000000000..bf8ad336fbf --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts @@ -0,0 +1,17 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts new file mode 100644 index 00000000000..182e454cfc8 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts @@ -0,0 +1,17 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(...s: T[]) { return s[0] } + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts new file mode 100644 index 00000000000..a0bd1ede193 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts new file mode 100644 index 00000000000..4a8fd9ff389 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts new file mode 100644 index 00000000000..b6e8fe0c86b --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts new file mode 100644 index 00000000000..2a73fd6f3c9 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts @@ -0,0 +1,16 @@ +//@target: ES6 +foo(...new SymbolIterator); + +function foo(s1: symbol, ...s: symbol[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts new file mode 100644 index 00000000000..c17c4156e65 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | string)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts new file mode 100644 index 00000000000..2c6150f8040 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: (symbol | number)[]) { } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts new file mode 100644 index 00000000000..56fb7936eb7 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts @@ -0,0 +1,29 @@ +//@target: ES6 +foo(...new SymbolIterator, ...new StringIterator); + +function foo(...s: T[]) { return s[0]; } +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts new file mode 100644 index 00000000000..e5b969456b7 --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...new SymbolIterator, ...new StringIterator); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts new file mode 100644 index 00000000000..470f99844ba --- /dev/null +++ b/tests/cases/conformance/es6/spread/iteratorSpreadInCall9.ts @@ -0,0 +1,32 @@ +//@target: ES6 +new Foo(...new SymbolIterator, ...[...new StringIterator]); + +class Foo { + constructor(...s: T[]) { } +} + +class SymbolIterator { + next() { + return { + value: Symbol(), + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} + +class StringIterator { + next() { + return { + value: "", + done: false + }; + } + + [Symbol.iterator]() { + return this; + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/getOccurrencesDeclare1.ts b/tests/cases/fourslash/getOccurrencesDeclare1.ts index 1cdad07eb7e..4207a92b5a6 100644 --- a/tests/cases/fourslash/getOccurrencesDeclare1.ts +++ b/tests/cases/fourslash/getOccurrencesDeclare1.ts @@ -44,7 +44,6 @@ //// protected prot1; //// //// protected constructor(public public, protected protected, private private) { -//// public = private = protected; //// } //// } //// } diff --git a/tests/cases/fourslash/getOccurrencesDeclare3.ts b/tests/cases/fourslash/getOccurrencesDeclare3.ts index 048dd8efeac..2dee0af4b14 100644 --- a/tests/cases/fourslash/getOccurrencesDeclare3.ts +++ b/tests/cases/fourslash/getOccurrencesDeclare3.ts @@ -48,7 +48,6 @@ //// protected prot1; //// //// protected constructor(public public, protected protected, private private) { -//// public = private = protected; //// } //// } //// } diff --git a/tests/cases/fourslash/getOccurrencesExport1.ts b/tests/cases/fourslash/getOccurrencesExport1.ts index c47c39cf548..bc82e8a1bea 100644 --- a/tests/cases/fourslash/getOccurrencesExport1.ts +++ b/tests/cases/fourslash/getOccurrencesExport1.ts @@ -44,7 +44,6 @@ //// protected prot1; //// //// protected constructor(public public, protected protected, private private) { -//// public = private = protected; //// } //// } //// } diff --git a/tests/cases/fourslash/getOccurrencesExport3.ts b/tests/cases/fourslash/getOccurrencesExport3.ts index 009b891992f..215cbf8f48a 100644 --- a/tests/cases/fourslash/getOccurrencesExport3.ts +++ b/tests/cases/fourslash/getOccurrencesExport3.ts @@ -48,7 +48,6 @@ //// protected prot1; //// //// protected constructor(public public, protected protected, private private) { -//// public = private = protected; //// } //// } //// } diff --git a/tests/cases/fourslash/server/brace.ts b/tests/cases/fourslash/server/brace01.ts similarity index 91% rename from tests/cases/fourslash/server/brace.ts rename to tests/cases/fourslash/server/brace01.ts index fc8a71197db..916a2e0b33f 100644 --- a/tests/cases/fourslash/server/brace.ts +++ b/tests/cases/fourslash/server/brace01.ts @@ -1,4 +1,4 @@ -/// +/// //////curly braces ////module Foo [|{ diff --git a/tests/cases/fourslash/server/completions.ts b/tests/cases/fourslash/server/completions01.ts similarity index 87% rename from tests/cases/fourslash/server/completions.ts rename to tests/cases/fourslash/server/completions01.ts index 2af0393283f..a837a74849d 100644 --- a/tests/cases/fourslash/server/completions.ts +++ b/tests/cases/fourslash/server/completions01.ts @@ -1,4 +1,4 @@ -/// +/// ////var x: string[] = []; ////x.forEach(function (y) { y/*1*/ diff --git a/tests/cases/fourslash/server/completions2.ts b/tests/cases/fourslash/server/completions02.ts similarity index 84% rename from tests/cases/fourslash/server/completions2.ts rename to tests/cases/fourslash/server/completions02.ts index 3e7e77b588c..b6c39a5c723 100644 --- a/tests/cases/fourslash/server/completions2.ts +++ b/tests/cases/fourslash/server/completions02.ts @@ -1,4 +1,4 @@ -/// +/// ////class Foo { ////} diff --git a/tests/cases/fourslash/server/definition.ts b/tests/cases/fourslash/server/definition01.ts similarity index 68% rename from tests/cases/fourslash/server/definition.ts rename to tests/cases/fourslash/server/definition01.ts index f403965fe12..8bf6e73c840 100644 --- a/tests/cases/fourslash/server/definition.ts +++ b/tests/cases/fourslash/server/definition01.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/server/format.ts b/tests/cases/fourslash/server/format01.ts similarity index 75% rename from tests/cases/fourslash/server/format.ts rename to tests/cases/fourslash/server/format01.ts index 75d06eef0c2..f4541152201 100644 --- a/tests/cases/fourslash/server/format.ts +++ b/tests/cases/fourslash/server/format01.ts @@ -1,4 +1,4 @@ -/// +/// /////**/module Default{var x= ( { } ) ;} diff --git a/tests/cases/fourslash/server/formatonkey.ts b/tests/cases/fourslash/server/formatonkey01.ts similarity index 76% rename from tests/cases/fourslash/server/formatonkey.ts rename to tests/cases/fourslash/server/formatonkey01.ts index 64cd74ca858..73e817ce3b3 100644 --- a/tests/cases/fourslash/server/formatonkey.ts +++ b/tests/cases/fourslash/server/formatonkey01.ts @@ -1,4 +1,4 @@ -/// +/// ////switch (1) { //// case 1: diff --git a/tests/cases/fourslash/server/navbar.ts b/tests/cases/fourslash/server/navbar01.ts similarity index 96% rename from tests/cases/fourslash/server/navbar.ts rename to tests/cases/fourslash/server/navbar01.ts index 67e14fe1009..82ded5e6f54 100644 --- a/tests/cases/fourslash/server/navbar.ts +++ b/tests/cases/fourslash/server/navbar01.ts @@ -1,4 +1,4 @@ -/// +/// ////// Interface ////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { diff --git a/tests/cases/fourslash/server/navto.ts b/tests/cases/fourslash/server/navto01.ts similarity index 94% rename from tests/cases/fourslash/server/navto.ts rename to tests/cases/fourslash/server/navto01.ts index ba907e985fd..1072c64494f 100644 --- a/tests/cases/fourslash/server/navto.ts +++ b/tests/cases/fourslash/server/navto01.ts @@ -1,4 +1,4 @@ -/// +/// /////// Module ////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { diff --git a/tests/cases/fourslash/server/occurrences01.ts b/tests/cases/fourslash/server/occurrences01.ts new file mode 100644 index 00000000000..db2fa64f38d --- /dev/null +++ b/tests/cases/fourslash/server/occurrences01.ts @@ -0,0 +1,22 @@ +/// + +////foo: [|switch|] (10) { +//// [|case|] 1: +//// [|case|] 2: +//// [|case|] 3: +//// [|break|]; +//// [|break|] foo; +//// continue; +//// continue foo; +////} + +let ranges = test.ranges(); + +for (let r of ranges) { + goTo.position(r.start); + verify.occurrencesAtPositionCount(ranges.length); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, /*isWriteAccess*/ false); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/server/occurrences02.ts b/tests/cases/fourslash/server/occurrences02.ts new file mode 100644 index 00000000000..e0d39cb92fd --- /dev/null +++ b/tests/cases/fourslash/server/occurrences02.ts @@ -0,0 +1,16 @@ +/// + +////function [|f|](x: typeof [|f|]) { +//// [|f|]([|f|]); +////} + +let ranges = test.ranges(); + +for (let r of ranges) { + goTo.position(r.start); + verify.occurrencesAtPositionCount(ranges.length); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/server/quickinfo.ts b/tests/cases/fourslash/server/quickinfo01.ts similarity index 88% rename from tests/cases/fourslash/server/quickinfo.ts rename to tests/cases/fourslash/server/quickinfo01.ts index 5292eb6c2c8..9008505e447 100644 --- a/tests/cases/fourslash/server/quickinfo.ts +++ b/tests/cases/fourslash/server/quickinfo01.ts @@ -1,4 +1,4 @@ -/// +/// ////interface One { //// commonProperty: number; diff --git a/tests/cases/fourslash/server/references.ts b/tests/cases/fourslash/server/references01.ts similarity index 79% rename from tests/cases/fourslash/server/references.ts rename to tests/cases/fourslash/server/references01.ts index 55b21615551..0ecbeb43de3 100644 --- a/tests/cases/fourslash/server/references.ts +++ b/tests/cases/fourslash/server/references01.ts @@ -1,4 +1,4 @@ -/// +/// // Global class reference. diff --git a/tests/cases/fourslash/server/rename.ts b/tests/cases/fourslash/server/rename01.ts similarity index 81% rename from tests/cases/fourslash/server/rename.ts rename to tests/cases/fourslash/server/rename01.ts index 4f8b7b98cd4..2da25f87ba7 100644 --- a/tests/cases/fourslash/server/rename.ts +++ b/tests/cases/fourslash/server/rename01.ts @@ -1,4 +1,4 @@ -/// +/// /////// diff --git a/tests/cases/fourslash/server/signatureHelp.ts b/tests/cases/fourslash/server/signatureHelp01.ts similarity index 72% rename from tests/cases/fourslash/server/signatureHelp.ts rename to tests/cases/fourslash/server/signatureHelp01.ts index 294df367f07..73303ecce4c 100644 --- a/tests/cases/fourslash/server/signatureHelp.ts +++ b/tests/cases/fourslash/server/signatureHelp01.ts @@ -1,4 +1,4 @@ -/// +/// ////function foo(data: number) { ////} From c25170558e57cf92a5f36c079519723edc5b24fe Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 16:06:26 -0700 Subject: [PATCH 65/69] Added test for super method calls in ES6 classes. --- ...itClassDeclarationWithSuperMethodCall01.js | 24 +++++++++++++++++ ...lassDeclarationWithSuperMethodCall01.types | 26 +++++++++++++++++++ ...itClassDeclarationWithSuperMethodCall01.ts | 12 +++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js create mode 100644 tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types create mode 100644 tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js new file mode 100644 index 00000000000..f0712f8e131 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js @@ -0,0 +1,24 @@ +//// [emitClassDeclarationWithSuperMethodCall01.ts] + +class Parent { + foo() { + } +} + +class Foo extends Parent { + foo() { + var x = () => super.foo(); + } +} + +//// [emitClassDeclarationWithSuperMethodCall01.js] +class Parent { + foo() { + } +} +class Foo extends Parent { + foo() { + var _this = this; + var x = () => super.foo(); + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types new file mode 100644 index 00000000000..8b68af897ac --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts === + +class Parent { +>Parent : Parent + + foo() { +>foo : () => void + } +} + +class Foo extends Parent { +>Foo : Foo +>Parent : Parent + + foo() { +>foo : () => void + + var x = () => super.foo(); +>x : () => void +>() => super.foo() : () => void +>super.foo() : void +>super.foo : () => void +>super : Parent +>foo : () => void + } +} diff --git a/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts new file mode 100644 index 00000000000..d9fdcc167eb --- /dev/null +++ b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts @@ -0,0 +1,12 @@ +//@target: es6 + +class Parent { + foo() { + } +} + +class Foo extends Parent { + foo() { + var x = () => super.foo(); + } +} \ No newline at end of file From fb8cc0c40a9c79f4ee31c226cd266b3e0df37aa8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 16:29:38 -0700 Subject: [PATCH 66/69] Don't emit '_this' declaration in ES6 or later. --- src/compiler/checker.ts | 2 +- tests/baselines/reference/computedPropertyNames31_ES6.js | 1 - .../reference/emitClassDeclarationWithSuperMethodCall01.js | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ea38a8f4b31..ea86b2b9b04 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5582,7 +5582,7 @@ module ts { needToCaptureLexicalThis = false; while (container && container.kind === SyntaxKind.ArrowFunction) { container = getSuperContainer(container, /*includeFunctions*/ true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6; } // topmost container must be something that is directly nested in the class declaration diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.js b/tests/baselines/reference/computedPropertyNames31_ES6.js index 2c63dcee077..d17423223e3 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.js +++ b/tests/baselines/reference/computedPropertyNames31_ES6.js @@ -23,7 +23,6 @@ class Base { } class C extends Base { foo() { - var _this = this; (() => { var obj = { [super.bar()]() { } // needs capture diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js index f0712f8e131..77b91730156 100644 --- a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js @@ -18,7 +18,6 @@ class Parent { } class Foo extends Parent { foo() { - var _this = this; var x = () => super.foo(); } } From 63bb38157be0b5952e488647256b79f0d513f75c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 17:00:22 -0700 Subject: [PATCH 67/69] Ragga fragga newlines. --- .../class/method/decoratorOnClassMethod11.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts index e3d94ff25d2..6f80fa00bca 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts @@ -1,9 +1,9 @@ -// @target: ES5 -module M { - class C { - decorator(target: Object, key: string): void { } - - @this.decorator - method() { } - } +// @target: ES5 +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } } \ No newline at end of file From 35d848f0bda676d99954c5c142b651c1838cd224 Mon Sep 17 00:00:00 2001 From: Ahmad Farid Date: Thu, 9 Apr 2015 17:11:42 -0700 Subject: [PATCH 68/69] merging --- .../baselines/reference/APISample_compile.js | 66 +++--- tests/baselines/reference/APISample_linter.js | 126 +++++------ .../reference/APISample_transform.js | 30 +-- .../baselines/reference/APISample_watcher.js | 204 +++++++++--------- .../reference/decoratorOnClassMethod11.js | 14 +- .../reference/decoratorOnClassMethod13.types | 4 +- 6 files changed, 222 insertions(+), 222 deletions(-) diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 83414abaf6e..f30bd2c21a9 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1,37 +1,37 @@ //// [APISample_compile.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var os: any; - -import ts = require("typescript"); - -export function compile(fileNames: string[], options: ts.CompilerOptions): void { - var program = ts.createProgram(fileNames, options); - var emitResult = program.emit(); - - var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - - allDiagnostics.forEach(diagnostic => { - var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); - console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); - }); - - var exitCode = emitResult.emitSkipped ? 1 : 0; - console.log(`Process exiting with code '${exitCode}'.`); - process.exit(exitCode); -} - -compile(process.argv.slice(2), { - noEmitOnError: true, noImplicitAny: true, - target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var os: any; + +import ts = require("typescript"); + +export function compile(fileNames: string[], options: ts.CompilerOptions): void { + var program = ts.createProgram(fileNames, options); + var emitResult = program.emit(); + + var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); + + allDiagnostics.forEach(diagnostic => { + var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + }); + + var exitCode = emitResult.emitSkipped ? 1 : 0; + console.log(`Process exiting with code '${exitCode}'.`); + process.exit(exitCode); +} + +compile(process.argv.slice(2), { + noEmitOnError: true, noImplicitAny: true, + target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS }); //// [APISample_compile.js] diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 9e1b4cf6c0d..17061add038 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1,67 +1,67 @@ //// [APISample_linter.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var readFileSync: any; - -import * as ts from "typescript"; - -export function delint(sourceFile: ts.SourceFile) { - delintNode(sourceFile); - - function delintNode(node: ts.Node) { - switch (node.kind) { - case ts.SyntaxKind.ForStatement: - case ts.SyntaxKind.ForInStatement: - case ts.SyntaxKind.WhileStatement: - case ts.SyntaxKind.DoStatement: - if ((node).statement.kind !== ts.SyntaxKind.Block) { - report(node, "A looping statement's contents should be wrapped in a block body."); - } - break; - - case ts.SyntaxKind.IfStatement: - let ifStatement = (node); - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); - } - if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && - ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); - } - break; - - case ts.SyntaxKind.BinaryExpression: - let op = (node).operatorToken.kind; - if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { - report(node, "Use '===' and '!=='.") - } - break; - } - - ts.forEachChild(node, delintNode); - } - - function report(node: ts.Node, message: string) { - let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); - console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); - } -} - -const fileNames = process.argv.slice(2); -fileNames.forEach(fileName => { - // Parse a file - let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); - - // delint it - delint(sourceFile); + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var readFileSync: any; + +import * as ts from "typescript"; + +export function delint(sourceFile: ts.SourceFile) { + delintNode(sourceFile); + + function delintNode(node: ts.Node) { + switch (node.kind) { + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + if ((node).statement.kind !== ts.SyntaxKind.Block) { + report(node, "A looping statement's contents should be wrapped in a block body."); + } + break; + + case ts.SyntaxKind.IfStatement: + let ifStatement = (node); + if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { + report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); + } + if (ifStatement.elseStatement && + ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && + ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { + report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); + } + break; + + case ts.SyntaxKind.BinaryExpression: + let op = (node).operatorToken.kind; + if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) { + report(node, "Use '===' and '!=='.") + } + break; + } + + ts.forEachChild(node, delintNode); + } + + function report(node: ts.Node, message: string) { + let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); + console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); + } +} + +const fileNames = process.argv.slice(2); +fileNames.forEach(fileName => { + // Parse a file + let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); + + // delint it + delint(sourceFile); }); //// [APISample_linter.js] diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index c38fe2a419b..a7f83f19b5e 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1,19 +1,19 @@ //// [APISample_transform.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var console: any; - -import * as ts from "typescript"; - -const source = "let x: string = 'string'"; - -let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); - + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var console: any; + +import * as ts from "typescript"; + +const source = "let x: string = 'string'"; + +let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); + console.log(JSON.stringify(result)); //// [APISample_transform.js] diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 704d36b6954..e2ab4e135dd 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1,106 +1,106 @@ //// [APISample_watcher.ts] - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var process: any; -declare var console: any; -declare var fs: any; -declare var path: any; - -import * as ts from "typescript"; - -function watch(rootFileNames: string[], options: ts.CompilerOptions) { - const files: ts.Map<{ version: number }> = {}; - - // initialize the list of files - rootFileNames.forEach(fileName => { - files[fileName] = { version: 0 }; - }); - - // Create the language service host to allow the LS to communicate with the host - const servicesHost: ts.LanguageServiceHost = { - getScriptFileNames: () => rootFileNames, - getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), - getScriptSnapshot: (fileName) => { - if (!fs.existsSync(fileName)) { - return undefined; - } - - return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); - }, - getCurrentDirectory: () => process.cwd(), - getCompilationSettings: () => options, - getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), - }; - - // Create the language service files - const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) - - // Now let's watch the files - rootFileNames.forEach(fileName => { - // First time around, emit all files - emitFile(fileName); - - // Add a watch on the file to handle next change - fs.watchFile(fileName, - { persistent: true, interval: 250 }, - (curr, prev) => { - // Check timestamp - if (+curr.mtime <= +prev.mtime) { - return; - } - - // Update the version to signal a change in the file - files[fileName].version++; - - // write the changes to disk - emitFile(fileName); - }); - }); - - function emitFile(fileName: string) { - let output = services.getEmitOutput(fileName); - - if (!output.emitSkipped) { - console.log(`Emitting ${fileName}`); - } - else { - console.log(`Emitting ${fileName} failed`); - logErrors(fileName); - } - - output.outputFiles.forEach(o => { - fs.writeFileSync(o.name, o.text, "utf8"); - }); - } - - function logErrors(fileName: string) { - let allDiagnostics = services.getCompilerOptionsDiagnostics() - .concat(services.getSyntacticDiagnostics(fileName)) - .concat(services.getSemanticDiagnostics(fileName)); - - allDiagnostics.forEach(diagnostic => { - let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); - if (diagnostic.file) { - let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); - } - else { - console.log(` Error: ${message}`); - } - }); - } -} - -// Initialize files constituting the program as all .ts files in the current directory -const currentDirectoryFiles = fs.readdirSync(process.cwd()). - filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); - -// Start the watcher + +/* + * Note: This test is a public API sample. The sample sources can be found + at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var process: any; +declare var console: any; +declare var fs: any; +declare var path: any; + +import * as ts from "typescript"; + +function watch(rootFileNames: string[], options: ts.CompilerOptions) { + const files: ts.Map<{ version: number }> = {}; + + // initialize the list of files + rootFileNames.forEach(fileName => { + files[fileName] = { version: 0 }; + }); + + // Create the language service host to allow the LS to communicate with the host + const servicesHost: ts.LanguageServiceHost = { + getScriptFileNames: () => rootFileNames, + getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), + getScriptSnapshot: (fileName) => { + if (!fs.existsSync(fileName)) { + return undefined; + } + + return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); + }, + getCurrentDirectory: () => process.cwd(), + getCompilationSettings: () => options, + getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), + }; + + // Create the language service files + const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) + + // Now let's watch the files + rootFileNames.forEach(fileName => { + // First time around, emit all files + emitFile(fileName); + + // Add a watch on the file to handle next change + fs.watchFile(fileName, + { persistent: true, interval: 250 }, + (curr, prev) => { + // Check timestamp + if (+curr.mtime <= +prev.mtime) { + return; + } + + // Update the version to signal a change in the file + files[fileName].version++; + + // write the changes to disk + emitFile(fileName); + }); + }); + + function emitFile(fileName: string) { + let output = services.getEmitOutput(fileName); + + if (!output.emitSkipped) { + console.log(`Emitting ${fileName}`); + } + else { + console.log(`Emitting ${fileName} failed`); + logErrors(fileName); + } + + output.outputFiles.forEach(o => { + fs.writeFileSync(o.name, o.text, "utf8"); + }); + } + + function logErrors(fileName: string) { + let allDiagnostics = services.getCompilerOptionsDiagnostics() + .concat(services.getSyntacticDiagnostics(fileName)) + .concat(services.getSemanticDiagnostics(fileName)); + + allDiagnostics.forEach(diagnostic => { + let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); + if (diagnostic.file) { + let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + } + else { + console.log(` Error: ${message}`); + } + }); + } +} + +// Initialize files constituting the program as all .ts files in the current directory +const currentDirectoryFiles = fs.readdirSync(process.cwd()). + filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); + +// Start the watcher watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); //// [APISample_watcher.js] diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index 71d4298f02c..f8276de2fe3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -1,11 +1,11 @@ //// [decoratorOnClassMethod11.ts] -module M { - class C { - decorator(target: Object, key: string): void { } - - @this.decorator - method() { } - } +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } } //// [decoratorOnClassMethod11.js] diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 8c34805792f..1390f5750e6 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -14,8 +14,8 @@ class C { >C : C @dec ["1"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor @dec ["b"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor } From 024d653efc98451db7ff5c890e01075396b4ed4b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 9 Apr 2015 22:27:18 -0700 Subject: [PATCH 69/69] Rename type. --- src/services/services.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index b99e7bf44c7..19fcb46552c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1019,7 +1019,7 @@ module ts { highlightSpans: HighlightSpan[]; } - export module DocumentHighlightKind { + export module HighlightSpanKind { export const none = "none"; export const definition = "definition"; export const reference = "reference"; @@ -4010,7 +4010,7 @@ module ts { return { fileName: sourceFile.fileName, textSpan: createTextSpanFromBounds(start, end), - kind: DocumentHighlightKind.none + kind: HighlightSpanKind.none }; } @@ -4047,7 +4047,7 @@ module ts { documentHighlights.highlightSpans.push({ textSpan: referenceEntry.textSpan, - kind: referenceEntry.isWriteAccess ? DocumentHighlightKind.writtenReference : DocumentHighlightKind.reference + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference }); } } @@ -4580,7 +4580,7 @@ module ts { result.push({ fileName: fileName, textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: DocumentHighlightKind.reference + kind: HighlightSpanKind.reference }); i++; // skip the next keyword continue; @@ -4613,7 +4613,7 @@ module ts { result.push({ fileName: entry.fileName, textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === DocumentHighlightKind.writtenReference + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference }); } }