From 4d3e842e9f3e5a7d521662dbb01966bb86875c1b Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Mon, 16 Mar 2015 16:47:50 -0700 Subject: [PATCH 01/42] Add assert to make sure getOccurences at position only returns results for the file we request the occurences for. --- src/services/services.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index 1bf5f6336d..edb7032b81 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3571,8 +3571,22 @@ module ts { } } - /// References and Occurrences function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { + let results = getOccurrencesAtPositionCore(fileName, position); + + 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}.`); + }); + + return results; + } + + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); From 325c8b655fe7cd50af49ec5e0be057e7c8140ffa Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Mon, 16 Mar 2015 17:29:56 -0700 Subject: [PATCH 02/42] Add a check to make sure we have results. --- src/services/services.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index edb7032b81..4458a45ed0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3573,14 +3573,16 @@ module ts { function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { let results = getOccurrencesAtPositionCore(fileName, position); + + if (results) { + let sourceFile = getCanonicalFileName(normalizeSlashes(fileName)); - 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}.`); - }); + // 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}.`); + }); + } return results; } From 36ea7c8d7725b978d32da5d5975faad5cb96a9f8 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 19 Mar 2015 14:36:30 -0700 Subject: [PATCH 03/42] Emit destructuring in parameter --- src/compiler/declarationEmitter.ts | 3 +- ...clarationEmitDestructuringArrayPattern5.js | 37 +++++++++++++++++++ ...rationEmitDestructuringArrayPattern5.types | 33 +++++++++++++++++ ...ingOptionalBindingParametersInOverloads.js | 4 +- ...ionEmitDestructuringParameterProperties.js | 6 +-- ...tructuringWithOptionalBindingParameters.js | 4 +- ...clarationEmitDestructuringArrayPattern5.ts | 5 +++ 7 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types create mode 100644 tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index cf75467e1c..6509ae6e2c 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1291,7 +1291,8 @@ module ts { write("..."); } if (isBindingPattern(node.name)) { - write("_" + indexOf((node.parent).parameters, node)); + // By emitting binding pattern as binding pattern in function parameters, language service can provide better signature help + write(getTextOfNode(node.name)); } else { writeTextOfNode(currentSourceFile, node.name); diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js new file mode 100644 index 0000000000..9e8dee3285 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js @@ -0,0 +1,37 @@ +//// [declarationEmitDestructuringArrayPattern5.ts] +function foo([a, b, c]: [string, string, string]): void { } +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } + + +//// [declarationEmitDestructuringArrayPattern5.js] +function foo(_a) { + var a = _a[0], b = _a[1], c = _a[2]; +} +function far(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0]; +} +function bar(_a) { + var a1 = _a.a1, b1 = _a.b1, c1 = _a.c1; +} +function baz(_a) { + var a2 = _a.a2, _b = _a.b2, b1 = _b.b1, c1 = _b.c1; +} + + +//// [declarationEmitDestructuringArrayPattern5.d.ts] +declare function foo([a, b, c]: [string, string, string]): void; +declare function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void; +declare function bar({a1, b1, c1}: { + a1: number; + b1: boolean; + c1: string; +}): void; +declare function baz({a2, b2: {b1, c1}}: { + a2: number; + b2: { + b1: boolean; + c1: string; + }; +}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types new file mode 100644 index 0000000000..fdb2bba88e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +function foo([a, b, c]: [string, string, string]): void { } +>foo : ([a, b, c]: [string, string, string]) => void +>a : string +>b : string +>c : string + +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +>far : ([a, [b], [[c]]]: [number, boolean[], string[][]]) => void +>a : number +>b : boolean +>c : string + +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +>bar : ({a1, b1, c1}: { a1: number; b1: boolean; c1: string; }) => void +>a1 : number +>b1 : boolean +>c1 : string +>a1 : number +>b1 : boolean +>c1 : string + +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } +>baz : ({a2, b2: {b1, c1}}: { a2: number; b2: { b1: boolean; c1: string; }; }) => void +>a2 : number +>b2 : unknown +>b1 : boolean +>c1 : string +>a2 : number +>b2 : { b1: boolean; c1: string; } +>b1 : boolean +>c1 : string + diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js index c907add11f..d44c9d4236 100644 --- a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js @@ -25,8 +25,8 @@ function foo2() { //// [declarationEmitDestructuringOptionalBindingParametersInOverloads.d.ts] -declare function foo(_0?: [string, number, boolean]): any; -declare function foo2(_0?: { +declare function foo([x, y, z]?: [string, number, boolean]): any; +declare function foo2({ x, y, z }?: { x: string; y: number; z: boolean; diff --git a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js index cfe4acc173..841508c331 100644 --- a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js +++ b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js @@ -43,12 +43,12 @@ var C3 = (function () { //// [declarationEmitDestructuringParameterProperties.d.ts] declare class C1 { x: string, y: string, z: string; - constructor(_0: string[]); + constructor([x, y, z]: string[]); } declare type TupleType1 = [string, number, boolean]; declare class C2 { x: string, y: number, z: boolean; - constructor(_0: TupleType1); + constructor([x, y, z]: TupleType1); } declare type ObjType1 = { x: number; @@ -57,5 +57,5 @@ declare type ObjType1 = { }; declare class C3 { x: number, y: string, z: boolean; - constructor(_0: ObjType1); + constructor({ x, y, z }: ObjType1); } diff --git a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js index 284cf10778..9ffd25a7fa 100644 --- a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js +++ b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js @@ -14,8 +14,8 @@ function foo1(_a) { //// [declarationEmitDestructuringWithOptionalBindingParameters.d.ts] -declare function foo(_0?: [string, number, boolean]): void; -declare function foo1(_0?: { +declare function foo([x,y,z]?: [string, number, boolean]): void; +declare function foo1({ x, y, z }?: { x: string; y: number; z: boolean; diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts b/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts new file mode 100644 index 0000000000..c610e24f93 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts @@ -0,0 +1,5 @@ +// @declaration: true +function foo([a, b, c]: [string, string, string]): void { } +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } From b5065f1f3aaa9817b9e5c060bb30927714faeb0f Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 19 Mar 2015 14:42:57 -0700 Subject: [PATCH 04/42] Allow destructuring in ambient context --- src/compiler/checker.ts | 3 --- .../reference/declarationInAmbientContext.errors.txt | 12 ------------ .../reference/declarationInAmbientContext.types | 9 +++++++++ 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 tests/baselines/reference/declarationInAmbientContext.errors.txt create mode 100644 tests/baselines/reference/declarationInAmbientContext.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d50e440c5e..f67b721465 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12005,9 +12005,6 @@ module ts { function checkGrammarVariableDeclaration(node: VariableDeclaration) { if (node.parent.parent.kind !== SyntaxKind.ForInStatement && node.parent.parent.kind !== SyntaxKind.ForOfStatement) { if (isInAmbientContext(node)) { - if (isBindingPattern(node.name)) { - return grammarErrorOnNode(node, Diagnostics.Destructuring_declarations_are_not_allowed_in_ambient_contexts); - } if (node.initializer) { // Error on equals token which immediate precedes the initializer let equalsTokenLength = "=".length; diff --git a/tests/baselines/reference/declarationInAmbientContext.errors.txt b/tests/baselines/reference/declarationInAmbientContext.errors.txt deleted file mode 100644 index 338da990a0..0000000000 --- a/tests/baselines/reference/declarationInAmbientContext.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts(1,13): error TS1183: Destructuring declarations are not allowed in ambient contexts. -tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts(2,13): error TS1183: Destructuring declarations are not allowed in ambient contexts. - - -==== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts (2 errors) ==== - declare var [a, b]; // Error, destructuring declaration not allowed in ambient context - ~~~~~~ -!!! error TS1183: Destructuring declarations are not allowed in ambient contexts. - declare var {c, d}; // Error, destructuring declaration not allowed in ambient context - ~~~~~~ -!!! error TS1183: Destructuring declarations are not allowed in ambient contexts. - \ No newline at end of file diff --git a/tests/baselines/reference/declarationInAmbientContext.types b/tests/baselines/reference/declarationInAmbientContext.types new file mode 100644 index 0000000000..ecdd3b7c7e --- /dev/null +++ b/tests/baselines/reference/declarationInAmbientContext.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts === +declare var [a, b]; // Error, destructuring declaration not allowed in ambient context +>a : any +>b : any + +declare var {c, d}; // Error, destructuring declaration not allowed in ambient context +>c : any +>d : any + From 5979dacf4f0278278b42749aa2ae7f146326bdac Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 23 Mar 2015 11:30:51 -0700 Subject: [PATCH 05/42] Correctly emit bidning pattern with initializer and rest --- src/compiler/declarationEmitter.ts | 99 +++++++++++++++---- ...clarationEmitDestructuringArrayPattern6.js | 65 ++++++++++++ ...rationEmitDestructuringArrayPattern6.types | 49 +++++++++ ...clarationEmitDestructuringArrayPattern7.js | 20 ++++ ...rationEmitDestructuringArrayPattern7.types | 13 +++ ...ingOptionalBindingParametersInOverloads.js | 2 +- ...ionEmitDestructuringParameterProperties.js | 2 +- ...tructuringWithOptionalBindingParameters.js | 4 +- ...clarationEmitDestructuringArrayPattern6.ts | 5 + ...clarationEmitDestructuringArrayPattern7.ts | 3 + 10 files changed, 237 insertions(+), 25 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types create mode 100644 tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts create mode 100644 tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 6509ae6e2c..93e0fa3129 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1291,8 +1291,10 @@ module ts { write("..."); } if (isBindingPattern(node.name)) { - // By emitting binding pattern as binding pattern in function parameters, language service can provide better signature help - write(getTextOfNode(node.name)); + // For bindingPattern, we can't simply writeTextOfNode from the source file + // because we want to omit the initializer and using writeTextOfNode will result in initializer get emitted. + // Therefore, we will have to recursively emit each element in the bindingPattern. + emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); @@ -1312,41 +1314,46 @@ module ts { } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { - let diagnosticMessage: DiagnosticMessage; + let diagnosticMessage: DiagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult: SymbolAccessiblityResult) { switch (node.parent.kind) { case SyntaxKind.Constructor: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; case SyntaxKind.ConstructSignature: // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; case SyntaxKind.CallSignature: // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -1354,30 +1361,80 @@ module ts { } else { // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - break; case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; default: Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } - - return { - diagnosticMessage, - errorNode: node, - typeName: node.name - }; } + + function emitBindingPattern(bindingPattern: BindingPattern) { + // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + if (bindingPattern.kind === SyntaxKind.ObjectBindingPattern) { + write("{"); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("}"); + } + else if (bindingPattern.kind === SyntaxKind.ArrayBindingPattern) { + write("["); + emitCommaList(bindingPattern.elements, emitBindingElement); + write("]"); + } + } + + function emitBindingElement(bindingElement: BindingElement) { + function getBindingElementTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + let diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: bindingElement, + typeName: bindingElement.name + } : undefined; + } + + if (bindingElement.propertyName) { + // bindingElement has propertyName property in the following case: + // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" + // We have to explicitly emit the propertyName before descending into its binding elements. + // Example: + // original: function foo({y: [a,b,c]}) {} + // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + + // If bindingElement has propertyName property, then its name must be another bindingPattern of SyntaxKind.ObjectBindingPattern + emitBindingPattern(bindingElement.name); + } + else if (bindingElement.name) { + if (isBindingPattern(bindingElement.name)) { + // If it is a nested binding pattern, we will recursively descend into each element and emit each one separately. + // In the case of rest element, we will omit rest element. + // Example: + // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} + // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; + // original with rest: function foo([a ...c]) {} + // emit : declare function foo([a, c]): void; + emitBindingPattern(bindingElement.name); + } + else { + // If the node is just an identifier, we will simply emit the text associated with the node's name + // Example: + // original: function foo({y = 10, x}) {} + // emit : declare function foo({y, x}: {number, any}): void; + writeTextOfNode(currentSourceFile, bindingElement.name); + } + } + } } function emitNode(node: Node) { diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js new file mode 100644 index 0000000000..803ea9fe01 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js @@ -0,0 +1,65 @@ +//// [declarationEmitDestructuringArrayPattern6.ts] +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +function g([a, b, c, d] = [1, 2, 3, 4]) { } +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } + +//// [declarationEmitDestructuringArrayPattern6.js] +function f(_a) { + var _b = _a === void 0 ? { + x: 10, + y: [ + 2, + 4, + 6, + 8 + ] + } : _a, _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, _e = _d === void 0 ? [ + 1, + 2, + 3, + 4 + ] : _d, a = _e[0], b = _e[1], c = _e[2], d = _e[3]; +} +function g(_a) { + var _b = _a === void 0 ? [ + 1, + 2, + 3, + 4 + ] : _a, a = _b[0], b = _b[1], c = _b[2], d = _b[3]; +} +function h(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, a = _d[0], b = _d[1], c = _d[2], _e = _b.z, a1 = _e.a1, b1 = _e.b1; +} +function h1(_a) { + var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, y = _d === void 0 ? [ + 1, + 2, + 3 + ] : _d, _e = _b.z, a1 = _e.a1, b1 = _e.b1; +} + + +//// [declarationEmitDestructuringArrayPattern6.d.ts] +declare function f({x, y: [a, b, c, d]}?: { + x: number; + y: [number, number, number, number]; +}): void; +declare function g([a, b, c, d]?: [number, number, number, number]): void; +declare function h([a, [b], [[c]], {x, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { + x?: number; + y: [any, any, any]; + z: { + a1: any; + b1: any; + }; +}]): void; +declare function h1([a, [b], [[c]], {x, y, z: {a1, b1}}]: [any, [any], [[any]], { + x?: number; + y?: number[]; + z: { + a1: any; + b1: any; + }; +}]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types new file mode 100644 index 0000000000..6112094cbe --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types @@ -0,0 +1,49 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts === +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +>f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void +>x : number +>y : unknown +>a : number +>b : number +>c : number +>d : number +>[1, 2, 3, 4] : [number, number, number, number] +>{ x: 10, y: [2, 4, 6, 8] } : { x: number; y: [number, number, number, number]; } +>x : number +>y : [number, number, number, number] +>[2, 4, 6, 8] : [number, number, number, number] + +function g([a, b, c, d] = [1, 2, 3, 4]) { } +>g : ([a, b, c, d]?: [number, number, number, number]) => void +>a : number +>b : number +>c : number +>d : number +>[1, 2, 3, 4] : [number, number, number, number] + +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +>h : ([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y: [any, any, any]; z: { a1: any; b1: any; }; }]) => void +>a : any +>b : any +>c : any +>x : number +>y : unknown +>a : any +>b : any +>c : any +>z : unknown +>a1 : any +>b1 : any + +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } +>h1 : ([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y?: number[]; z: { a1: any; b1: any; }; }]) => void +>a : any +>b : any +>c : any +>x : number +>y : number[] +>[1, 2, 3] : number[] +>z : unknown +>a1 : any +>b1 : any + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js new file mode 100644 index 0000000000..00e65b816b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js @@ -0,0 +1,20 @@ +//// [declarationEmitDestructuringArrayPattern7.ts] +function bar([x, z, ...w]) { } +function foo([x, ...y] = [1, "string", true]) { } + +//// [declarationEmitDestructuringArrayPattern7.js] +function bar(_a) { + var x = _a[0], z = _a[1], w = _a.slice(2); +} +function foo(_a) { + var _b = _a === void 0 ? [ + 1, + "string", + true + ] : _a, x = _b[0], y = _b.slice(1); +} + + +//// [declarationEmitDestructuringArrayPattern7.d.ts] +declare function bar([x, z, w]: any[]): void; +declare function foo([x, y]?: (string | number | boolean)[]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types new file mode 100644 index 0000000000..8dc51bf5c7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts === +function bar([x, z, ...w]) { } +>bar : ([x, z, ...w]: any[]) => void +>x : any +>z : any +>w : any[] + +function foo([x, ...y] = [1, "string", true]) { } +>foo : ([x, ...y]?: (string | number | boolean)[]) => void +>x : string | number | boolean +>y : (string | number | boolean)[] +>[1, "string", true] : (string | number | boolean)[] + diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js index d44c9d4236..a3cdee3122 100644 --- a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.js @@ -26,7 +26,7 @@ function foo2() { //// [declarationEmitDestructuringOptionalBindingParametersInOverloads.d.ts] declare function foo([x, y, z]?: [string, number, boolean]): any; -declare function foo2({ x, y, z }?: { +declare function foo2({x, y, z}?: { x: string; y: number; z: boolean; diff --git a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js index 841508c331..a98620c852 100644 --- a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js +++ b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js @@ -57,5 +57,5 @@ declare type ObjType1 = { }; declare class C3 { x: number, y: string, z: boolean; - constructor({ x, y, z }: ObjType1); + constructor({x, y, z}: ObjType1); } diff --git a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js index 9ffd25a7fa..5c7f4d2cec 100644 --- a/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js +++ b/tests/baselines/reference/declarationEmitDestructuringWithOptionalBindingParameters.js @@ -14,8 +14,8 @@ function foo1(_a) { //// [declarationEmitDestructuringWithOptionalBindingParameters.d.ts] -declare function foo([x,y,z]?: [string, number, boolean]): void; -declare function foo1({ x, y, z }?: { +declare function foo([x, y, z]?: [string, number, boolean]): void; +declare function foo1({x, y, z}?: { x: string; y: number; z: boolean; diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts b/tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts new file mode 100644 index 0000000000..34441cd6c7 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts @@ -0,0 +1,5 @@ +// @declaration: true +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +function g([a, b, c, d] = [1, 2, 3, 4]) { } +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts b/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts new file mode 100644 index 0000000000..321c6fd420 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts @@ -0,0 +1,3 @@ +// @declaration: true +function bar([x, z, ...w]) { } +function foo([x, ...y] = [1, "string", true]) { } \ No newline at end of file From 85624c03219d119f38a44debb0697c0839409200 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 23 Mar 2015 17:58:53 -0700 Subject: [PATCH 06/42] Change test files name --- ...n5.js => declarationEmitDestructuring1.js} | 6 +- ...es => declarationEmitDestructuring1.types} | 2 +- ...n6.js => declarationEmitDestructuring2.js} | 6 +- ...es => declarationEmitDestructuring2.types} | 2 +- .../declarationEmitDestructuring3.js | 22 ++++++ ...es => declarationEmitDestructuring3.types} | 3 +- .../declarationEmitDestructuring4.js | 67 +++++++++++++++++++ .../declarationEmitDestructuring4.types | 32 +++++++++ ...clarationEmitDestructuringArrayPattern7.js | 20 ------ ...n5.ts => declarationEmitDestructuring1.ts} | 0 ...n6.ts => declarationEmitDestructuring2.ts} | 0 .../compiler/declarationEmitDestructuring3.ts | 4 ++ .../compiler/declarationEmitDestructuring4.ts | 12 ++++ ...clarationEmitDestructuringArrayPattern7.ts | 3 - 14 files changed, 147 insertions(+), 32 deletions(-) rename tests/baselines/reference/{declarationEmitDestructuringArrayPattern5.js => declarationEmitDestructuring1.js} (83%) rename tests/baselines/reference/{declarationEmitDestructuringArrayPattern5.types => declarationEmitDestructuring1.types} (89%) rename tests/baselines/reference/{declarationEmitDestructuringArrayPattern6.js => declarationEmitDestructuring2.js} (88%) rename tests/baselines/reference/{declarationEmitDestructuringArrayPattern6.types => declarationEmitDestructuring2.types} (91%) create mode 100644 tests/baselines/reference/declarationEmitDestructuring3.js rename tests/baselines/reference/{declarationEmitDestructuringArrayPattern7.types => declarationEmitDestructuring3.types} (78%) create mode 100644 tests/baselines/reference/declarationEmitDestructuring4.js create mode 100644 tests/baselines/reference/declarationEmitDestructuring4.types delete mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js rename tests/cases/compiler/{declarationEmitDestructuringArrayPattern5.ts => declarationEmitDestructuring1.ts} (100%) rename tests/cases/compiler/{declarationEmitDestructuringArrayPattern6.ts => declarationEmitDestructuring2.ts} (100%) create mode 100644 tests/cases/compiler/declarationEmitDestructuring3.ts create mode 100644 tests/cases/compiler/declarationEmitDestructuring4.ts delete mode 100644 tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js b/tests/baselines/reference/declarationEmitDestructuring1.js similarity index 83% rename from tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js rename to tests/baselines/reference/declarationEmitDestructuring1.js index 9e8dee3285..9ac08032a0 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js +++ b/tests/baselines/reference/declarationEmitDestructuring1.js @@ -1,11 +1,11 @@ -//// [declarationEmitDestructuringArrayPattern5.ts] +//// [declarationEmitDestructuring1.ts] function foo([a, b, c]: [string, string, string]): void { } function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } -//// [declarationEmitDestructuringArrayPattern5.js] +//// [declarationEmitDestructuring1.js] function foo(_a) { var a = _a[0], b = _a[1], c = _a[2]; } @@ -20,7 +20,7 @@ function baz(_a) { } -//// [declarationEmitDestructuringArrayPattern5.d.ts] +//// [declarationEmitDestructuring1.d.ts] declare function foo([a, b, c]: [string, string, string]): void; declare function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void; declare function bar({a1, b1, c1}: { diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuring1.types similarity index 89% rename from tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types rename to tests/baselines/reference/declarationEmitDestructuring1.types index fdb2bba88e..6b22f25b54 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +=== tests/cases/compiler/declarationEmitDestructuring1.ts === function foo([a, b, c]: [string, string, string]): void { } >foo : ([a, b, c]: [string, string, string]) => void >a : string diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js b/tests/baselines/reference/declarationEmitDestructuring2.js similarity index 88% rename from tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js rename to tests/baselines/reference/declarationEmitDestructuring2.js index 803ea9fe01..f6d3d17abe 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.js +++ b/tests/baselines/reference/declarationEmitDestructuring2.js @@ -1,10 +1,10 @@ -//// [declarationEmitDestructuringArrayPattern6.ts] +//// [declarationEmitDestructuring2.ts] function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } function g([a, b, c, d] = [1, 2, 3, 4]) { } function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } -//// [declarationEmitDestructuringArrayPattern6.js] +//// [declarationEmitDestructuring2.js] function f(_a) { var _b = _a === void 0 ? { x: 10, @@ -41,7 +41,7 @@ function h1(_a) { } -//// [declarationEmitDestructuringArrayPattern6.d.ts] +//// [declarationEmitDestructuring2.d.ts] declare function f({x, y: [a, b, c, d]}?: { x: number; y: [number, number, number, number]; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types b/tests/baselines/reference/declarationEmitDestructuring2.types similarity index 91% rename from tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types rename to tests/baselines/reference/declarationEmitDestructuring2.types index 6112094cbe..3368d4e72f 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern6.types +++ b/tests/baselines/reference/declarationEmitDestructuring2.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts === +=== tests/cases/compiler/declarationEmitDestructuring2.ts === function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } >f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void >x : number diff --git a/tests/baselines/reference/declarationEmitDestructuring3.js b/tests/baselines/reference/declarationEmitDestructuring3.js new file mode 100644 index 0000000000..66f6b071a8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring3.js @@ -0,0 +1,22 @@ +//// [declarationEmitDestructuring3.ts] +function bar([x, z, ...w]) { } +function foo([x, ...y] = [1, "string", true]) { } + + + +//// [declarationEmitDestructuring3.js] +function bar(_a) { + var x = _a[0], z = _a[1], w = _a.slice(2); +} +function foo(_a) { + var _b = _a === void 0 ? [ + 1, + "string", + true + ] : _a, x = _b[0], y = _b.slice(1); +} + + +//// [declarationEmitDestructuring3.d.ts] +declare function bar([x, z, ...w]: any[]): void; +declare function foo([x, ...y]?: (string | number | boolean)[]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types b/tests/baselines/reference/declarationEmitDestructuring3.types similarity index 78% rename from tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types rename to tests/baselines/reference/declarationEmitDestructuring3.types index 8dc51bf5c7..57764f53ee 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.types +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts === +=== tests/cases/compiler/declarationEmitDestructuring3.ts === function bar([x, z, ...w]) { } >bar : ([x, z, ...w]: any[]) => void >x : any @@ -11,3 +11,4 @@ function foo([x, ...y] = [1, "string", true]) { } >y : (string | number | boolean)[] >[1, "string", true] : (string | number | boolean)[] + diff --git a/tests/baselines/reference/declarationEmitDestructuring4.js b/tests/baselines/reference/declarationEmitDestructuring4.js new file mode 100644 index 0000000000..5b43fbfc85 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.js @@ -0,0 +1,67 @@ +//// [declarationEmitDestructuring4.ts] +function baz([]) { } +function baz1([] = [1,2,3]) { } +function baz2([[]] = [[1,2,3]]) { } +function baz3({}) { } +function baz4({} = { x: 10 }) { } +function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } + + + +//// [declarationEmitDestructuring4.js] +function baz(_a) { + var ; +} +function baz1(_a) { + var _b = _a === void 0 ? [ + 1, + 2, + 3 + ] : _a; +} +function baz2(_a) { + var _b = (_a === void 0 ? [ + [ + 1, + 2, + 3 + ] + ] : _a)[0]; +} +function baz3(_a) { + var ; +} +function baz4(_a) { + var _b = _a === void 0 ? { + x: 10 + } : _a; +} +function baz5(_a) { + var _b = _a === void 0 ? { + x: 10, + y: { + a: 2 + }, + z: [ + 1, + 2 + ] + } : _a; +} + + +//// [declarationEmitDestructuring4.d.ts] +declare function baz([]: any[]): void; +declare function baz1([]?: number[]): void; +declare function baz2([[]]?: [number[]]): void; +declare function baz3({}: {}): void; +declare function baz4({}?: { + x: number; +}): void; +declare function baz5({}?: { + x: number; + y: { + a: number; + }; + z: number[]; +}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types new file mode 100644 index 0000000000..6602fbdcb7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declarationEmitDestructuring4.ts === +function baz([]) { } +>baz : ([]: any[]) => void + +function baz1([] = [1,2,3]) { } +>baz1 : ([]?: number[]) => void +>[1,2,3] : number[] + +function baz2([[]] = [[1,2,3]]) { } +>baz2 : ([[]]?: [number[]]) => void +>[[1,2,3]] : [number[]] +>[1,2,3] : number[] + +function baz3({}) { } +>baz3 : ({}: {}) => void + +function baz4({} = { x: 10 }) { } +>baz4 : ({}?: { x: number; }) => void +>{ x: 10 } : { x: number; } +>x : number + +function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } +>baz5 : ({}?: { x: number; y: { a: number; }; z: number[]; }) => void +>{ x: 10, y: { a: 2 }, z: [1,2] } : { x: number; y: { a: number; }; z: number[]; } +>x : number +>y : { a: number; } +>{ a: 2 } : { a: number; } +>a : number +>z : number[] +>[1,2] : number[] + + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js deleted file mode 100644 index 00e65b816b..0000000000 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern7.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [declarationEmitDestructuringArrayPattern7.ts] -function bar([x, z, ...w]) { } -function foo([x, ...y] = [1, "string", true]) { } - -//// [declarationEmitDestructuringArrayPattern7.js] -function bar(_a) { - var x = _a[0], z = _a[1], w = _a.slice(2); -} -function foo(_a) { - var _b = _a === void 0 ? [ - 1, - "string", - true - ] : _a, x = _b[0], y = _b.slice(1); -} - - -//// [declarationEmitDestructuringArrayPattern7.d.ts] -declare function bar([x, z, w]: any[]): void; -declare function foo([x, y]?: (string | number | boolean)[]): void; diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts b/tests/cases/compiler/declarationEmitDestructuring1.ts similarity index 100% rename from tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts rename to tests/cases/compiler/declarationEmitDestructuring1.ts diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts b/tests/cases/compiler/declarationEmitDestructuring2.ts similarity index 100% rename from tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts rename to tests/cases/compiler/declarationEmitDestructuring2.ts diff --git a/tests/cases/compiler/declarationEmitDestructuring3.ts b/tests/cases/compiler/declarationEmitDestructuring3.ts new file mode 100644 index 0000000000..78aeddb0e1 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuring3.ts @@ -0,0 +1,4 @@ +// @declaration: true +function bar([x, z, ...w]) { } +function foo([x, ...y] = [1, "string", true]) { } + diff --git a/tests/cases/compiler/declarationEmitDestructuring4.ts b/tests/cases/compiler/declarationEmitDestructuring4.ts new file mode 100644 index 0000000000..b961be2b39 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuring4.ts @@ -0,0 +1,12 @@ +// @declaration: true +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written +function baz([]) { } +function baz1([] = [1,2,3]) { } +function baz2([[]] = [[1,2,3]]) { } + +function baz3({}) { } +function baz4({} = { x: 10 }) { } +function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } + diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts b/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts deleted file mode 100644 index 321c6fd420..0000000000 --- a/tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @declaration: true -function bar([x, z, ...w]) { } -function foo([x, ...y] = [1, "string", true]) { } \ No newline at end of file From 6695981583fa5f4f2ad184d64fae630808266c50 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 23 Mar 2015 17:59:02 -0700 Subject: [PATCH 07/42] Address code review --- src/compiler/declarationEmitter.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 93e0fa3129..8431756c91 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1322,7 +1322,7 @@ module ts { } : undefined; } - function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult: SymbolAccessiblityResult) { + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult: SymbolAccessiblityResult): DiagnosticMessage { switch (node.parent.kind) { case SyntaxKind.Constructor: return symbolAccesibilityResult.errorModuleName ? @@ -1422,15 +1422,19 @@ module ts { // Example: // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; - // original with rest: function foo([a ...c]) {} - // emit : declare function foo([a, c]): void; + // original with rest: function foo([a, ...c]) {} + // emit : declare function foo([a, ...c]): void; emitBindingPattern(bindingElement.name); } else { + Debug.assert(bindingElement.name.kind === SyntaxKind.Identifier); // If the node is just an identifier, we will simply emit the text associated with the node's name // Example: // original: function foo({y = 10, x}) {} // emit : declare function foo({y, x}: {number, any}): void; + if (bindingElement.dotDotDotToken) { + write("..."); + } writeTextOfNode(currentSourceFile, bindingElement.name); } } From 1c2eae6b72c8cc9646fda407bbaa6344bcf4e997 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 24 Mar 2015 10:11:29 -0700 Subject: [PATCH 08/42] Update test cases --- .../declarationEmitDestructuring4.js | 27 +++++-------------- .../declarationEmitDestructuring4.types | 13 +++------ .../compiler/declarationEmitDestructuring4.ts | 1 - 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/tests/baselines/reference/declarationEmitDestructuring4.js b/tests/baselines/reference/declarationEmitDestructuring4.js index 5b43fbfc85..81d1707b8e 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.js +++ b/tests/baselines/reference/declarationEmitDestructuring4.js @@ -1,14 +1,20 @@ //// [declarationEmitDestructuring4.ts] +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written function baz([]) { } function baz1([] = [1,2,3]) { } function baz2([[]] = [[1,2,3]]) { } + function baz3({}) { } function baz4({} = { x: 10 }) { } -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } //// [declarationEmitDestructuring4.js] +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written function baz(_a) { var ; } @@ -36,18 +42,6 @@ function baz4(_a) { x: 10 } : _a; } -function baz5(_a) { - var _b = _a === void 0 ? { - x: 10, - y: { - a: 2 - }, - z: [ - 1, - 2 - ] - } : _a; -} //// [declarationEmitDestructuring4.d.ts] @@ -58,10 +52,3 @@ declare function baz3({}: {}): void; declare function baz4({}?: { x: number; }): void; -declare function baz5({}?: { - x: number; - y: { - a: number; - }; - z: number[]; -}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types index 6602fbdcb7..6a90eda170 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.types +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -1,4 +1,7 @@ === tests/cases/compiler/declarationEmitDestructuring4.ts === +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written function baz([]) { } >baz : ([]: any[]) => void @@ -19,14 +22,4 @@ function baz4({} = { x: 10 }) { } >{ x: 10 } : { x: number; } >x : number -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } ->baz5 : ({}?: { x: number; y: { a: number; }; z: number[]; }) => void ->{ x: 10, y: { a: 2 }, z: [1,2] } : { x: number; y: { a: number; }; z: number[]; } ->x : number ->y : { a: number; } ->{ a: 2 } : { a: number; } ->a : number ->z : number[] ->[1,2] : number[] - diff --git a/tests/cases/compiler/declarationEmitDestructuring4.ts b/tests/cases/compiler/declarationEmitDestructuring4.ts index b961be2b39..bd1a57af12 100644 --- a/tests/cases/compiler/declarationEmitDestructuring4.ts +++ b/tests/cases/compiler/declarationEmitDestructuring4.ts @@ -8,5 +8,4 @@ function baz2([[]] = [[1,2,3]]) { } function baz3({}) { } function baz4({} = { x: 10 }) { } -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } From a51f0bf8bbca289f692e046cecd18670fd5cf6dd Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 25 Mar 2015 23:18:58 -0700 Subject: [PATCH 09/42] added relaxed emit rules for separate compilation --- src/compiler/checker.ts | 19 ++++++++-- src/compiler/types.ts | 1 + src/services/services.ts | 80 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6fdaac79ce..9765ceee4a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -713,8 +713,14 @@ module ts { function markExportAsReferenced(node: ImportEqualsDeclaration | ExportAssignment | ExportSpecifier) { let symbol = getSymbolOfNode(node); let target = resolveAlias(symbol); - if (target && target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target)) { - markAliasSymbolAsReferenced(symbol); + if (target) { + let markAlias = + (target === unknownSymbol && compilerOptions.separateCompilation) || + (target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target)); + + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } } } @@ -9745,7 +9751,9 @@ module ts { checkKindsOfPropertyMemberOverrides(type, baseType); } + } + if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { // Check that base type can be evaluated as expression checkExpressionOrQualifiedName(baseTypeNode.typeName); } @@ -11264,11 +11272,16 @@ module ts { // parent is not source file or it is not reference to internal module return false; } - return isAliasResolvedToValue(getSymbolOfNode(node)); + + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference); } function isAliasResolvedToValue(symbol: Symbol): boolean { let target = resolveAlias(symbol); + if (target === unknownSymbol && compilerOptions.separateCompilation) { + return true; + } // const enums and modules that contain only const enums are not considered values from the emit perespective return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e5697f9f37..9482339d09 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1587,6 +1587,7 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; /* @internal */ stripInternal?: boolean; /* @internal */ preserveNewLines?: boolean; /* @internal */ cacheDownlevelForOfLength?: boolean; diff --git a/src/services/services.ts b/src/services/services.ts index 41ffc04e5a..5f8ab267e7 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1635,6 +1635,86 @@ module ts { sourceFile.scriptSnapshot = scriptSnapshot; } + export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, syntaxErrors?: Diagnostic[]): string { + let options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); + + // Single file transformation is only guranteed to be correct if inside an external module. + // External modules have thier own scope and can not contribute to internal modules outside their + // scope. + if (options.target !== ScriptTarget.ES6 && (!options.module || options.module === ModuleKind.None)) { + // add errors + } + + // In sigle file transformation the compiler does not have access to declaration sites. + // Const enum property access will not be detected if they are not in the same file as the enum. + // thus they are goign to be emitted as normal propety access. To ensure correct behaviour at runtime, + // we need to generare the actual enum object so that the proprty accesses do not fail. + options.preserveConstEnums = true; + + // No reason to get declarations, we are only returning javascript + options.declaration = false; + + // Filename can be non-ts file. We are not locating any modules as well, so allow + // non-ts extensions + options.allowNonTsExtensions = true; + + // enable relaxed emit rules + options.separateCompilation = true; + + // We are not resolving references or modules, or even including the library. Disabling + // emit on error will block generating the output and has no meaningful use here. + options.noEmitOnError = false; + + // No resolution requests will be honered anyways. So do not do it + options.noResolve = true; + + // TODO (vladima): add inlineSourceMap once it is checked in + //if (options.sourceMap) { + // // We need to return a single string, so inline the sourceMap in the output + // options.inlineSourceMap = true;; + //} + + // Parse + var inputFileName = fileName || "module.ts"; + var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + + // Store syntactic diagnostics + if (syntaxErrors && sourceFile.parseDiagnostics) { + syntaxErrors.push(...sourceFile.parseDiagnostics); + } + + // Output + let outputText: string; + + // Create a compilerHost object to allow the compiler to read and write files + var compilerHost: CompilerHost = { + getSourceFile: (fileName, target) => fileName === inputFileName ? sourceFile : undefined, + writeFile: (name, text, writeByteOrderMark) => { + if (ts.fileExtensionIs(name, ".js")) { + Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; + } + }, + getDefaultLibFileName: () => "lib.d.ts", + useCaseSensitiveFileNames: () => false, + getCanonicalFileName: fileName => fileName, + getCurrentDirectory: () => "", + getNewLine: () => "\r\n" + }; + + // Note: The emitter needs a the checker to walk the file, so we will create a program for this + // though single file transformation does not really need this. First we need to drop the emitter + // dependcy on the checker and then implement a new resolver that does not do the full check. + var program = ts.createProgram([inputFileName], options, compilerHost); + + // Emit + program.emit(); + + Debug.assert(outputText !== undefined, "Output generation failed"); + + return outputText; + } + export function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile { let sourceFile = createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); From 8f616ce65c5daa72565bdb60044671f1314f6606 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 12:43:10 -0700 Subject: [PATCH 10/42] fix typos in comments --- src/services/services.ts | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 5f8ab267e7..2d5ce2d5f2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1638,41 +1638,37 @@ module ts { export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, syntaxErrors?: Diagnostic[]): string { let options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); - // Single file transformation is only guranteed to be correct if inside an external module. - // External modules have thier own scope and can not contribute to internal modules outside their + // Single file transformation is only guaranteed to be correct inside an external module. + // External modules have their own scope and cannot contribute to internal modules outside their // scope. if (options.target !== ScriptTarget.ES6 && (!options.module || options.module === ModuleKind.None)) { - // add errors + // TODO: add errors } - // In sigle file transformation the compiler does not have access to declaration sites. - // Const enum property access will not be detected if they are not in the same file as the enum. - // thus they are goign to be emitted as normal propety access. To ensure correct behaviour at runtime, - // we need to generare the actual enum object so that the proprty accesses do not fail. + // In single file transformation the compiler does not have access to declaration sites. + // Const enum property accesses will not be detected if they are not in the same file as the enum. + // thus they are going to be emitted as normal propety access. To ensure correct behaviour at runtime, + // we need to generate the actual enum object so that the property accesses do not fail. options.preserveConstEnums = true; // No reason to get declarations, we are only returning javascript options.declaration = false; - // Filename can be non-ts file. We are not locating any modules as well, so allow - // non-ts extensions + // Filename can be non-ts file. options.allowNonTsExtensions = true; // enable relaxed emit rules options.separateCompilation = true; - // We are not resolving references or modules, or even including the library. Disabling + // We are not resolving references or modules, or even including the default library. Disabling // emit on error will block generating the output and has no meaningful use here. options.noEmitOnError = false; - // No resolution requests will be honered anyways. So do not do it + // No resolution requests will be honored anyways. So do not do it options.noResolve = true; - // TODO (vladima): add inlineSourceMap once it is checked in - //if (options.sourceMap) { - // // We need to return a single string, so inline the sourceMap in the output - // options.inlineSourceMap = true;; - //} + // TODO (vladima): this should be enabled after adding support to inlinable source maps + options.sourceMap = false; // Parse var inputFileName = fileName || "module.ts"; @@ -1690,10 +1686,8 @@ module ts { var compilerHost: CompilerHost = { getSourceFile: (fileName, target) => fileName === inputFileName ? sourceFile : undefined, writeFile: (name, text, writeByteOrderMark) => { - if (ts.fileExtensionIs(name, ".js")) { - Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); - outputText = text; - } + Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + outputText = text; }, getDefaultLibFileName: () => "lib.d.ts", useCaseSensitiveFileNames: () => false, @@ -1702,9 +1696,6 @@ module ts { getNewLine: () => "\r\n" }; - // Note: The emitter needs a the checker to walk the file, so we will create a program for this - // though single file transformation does not really need this. First we need to drop the emitter - // dependcy on the checker and then implement a new resolver that does not do the full check. var program = ts.createProgram([inputFileName], options, compilerHost); // Emit From 1f055b95aa704e3881d9ed8a2e8dd4f915877f71 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 30 Mar 2015 13:25:46 -0700 Subject: [PATCH 11/42] Emit ommittedExpression in binding pattern --- src/compiler/declarationEmitter.ts | 73 +++++++++++-------- .../declarationEmitDestructuring5.js | 37 ++++++++++ .../declarationEmitDestructuring5.types | 22 ++++++ .../compiler/declarationEmitDestructuring5.ts | 6 ++ 4 files changed, 109 insertions(+), 29 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitDestructuring5.js create mode 100644 tests/baselines/reference/declarationEmitDestructuring5.types create mode 100644 tests/cases/compiler/declarationEmitDestructuring5.ts diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 8431756c91..ee8b7f2ac3 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1387,7 +1387,11 @@ module ts { } else if (bindingPattern.kind === SyntaxKind.ArrayBindingPattern) { write("["); - emitCommaList(bindingPattern.elements, emitBindingElement); + let elements = bindingPattern.elements; + emitCommaList(elements, emitBindingElement); + if (elements && elements.hasTrailingComma) { + write(", "); + } write("]"); } } @@ -1402,40 +1406,51 @@ module ts { } : undefined; } - if (bindingElement.propertyName) { - // bindingElement has propertyName property in the following case: - // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" - // We have to explicitly emit the propertyName before descending into its binding elements. + if (bindingElement.kind === SyntaxKind.OmittedExpression) { + // If bindingElement is an omittedExpression (i.e. containing elision), + // we will emit blank space (although this may differ from users' original code, + // it allows emitSeparatedList to write separator appropriately) // Example: - // original: function foo({y: [a,b,c]}) {} - // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; - writeTextOfNode(currentSourceFile, bindingElement.propertyName); - write(": "); - - // If bindingElement has propertyName property, then its name must be another bindingPattern of SyntaxKind.ObjectBindingPattern - emitBindingPattern(bindingElement.name); + // original: function foo([, x, ,]) {} + // emit : function foo([ , x, , ]) {} + write(" "); } - else if (bindingElement.name) { - if (isBindingPattern(bindingElement.name)) { - // If it is a nested binding pattern, we will recursively descend into each element and emit each one separately. - // In the case of rest element, we will omit rest element. + else if (bindingElement.kind === SyntaxKind.BindingElement) { + if (bindingElement.propertyName) { + // bindingElement has propertyName property in the following case: + // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" + // We have to explicitly emit the propertyName before descending into its binding elements. // Example: - // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} - // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; - // original with rest: function foo([a, ...c]) {} - // emit : declare function foo([a, ...c]): void; + // original: function foo({y: [a,b,c]}) {} + // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; + writeTextOfNode(currentSourceFile, bindingElement.propertyName); + write(": "); + + // If bindingElement has propertyName property, then its name must be another bindingPattern of SyntaxKind.ObjectBindingPattern emitBindingPattern(bindingElement.name); } - else { - Debug.assert(bindingElement.name.kind === SyntaxKind.Identifier); - // If the node is just an identifier, we will simply emit the text associated with the node's name - // Example: - // original: function foo({y = 10, x}) {} - // emit : declare function foo({y, x}: {number, any}): void; - if (bindingElement.dotDotDotToken) { - write("..."); + else if (bindingElement.name) { + if (isBindingPattern(bindingElement.name)) { + // If it is a nested binding pattern, we will recursively descend into each element and emit each one separately. + // In the case of rest element, we will omit rest element. + // Example: + // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} + // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; + // original with rest: function foo([a, ...c]) {} + // emit : declare function foo([a, ...c]): void; + emitBindingPattern(bindingElement.name); + } + else { + Debug.assert(bindingElement.name.kind === SyntaxKind.Identifier); + // If the node is just an identifier, we will simply emit the text associated with the node's name + // Example: + // original: function foo({y = 10, x}) {} + // emit : declare function foo({y, x}: {number, any}): void; + if (bindingElement.dotDotDotToken) { + write("..."); + } + writeTextOfNode(currentSourceFile, bindingElement.name); } - writeTextOfNode(currentSourceFile, bindingElement.name); } } } diff --git a/tests/baselines/reference/declarationEmitDestructuring5.js b/tests/baselines/reference/declarationEmitDestructuring5.js new file mode 100644 index 0000000000..f0602206a1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.js @@ -0,0 +1,37 @@ +//// [declarationEmitDestructuring5.ts] +function baz([, z, , ]) { } +function foo([, b, ]: [any, any]): void { } +function bar([z, , , ]) { } +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +function bar2([,,z, , , ]) { } + +//// [declarationEmitDestructuring5.js] +function baz(_a) { + var z = _a[1]; +} +function foo(_a) { + var b = _a[1]; +} +function bar(_a) { + var z = _a[0]; +} +function bar1(_a) { + var _b = _a === void 0 ? [ + 1, + 3, + 4, + 6, + 7 + ] : _a, z = _b[0]; +} +function bar2(_a) { + var z = _a[2]; +} + + +//// [declarationEmitDestructuring5.d.ts] +declare function baz([ , z, , ]: [any, any, any]): void; +declare function foo([ , b, ]: [any, any]): void; +declare function bar([z, , , ]: [any, any, any]): void; +declare function bar1([z, , , ]?: [number, number, number, number, number]): void; +declare function bar2([ , , z, , , ]: [any, any, any, any, any]): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types new file mode 100644 index 0000000000..375440bea0 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declarationEmitDestructuring5.ts === +function baz([, z, , ]) { } +>baz : ([, z, , ]: [any, any, any]) => void +>z : any + +function foo([, b, ]: [any, any]): void { } +>foo : ([, b, ]: [any, any]) => void +>b : any + +function bar([z, , , ]) { } +>bar : ([z, , , ]: [any, any, any]) => void +>z : any + +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +>bar1 : ([z, , , ]?: [number, number, number, number, number]) => void +>z : number +>[1, 3, 4, 6, 7] : [number, number, number, number, number] + +function bar2([,,z, , , ]) { } +>bar2 : ([,,z, , , ]: [any, any, any, any, any]) => void +>z : any + diff --git a/tests/cases/compiler/declarationEmitDestructuring5.ts b/tests/cases/compiler/declarationEmitDestructuring5.ts new file mode 100644 index 0000000000..a02a21b5a5 --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuring5.ts @@ -0,0 +1,6 @@ +// @declaration: true +function baz([, z, , ]) { } +function foo([, b, ]: [any, any]): void { } +function bar([z, , , ]) { } +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +function bar2([,,z, , , ]) { } \ No newline at end of file From 8320bca4d002e9081282fb689676470c3b34be82 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 30 Mar 2015 14:41:07 -0700 Subject: [PATCH 12/42] Fix emit trailing comma for array binding pattern for varaible declaration --- src/compiler/declarationEmitter.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index ee8b7f2ac3..3ba1cb0a1a 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -993,7 +993,18 @@ module ts { } function emitBindingPattern(bindingPattern: BindingPattern) { - emitCommaList(bindingPattern.elements, emitBindingElement); + // Only select non-omitted expression from the bindingPattern's elements. + // We have to do this to avoid emitting trailing commas. + // For example: + // original: var [, c,,] = [ 2,3,4] + // emitted: declare var c: number; // instead of declare var c:number, ; + let elements: Node[] = []; + for (let element of bindingPattern.elements) { + if (element.kind !== SyntaxKind.OmittedExpression){ + elements.push(element); + } + } + emitCommaList(elements, emitBindingElement); } function emitBindingElement(bindingElement: BindingElement) { From 129b8ad8b041f34e5e06c09f0b94793d987133a0 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 30 Mar 2015 16:28:10 -0700 Subject: [PATCH 13/42] Update baselines from merging with master --- .../declarationEmitDestructuring2.js | 28 ++----------------- .../declarationEmitDestructuring3.js | 6 +--- .../declarationEmitDestructuring4.js | 18 ++---------- .../declarationEmitDestructuring5.js | 8 +----- 4 files changed, 8 insertions(+), 52 deletions(-) diff --git a/tests/baselines/reference/declarationEmitDestructuring2.js b/tests/baselines/reference/declarationEmitDestructuring2.js index f6d3d17abe..eeabbf1ff3 100644 --- a/tests/baselines/reference/declarationEmitDestructuring2.js +++ b/tests/baselines/reference/declarationEmitDestructuring2.js @@ -6,38 +6,16 @@ function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } //// [declarationEmitDestructuring2.js] function f(_a) { - var _b = _a === void 0 ? { - x: 10, - y: [ - 2, - 4, - 6, - 8 - ] - } : _a, _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, _e = _d === void 0 ? [ - 1, - 2, - 3, - 4 - ] : _d, a = _e[0], b = _e[1], c = _e[2], d = _e[3]; + var _b = _a === void 0 ? { x: 10, y: [2, 4, 6, 8] } : _a, _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, _e = _d === void 0 ? [1, 2, 3, 4] : _d, a = _e[0], b = _e[1], c = _e[2], d = _e[3]; } function g(_a) { - var _b = _a === void 0 ? [ - 1, - 2, - 3, - 4 - ] : _a, a = _b[0], b = _b[1], c = _b[2], d = _b[3]; + var _b = _a === void 0 ? [1, 2, 3, 4] : _a, a = _b[0], b = _b[1], c = _b[2], d = _b[3]; } function h(_a) { var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, a = _d[0], b = _d[1], c = _d[2], _e = _b.z, a1 = _e.a1, b1 = _e.b1; } function h1(_a) { - var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, y = _d === void 0 ? [ - 1, - 2, - 3 - ] : _d, _e = _b.z, a1 = _e.a1, b1 = _e.b1; + var a = _a[0], b = _a[1][0], c = _a[2][0][0], _b = _a[3], _c = _b.x, x = _c === void 0 ? 10 : _c, _d = _b.y, y = _d === void 0 ? [1, 2, 3] : _d, _e = _b.z, a1 = _e.a1, b1 = _e.b1; } diff --git a/tests/baselines/reference/declarationEmitDestructuring3.js b/tests/baselines/reference/declarationEmitDestructuring3.js index 66f6b071a8..b21c63203c 100644 --- a/tests/baselines/reference/declarationEmitDestructuring3.js +++ b/tests/baselines/reference/declarationEmitDestructuring3.js @@ -9,11 +9,7 @@ function bar(_a) { var x = _a[0], z = _a[1], w = _a.slice(2); } function foo(_a) { - var _b = _a === void 0 ? [ - 1, - "string", - true - ] : _a, x = _b[0], y = _b.slice(1); + var _b = _a === void 0 ? [1, "string", true] : _a, x = _b[0], y = _b.slice(1); } diff --git a/tests/baselines/reference/declarationEmitDestructuring4.js b/tests/baselines/reference/declarationEmitDestructuring4.js index 81d1707b8e..f5d9df0917 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.js +++ b/tests/baselines/reference/declarationEmitDestructuring4.js @@ -19,28 +19,16 @@ function baz(_a) { var ; } function baz1(_a) { - var _b = _a === void 0 ? [ - 1, - 2, - 3 - ] : _a; + var _b = _a === void 0 ? [1, 2, 3] : _a; } function baz2(_a) { - var _b = (_a === void 0 ? [ - [ - 1, - 2, - 3 - ] - ] : _a)[0]; + var _b = (_a === void 0 ? [[1, 2, 3]] : _a)[0]; } function baz3(_a) { var ; } function baz4(_a) { - var _b = _a === void 0 ? { - x: 10 - } : _a; + var _b = _a === void 0 ? { x: 10 } : _a; } diff --git a/tests/baselines/reference/declarationEmitDestructuring5.js b/tests/baselines/reference/declarationEmitDestructuring5.js index f0602206a1..32c9b5667d 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.js +++ b/tests/baselines/reference/declarationEmitDestructuring5.js @@ -16,13 +16,7 @@ function bar(_a) { var z = _a[0]; } function bar1(_a) { - var _b = _a === void 0 ? [ - 1, - 3, - 4, - 6, - 7 - ] : _a, z = _b[0]; + var _b = _a === void 0 ? [1, 3, 4, 6, 7] : _a, z = _b[0]; } function bar2(_a) { var z = _a[2]; From c1d9cfe6408fb5954133ac38bcb867298f2a74bb Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 30 Mar 2015 16:45:20 -0700 Subject: [PATCH 14/42] Add test for emit destructuring invariable declaration with omitted expression --- .../declarationEmitDestructuringArrayPattern5.js | 15 +++++++++++++++ ...eclarationEmitDestructuringArrayPattern5.types | 14 ++++++++++++++ .../declarationEmitDestructuringArrayPattern5.ts | 4 ++++ 3 files changed, 33 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js create mode 100644 tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types create mode 100644 tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js new file mode 100644 index 0000000000..820864cc25 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.js @@ -0,0 +1,15 @@ +//// [declarationEmitDestructuringArrayPattern5.ts] +var [, , z] = [1, 2, 4]; +var [, a, , ] = [3, 4, 5]; +var [, , [, b, ]] = [3,5,[0, 1]]; + +//// [declarationEmitDestructuringArrayPattern5.js] +var _a = [1, 2, 4], z = _a[2]; +var _b = [3, 4, 5], a = _b[1]; +var _c = [3, 5, [0, 1]], _d = _c[2], b = _d[1]; + + +//// [declarationEmitDestructuringArrayPattern5.d.ts] +declare var z: number; +declare var a: number; +declare var b: number; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types new file mode 100644 index 0000000000..6352917682 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +var [, , z] = [1, 2, 4]; +>z : number +>[1, 2, 4] : [number, number, number] + +var [, a, , ] = [3, 4, 5]; +>a : number +>[3, 4, 5] : [number, number, number] + +var [, , [, b, ]] = [3,5,[0, 1]]; +>b : number +>[3,5,[0, 1]] : [number, number, [number, number]] +>[0, 1] : [number, number] + diff --git a/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts b/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts new file mode 100644 index 0000000000..eeb5dd4bdc --- /dev/null +++ b/tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts @@ -0,0 +1,4 @@ +// @declaration: true +var [, , z] = [1, 2, 4]; +var [, a, , ] = [3, 4, 5]; +var [, , [, b, ]] = [3,5,[0, 1]]; \ No newline at end of file From 4d0aa589f2819649043ec737989cf64b271aa949 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Tue, 31 Mar 2015 04:34:55 +0300 Subject: [PATCH 15/42] Allows extending ActiveXObject with with specialized overloads returning string types, per https://github.com/Microsoft/TypeScript/issues/2541. --- src/lib/scriptHost.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index 2639739e5d..bfa562a930 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -4,7 +4,11 @@ /// Windows Script Host APIS ///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; interface ITextWriter { Write(s: string): void; From 4b7e6cfc2e981fbd005812d0ce5a3c0167f689e4 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 19:33:15 -0700 Subject: [PATCH 16/42] addressed CR feedback, accepted baselines --- src/compiler/checker.ts | 6 +-- src/compiler/commandLineParser.ts | 4 ++ .../diagnosticInformationMap.generated.ts | 6 +++ src/compiler/diagnosticMessages.json | 25 +++++++++- src/compiler/emitter.ts | 9 +++- src/compiler/program.ts | 39 +++++++++++++--- src/compiler/utilities.ts | 7 +++ src/services/services.ts | 46 ++++++------------- .../baselines/reference/APISample_compile.js | 2 + .../reference/APISample_compile.types | 12 +++++ tests/baselines/reference/APISample_linter.js | 2 + .../reference/APISample_linter.types | 12 +++++ .../reference/APISample_transform.js | 2 + .../reference/APISample_transform.types | 12 +++++ .../baselines/reference/APISample_watcher.js | 2 + .../reference/APISample_watcher.types | 12 +++++ 16 files changed, 155 insertions(+), 43 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 58383e2b6f..a5c83f8d3f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -716,7 +716,7 @@ module ts { if (target) { let markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || - (target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target)); + (target !== unknownSymbol && (target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target)); if (markAlias) { markAliasSymbolAsReferenced(symbol); @@ -10231,7 +10231,7 @@ module ts { if (symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length > 1 && !isInAmbientContext(node) - && isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { let classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(classOrFunc)) { @@ -11285,7 +11285,7 @@ module ts { return true; } // const enums and modules that contain only const enums are not considered values from the emit perespective - return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); + return target !== unknownSymbol && target && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s: Symbol): boolean { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4ba2da757e..c91fef4032 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -117,6 +117,10 @@ module ts { type: "boolean", description: Diagnostics.Do_not_emit_comments_to_output, }, + { + name: "separateCompilation", + type: "boolean", + }, { name: "sourceMap", type: "boolean", diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 967afd171b..a7bbe3a3ba 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -165,6 +165,7 @@ module ts { Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." }, 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." }, 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." }, @@ -434,6 +435,11 @@ module ts { Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, + Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." }, + Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." }, + Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, + Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, + Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6e24afad80..d3643e6536 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -651,7 +651,10 @@ "category": "Error", "code": 1207 }, - + "Cannot compile non-external modules when the '--separateCompilation' flag is provided.": { + "category": "Error", + "code": 1208 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 @@ -1729,6 +1732,26 @@ "category": "Error", "code": 5042 }, + "Option 'sourceMap' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5043 + }, + "Option 'declaration' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5044 + }, + "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5045 + }, + "Option 'out' cannot be specified with option 'separateCompilation'.": { + "category": "Error", + "code": 5046 + }, + "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": { + "category": "Error", + "code": 5047 + }, "Concatenate and emit output to single file.": { "category": "Message", "code": 6001 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 366bb1856e..bf58167bd8 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1641,6 +1641,11 @@ module ts { } function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean { + if (compilerOptions.separateCompilation) { + // do not inline enum values in separate compilation mode + return false; + } + let constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); @@ -3874,7 +3879,7 @@ module ts { function shouldEmitEnumDeclaration(node: EnumDeclaration) { let isConstEnum = isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums; + return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node: EnumDeclaration) { @@ -3966,7 +3971,7 @@ module ts { } function shouldEmitModuleDeclaration(node: ModuleDeclaration) { - return isInstantiatedModule(node, compilerOptions.preserveConstEnums); + return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } function emitModuleDeclaration(node: ModuleDeclaration) { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index cb12e6da4d..1deb413231 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -454,6 +454,24 @@ module ts { } function verifyCompilerOptions() { + if (options.separateCompilation) { + if (options.sourceMap) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.declaration) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.noEmitOnError) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation)); + } + + if (options.out) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); + } + } + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { @@ -468,12 +486,21 @@ module ts { let languageVersion = options.target || ScriptTarget.ES3; let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined); - if (firstExternalModuleSourceFile && !options.module) { + if (options.separateCompilation) { if (!options.module && languageVersion < ScriptTarget.ES6) { - // We cannot use createDiagnosticFromNode because nodes do not have parents yet - let span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); } + + let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) ? f : undefined); + if (firstNonExternalModuleSourceFile) { + let span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); + diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + } + } + else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && !options.module) { + // We cannot use createDiagnosticFromNode because nodes do not have parents yet + let span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); + diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } // Cannot specify module gen target when in es6 or above @@ -481,11 +508,11 @@ module ts { diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); } - // there has to be common source directory if user specified --outdir || --sourcRoot + // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted if (options.outDir || // there is --outDir specified options.sourceRoot || // there is --sourceRoot specified - (options.mapRoot && // there is --mapRoot Specified and there would be multiple js files generated + (options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated (!options.out || firstExternalModuleSourceFile !== undefined))) { let commonPathComponents: string[]; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9fa0674c25..936d40e18d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -274,6 +274,13 @@ module ts { export function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan { let errorNode = node; switch (node.kind) { + case SyntaxKind.SourceFile: + let pos = skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); + if (pos === sourceFile.text.length) { + // file is empty - return span for the beginning of the file + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos); // This list is a work in progress. Add missing node kinds to improve their error // spans. case SyntaxKind.VariableDeclaration: diff --git a/src/services/services.ts b/src/services/services.ts index 2d5ce2d5f2..05e173e70b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1635,48 +1635,28 @@ module ts { sourceFile.scriptSnapshot = scriptSnapshot; } - export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, syntaxErrors?: Diagnostic[]): string { + /* + * This function will compile source text from 'input' argument using specified compiler options. + * If not options are provided - it will use a set of default compiler options. + * Extra compiler options that will unconditionally be used bu this function are: + * - separateCompilation = true + * - allowNonTsExtensions = true + */ + export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string { let options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); - // Single file transformation is only guaranteed to be correct inside an external module. - // External modules have their own scope and cannot contribute to internal modules outside their - // scope. - if (options.target !== ScriptTarget.ES6 && (!options.module || options.module === ModuleKind.None)) { - // TODO: add errors - } - - // In single file transformation the compiler does not have access to declaration sites. - // Const enum property accesses will not be detected if they are not in the same file as the enum. - // thus they are going to be emitted as normal propety access. To ensure correct behaviour at runtime, - // we need to generate the actual enum object so that the property accesses do not fail. - options.preserveConstEnums = true; - - // No reason to get declarations, we are only returning javascript - options.declaration = false; + options.separateCompilation = true; // Filename can be non-ts file. options.allowNonTsExtensions = true; - // enable relaxed emit rules - options.separateCompilation = true; - - // We are not resolving references or modules, or even including the default library. Disabling - // emit on error will block generating the output and has no meaningful use here. - options.noEmitOnError = false; - - // No resolution requests will be honored anyways. So do not do it - options.noResolve = true; - - // TODO (vladima): this should be enabled after adding support to inlinable source maps - options.sourceMap = false; - // Parse var inputFileName = fileName || "module.ts"; var sourceFile = ts.createSourceFile(inputFileName, input, options.target); // Store syntactic diagnostics - if (syntaxErrors && sourceFile.parseDiagnostics) { - syntaxErrors.push(...sourceFile.parseDiagnostics); + if (diagnostics && sourceFile.parseDiagnostics) { + diagnostics.push(...sourceFile.parseDiagnostics); } // Output @@ -1698,6 +1678,10 @@ module ts { var program = ts.createProgram([inputFileName], options, compilerHost); + if (diagnostics) { + diagnostics.push(...program.getGlobalDiagnostics()); + } + // Emit program.emit(); diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 3f0ba5f18c..70e9f76115 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1243,6 +1243,7 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1984,6 +1985,7 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index eff47a4cb7..f06e49fcba 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -3984,6 +3984,9 @@ declare module "typescript" { watch?: boolean; >watch : boolean + separateCompilation?: boolean; +>separateCompilation : boolean + [option: string]: string | number | boolean; >option : string } @@ -6160,6 +6163,15 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index ab48f78aff..9387b52f4b 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1274,6 +1274,7 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -2015,6 +2016,7 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 600bf5c6ad..c92c66afd2 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -4130,6 +4130,9 @@ declare module "typescript" { watch?: boolean; >watch : boolean + separateCompilation?: boolean; +>separateCompilation : boolean + [option: string]: string | number | boolean; >option : string } @@ -6306,6 +6309,15 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index d40c078a15..fba3642d36 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1275,6 +1275,7 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -2016,6 +2017,7 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4ea9c49d75..a7a898e01b 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -4080,6 +4080,9 @@ declare module "typescript" { watch?: boolean; >watch : boolean + separateCompilation?: boolean; +>separateCompilation : boolean + [option: string]: string | number | boolean; >option : string } @@ -6256,6 +6259,15 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index c53034c11d..1a203faea4 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1312,6 +1312,7 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; + separateCompilation?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -2053,6 +2054,7 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3903e169b4..acbbfdb2ea 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -4253,6 +4253,9 @@ declare module "typescript" { watch?: boolean; >watch : boolean + separateCompilation?: boolean; +>separateCompilation : boolean + [option: string]: string | number | boolean; >option : string } @@ -6429,6 +6432,15 @@ declare module "typescript" { 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 From a6c88e290efb1f8f659f6bfe66833fda4345afc6 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 21:35:27 -0700 Subject: [PATCH 17/42] addressed CR feedback --- src/services/services.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 05e173e70b..296ff033ef 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1643,7 +1643,7 @@ module ts { * - allowNonTsExtensions = true */ export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string { - let options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); + let options = compilerOptions ? clone(compilerOptions) : getDefaultCompilerOptions(); options.separateCompilation = true; @@ -1676,7 +1676,7 @@ module ts { getNewLine: () => "\r\n" }; - var program = ts.createProgram([inputFileName], options, compilerHost); + var program = createProgram([inputFileName], options, compilerHost); if (diagnostics) { diagnostics.push(...program.getGlobalDiagnostics()); From 955b4c05890bf2e10611ea954672415a55d343b7 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 21:36:06 -0700 Subject: [PATCH 18/42] addressed CR feedback --- 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 296ff033ef..e481479150 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1652,7 +1652,7 @@ module ts { // Parse var inputFileName = fileName || "module.ts"; - var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + var sourceFile = createSourceFile(inputFileName, input, options.target); // Store syntactic diagnostics if (diagnostics && sourceFile.parseDiagnostics) { From 757257b9a12442d3e90b7b75a47f786080a3e218 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 30 Mar 2015 22:18:13 -0700 Subject: [PATCH 19/42] Ensure export= is emitted correctelly in declaration files --- src/compiler/checker.ts | 6 ++- ...FileImportModuleWithExportAssignment.types | 14 +++---- ...ernalModuleWithExportAssignedFundule.types | 2 +- .../declareFileExportAssignment.types | 14 +++---- ...signmentWithVarFromVariableStatement.types | 14 +++---- .../baselines/reference/es5ExportEqualsDts.js | 37 +++++++++++++++++++ .../reference/es5ExportEqualsDts.types | 28 ++++++++++++++ .../exportAssignClassAndModule.types | 4 +- .../reference/exportEqualNamespaces.types | 2 +- ...ssignmentOnExportedGenericInterface1.types | 4 +- tests/cases/compiler/es5ExportEqualsDts.ts | 16 ++++++++ 11 files changed, 113 insertions(+), 28 deletions(-) create mode 100644 tests/baselines/reference/es5ExportEqualsDts.js create mode 100644 tests/baselines/reference/es5ExportEqualsDts.types create mode 100644 tests/cases/compiler/es5ExportEqualsDts.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 699d2f74a6..20c4f3bb1a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1091,7 +1091,7 @@ module ts { // Check if symbol is any of the alias return forEachValue(symbols, symbolFromSymbolTable => { - if (symbolFromSymbolTable.flags & SymbolFlags.Alias) { + if (symbolFromSymbolTable.flags & SymbolFlags.Alias && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || // We can use any type of alias to get the name // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) { @@ -1932,6 +1932,10 @@ module ts { case SyntaxKind.SourceFile: return true; + // Export assignements do not create name bindings outside the module + case SyntaxKind.ExportAssignment: + return false; + default: Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types index a2ae5c0768..15201baa48 100644 --- a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types @@ -42,23 +42,23 @@ module m2 { } var m2: { ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types index e861059af7..70718471d5 100644 --- a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types @@ -7,7 +7,7 @@ declare module "express" { function express(): express.ExpressServer; >express : typeof express >express : unknown ->ExpressServer : export=.ExpressServer +>ExpressServer : express.ExpressServer module express { >express : typeof express diff --git a/tests/baselines/reference/declareFileExportAssignment.types b/tests/baselines/reference/declareFileExportAssignment.types index 80cfbf8238..f30586b07e 100644 --- a/tests/baselines/reference/declareFileExportAssignment.types +++ b/tests/baselines/reference/declareFileExportAssignment.types @@ -27,24 +27,24 @@ module m2 { } var m2: { ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index 376a9d7ba6..675dc38c86 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,24 +28,24 @@ module m2 { var x = 10, m2: { >x : number ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; >m2 : unknown ->connectExport : export=.connectExport +>connectExport : m2.connectExport test1: m2.connectModule; ->test1 : export=.connectModule +>test1 : m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule test2(): m2.connectModule; ->test2 : () => export=.connectModule +>test2 : () => m2.connectModule >m2 : unknown ->connectModule : export=.connectModule +>connectModule : m2.connectModule }; export = m2; ->m2 : { (): export=.connectExport; test1: export=.connectModule; test2(): export=.connectModule; } +>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } diff --git a/tests/baselines/reference/es5ExportEqualsDts.js b/tests/baselines/reference/es5ExportEqualsDts.js new file mode 100644 index 0000000000..922d012be0 --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.js @@ -0,0 +1,37 @@ +//// [es5ExportEqualsDts.ts] + +class A { + foo() { + var aVal: A.B; + return aVal; + } +} + +module A { + export interface B { } +} + +export = A + +//// [es5ExportEqualsDts.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + var aVal; + return aVal; + }; + return A; +})(); +module.exports = A; + + +//// [es5ExportEqualsDts.d.ts] +declare class A { + foo(): A.B; +} +declare module A { + interface B { + } +} +export = A; diff --git a/tests/baselines/reference/es5ExportEqualsDts.types b/tests/baselines/reference/es5ExportEqualsDts.types new file mode 100644 index 0000000000..58b35a0d7c --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/es5ExportEqualsDts.ts === + +class A { +>A : A + + foo() { +>foo : () => A.B + + var aVal: A.B; +>aVal : A.B +>A : unknown +>B : A.B + + return aVal; +>aVal : A.B + } +} + +module A { +>A : typeof A + + export interface B { } +>B : B +} + +export = A +>A : A + diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index 05a5cbf07a..dc4a19f345 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -22,9 +22,9 @@ class Foo { >Foo : Foo x: Foo.Bar; ->x : export=.Bar +>x : Foo.Bar >Foo : unknown ->Bar : export=.Bar +>Bar : Foo.Bar } module Foo { >Foo : typeof Foo diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index b94770837a..0f3091c1b8 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -12,7 +12,7 @@ interface server { (): server.Server; >server : unknown ->Server : export=.Server +>Server : server.Server startTime: Date; >startTime : Date diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types index f0c8c25be2..936f04731f 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types @@ -12,9 +12,9 @@ interface Foo { >T : T } var Foo: new () => Foo.A>; ->Foo : new () => export=.A> +>Foo : new () => Foo.A> >Foo : unknown ->A : export=.A +>A : Foo.A >Foo : Foo export = Foo; diff --git a/tests/cases/compiler/es5ExportEqualsDts.ts b/tests/cases/compiler/es5ExportEqualsDts.ts new file mode 100644 index 0000000000..1253c9ac22 --- /dev/null +++ b/tests/cases/compiler/es5ExportEqualsDts.ts @@ -0,0 +1,16 @@ +// @target: es5 +// @module: commonjs +// @declaration: true + +class A { + foo() { + var aVal: A.B; + return aVal; + } +} + +module A { + export interface B { } +} + +export = A \ No newline at end of file From c885f59d1b4f176afb872c852649b585fed05900 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 22:41:49 -0700 Subject: [PATCH 20/42] do not include declaration files in 'is external module' check --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 1deb413231..6a211d6213 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -491,7 +491,7 @@ module ts { diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); } - let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) ? f : undefined); + let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined); if (firstNonExternalModuleSourceFile) { let span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); From 49b3f85a179db0b020312214f681f670ccf7c0a4 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 22:42:54 -0700 Subject: [PATCH 21/42] disallow ambient const enums in 'separate compilation' mode --- src/compiler/checker.ts | 6 +++++- src/compiler/diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a5c83f8d3f..d303be36f7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10159,6 +10159,11 @@ module ts { computeEnumMemberValues(node); + let enumIsConst = isConst(node); + if (compilerOptions.separateCompilation && enumIsConst && isInAmbientContext(node)) { + error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided); + } + // Spec 2014 - Section 9.3: // It isn't possible for one enum declaration to continue the automatic numbering sequence of another, // and when an enum type has multiple declarations, only one declaration is permitted to omit a value @@ -10169,7 +10174,6 @@ module ts { let firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - let enumIsConst = isConst(node); // check that const is placed\omitted on all enum declarations forEach(enumSymbol.declarations, decl => { if (isConstEnumDeclaration(decl) !== enumIsConst) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index a7bbe3a3ba..32d36020d3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -166,6 +166,7 @@ module ts { Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." }, 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." }, 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." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d3643e6536..f593ac2ff7 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -655,6 +655,10 @@ "category": "Error", "code": 1208 }, + "Ambient const enums are not allowed when the '--separateCompilation' flag is provided.": { + "category": "Error", + "code": 1209 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 From 1803d730c2f737dda8ec765744745f8ffb4acf27 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 30 Mar 2015 23:17:45 -0700 Subject: [PATCH 22/42] added initial set of unit tests for separate compilation mode --- src/harness/harness.ts | 11 +++++++- ...rateCompilationAmbientConstEnum.errors.txt | 10 +++++++ .../separateCompilationAmbientConstEnum.js | 8 ++++++ .../separateCompilationDeclaration.errors.txt | 7 +++++ .../separateCompilationDeclaration.js | 10 +++++++ .../reference/separateCompilationES6.js | 5 ++++ .../reference/separateCompilationES6.types | 4 +++ ...eparateCompilationNoEmitOnError.errors.txt | 7 +++++ ...rateCompilationNoExternalModule.errors.txt | 8 ++++++ .../separateCompilationNoExternalModule.js | 6 +++++ .../separateCompilationNonAmbientConstEnum.js | 14 ++++++++++ ...parateCompilationNonAmbientConstEnum.types | 15 +++++++++++ .../separateCompilationOut.errors.txt | 12 +++++++++ .../reference/separateCompilationOut.js | 12 +++++++++ .../separateCompilationSourceMap.errors.txt | 7 +++++ .../reference/separateCompilationSourceMap.js | 7 +++++ .../separateCompilationSourceMap.js.map | 2 ++ ...separateCompilationSourceMap.sourcemap.txt | 27 +++++++++++++++++++ .../separateCompilationSpecifiedModule.js | 5 ++++ .../separateCompilationSpecifiedModule.types | 4 +++ ...ateCompilationUnspecifiedModule.errors.txt | 6 +++++ .../separateCompilationUnspecifiedModule.js | 5 ++++ .../separateCompilationWithDeclarationFile.js | 11 ++++++++ ...parateCompilationWithDeclarationFile.types | 9 +++++++ .../separateCompilationAmbientConstEnum.ts | 7 +++++ .../separateCompilationDeclaration.ts | 6 +++++ .../cases/compiler/separateCompilationES6.ts | 4 +++ .../separateCompilationNoEmitOnError.ts | 6 +++++ .../separateCompilationNoExternalModule.ts | 5 ++++ .../separateCompilationNonAmbientConstEnum.ts | 7 +++++ .../cases/compiler/separateCompilationOut.ts | 8 ++++++ .../compiler/separateCompilationSourceMap.ts | 6 +++++ .../separateCompilationSpecifiedModule.ts | 4 +++ .../separateCompilationUnspecifiedModule.ts | 3 +++ .../separateCompilationWithDeclarationFile.ts | 8 ++++++ 35 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt create mode 100644 tests/baselines/reference/separateCompilationAmbientConstEnum.js create mode 100644 tests/baselines/reference/separateCompilationDeclaration.errors.txt create mode 100644 tests/baselines/reference/separateCompilationDeclaration.js create mode 100644 tests/baselines/reference/separateCompilationES6.js create mode 100644 tests/baselines/reference/separateCompilationES6.types create mode 100644 tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt create mode 100644 tests/baselines/reference/separateCompilationNoExternalModule.errors.txt create mode 100644 tests/baselines/reference/separateCompilationNoExternalModule.js create mode 100644 tests/baselines/reference/separateCompilationNonAmbientConstEnum.js create mode 100644 tests/baselines/reference/separateCompilationNonAmbientConstEnum.types create mode 100644 tests/baselines/reference/separateCompilationOut.errors.txt create mode 100644 tests/baselines/reference/separateCompilationOut.js create mode 100644 tests/baselines/reference/separateCompilationSourceMap.errors.txt create mode 100644 tests/baselines/reference/separateCompilationSourceMap.js create mode 100644 tests/baselines/reference/separateCompilationSourceMap.js.map create mode 100644 tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt create mode 100644 tests/baselines/reference/separateCompilationSpecifiedModule.js create mode 100644 tests/baselines/reference/separateCompilationSpecifiedModule.types create mode 100644 tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt create mode 100644 tests/baselines/reference/separateCompilationUnspecifiedModule.js create mode 100644 tests/baselines/reference/separateCompilationWithDeclarationFile.js create mode 100644 tests/baselines/reference/separateCompilationWithDeclarationFile.types create mode 100644 tests/cases/compiler/separateCompilationAmbientConstEnum.ts create mode 100644 tests/cases/compiler/separateCompilationDeclaration.ts create mode 100644 tests/cases/compiler/separateCompilationES6.ts create mode 100644 tests/cases/compiler/separateCompilationNoEmitOnError.ts create mode 100644 tests/cases/compiler/separateCompilationNoExternalModule.ts create mode 100644 tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts create mode 100644 tests/cases/compiler/separateCompilationOut.ts create mode 100644 tests/cases/compiler/separateCompilationSourceMap.ts create mode 100644 tests/cases/compiler/separateCompilationSpecifiedModule.ts create mode 100644 tests/cases/compiler/separateCompilationUnspecifiedModule.ts create mode 100644 tests/cases/compiler/separateCompilationWithDeclarationFile.ts diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f401f19da2..55f0910524 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1062,6 +1062,10 @@ module Harness { options.preserveConstEnums = setting.value === 'true'; break; + case 'separatecompilation': + options.separateCompilation = setting.value === 'true'; + break; + case 'suppressimplicitanyindexerrors': options.suppressImplicitAnyIndexErrors = setting.value === 'true'; break; @@ -1461,7 +1465,12 @@ module Harness { var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums", "includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal"]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", + "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", + "noimplicitany", "noresolve", "newline", "newlines", "emitbom", + "errortruncation", "usecasesensitivefilenames", "preserveconstenums", + "includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal", + "separatecompilation"]; function extractCompilerSettings(content: string): CompilerSetting[] { diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt b/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt new file mode 100644 index 0000000000..6ea2e445e2 --- /dev/null +++ b/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationAmbientConstEnum.ts (1 errors) ==== + + + declare const enum E { X = 1} + ~ +!!! error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided. + export var y; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.js b/tests/baselines/reference/separateCompilationAmbientConstEnum.js new file mode 100644 index 0000000000..5b3af0957e --- /dev/null +++ b/tests/baselines/reference/separateCompilationAmbientConstEnum.js @@ -0,0 +1,8 @@ +//// [separateCompilationAmbientConstEnum.ts] + + +declare const enum E { X = 1} +export var y; + +//// [separateCompilationAmbientConstEnum.js] +export var y; diff --git a/tests/baselines/reference/separateCompilationDeclaration.errors.txt b/tests/baselines/reference/separateCompilationDeclaration.errors.txt new file mode 100644 index 0000000000..8951184584 --- /dev/null +++ b/tests/baselines/reference/separateCompilationDeclaration.errors.txt @@ -0,0 +1,7 @@ +error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'. + + +!!! error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationDeclaration.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationDeclaration.js b/tests/baselines/reference/separateCompilationDeclaration.js new file mode 100644 index 0000000000..33d64b088d --- /dev/null +++ b/tests/baselines/reference/separateCompilationDeclaration.js @@ -0,0 +1,10 @@ +//// [separateCompilationDeclaration.ts] + +export var x; + +//// [separateCompilationDeclaration.js] +export var x; + + +//// [separateCompilationDeclaration.d.ts] +export declare var x: any; diff --git a/tests/baselines/reference/separateCompilationES6.js b/tests/baselines/reference/separateCompilationES6.js new file mode 100644 index 0000000000..cf05e5590a --- /dev/null +++ b/tests/baselines/reference/separateCompilationES6.js @@ -0,0 +1,5 @@ +//// [separateCompilationES6.ts] +export var x; + +//// [separateCompilationES6.js] +export var x; diff --git a/tests/baselines/reference/separateCompilationES6.types b/tests/baselines/reference/separateCompilationES6.types new file mode 100644 index 0000000000..7038190680 --- /dev/null +++ b/tests/baselines/reference/separateCompilationES6.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/separateCompilationES6.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt b/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt new file mode 100644 index 0000000000..61d4f2d6d9 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt @@ -0,0 +1,7 @@ +error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. + + +!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationNoEmitOnError.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt new file mode 100644 index 0000000000..269727584d --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/separateCompilationNoExternalModule.ts(2,1): error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationNoExternalModule.ts (1 errors) ==== + + var x; + ~~~ +!!! error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.js b/tests/baselines/reference/separateCompilationNoExternalModule.js new file mode 100644 index 0000000000..9ddc8bdef2 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNoExternalModule.js @@ -0,0 +1,6 @@ +//// [separateCompilationNoExternalModule.ts] + +var x; + +//// [separateCompilationNoExternalModule.js] +var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js new file mode 100644 index 0000000000..74096adca1 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js @@ -0,0 +1,14 @@ +//// [separateCompilationNonAmbientConstEnum.ts] + +const enum E { X = 100 }; +var e = E.X; +export var x; + +//// [separateCompilationNonAmbientConstEnum.js] +var E; +(function (E) { + E[E["X"] = 100] = "X"; +})(E || (E = {})); +; +var e = E.X; +export var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types new file mode 100644 index 0000000000..d444cbd149 --- /dev/null +++ b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts === + +const enum E { X = 100 }; +>E : E +>X : E + +var e = E.X; +>e : E +>E.X : E +>E : typeof E +>X : E + +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationOut.errors.txt b/tests/baselines/reference/separateCompilationOut.errors.txt new file mode 100644 index 0000000000..7c2631a718 --- /dev/null +++ b/tests/baselines/reference/separateCompilationOut.errors.txt @@ -0,0 +1,12 @@ +error TS5046: Option 'out' cannot be specified with option 'separateCompilation'. +tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. + + +!!! error TS5046: Option 'out' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + + export var x; +==== tests/cases/compiler/file2.ts (1 errors) ==== + var y; + ~~~ +!!! error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationOut.js b/tests/baselines/reference/separateCompilationOut.js new file mode 100644 index 0000000000..67dd2dcfbf --- /dev/null +++ b/tests/baselines/reference/separateCompilationOut.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/separateCompilationOut.ts] //// + +//// [file1.ts] + +export var x; +//// [file2.ts] +var y; + +//// [file1.js] +export var x; +//// [all.js] +var y; diff --git a/tests/baselines/reference/separateCompilationSourceMap.errors.txt b/tests/baselines/reference/separateCompilationSourceMap.errors.txt new file mode 100644 index 0000000000..5274ef3921 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.errors.txt @@ -0,0 +1,7 @@ +error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. + + +!!! error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. +==== tests/cases/compiler/separateCompilationSourceMap.ts (0 errors) ==== + + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js b/tests/baselines/reference/separateCompilationSourceMap.js new file mode 100644 index 0000000000..1e8f141eb4 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.js @@ -0,0 +1,7 @@ +//// [separateCompilationSourceMap.ts] + +export var x; + +//// [separateCompilationSourceMap.js] +export var x; +//# sourceMappingURL=separateCompilationSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js.map b/tests/baselines/reference/separateCompilationSourceMap.js.map new file mode 100644 index 0000000000..68c4e2c78d --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.js.map @@ -0,0 +1,2 @@ +//// [separateCompilationSourceMap.js.map] +{"version":3,"file":"separateCompilationSourceMap.js","sourceRoot":"","sources":["separateCompilationSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt b/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt new file mode 100644 index 0000000000..74e0d73d7e --- /dev/null +++ b/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt @@ -0,0 +1,27 @@ +=================================================================== +JsFile: separateCompilationSourceMap.js +mapUrl: separateCompilationSourceMap.js.map +sourceRoot: +sources: separateCompilationSourceMap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/separateCompilationSourceMap.js +sourceFile:separateCompilationSourceMap.ts +------------------------------------------------------------------- +>>>export var x; +1 > +2 >^^^^^^^^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export var +3 > x +4 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0) +--- +>>>//# sourceMappingURL=separateCompilationSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.js b/tests/baselines/reference/separateCompilationSpecifiedModule.js new file mode 100644 index 0000000000..5f3c7ceb39 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSpecifiedModule.js @@ -0,0 +1,5 @@ +//// [separateCompilationSpecifiedModule.ts] +export var x; + +//// [separateCompilationSpecifiedModule.js] +exports.x; diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.types b/tests/baselines/reference/separateCompilationSpecifiedModule.types new file mode 100644 index 0000000000..497f63faf6 --- /dev/null +++ b/tests/baselines/reference/separateCompilationSpecifiedModule.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/separateCompilationSpecifiedModule.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt b/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt new file mode 100644 index 0000000000..ab0fd7ffe9 --- /dev/null +++ b/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt @@ -0,0 +1,6 @@ +error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. + + +!!! error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. +==== tests/cases/compiler/separateCompilationUnspecifiedModule.ts (0 errors) ==== + export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.js b/tests/baselines/reference/separateCompilationUnspecifiedModule.js new file mode 100644 index 0000000000..0f2e5c71a8 --- /dev/null +++ b/tests/baselines/reference/separateCompilationUnspecifiedModule.js @@ -0,0 +1,5 @@ +//// [separateCompilationUnspecifiedModule.ts] +export var x; + +//// [separateCompilationUnspecifiedModule.js] +exports.x; diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.js b/tests/baselines/reference/separateCompilationWithDeclarationFile.js new file mode 100644 index 0000000000..71d7ef4192 --- /dev/null +++ b/tests/baselines/reference/separateCompilationWithDeclarationFile.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/separateCompilationWithDeclarationFile.ts] //// + +//// [file1.d.ts] + +declare function foo(): void; + +//// [file1.ts] +export var x; + +//// [file1.js] +export var x; diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.types b/tests/baselines/reference/separateCompilationWithDeclarationFile.types new file mode 100644 index 0000000000..94adc5fa27 --- /dev/null +++ b/tests/baselines/reference/separateCompilationWithDeclarationFile.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/file1.d.ts === + +declare function foo(): void; +>foo : () => void + +=== tests/cases/compiler/file1.ts === +export var x; +>x : any + diff --git a/tests/cases/compiler/separateCompilationAmbientConstEnum.ts b/tests/cases/compiler/separateCompilationAmbientConstEnum.ts new file mode 100644 index 0000000000..aaccfaaf02 --- /dev/null +++ b/tests/cases/compiler/separateCompilationAmbientConstEnum.ts @@ -0,0 +1,7 @@ +// @separateCompilation: true +// @target: es6 + +// @filename: file1.ts + +declare const enum E { X = 1} +export var y; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationDeclaration.ts b/tests/cases/compiler/separateCompilationDeclaration.ts new file mode 100644 index 0000000000..11003a1919 --- /dev/null +++ b/tests/cases/compiler/separateCompilationDeclaration.ts @@ -0,0 +1,6 @@ +// @separateCompilation: true +// @declaration: true +// @target: es6 + +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationES6.ts b/tests/cases/compiler/separateCompilationES6.ts new file mode 100644 index 0000000000..a2ac8c8d94 --- /dev/null +++ b/tests/cases/compiler/separateCompilationES6.ts @@ -0,0 +1,4 @@ +// @separateCompilation: true +// @target: es6 +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationNoEmitOnError.ts b/tests/cases/compiler/separateCompilationNoEmitOnError.ts new file mode 100644 index 0000000000..fe0f59199f --- /dev/null +++ b/tests/cases/compiler/separateCompilationNoEmitOnError.ts @@ -0,0 +1,6 @@ +// @separateCompilation: true +// @noEmitOnError:true +// @target: es6 + +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationNoExternalModule.ts b/tests/cases/compiler/separateCompilationNoExternalModule.ts new file mode 100644 index 0000000000..e66ef27c00 --- /dev/null +++ b/tests/cases/compiler/separateCompilationNoExternalModule.ts @@ -0,0 +1,5 @@ +// @separateCompilation: true +// @target: es6 + +// @filename: file1.ts +var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts b/tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts new file mode 100644 index 0000000000..5f3054238d --- /dev/null +++ b/tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts @@ -0,0 +1,7 @@ +// @separateCompilation: true +// @target: es6 + +// @filename: file1.ts +const enum E { X = 100 }; +var e = E.X; +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationOut.ts b/tests/cases/compiler/separateCompilationOut.ts new file mode 100644 index 0000000000..6c0a95f8ae --- /dev/null +++ b/tests/cases/compiler/separateCompilationOut.ts @@ -0,0 +1,8 @@ +// @separateCompilation: true +// @out:all.js +// @target: es6 + +// @filename: file1.ts +export var x; +// @filename: file2.ts +var y; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationSourceMap.ts b/tests/cases/compiler/separateCompilationSourceMap.ts new file mode 100644 index 0000000000..7becf7cbda --- /dev/null +++ b/tests/cases/compiler/separateCompilationSourceMap.ts @@ -0,0 +1,6 @@ +// @separateCompilation: true +// @sourceMap:sourcemap.map +// @target: es6 + +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationSpecifiedModule.ts b/tests/cases/compiler/separateCompilationSpecifiedModule.ts new file mode 100644 index 0000000000..6ba3a0d3bf --- /dev/null +++ b/tests/cases/compiler/separateCompilationSpecifiedModule.ts @@ -0,0 +1,4 @@ +// @separateCompilation: true +// @module: commonjs +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationUnspecifiedModule.ts b/tests/cases/compiler/separateCompilationUnspecifiedModule.ts new file mode 100644 index 0000000000..38a3fd8286 --- /dev/null +++ b/tests/cases/compiler/separateCompilationUnspecifiedModule.ts @@ -0,0 +1,3 @@ +// @separateCompilation: true +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationWithDeclarationFile.ts b/tests/cases/compiler/separateCompilationWithDeclarationFile.ts new file mode 100644 index 0000000000..121db1702a --- /dev/null +++ b/tests/cases/compiler/separateCompilationWithDeclarationFile.ts @@ -0,0 +1,8 @@ +// @separateCompilation: true +// @target: es6 + +// @filename: file1.d.ts +declare function foo(): void; + +// @filename: file1.ts +export var x; \ No newline at end of file From cebe42b81fbeeaf68c8e228dda5e602ab94e151b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 30 Mar 2015 23:32:11 -0700 Subject: [PATCH 23/42] Remove unsed options --- src/compiler/commandLineParser.ts | 8 -------- src/compiler/types.ts | 2 -- src/harness/harness.ts | 10 ---------- tests/baselines/reference/APISample_compile.js | 2 -- tests/baselines/reference/APISample_compile.types | 6 ------ tests/baselines/reference/APISample_linter.js | 2 -- tests/baselines/reference/APISample_linter.types | 6 ------ tests/baselines/reference/APISample_transform.js | 2 -- tests/baselines/reference/APISample_transform.types | 6 ------ tests/baselines/reference/APISample_watcher.js | 2 -- tests/baselines/reference/APISample_watcher.types | 6 ------ 11 files changed, 52 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4ba2da757e..96c1bc9e29 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -9,10 +9,6 @@ module ts { name: "charset", type: "string", }, - { - name: "codepage", - type: "number", - }, { name: "declaration", shortName: "d", @@ -78,10 +74,6 @@ module ts { name: "noLib", type: "boolean", }, - { - name: "noLibCheck", - type: "boolean", - }, { name: "noResolve", type: "boolean", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d24ee45e21..56d5b0a7e1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1560,7 +1560,6 @@ module ts { export interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1574,7 +1573,6 @@ module ts { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f401f19da2..40bf68f0a3 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1036,17 +1036,7 @@ module Harness { useCaseSensitiveFileNames = setting.value === 'true'; break; - case 'mapsourcefiles': - case 'maproot': - case 'generatedeclarationfiles': - case 'gatherDiagnostics': - case 'codepage': - case 'createFileLog': case 'filename': - case 'removecomments': - case 'watch': - case 'allowautomaticsemicoloninsertion': - case 'locale': // Not supported yet break; diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 3f0ba5f18c..397404ee98 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1216,7 +1216,6 @@ declare module "typescript" { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1230,7 +1229,6 @@ declare module "typescript" { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index eff47a4cb7..b23ab38e0c 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -3901,9 +3901,6 @@ declare module "typescript" { charset?: string; >charset : string - codepage?: number; ->codepage : number - declaration?: boolean; >declaration : boolean @@ -3944,9 +3941,6 @@ declare module "typescript" { noLib?: boolean; >noLib : boolean - noLibCheck?: boolean; ->noLibCheck : boolean - noResolve?: boolean; >noResolve : boolean diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index ab48f78aff..fc8f844ac0 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1247,7 +1247,6 @@ declare module "typescript" { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1261,7 +1260,6 @@ declare module "typescript" { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 600bf5c6ad..64e4910853 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -4047,9 +4047,6 @@ declare module "typescript" { charset?: string; >charset : string - codepage?: number; ->codepage : number - declaration?: boolean; >declaration : boolean @@ -4090,9 +4087,6 @@ declare module "typescript" { noLib?: boolean; >noLib : boolean - noLibCheck?: boolean; ->noLibCheck : boolean - noResolve?: boolean; >noResolve : boolean diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index d40c078a15..77c7727811 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1248,7 +1248,6 @@ declare module "typescript" { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1262,7 +1261,6 @@ declare module "typescript" { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4ea9c49d75..7a284e2026 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -3997,9 +3997,6 @@ declare module "typescript" { charset?: string; >charset : string - codepage?: number; ->codepage : number - declaration?: boolean; >declaration : boolean @@ -4040,9 +4037,6 @@ declare module "typescript" { noLib?: boolean; >noLib : boolean - noLibCheck?: boolean; ->noLibCheck : boolean - noResolve?: boolean; >noResolve : boolean diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index c53034c11d..8340a5150c 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1285,7 +1285,6 @@ declare module "typescript" { interface CompilerOptions { allowNonTsExtensions?: boolean; charset?: string; - codepage?: number; declaration?: boolean; diagnostics?: boolean; emitBOM?: boolean; @@ -1299,7 +1298,6 @@ declare module "typescript" { noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; - noLibCheck?: boolean; noResolve?: boolean; out?: string; outDir?: string; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3903e169b4..d151e8f046 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -4170,9 +4170,6 @@ declare module "typescript" { charset?: string; >charset : string - codepage?: number; ->codepage : number - declaration?: boolean; >declaration : boolean @@ -4213,9 +4210,6 @@ declare module "typescript" { noLib?: boolean; >noLib : boolean - noLibCheck?: boolean; ->noLibCheck : boolean - noResolve?: boolean; >noResolve : boolean From d53e0c2ac2c0655cb656b02c774684bd52c5072b Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Tue, 31 Mar 2015 12:59:50 +0300 Subject: [PATCH 24/42] Added properties/methods for WScript - https://msdn.microsoft.com/en-us/library/2795740w(v=vs.84).aspx per #2540 --- src/lib/scriptHost.d.ts | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index bfa562a930..ec5d5cca57 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -10,12 +10,28 @@ interface ActiveXObject { } declare var ActiveXObject: ActiveXObject; -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; +interface ITextStreamBase { + Column: number; + Line: number; Close(): void; } +interface ITextWriter extends ITextStreamBase { + Write(s: string): void; + WriteBlankLines(intLines: number): void; + WriteLine(s: string): void; +} + +interface ITextReader extends ITextStreamBase { + Read(characters: number): string; + ReadAll(): string; + ReadLine(): string; + Skip(characters: number): void; + SkipLine(): void; + AtEndOfLine: boolean; + AtEndOfStream: boolean; +} + declare var WScript: { Echo(s: any): void; StdErr: ITextWriter; @@ -23,4 +39,17 @@ declare var WScript: { Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; + BuildVersion: number; + FullName: string; + Interactive: boolean; + Name: string; + Path: string; + ScriptName: string; + StdIn: ITextReader; + Version: string; + ConnectObject(objEventSource: any, strPrefix: string): void; + CreateObject(strProgID: string, strPrefix?: string): any; + DisconnectObject(obj: any): void; + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + Sleep(intTime: number): void; } From 41547dc2f26d5fc6583ff8c9a53cd0541b56338e Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Tue, 31 Mar 2015 14:09:43 +0300 Subject: [PATCH 25/42] JSDoc for WScript members --- src/lib/scriptHost.d.ts | 111 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index ec5d5cca57..9f7b773b31 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -11,45 +11,156 @@ interface ActiveXObject { declare var ActiveXObject: ActiveXObject; interface ITextStreamBase { + /** + * The column number of the current character position in an input stream. + */ Column: number; + /** + * The current line number in an input stream. + */ Line: number; + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ Close(): void; } interface ITextWriter extends ITextStreamBase { + /** + * Sends a string to an output stream. + */ Write(s: string): void; + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ WriteBlankLines(intLines: number): void; + /** + * Sends a string followed by a newline character to an output stream. + */ WriteLine(s: string): void; } interface ITextReader extends ITextStreamBase { + /** + * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ Read(characters: number): string; + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ ReadAll(): string; + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ ReadLine(): string; + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ Skip(characters: number): void; + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ SkipLine(): void; + /** + * Indicates whether the stream pointer position is at the end of a line. + */ AtEndOfLine: boolean; + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ AtEndOfStream: boolean; } declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ Echo(s: any): void; + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ StdErr: ITextWriter; + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ StdOut: ITextWriter; Arguments: { length: number; Item(n: number): string; }; + /** + * The full path of the currently running script. + */ ScriptFullName: string; + /** + * Forces the script to stop immediately, with an optional exit code. + */ Quit(exitCode?: number): number; + /** + * The Windows Script Host build version number. + */ BuildVersion: number; + /** + * Fully qualified path of the host executable. + */ FullName: string; + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ Interactive: boolean; + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ Name: string; + /** + * Path of the directory containing the host executable. + */ Path: string; + /** + * The filename of the currently running script. + */ ScriptName: string; + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ StdIn: ITextReader; + /** + * Windows Script Host version + */ Version: string; + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ ConnectObject(objEventSource: any, strPrefix: string): void; + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ CreateObject(strProgID: string, strPrefix?: string): any; + /** + * Disconnects a COM object from its event sources. + */ DisconnectObject(obj: any): void; + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ Sleep(intTime: number): void; } From b06e19bee86bd1049c92ed1bf8cae30e14c24766 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Tue, 31 Mar 2015 14:43:10 +0300 Subject: [PATCH 26/42] Missing ; --- src/lib/scriptHost.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index 9f7b773b31..eaf3cfc2d9 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -82,8 +82,8 @@ interface ITextReader extends ITextStreamBase { declare var WScript: { /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). - */ + * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext). + */ Echo(s: any): void; /** * Exposes the write-only error output stream for the current script. @@ -163,4 +163,4 @@ declare var WScript: { * @param intTime Interval (in milliseconds) to suspend script execution. */ Sleep(intTime: number): void; -} +}; From 7890a6894c5ada8ac3582538748d4f53c7804d2b Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Tue, 31 Mar 2015 16:56:30 +0300 Subject: [PATCH 27/42] Nre TextStreamWriter interface with JSDoc and additional members (ITextWriter is being used by the compiler and cannot be safely modified).. --- src/lib/scriptHost.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index eaf3cfc2d9..decf813bc2 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -10,7 +10,13 @@ interface ActiveXObject { } declare var ActiveXObject: ActiveXObject; -interface ITextStreamBase { +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { /** * The column number of the current character position in an input stream. */ @@ -26,7 +32,7 @@ interface ITextStreamBase { Close(): void; } -interface ITextWriter extends ITextStreamBase { +interface TextStreamWriter extends TextStreamBase { /** * Sends a string to an output stream. */ @@ -41,7 +47,7 @@ interface ITextWriter extends ITextStreamBase { WriteLine(s: string): void; } -interface ITextReader extends ITextStreamBase { +interface TextStreamReader extends TextStreamBase { /** * Returns a specified number of characters from an input stream, beginning at the current pointer position. * Does not return until the ENTER key is pressed. @@ -89,12 +95,12 @@ declare var WScript: { * Exposes the write-only error output stream for the current script. * Can be accessed only while using CScript.exe. */ - StdErr: ITextWriter; + StdErr: TextStreamWriter; /** * Exposes the write-only output stream for the current script. * Can be accessed only while using CScript.exe. */ - StdOut: ITextWriter; + StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; /** * The full path of the currently running script. @@ -132,7 +138,7 @@ declare var WScript: { * Exposes the read-only input stream for the current script. * Can be accessed only while using CScript.exe. */ - StdIn: ITextReader; + StdIn: TextStreamReader; /** * Windows Script Host version */ From 18d8fedbf52a02af0700f653f499a2e79fb479d3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 31 Mar 2015 10:52:21 -0700 Subject: [PATCH 28/42] Expose readConfigFile and parseConfigFile --- Jakefile | 1 + src/compiler/commandLineParser.ts | 14 ++++++++++++- .../baselines/reference/APISample_compile.js | 14 +++++++++++++ .../reference/APISample_compile.types | 21 +++++++++++++++++++ tests/baselines/reference/APISample_linter.js | 14 +++++++++++++ .../reference/APISample_linter.types | 21 +++++++++++++++++++ .../reference/APISample_transform.js | 14 +++++++++++++ .../reference/APISample_transform.types | 21 +++++++++++++++++++ .../baselines/reference/APISample_watcher.js | 14 +++++++++++++ .../reference/APISample_watcher.types | 21 +++++++++++++++++++ 10 files changed, 154 insertions(+), 1 deletion(-) diff --git a/Jakefile b/Jakefile index 665bb807b4..e5d1cb856f 100644 --- a/Jakefile +++ b/Jakefile @@ -111,6 +111,7 @@ var definitionsRoots = [ "compiler/parser.d.ts", "compiler/checker.d.ts", "compiler/program.d.ts", + "compiler/commandLineParser.d.ts", "services/services.d.ts", ]; diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 96c1bc9e29..1bab9e4e2d 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -4,6 +4,7 @@ /// module ts { + /* @internal */ export var optionDeclarations: CommandLineOption[] = [ { name: "charset", @@ -153,7 +154,8 @@ module ts { description: Diagnostics.Watch_input_files, } ]; - + + /* @internal */ export function parseCommandLine(commandLine: string[]): ParsedCommandLine { var options: CompilerOptions = {}; var fileNames: string[] = []; @@ -263,6 +265,10 @@ module ts { } } + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ export function readConfigFile(fileName: string): any { try { var text = sys.readFile(fileName); @@ -272,6 +278,12 @@ module ts { } } + /** + * 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 + */ export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine { var errors: Diagnostic[] = []; diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 397404ee98..acbd769585 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -1489,6 +1489,20 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index b23ab38e0c..eede842b51 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -4796,6 +4796,27 @@ declare module "typescript" { >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; diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index fc8f844ac0..fadad208c3 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -1520,6 +1520,20 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 64e4910853..ea0e2a5c99 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -4942,6 +4942,27 @@ declare module "typescript" { >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; diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index 77c7727811..4b03ade403 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -1521,6 +1521,20 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 7a284e2026..abf2377057 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -4892,6 +4892,27 @@ declare module "typescript" { >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; diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 8340a5150c..d33b2f0750 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -1558,6 +1558,20 @@ declare module "typescript" { 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; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index d151e8f046..74aa5db61f 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -5065,6 +5065,27 @@ declare module "typescript" { >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; From a1e18fc22b650f07088fec86efbc6a0f0685bb83 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 12:29:02 -0700 Subject: [PATCH 29/42] Introduce a new HeritageClauseElment type. This type represents the expression+type arguments you can get in a class or interface heritage clause section. For class-implements clauses, or interface-extends clauses, these expressions can only be identifiers or dotted names. For class extends clauses, these could be any expressions in the future. However, for now, we only support identifiers and dotted names. --- src/compiler/checker.ts | 228 +- src/compiler/declarationEmitter.ts | 39 +- .../diagnosticInformationMap.generated.ts | 3 + src/compiler/diagnosticMessages.json | 12 + src/compiler/emitter.ts | 16 +- src/compiler/parser.ts | 104 +- src/compiler/types.ts | 10 +- src/compiler/utilities.ts | 22 + src/harness/typeWriter.ts | 9 +- src/services/services.ts | 35 +- .../baselines/reference/APISample_compile.js | 111 +- .../reference/APISample_compile.types | 131 +- tests/baselines/reference/APISample_linter.js | 127 +- .../reference/APISample_linter.types | 131 +- .../reference/APISample_linter.types.pull | 6384 +++++++++++++++++ .../reference/APISample_transform.js | 111 +- .../reference/APISample_transform.types | 131 +- .../baselines/reference/APISample_watcher.js | 111 +- .../reference/APISample_watcher.types | 131 +- .../aliasUsageInAccessorsOfClass.types | 2 +- .../reference/aliasUsageInArray.types | 2 +- .../aliasUsageInFunctionExpression.types | 2 +- .../aliasUsageInGenericFunction.types | 2 +- .../aliasUsageInIndexerOfClass.types | 2 +- .../reference/aliasUsageInObjectLiteral.types | 2 +- .../reference/aliasUsageInOrExpression.types | 2 +- .../aliasUsageInOrExpression.types.pull | 2 +- ...asUsageInTypeArgumentOfExtendsClause.types | 2 +- .../reference/aliasUsageInVarAssignment.types | 2 +- .../reference/circularImportAlias.types | 2 +- ...rationMergedInModuleWithContinuation.types | 2 +- .../classExtendingPrimitive.errors.txt | 13 +- .../reference/classExtendingPrimitive.js | 8 +- .../classExtendingPrimitive2.errors.txt | 13 +- .../reference/classExtendingPrimitive2.js | 14 +- .../classExtendingQualifiedName2.types | 2 +- .../classExtendsEveryObjectType.errors.txt | 17 +- .../reference/classExtendsEveryObjectType.js | 15 +- .../classExtendsEveryObjectType2.errors.txt | 17 +- .../reference/classExtendsEveryObjectType2.js | 21 +- .../reference/commentOnAmbientModule.types | 2 +- .../reference/declFileGenericType.types | 4 +- .../reference/declFileGenericType2.types | 18 +- .../declFileModuleContinuation.types | 2 +- ...tingWithClassReferredByExtendsClause.types | 12 +- ...lModuleNameConflictsInExtendsClause1.types | 4 +- ...lModuleNameConflictsInExtendsClause2.types | 2 +- ...lModuleNameConflictsInExtendsClause3.types | 4 +- .../declarationEmit_nameConflicts.types | 10 +- .../reference/declareDottedExtend.types | 6 +- tests/baselines/reference/es6ClassTest7.types | 2 +- tests/baselines/reference/extBaseClass1.types | 2 +- ...ndingClassFromAliasAndUsageInIndexer.types | 4 +- ...assPropertyInheritanceSpecialization.types | 6 +- ...ericConstraintOnExtendedBuiltinTypes.types | 2 +- ...ricConstraintOnExtendedBuiltinTypes2.types | 2 +- .../reference/importUsedInExtendsList1.types | 2 +- ...heritanceOfGenericConstructorMethod2.types | 4 +- ...terfaceMayNotBeExtendedWitACall.errors.txt | 11 +- .../interfaceMayNotBeExtendedWitACall.js | 2 - ...sDeclarationWhenInBaseTypeResolution.types | 94 +- .../thisInInvalidContexts.errors.txt | 9 +- .../reference/thisInInvalidContexts.js | 9 +- ...InInvalidContextsExternalModule.errors.txt | 9 +- .../thisInInvalidContextsExternalModule.js | 9 +- .../completionListInExtendsClause.ts | 6 +- ...etOccurrencesPropertyInAliasedInterface.ts | 2 +- .../fourslash/semanticClassification1.ts | 1 + 68 files changed, 7460 insertions(+), 770 deletions(-) create mode 100644 tests/baselines/reference/APISample_linter.types.pull diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3c0bf39f1f..e6594ee271 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -582,7 +582,7 @@ module ts { if (moduleSymbol.flags & SymbolFlags.Variable) { let typeAnnotation = (moduleSymbol.valueDeclaration).type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name); } } } @@ -631,7 +631,7 @@ module ts { if (symbol.flags & SymbolFlags.Variable) { var typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name)); } } } @@ -773,7 +773,7 @@ module ts { } // Resolves a qualified name and any involved aliases - function resolveEntityName(name: EntityName, meaning: SymbolFlags): Symbol { + function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags): Symbol { if (getFullWidth(name) === 0) { return undefined; } @@ -785,18 +785,23 @@ module ts { return undefined; } } - else if (name.kind === SyntaxKind.QualifiedName) { - let namespace = resolveEntityName((name).left, SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || getFullWidth((name).right) === 0) { + else if (name.kind === SyntaxKind.QualifiedName || name.kind === SyntaxKind.PropertyAccessExpression) { + let left = name.kind === SyntaxKind.QualifiedName ? (name).left : (name).expression; + let right = name.kind === SyntaxKind.QualifiedName ? (name).right : (name).name; + + let namespace = resolveEntityName(left, SymbolFlags.Namespace); + if (!namespace || namespace === unknownSymbol || getFullWidth(right) === 0) { return undefined; } - let right = (name).right; symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right)); return undefined; } } + else { + Debug.fail("Unknown entity name kind."); + } Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } @@ -1255,14 +1260,15 @@ module ts { } } - function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult { + function isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult { + // get symbol of the first identifier of the entityName let meaning: SymbolFlags; if (entityName.parent.kind === SyntaxKind.TypeQuery) { // Typeof value meaning = SymbolFlags.Value | SymbolFlags.ExportValue; } - else if (entityName.kind === SyntaxKind.QualifiedName || + else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccessExpression || entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration @@ -2088,7 +2094,7 @@ module ts { } // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let func = declaration.parent; @@ -2225,7 +2231,7 @@ module ts { return links.type = checkExpression(exportAssignment.expression); } else if (exportAssignment.type) { - return links.type = getTypeFromTypeNode(exportAssignment.type); + return links.type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(exportAssignment.type); } else { return links.type = anyType; @@ -2257,11 +2263,11 @@ module ts { function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { - return accessor.type && getTypeFromTypeNode(accessor.type); + return accessor.type && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(accessor.type); } else { let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -2429,7 +2435,7 @@ module ts { let declaration = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); let baseTypeNode = getClassBaseTypeNode(declaration); if (baseTypeNode) { - let baseType = getTypeFromTypeReferenceNode(baseTypeNode); + let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & TypeFlags.Class) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2470,7 +2476,8 @@ module ts { forEach(symbol.declarations, declaration => { if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { forEach(getInterfaceBaseTypeNodes(declaration), node => { - let baseType = getTypeFromTypeReferenceNode(node); + let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(node); + if (baseType !== unknownType) { if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2501,7 +2508,7 @@ module ts { if (!links.declaredType) { links.declaredType = resolvingType; let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - let type = getTypeFromTypeNode(declaration.type); + let type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -3043,7 +3050,7 @@ module ts { returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); + returnType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); } else { // TypeScript 1.0 spec (April 2014): @@ -3201,7 +3208,7 @@ module ts { function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { let declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type) : anyType : undefined; } @@ -3212,7 +3219,7 @@ module ts { type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + type.constraint = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -3260,7 +3267,7 @@ module ts { return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode, typeParameterSymbol: Symbol): boolean { + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | HeritageClauseElement, typeParameterSymbol: Symbol): boolean { let links = getNodeLinks(typeReferenceNode); if (links.isIllegalTypeReferenceInConstraint !== undefined) { return links.isIllegalTypeReferenceInConstraint; @@ -3309,39 +3316,47 @@ module ts { } } - function getTypeFromTypeReferenceNode(node: TypeReferenceNode): Type { + function getTypeFromTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - let symbol = resolveEntityName(node.typeName, SymbolFlags.Type); let type: Type; - if (symbol) { - if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { - let typeParameters = (type).typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); - type = undefined; - } + + if (node.kind !== SyntaxKind.HeritageClauseElement || isSupportedHeritageClauseElement(node)) { + let typeNameOrExpression = node.kind === SyntaxKind.TypeReference + ? (node).typeName + : (node).expression; + + let symbol = resolveEntityName(typeNameOrExpression, SymbolFlags.Type); + if (symbol) { + if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // Type parameters declared in a particular type parameter list + // may not be referenced in constraints in that type parameter list + // Implementation: such type references are resolved to 'unknown' type that usually denotes error + type = unknownType; } else { - if (node.typeArguments) { - error(node, Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { + let typeParameters = (type).typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement)); + } + else { + error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, Diagnostics.Type_0_is_not_generic, typeToString(type)); + type = undefined; + } } } } } + links.resolvedType = type || unknownType; } return links.resolvedType; @@ -3419,7 +3434,7 @@ module ts { function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -3437,7 +3452,7 @@ module ts { function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNode)); + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement)); } return links.resolvedType; } @@ -3533,7 +3548,7 @@ module ts { function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), /*noSubtypeReduction*/ true); + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement), /*noSubtypeReduction*/ true); } return links.resolvedType; } @@ -3565,7 +3580,7 @@ module ts { return links.resolvedType; } - function getTypeFromTypeNode(node: TypeNode | LiteralExpression): Type { + function getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: return anyType; @@ -3582,7 +3597,9 @@ module ts { case SyntaxKind.StringLiteral: return getTypeFromStringLiteral(node); case SyntaxKind.TypeReference: - return getTypeFromTypeReferenceNode(node); + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + case SyntaxKind.HeritageClauseElement: + return getTypeFromTypeReferenceOrHeritageClauseElement(node); case SyntaxKind.TypeQuery: return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: @@ -3592,7 +3609,7 @@ module ts { case SyntaxKind.UnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromTypeNode((node).type); + return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: @@ -5593,7 +5610,7 @@ module ts { let declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNode(declaration.type); + return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let type = getContextuallyTypedParameterType(declaration); @@ -5796,7 +5813,7 @@ module ts { case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: - return getTypeFromTypeNode((parent).type); + return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((parent).type); case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: @@ -6597,7 +6614,7 @@ module ts { let typeArgumentsAreAssignable = true; for (let i = 0; i < typeParameters.length; i++) { let typeArgNode = typeArguments[i]; - let typeArgument = getTypeFromTypeNode(typeArgNode); + let typeArgument = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeArgNode); // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { @@ -7079,7 +7096,7 @@ module ts { function checkTypeAssertion(node: TypeAssertion): Type { let exprType = checkExpression(node.expression); - let targetType = getTypeFromTypeNode(node.type); + let targetType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { let widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -7258,7 +7275,7 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type)); } if (node.body) { @@ -7268,7 +7285,7 @@ module ts { else { let exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -8272,11 +8289,11 @@ module ts { checkDecorators(node); } - function checkTypeReference(node: TypeReferenceNode) { + function checkTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); - let type = getTypeFromTypeReferenceNode(node); + let type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved let len = node.typeArguments.length; @@ -8767,7 +8784,7 @@ module ts { checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type)); } // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -9731,8 +9748,12 @@ module ts { let staticType = getTypeOfSymbol(symbol); let baseTypeNode = getClassBaseTypeNode(node); if (baseTypeNode) { + if (!isSupportedHeritageClauseElement(baseTypeNode)) { + error(baseTypeNode.expression, Diagnostics.Only_type_references_are_currently_supported_in_a_class_extends_clauses); + } + emitExtends = emitExtends || !isInAmbientContext(node); - checkTypeReference(baseTypeNode); + checkTypeReferenceOrHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -9741,7 +9762,8 @@ module ts { let staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, SymbolFlags.Value)) { + + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, SymbolFlags.Value)) { error(baseTypeNode, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } @@ -9749,15 +9771,19 @@ module ts { } // Check that base type can be evaluated as expression - checkExpressionOrQualifiedName(baseTypeNode.typeName); + checkExpressionOrQualifiedName(baseTypeNode.expression); } let implementedTypeNodes = getClassImplementedTypeNodes(node); if (implementedTypeNodes) { forEach(implementedTypeNodes, typeRefNode => { - checkTypeReference(typeRefNode); + if (!isSupportedHeritageClauseElement(typeRefNode)) { + error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_type_references); + } + + checkTypeReferenceOrHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - let t = getTypeFromTypeReferenceNode(typeRefNode); + let t = getTypeFromTypeReferenceOrHeritageClauseElement(typeRefNode); if (t !== unknownType) { let declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -9879,7 +9905,7 @@ module ts { if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -9950,7 +9976,13 @@ module ts { } } } - forEach(getInterfaceBaseTypeNodes(node), checkTypeReference); + forEach(getInterfaceBaseTypeNodes(node), heritageElement => { + if (!isSupportedHeritageClauseElement(heritageElement)) { + error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_a_type_reference); + } + + checkTypeReferenceOrHeritageClauseElement(heritageElement); + }); forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -10248,10 +10280,19 @@ module ts { checkSourceElement(node.body); } - function getFirstIdentifier(node: EntityName): Identifier { - while (node.kind === SyntaxKind.QualifiedName) { - node = (node).left; + function getFirstIdentifier(node: EntityName | Expression): Identifier { + while (true) { + if (node.kind === SyntaxKind.QualifiedName) { + node = (node).left; + } + else if (node.kind === SyntaxKind.PropertyAccessExpression) { + node = (node).expression; + } + else { + break; + } } + Debug.assert(node.kind === SyntaxKind.Identifier); return node; } @@ -10478,7 +10519,7 @@ module ts { case SyntaxKind.SetAccessor: return checkAccessorDeclaration(node); case SyntaxKind.TypeReference: - return checkTypeReference(node); + return checkTypeReferenceOrHeritageClauseElement(node); case SyntaxKind.TypeQuery: return checkTypeQuery(node); case SyntaxKind.TypeLiteral: @@ -10854,11 +10895,23 @@ module ts { // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName: EntityName): boolean { let node: Node = entityName; - while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) { + node = node.parent; + } + return node.parent && node.parent.kind === SyntaxKind.TypeReference; } - function isTypeNode(node: Node): boolean { + function isHeritageClauseElementIdentifier(entityName: Node): boolean { + let node = entityName; + while (node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression) { + node = node.parent; + } + + return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement; + } + + function isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { return true; } @@ -10875,6 +10928,8 @@ module ts { case SyntaxKind.StringLiteral: // Specialized signatures can have string literals as their parameters' type names return node.parent.kind === SyntaxKind.Parameter; + case SyntaxKind.HeritageClauseElement: + return true; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container @@ -10883,10 +10938,15 @@ module ts { if (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) { node = node.parent; } + else if (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node) { + node = node.parent; + } // fall through case SyntaxKind.QualifiedName: + case SyntaxKind.PropertyAccessExpression: // At this point, node is either a qualified name or an identifier - Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression, + "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); let parent = node.parent; if (parent.kind === SyntaxKind.TypeQuery) { @@ -10902,6 +10962,8 @@ module ts { return true; } switch (parent.kind) { + case SyntaxKind.HeritageClauseElement: + return true; case SyntaxKind.TypeParameter: return node === (parent).constraint; case SyntaxKind.PropertyDeclaration: @@ -10956,11 +11018,6 @@ module ts { return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } - function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) { - return (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) || - (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node); - } - function getSymbolOfEntityNameOrPropertyAccessExpression(entityName: EntityName | PropertyAccessExpression): Symbol { if (isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); @@ -10982,7 +11039,12 @@ module ts { entityName = entityName.parent; } - if (isExpression(entityName)) { + if (isHeritageClauseElementIdentifier(entityName)) { + let meaning = entityName.parent.kind === SyntaxKind.HeritageClauseElement ? SymbolFlags.Type : SymbolFlags.Namespace; + meaning |= SymbolFlags.Alias; + return resolveEntityName(entityName, meaning); + } + else if (isExpression(entityName)) { if (getFullWidth(entityName) === 0) { // Missing entity name. return undefined; @@ -11098,12 +11160,12 @@ module ts { return unknownType; } - if (isExpression(node)) { - return getTypeOfExpression(node); + if (isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node); } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); + if (isExpression(node)) { + return getTypeOfExpression(node); } if (isTypeDeclaration(node)) { diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index cf75467e1c..7fd46d5342 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -314,12 +314,12 @@ module ts { } } - function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName | HeritageClauseElement, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; emitType(type); } - function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName) { + function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName | HeritageClauseElement) { switch (type.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.StringKeyword: @@ -329,6 +329,8 @@ module ts { case SyntaxKind.VoidKeyword: case SyntaxKind.StringLiteral: return writeTextOfNode(currentSourceFile, type); + case SyntaxKind.HeritageClauseElement: + return emitHeritageClauseElement(type); case SyntaxKind.TypeReference: return emitTypeReference(type); case SyntaxKind.TypeQuery: @@ -350,11 +352,9 @@ module ts { return emitEntityName(type); case SyntaxKind.QualifiedName: return emitEntityName(type); - default: - Debug.fail("Unknown type annotation: " + type.kind); } - function emitEntityName(entityName: EntityName) { + function emitEntityName(entityName: EntityName | PropertyAccessExpression) { let visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration ? entityName.parent : enclosingDeclaration); @@ -362,15 +362,28 @@ module ts { handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); - function writeEntityName(entityName: EntityName) { + function writeEntityName(entityName: EntityName | Expression) { if (entityName.kind === SyntaxKind.Identifier) { writeTextOfNode(currentSourceFile, entityName); } else { - let qualifiedName = entityName; - writeEntityName(qualifiedName.left); + let left = entityName.kind === SyntaxKind.QualifiedName ? (entityName).left : (entityName).expression; + let right = entityName.kind === SyntaxKind.QualifiedName ? (entityName).right : (entityName).name; + writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, qualifiedName.right); + writeTextOfNode(currentSourceFile, right); + } + } + } + + function emitHeritageClauseElement(node: HeritageClauseElement) { + if (isSupportedHeritageClauseElement(node)) { + Debug.assert(node.expression.kind === SyntaxKind.Identifier || node.expression.kind === SyntaxKind.PropertyAccessExpression); + emitEntityName(node.expression); + if (node.typeArguments) { + write("<"); + emitCommaList(node.typeArguments, emitType); + write(">"); } } } @@ -827,14 +840,16 @@ module ts { } } - function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { + function emitHeritageClause(typeReferences: HeritageClauseElement[], isImplementsList: boolean) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); } - function emitTypeOfTypeReference(node: TypeReferenceNode) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + function emitTypeOfTypeReference(node: HeritageClauseElement) { + if (isSupportedHeritageClauseElement(node)) { + emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); + } function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { let diagnosticMessage: DiagnosticMessage; diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 967afd171b..22e3a81ff3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -351,6 +351,8 @@ module ts { The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + An_interface_can_only_extend_a_type_reference: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend a type reference." }, + A_class_can_only_implement_type_references: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement type references." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -498,5 +500,6 @@ module ts { You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, + Only_type_references_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only type references are currently supported in a class 'extends' clauses." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6e24afad80..347ae08460 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1396,6 +1396,14 @@ "category": "Error", "code": 2498 }, + "An interface can only extend a type reference.": { + "category": "Error", + "code": 2499 + }, + "A class can only implement type references.": { + "category": "Error", + "code": 2500 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -1985,5 +1993,9 @@ "Generators are not currently supported.": { "category": "Error", "code": 9001 + }, + "Only type references are currently supported in a class 'extends' clauses.": { + "category": "Error", + "code": 9002 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ac5fa31319..09e721c9cf 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3314,7 +3314,7 @@ module ts { } } - function emitConstructor(node: ClassDeclaration, baseTypeNode: TypeReferenceNode) { + function emitConstructor(node: ClassDeclaration, baseTypeElement: HeritageClauseElement) { let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; @@ -3368,7 +3368,7 @@ module ts { // Let constructor be the result of parsing the String "constructor(... args){ super (...args);}" using the syntactic grammar with the goal symbol MethodDefinition. // Else, // Let constructor be the result of parsing the String "constructor( ){ }" using the syntactic grammar with the goal symbol MethodDefinition - if (baseTypeNode) { + if (baseTypeElement) { write("(...args)"); } else { @@ -3387,7 +3387,7 @@ module ts { if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); - if (baseTypeNode) { + if (baseTypeElement) { var superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); @@ -3397,16 +3397,16 @@ module ts { emitParameterPropertyAssignments(ctor); } else { - if (baseTypeNode) { + if (baseTypeElement) { writeLine(); - emitStart(baseTypeNode); + emitStart(baseTypeElement); if (languageVersion < ScriptTarget.ES6) { write("_super.apply(this, arguments);"); } else { write("super(...args);"); } - emitEnd(baseTypeNode); + emitEnd(baseTypeElement); } } emitMemberAssignments(node, /*staticFlag*/0); @@ -3525,7 +3525,7 @@ module ts { var baseTypeNode = getClassBaseTypeNode(node); if (baseTypeNode) { write(" extends "); - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } write(" {"); @@ -3639,7 +3639,7 @@ module ts { emitStart(node); write(")("); if (baseTypeNode) { - emit(baseTypeNode.typeName); + emit(baseTypeNode.expression); } write(");"); emitEnd(node); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 14311ccbc5..49bd301dc7 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -308,6 +308,9 @@ module ts { return visitNode(cbNode, (node).expression); case SyntaxKind.HeritageClause: return visitNodes(cbNodes, (node).types); + case SyntaxKind.HeritageClauseElement: + return visitNode(cbNode, (node).expression) || + visitNodes(cbNodes, (node).typeArguments); case SyntaxKind.ExternalModuleReference: return visitNode(cbNode, (node).expression); case SyntaxKind.MissingDeclaration: @@ -324,7 +327,7 @@ module ts { TypeMembers, // Members in interface or type literal ClassMembers, // Members in class declaration EnumMembers, // Members in enum declaration - TypeReferences, // Type references in extends or implements clause + HeritageClauseElement, // Elements in a heritage clause VariableDeclarations, // Variable declarations in variable statement ObjectBindingElements, // Binding elements in object binding list ArrayBindingElements, // Binding elements in array binding list @@ -356,7 +359,7 @@ module ts { case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected; case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected; - case ParsingContext.TypeReferences: return Diagnostics.Type_reference_expected; + case ParsingContext.HeritageClauseElement: return Diagnostics.Expression_expected; case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected; case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected; case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected; @@ -1614,10 +1617,22 @@ module ts { return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isLiteralPropertyName(); case ParsingContext.ObjectBindingElements: return isLiteralPropertyName(); - case ParsingContext.TypeReferences: - // We want to make sure that the "extends" in "extends foo" or the "implements" in - // "implements foo" is not considered a type name. - return isIdentifier() && !isNotHeritageClauseTypeName(); + case ParsingContext.HeritageClauseElement: + // If we see { } then only consume it as an expression if it is followed by , or { + // That way we won't consume the body of a class in its heritage clause. + if (token === SyntaxKind.OpenBraceToken) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + else { + // If we're in error recovery we tighten up what we're willing to match. + // That way we don't treat something like "this" as a valid heritage clause + // element during recovery. + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } case ParsingContext.VariableDeclarations: return isIdentifierOrPattern(); case ParsingContext.ArrayBindingElements: @@ -1641,21 +1656,44 @@ module ts { Debug.fail("Non-exhaustive case in 'isListElement'."); } + function isValidHeritageClauseObjectLiteral() { + Debug.assert(token === SyntaxKind.OpenBraceToken); + if (nextToken() === SyntaxKind.CloseBraceToken) { + // if we see "extends {}" then only treat the {} as what we're extending (and not + // the class body) if we have: + // + // extends {} { + // extends {}, + // extends {} extends + // extends {} implements + + let next = nextToken(); + return next === SyntaxKind.CommaToken || next === SyntaxKind.OpenBraceToken || next === SyntaxKind.ExtendsKeyword || next === SyntaxKind.ImplementsKeyword; + } + + return true; + } + function nextTokenIsIdentifier() { nextToken(); return isIdentifier(); } - function isNotHeritageClauseTypeName(): boolean { + function isHeritageClauseExtendsOrImplementsKeyword(): boolean { if (token === SyntaxKind.ImplementsKeyword || token === SyntaxKind.ExtendsKeyword) { - return lookAhead(nextTokenIsIdentifier); + return lookAhead(nextTokenIsStartOfExpression); } return false; } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } + // True if positioned at a list terminator function isListTerminator(kind: ParsingContext): boolean { if (token === SyntaxKind.EndOfFileToken) { @@ -1676,7 +1714,7 @@ module ts { return token === SyntaxKind.CloseBraceToken; case ParsingContext.SwitchClauseStatements: return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; - case ParsingContext.TypeReferences: + case ParsingContext.HeritageClauseElement: return token === SyntaxKind.OpenBraceToken || token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; case ParsingContext.VariableDeclarations: return isVariableDeclaratorListTerminator(); @@ -1891,12 +1929,6 @@ module ts { // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. - case ParsingContext.TypeReferences: - // This would probably be safe to reuse. There is no speculative parsing with - // type names in a heritage clause. There can be generic names in the type - // name list. But because it is a type context, we never use speculative - // parsing on the type argument list. - case ParsingContext.TypeParameters: // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in @@ -1923,6 +1955,12 @@ module ts { // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. case ParsingContext.ObjectLiteralMembers: + + // This is probably not safe to reuse. There can be speculative parsing with + // type names in a heritage clause. There can be generic names in the type + // name list, and there can be left hand side expressions (which can have type + // arguments.) + case ParsingContext.HeritageClauseElement: } return false; @@ -2846,8 +2884,7 @@ module ts { } // EXPRESSIONS - - function isStartOfExpression(): boolean { + function isStartOfLeftHandSideExpression(): boolean { switch (token) { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: @@ -2865,6 +2902,19 @@ module ts { case SyntaxKind.NewKeyword: case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: + case SyntaxKind.Identifier: + return true; + default: + return isIdentifier(); + } + } + + function isStartOfExpression(): boolean { + if (isStartOfLeftHandSideExpression()) { + return true; + } + + switch (token) { case SyntaxKind.PlusToken: case SyntaxKind.MinusToken: case SyntaxKind.TildeToken: @@ -2875,7 +2925,6 @@ module ts { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: case SyntaxKind.LessThanToken: - case SyntaxKind.Identifier: case SyntaxKind.YieldKeyword: // Yield always starts an expression. Either it is an identifier (in which case // it is definitely an expression). Or it's a keyword (either because we're in @@ -3667,7 +3716,6 @@ module ts { case SyntaxKind.CloseBracketToken: // foo] case SyntaxKind.ColonToken: // foo: case SyntaxKind.SemicolonToken: // foo; - case SyntaxKind.CommaToken: // foo, case SyntaxKind.QuestionToken: // foo? case SyntaxKind.EqualsEqualsToken: // foo == case SyntaxKind.EqualsEqualsEqualsToken: // foo === @@ -3685,6 +3733,12 @@ module ts { // treat it as such. return true; + case SyntaxKind.CommaToken: // foo, + case SyntaxKind.OpenBraceToken: // foo { + // We don't want to treat these as type arguments. Otherwise we'll parse this + // as an invocation expression. Instead, we want to parse out the expression + // in isolation from the type arguments. + default: // Anything else treat as an expression. return false; @@ -4714,13 +4768,23 @@ module ts { let node = createNode(SyntaxKind.HeritageClause); node.token = token; nextToken(); - node.types = parseDelimitedList(ParsingContext.TypeReferences, parseTypeReference); + node.types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseHeritageClauseElement); return finishNode(node); } return undefined; } + function parseHeritageClauseElement(): HeritageClauseElement { + let node = createNode(SyntaxKind.HeritageClauseElement); + node.expression = parseLeftHandSideExpressionOrHigher(); + if (token === SyntaxKind.LessThanToken) { + node.typeArguments = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); + } + + return finishNode(node); + } + function isHeritageClause(): boolean { return token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d24ee45e21..a9a04c3bd3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -206,6 +206,7 @@ module ts { OmittedExpression, // Misc TemplateSpan, + HeritageClauseElement, // Element Block, VariableStatement, @@ -728,6 +729,11 @@ module ts { arguments: NodeArray; } + export interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } + export interface NewExpression extends CallExpression, PrimaryExpression { } export interface TaggedTemplateExpression extends MemberExpression { @@ -869,7 +875,7 @@ module ts { export interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } export interface TypeAliasDeclaration extends Declaration, ModuleElement { @@ -1231,7 +1237,7 @@ module ts { 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, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; // Returns the constant value this property access resolves to, or 'undefined' for a non-constant getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9fa0674c25..761e1cdb4d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1768,4 +1768,26 @@ module ts { } } + // Returns true if this heritage clause element's expression contains something unsupported + // (i.e. not a name or dotted name). + export function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean { + return isSupportedHeritageClauseElementExpression(node.expression); + } + + function isSupportedHeritageClauseElementExpression(node: Expression): boolean { + if (node.kind === SyntaxKind.Identifier) { + return true; + } + else if (node.kind === SyntaxKind.PropertyAccessExpression) { + return isSupportedHeritageClauseElementExpression((node).expression); + } + else { + return false; + } + } + + export function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) { + return (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) || + (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node); + } } diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 54cdc27e3b..a83c04e6e8 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -38,7 +38,6 @@ class TypeWriterWalker { case ts.SyntaxKind.SuperKeyword: case ts.SyntaxKind.ArrayLiteralExpression: case ts.SyntaxKind.ObjectLiteralExpression: - case ts.SyntaxKind.PropertyAccessExpression: case ts.SyntaxKind.ElementAccessExpression: case ts.SyntaxKind.CallExpression: case ts.SyntaxKind.NewExpression: @@ -56,6 +55,14 @@ class TypeWriterWalker { this.log(node, this.getTypeOfNode(node)); break; + case ts.SyntaxKind.PropertyAccessExpression: + for (var current = node; current.kind === ts.SyntaxKind.PropertyAccessExpression; current = current.parent) { + } + if (current.kind !== ts.SyntaxKind.HeritageClauseElement) { + this.log(node, this.getTypeOfNode(node)); + } + break; + // Should not change expression status (maybe expressions) // TODO: Again, ideally should log number and string literals too, // but to be consistent with the old typeWriter, just log identifiers diff --git a/src/services/services.ts b/src/services/services.ts index 41ffc04e5a..cf184ba775 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2932,7 +2932,7 @@ module ts { function getCompletionsAtPosition(fileName: string, position: number): CompletionInfo { synchronizeHostData(); - + let completionData = getCompletionData(fileName, position); if (!completionData) { return undefined; @@ -4887,7 +4887,7 @@ module ts { } return; - function getPropertySymbolFromTypeReference(typeReference: TypeReferenceNode) { + function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) { if (typeReference) { let type = typeInfoResolver.getTypeAtLocation(typeReference); if (type) { @@ -5144,19 +5144,44 @@ module ts { } function isTypeReference(node: Node): boolean { - if (isRightSideOfQualifiedName(node)) { + if (isRightSideOfQualifiedNameOrPropertyAccess(node) ) { node = node.parent; } - return node.parent.kind === SyntaxKind.TypeReference; + return node.parent.kind === SyntaxKind.TypeReference || node.parent.kind === SyntaxKind.HeritageClauseElement; } function isNamespaceReference(node: Node): boolean { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + + function isPropertyAccessNamespaceReference(node: Node): boolean { + let root = node; + let isLastClause = true; + if (root.parent.kind === SyntaxKind.PropertyAccessExpression) { + while (root.parent && root.parent.kind === SyntaxKind.PropertyAccessExpression) { + root = root.parent; + } + + isLastClause = (root).name === node; + } + + if (!isLastClause && root.parent.kind === SyntaxKind.HeritageClauseElement && root.parent.parent.kind === SyntaxKind.HeritageClause) { + let decl = root.parent.parent.parent; + return (decl.kind === SyntaxKind.ClassDeclaration && (root.parent.parent).token === SyntaxKind.ImplementsKeyword) || + (decl.kind === SyntaxKind.InterfaceDeclaration && (root.parent.parent).token === SyntaxKind.ExtendsKeyword); + } + + return false; + } + + function isQualifiedNameNamespaceReference(node: Node): boolean { let root = node; let isLastClause = true; if (root.parent.kind === SyntaxKind.QualifiedName) { - while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) + while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) { root = root.parent; + } isLastClause = (root).right === node; } diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 3f0ba5f18c..92711f4b75 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -235,57 +235,58 @@ declare module "typescript" { SpreadElementExpression = 173, OmittedExpression = 174, TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, + HeritageClauseElement = 176, + Block = 177, + VariableStatement = 178, + EmptyStatement = 179, + ExpressionStatement = 180, + IfStatement = 181, + DoStatement = 182, + WhileStatement = 183, + ForStatement = 184, + ForInStatement = 185, + ForOfStatement = 186, + ContinueStatement = 187, + BreakStatement = 188, + ReturnStatement = 189, + WithStatement = 190, + SwitchStatement = 191, + LabeledStatement = 192, + ThrowStatement = 193, + TryStatement = 194, + DebuggerStatement = 195, + VariableDeclaration = 196, + VariableDeclarationList = 197, + FunctionDeclaration = 198, + ClassDeclaration = 199, + InterfaceDeclaration = 200, + TypeAliasDeclaration = 201, + EnumDeclaration = 202, + ModuleDeclaration = 203, + ModuleBlock = 204, + CaseBlock = 205, + ImportEqualsDeclaration = 206, + ImportDeclaration = 207, + ImportClause = 208, + NamespaceImport = 209, + NamedImports = 210, + ImportSpecifier = 211, + ExportAssignment = 212, + ExportDeclaration = 213, + NamedExports = 214, + ExportSpecifier = 215, + MissingDeclaration = 216, + ExternalModuleReference = 217, + CaseClause = 218, + DefaultClause = 219, + HeritageClause = 220, + CatchClause = 221, + PropertyAssignment = 222, + ShorthandPropertyAssignment = 223, + EnumMember = 224, + SourceFile = 225, + SyntaxList = 226, + Count = 227, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -607,6 +608,10 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -718,7 +723,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -960,7 +965,7 @@ declare module "typescript" { 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, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index eff47a4cb7..31322f07ea 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -723,157 +723,160 @@ declare module "typescript" { TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 176, + HeritageClauseElement = 176, +>HeritageClauseElement : SyntaxKind + + Block = 177, >Block : SyntaxKind - VariableStatement = 177, + VariableStatement = 178, >VariableStatement : SyntaxKind - EmptyStatement = 178, + EmptyStatement = 179, >EmptyStatement : SyntaxKind - ExpressionStatement = 179, + ExpressionStatement = 180, >ExpressionStatement : SyntaxKind - IfStatement = 180, + IfStatement = 181, >IfStatement : SyntaxKind - DoStatement = 181, + DoStatement = 182, >DoStatement : SyntaxKind - WhileStatement = 182, + WhileStatement = 183, >WhileStatement : SyntaxKind - ForStatement = 183, + ForStatement = 184, >ForStatement : SyntaxKind - ForInStatement = 184, + ForInStatement = 185, >ForInStatement : SyntaxKind - ForOfStatement = 185, + ForOfStatement = 186, >ForOfStatement : SyntaxKind - ContinueStatement = 186, + ContinueStatement = 187, >ContinueStatement : SyntaxKind - BreakStatement = 187, + BreakStatement = 188, >BreakStatement : SyntaxKind - ReturnStatement = 188, + ReturnStatement = 189, >ReturnStatement : SyntaxKind - WithStatement = 189, + WithStatement = 190, >WithStatement : SyntaxKind - SwitchStatement = 190, + SwitchStatement = 191, >SwitchStatement : SyntaxKind - LabeledStatement = 191, + LabeledStatement = 192, >LabeledStatement : SyntaxKind - ThrowStatement = 192, + ThrowStatement = 193, >ThrowStatement : SyntaxKind - TryStatement = 193, + TryStatement = 194, >TryStatement : SyntaxKind - DebuggerStatement = 194, + DebuggerStatement = 195, >DebuggerStatement : SyntaxKind - VariableDeclaration = 195, + VariableDeclaration = 196, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 196, + VariableDeclarationList = 197, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 197, + FunctionDeclaration = 198, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 198, + ClassDeclaration = 199, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 199, + InterfaceDeclaration = 200, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 200, + TypeAliasDeclaration = 201, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 201, + EnumDeclaration = 202, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 202, + ModuleDeclaration = 203, >ModuleDeclaration : SyntaxKind - ModuleBlock = 203, + ModuleBlock = 204, >ModuleBlock : SyntaxKind - CaseBlock = 204, + CaseBlock = 205, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 205, + ImportEqualsDeclaration = 206, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 206, + ImportDeclaration = 207, >ImportDeclaration : SyntaxKind - ImportClause = 207, + ImportClause = 208, >ImportClause : SyntaxKind - NamespaceImport = 208, + NamespaceImport = 209, >NamespaceImport : SyntaxKind - NamedImports = 209, + NamedImports = 210, >NamedImports : SyntaxKind - ImportSpecifier = 210, + ImportSpecifier = 211, >ImportSpecifier : SyntaxKind - ExportAssignment = 211, + ExportAssignment = 212, >ExportAssignment : SyntaxKind - ExportDeclaration = 212, + ExportDeclaration = 213, >ExportDeclaration : SyntaxKind - NamedExports = 213, + NamedExports = 214, >NamedExports : SyntaxKind - ExportSpecifier = 214, + ExportSpecifier = 215, >ExportSpecifier : SyntaxKind - MissingDeclaration = 215, + MissingDeclaration = 216, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 216, + ExternalModuleReference = 217, >ExternalModuleReference : SyntaxKind - CaseClause = 217, + CaseClause = 218, >CaseClause : SyntaxKind - DefaultClause = 218, + DefaultClause = 219, >DefaultClause : SyntaxKind - HeritageClause = 219, + HeritageClause = 220, >HeritageClause : SyntaxKind - CatchClause = 220, + CatchClause = 221, >CatchClause : SyntaxKind - PropertyAssignment = 221, + PropertyAssignment = 222, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 222, + ShorthandPropertyAssignment = 223, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 223, + EnumMember = 224, >EnumMember : SyntaxKind - SourceFile = 224, + SourceFile = 225, >SourceFile : SyntaxKind - SyntaxList = 225, + SyntaxList = 226, >SyntaxList : SyntaxKind - Count = 226, + Count = 227, >Count : SyntaxKind FirstAssignment = 53, @@ -1831,6 +1834,19 @@ declare module "typescript" { >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 @@ -2178,10 +2194,10 @@ declare module "typescript" { >token : SyntaxKind >SyntaxKind : SyntaxKind - types?: NodeArray; ->types : NodeArray + types?: NodeArray; +>types : NodeArray >NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode +>HeritageClauseElement : HeritageClauseElement } interface TypeAliasDeclaration extends Declaration, ModuleElement { >TypeAliasDeclaration : TypeAliasDeclaration @@ -3125,10 +3141,11 @@ declare module "typescript" { >SymbolFlags : SymbolFlags >SymbolAccessiblityResult : SymbolAccessiblityResult - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName + 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 diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index ab48f78aff..dc96584dc5 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -266,57 +266,58 @@ declare module "typescript" { SpreadElementExpression = 173, OmittedExpression = 174, TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, + HeritageClauseElement = 176, + Block = 177, + VariableStatement = 178, + EmptyStatement = 179, + ExpressionStatement = 180, + IfStatement = 181, + DoStatement = 182, + WhileStatement = 183, + ForStatement = 184, + ForInStatement = 185, + ForOfStatement = 186, + ContinueStatement = 187, + BreakStatement = 188, + ReturnStatement = 189, + WithStatement = 190, + SwitchStatement = 191, + LabeledStatement = 192, + ThrowStatement = 193, + TryStatement = 194, + DebuggerStatement = 195, + VariableDeclaration = 196, + VariableDeclarationList = 197, + FunctionDeclaration = 198, + ClassDeclaration = 199, + InterfaceDeclaration = 200, + TypeAliasDeclaration = 201, + EnumDeclaration = 202, + ModuleDeclaration = 203, + ModuleBlock = 204, + CaseBlock = 205, + ImportEqualsDeclaration = 206, + ImportDeclaration = 207, + ImportClause = 208, + NamespaceImport = 209, + NamedImports = 210, + ImportSpecifier = 211, + ExportAssignment = 212, + ExportDeclaration = 213, + NamedExports = 214, + ExportSpecifier = 215, + MissingDeclaration = 216, + ExternalModuleReference = 217, + CaseClause = 218, + DefaultClause = 219, + HeritageClause = 220, + CatchClause = 221, + PropertyAssignment = 222, + ShorthandPropertyAssignment = 223, + EnumMember = 224, + SourceFile = 225, + SyntaxList = 226, + Count = 227, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -638,6 +639,10 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -749,7 +754,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -991,7 +996,7 @@ declare module "typescript" { 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, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; @@ -2042,21 +2047,21 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 183 /* ForStatement */: - case 184 /* ForInStatement */: - case 182 /* WhileStatement */: - case 181 /* DoStatement */: - if (node.statement.kind !== 176 /* Block */) { + case 184 /* ForStatement */: + case 185 /* ForInStatement */: + case 183 /* WhileStatement */: + case 182 /* DoStatement */: + if (node.statement.kind !== 177 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 180 /* IfStatement */: + case 181 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 176 /* Block */) { + if (ifStatement.thenStatement.kind !== 177 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 176 /* Block */ && ifStatement.elseStatement.kind !== 180 /* IfStatement */) { + ifStatement.elseStatement.kind !== 177 /* Block */ && ifStatement.elseStatement.kind !== 181 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 600bf5c6ad..57473b8981 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -869,157 +869,160 @@ declare module "typescript" { TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 176, + HeritageClauseElement = 176, +>HeritageClauseElement : SyntaxKind + + Block = 177, >Block : SyntaxKind - VariableStatement = 177, + VariableStatement = 178, >VariableStatement : SyntaxKind - EmptyStatement = 178, + EmptyStatement = 179, >EmptyStatement : SyntaxKind - ExpressionStatement = 179, + ExpressionStatement = 180, >ExpressionStatement : SyntaxKind - IfStatement = 180, + IfStatement = 181, >IfStatement : SyntaxKind - DoStatement = 181, + DoStatement = 182, >DoStatement : SyntaxKind - WhileStatement = 182, + WhileStatement = 183, >WhileStatement : SyntaxKind - ForStatement = 183, + ForStatement = 184, >ForStatement : SyntaxKind - ForInStatement = 184, + ForInStatement = 185, >ForInStatement : SyntaxKind - ForOfStatement = 185, + ForOfStatement = 186, >ForOfStatement : SyntaxKind - ContinueStatement = 186, + ContinueStatement = 187, >ContinueStatement : SyntaxKind - BreakStatement = 187, + BreakStatement = 188, >BreakStatement : SyntaxKind - ReturnStatement = 188, + ReturnStatement = 189, >ReturnStatement : SyntaxKind - WithStatement = 189, + WithStatement = 190, >WithStatement : SyntaxKind - SwitchStatement = 190, + SwitchStatement = 191, >SwitchStatement : SyntaxKind - LabeledStatement = 191, + LabeledStatement = 192, >LabeledStatement : SyntaxKind - ThrowStatement = 192, + ThrowStatement = 193, >ThrowStatement : SyntaxKind - TryStatement = 193, + TryStatement = 194, >TryStatement : SyntaxKind - DebuggerStatement = 194, + DebuggerStatement = 195, >DebuggerStatement : SyntaxKind - VariableDeclaration = 195, + VariableDeclaration = 196, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 196, + VariableDeclarationList = 197, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 197, + FunctionDeclaration = 198, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 198, + ClassDeclaration = 199, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 199, + InterfaceDeclaration = 200, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 200, + TypeAliasDeclaration = 201, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 201, + EnumDeclaration = 202, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 202, + ModuleDeclaration = 203, >ModuleDeclaration : SyntaxKind - ModuleBlock = 203, + ModuleBlock = 204, >ModuleBlock : SyntaxKind - CaseBlock = 204, + CaseBlock = 205, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 205, + ImportEqualsDeclaration = 206, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 206, + ImportDeclaration = 207, >ImportDeclaration : SyntaxKind - ImportClause = 207, + ImportClause = 208, >ImportClause : SyntaxKind - NamespaceImport = 208, + NamespaceImport = 209, >NamespaceImport : SyntaxKind - NamedImports = 209, + NamedImports = 210, >NamedImports : SyntaxKind - ImportSpecifier = 210, + ImportSpecifier = 211, >ImportSpecifier : SyntaxKind - ExportAssignment = 211, + ExportAssignment = 212, >ExportAssignment : SyntaxKind - ExportDeclaration = 212, + ExportDeclaration = 213, >ExportDeclaration : SyntaxKind - NamedExports = 213, + NamedExports = 214, >NamedExports : SyntaxKind - ExportSpecifier = 214, + ExportSpecifier = 215, >ExportSpecifier : SyntaxKind - MissingDeclaration = 215, + MissingDeclaration = 216, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 216, + ExternalModuleReference = 217, >ExternalModuleReference : SyntaxKind - CaseClause = 217, + CaseClause = 218, >CaseClause : SyntaxKind - DefaultClause = 218, + DefaultClause = 219, >DefaultClause : SyntaxKind - HeritageClause = 219, + HeritageClause = 220, >HeritageClause : SyntaxKind - CatchClause = 220, + CatchClause = 221, >CatchClause : SyntaxKind - PropertyAssignment = 221, + PropertyAssignment = 222, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 222, + ShorthandPropertyAssignment = 223, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 223, + EnumMember = 224, >EnumMember : SyntaxKind - SourceFile = 224, + SourceFile = 225, >SourceFile : SyntaxKind - SyntaxList = 225, + SyntaxList = 226, >SyntaxList : SyntaxKind - Count = 226, + Count = 227, >Count : SyntaxKind FirstAssignment = 53, @@ -1977,6 +1980,19 @@ declare module "typescript" { >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 @@ -2324,10 +2340,10 @@ declare module "typescript" { >token : SyntaxKind >SyntaxKind : SyntaxKind - types?: NodeArray; ->types : NodeArray + types?: NodeArray; +>types : NodeArray >NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode +>HeritageClauseElement : HeritageClauseElement } interface TypeAliasDeclaration extends Declaration, ModuleElement { >TypeAliasDeclaration : TypeAliasDeclaration @@ -3271,10 +3287,11 @@ declare module "typescript" { >SymbolFlags : SymbolFlags >SymbolAccessiblityResult : SymbolAccessiblityResult - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName + 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 diff --git a/tests/baselines/reference/APISample_linter.types.pull b/tests/baselines/reference/APISample_linter.types.pull new file mode 100644 index 0000000000..74632737ca --- /dev/null +++ b/tests/baselines/reference/APISample_linter.types.pull @@ -0,0 +1,6384 @@ +=== 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 + + OmittedExpression = 174, +>OmittedExpression : SyntaxKind + + TemplateSpan = 175, +>TemplateSpan : SyntaxKind + + HeritageClauseElement = 176, +>HeritageClauseElement : SyntaxKind + + Block = 177, +>Block : SyntaxKind + + VariableStatement = 178, +>VariableStatement : SyntaxKind + + EmptyStatement = 179, +>EmptyStatement : SyntaxKind + + ExpressionStatement = 180, +>ExpressionStatement : SyntaxKind + + IfStatement = 181, +>IfStatement : SyntaxKind + + DoStatement = 182, +>DoStatement : SyntaxKind + + WhileStatement = 183, +>WhileStatement : SyntaxKind + + ForStatement = 184, +>ForStatement : SyntaxKind + + ForInStatement = 185, +>ForInStatement : SyntaxKind + + ForOfStatement = 186, +>ForOfStatement : SyntaxKind + + ContinueStatement = 187, +>ContinueStatement : SyntaxKind + + BreakStatement = 188, +>BreakStatement : SyntaxKind + + ReturnStatement = 189, +>ReturnStatement : SyntaxKind + + WithStatement = 190, +>WithStatement : SyntaxKind + + SwitchStatement = 191, +>SwitchStatement : SyntaxKind + + LabeledStatement = 192, +>LabeledStatement : SyntaxKind + + ThrowStatement = 193, +>ThrowStatement : SyntaxKind + + TryStatement = 194, +>TryStatement : SyntaxKind + + DebuggerStatement = 195, +>DebuggerStatement : SyntaxKind + + VariableDeclaration = 196, +>VariableDeclaration : SyntaxKind + + VariableDeclarationList = 197, +>VariableDeclarationList : SyntaxKind + + FunctionDeclaration = 198, +>FunctionDeclaration : SyntaxKind + + ClassDeclaration = 199, +>ClassDeclaration : SyntaxKind + + InterfaceDeclaration = 200, +>InterfaceDeclaration : SyntaxKind + + TypeAliasDeclaration = 201, +>TypeAliasDeclaration : SyntaxKind + + EnumDeclaration = 202, +>EnumDeclaration : SyntaxKind + + ModuleDeclaration = 203, +>ModuleDeclaration : SyntaxKind + + ModuleBlock = 204, +>ModuleBlock : SyntaxKind + + CaseBlock = 205, +>CaseBlock : SyntaxKind + + ImportEqualsDeclaration = 206, +>ImportEqualsDeclaration : SyntaxKind + + ImportDeclaration = 207, +>ImportDeclaration : SyntaxKind + + ImportClause = 208, +>ImportClause : SyntaxKind + + NamespaceImport = 209, +>NamespaceImport : SyntaxKind + + NamedImports = 210, +>NamedImports : SyntaxKind + + ImportSpecifier = 211, +>ImportSpecifier : SyntaxKind + + ExportAssignment = 212, +>ExportAssignment : SyntaxKind + + ExportDeclaration = 213, +>ExportDeclaration : SyntaxKind + + NamedExports = 214, +>NamedExports : SyntaxKind + + ExportSpecifier = 215, +>ExportSpecifier : SyntaxKind + + MissingDeclaration = 216, +>MissingDeclaration : SyntaxKind + + ExternalModuleReference = 217, +>ExternalModuleReference : SyntaxKind + + CaseClause = 218, +>CaseClause : SyntaxKind + + DefaultClause = 219, +>DefaultClause : SyntaxKind + + HeritageClause = 220, +>HeritageClause : SyntaxKind + + CatchClause = 221, +>CatchClause : SyntaxKind + + PropertyAssignment = 222, +>PropertyAssignment : SyntaxKind + + ShorthandPropertyAssignment = 223, +>ShorthandPropertyAssignment : SyntaxKind + + EnumMember = 224, +>EnumMember : SyntaxKind + + SourceFile = 225, +>SourceFile : SyntaxKind + + SyntaxList = 226, +>SyntaxList : SyntaxKind + + Count = 227, +>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 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 ClassDeclaration extends Declaration, ModuleElement { +>ClassDeclaration : ClassDeclaration +>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 +>ClassElement : ClassElement + } + 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 Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>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 + + getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; +>getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] +>node : ImportDeclaration +>ImportDeclaration : ImportDeclaration +>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: Expression | Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult +>entityName : Expression | Identifier | 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 + + codepage?: number; +>codepage : number + + 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 + + noLibCheck?: boolean; +>noLibCheck : 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 + + [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" { + /** 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 + } + 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 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 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 d40c078a15..a29467c1c4 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -267,57 +267,58 @@ declare module "typescript" { SpreadElementExpression = 173, OmittedExpression = 174, TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, + HeritageClauseElement = 176, + Block = 177, + VariableStatement = 178, + EmptyStatement = 179, + ExpressionStatement = 180, + IfStatement = 181, + DoStatement = 182, + WhileStatement = 183, + ForStatement = 184, + ForInStatement = 185, + ForOfStatement = 186, + ContinueStatement = 187, + BreakStatement = 188, + ReturnStatement = 189, + WithStatement = 190, + SwitchStatement = 191, + LabeledStatement = 192, + ThrowStatement = 193, + TryStatement = 194, + DebuggerStatement = 195, + VariableDeclaration = 196, + VariableDeclarationList = 197, + FunctionDeclaration = 198, + ClassDeclaration = 199, + InterfaceDeclaration = 200, + TypeAliasDeclaration = 201, + EnumDeclaration = 202, + ModuleDeclaration = 203, + ModuleBlock = 204, + CaseBlock = 205, + ImportEqualsDeclaration = 206, + ImportDeclaration = 207, + ImportClause = 208, + NamespaceImport = 209, + NamedImports = 210, + ImportSpecifier = 211, + ExportAssignment = 212, + ExportDeclaration = 213, + NamedExports = 214, + ExportSpecifier = 215, + MissingDeclaration = 216, + ExternalModuleReference = 217, + CaseClause = 218, + DefaultClause = 219, + HeritageClause = 220, + CatchClause = 221, + PropertyAssignment = 222, + ShorthandPropertyAssignment = 223, + EnumMember = 224, + SourceFile = 225, + SyntaxList = 226, + Count = 227, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -639,6 +640,10 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -750,7 +755,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -992,7 +997,7 @@ declare module "typescript" { 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, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4ea9c49d75..68ce9de45b 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -819,157 +819,160 @@ declare module "typescript" { TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 176, + HeritageClauseElement = 176, +>HeritageClauseElement : SyntaxKind + + Block = 177, >Block : SyntaxKind - VariableStatement = 177, + VariableStatement = 178, >VariableStatement : SyntaxKind - EmptyStatement = 178, + EmptyStatement = 179, >EmptyStatement : SyntaxKind - ExpressionStatement = 179, + ExpressionStatement = 180, >ExpressionStatement : SyntaxKind - IfStatement = 180, + IfStatement = 181, >IfStatement : SyntaxKind - DoStatement = 181, + DoStatement = 182, >DoStatement : SyntaxKind - WhileStatement = 182, + WhileStatement = 183, >WhileStatement : SyntaxKind - ForStatement = 183, + ForStatement = 184, >ForStatement : SyntaxKind - ForInStatement = 184, + ForInStatement = 185, >ForInStatement : SyntaxKind - ForOfStatement = 185, + ForOfStatement = 186, >ForOfStatement : SyntaxKind - ContinueStatement = 186, + ContinueStatement = 187, >ContinueStatement : SyntaxKind - BreakStatement = 187, + BreakStatement = 188, >BreakStatement : SyntaxKind - ReturnStatement = 188, + ReturnStatement = 189, >ReturnStatement : SyntaxKind - WithStatement = 189, + WithStatement = 190, >WithStatement : SyntaxKind - SwitchStatement = 190, + SwitchStatement = 191, >SwitchStatement : SyntaxKind - LabeledStatement = 191, + LabeledStatement = 192, >LabeledStatement : SyntaxKind - ThrowStatement = 192, + ThrowStatement = 193, >ThrowStatement : SyntaxKind - TryStatement = 193, + TryStatement = 194, >TryStatement : SyntaxKind - DebuggerStatement = 194, + DebuggerStatement = 195, >DebuggerStatement : SyntaxKind - VariableDeclaration = 195, + VariableDeclaration = 196, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 196, + VariableDeclarationList = 197, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 197, + FunctionDeclaration = 198, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 198, + ClassDeclaration = 199, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 199, + InterfaceDeclaration = 200, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 200, + TypeAliasDeclaration = 201, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 201, + EnumDeclaration = 202, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 202, + ModuleDeclaration = 203, >ModuleDeclaration : SyntaxKind - ModuleBlock = 203, + ModuleBlock = 204, >ModuleBlock : SyntaxKind - CaseBlock = 204, + CaseBlock = 205, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 205, + ImportEqualsDeclaration = 206, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 206, + ImportDeclaration = 207, >ImportDeclaration : SyntaxKind - ImportClause = 207, + ImportClause = 208, >ImportClause : SyntaxKind - NamespaceImport = 208, + NamespaceImport = 209, >NamespaceImport : SyntaxKind - NamedImports = 209, + NamedImports = 210, >NamedImports : SyntaxKind - ImportSpecifier = 210, + ImportSpecifier = 211, >ImportSpecifier : SyntaxKind - ExportAssignment = 211, + ExportAssignment = 212, >ExportAssignment : SyntaxKind - ExportDeclaration = 212, + ExportDeclaration = 213, >ExportDeclaration : SyntaxKind - NamedExports = 213, + NamedExports = 214, >NamedExports : SyntaxKind - ExportSpecifier = 214, + ExportSpecifier = 215, >ExportSpecifier : SyntaxKind - MissingDeclaration = 215, + MissingDeclaration = 216, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 216, + ExternalModuleReference = 217, >ExternalModuleReference : SyntaxKind - CaseClause = 217, + CaseClause = 218, >CaseClause : SyntaxKind - DefaultClause = 218, + DefaultClause = 219, >DefaultClause : SyntaxKind - HeritageClause = 219, + HeritageClause = 220, >HeritageClause : SyntaxKind - CatchClause = 220, + CatchClause = 221, >CatchClause : SyntaxKind - PropertyAssignment = 221, + PropertyAssignment = 222, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 222, + ShorthandPropertyAssignment = 223, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 223, + EnumMember = 224, >EnumMember : SyntaxKind - SourceFile = 224, + SourceFile = 225, >SourceFile : SyntaxKind - SyntaxList = 225, + SyntaxList = 226, >SyntaxList : SyntaxKind - Count = 226, + Count = 227, >Count : SyntaxKind FirstAssignment = 53, @@ -1927,6 +1930,19 @@ declare module "typescript" { >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 @@ -2274,10 +2290,10 @@ declare module "typescript" { >token : SyntaxKind >SyntaxKind : SyntaxKind - types?: NodeArray; ->types : NodeArray + types?: NodeArray; +>types : NodeArray >NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode +>HeritageClauseElement : HeritageClauseElement } interface TypeAliasDeclaration extends Declaration, ModuleElement { >TypeAliasDeclaration : TypeAliasDeclaration @@ -3221,10 +3237,11 @@ declare module "typescript" { >SymbolFlags : SymbolFlags >SymbolAccessiblityResult : SymbolAccessiblityResult - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName + 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 diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index c53034c11d..918768222b 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -304,57 +304,58 @@ declare module "typescript" { SpreadElementExpression = 173, OmittedExpression = 174, TemplateSpan = 175, - Block = 176, - VariableStatement = 177, - EmptyStatement = 178, - ExpressionStatement = 179, - IfStatement = 180, - DoStatement = 181, - WhileStatement = 182, - ForStatement = 183, - ForInStatement = 184, - ForOfStatement = 185, - ContinueStatement = 186, - BreakStatement = 187, - ReturnStatement = 188, - WithStatement = 189, - SwitchStatement = 190, - LabeledStatement = 191, - ThrowStatement = 192, - TryStatement = 193, - DebuggerStatement = 194, - VariableDeclaration = 195, - VariableDeclarationList = 196, - FunctionDeclaration = 197, - ClassDeclaration = 198, - InterfaceDeclaration = 199, - TypeAliasDeclaration = 200, - EnumDeclaration = 201, - ModuleDeclaration = 202, - ModuleBlock = 203, - CaseBlock = 204, - ImportEqualsDeclaration = 205, - ImportDeclaration = 206, - ImportClause = 207, - NamespaceImport = 208, - NamedImports = 209, - ImportSpecifier = 210, - ExportAssignment = 211, - ExportDeclaration = 212, - NamedExports = 213, - ExportSpecifier = 214, - MissingDeclaration = 215, - ExternalModuleReference = 216, - CaseClause = 217, - DefaultClause = 218, - HeritageClause = 219, - CatchClause = 220, - PropertyAssignment = 221, - ShorthandPropertyAssignment = 222, - EnumMember = 223, - SourceFile = 224, - SyntaxList = 225, - Count = 226, + HeritageClauseElement = 176, + Block = 177, + VariableStatement = 178, + EmptyStatement = 179, + ExpressionStatement = 180, + IfStatement = 181, + DoStatement = 182, + WhileStatement = 183, + ForStatement = 184, + ForInStatement = 185, + ForOfStatement = 186, + ContinueStatement = 187, + BreakStatement = 188, + ReturnStatement = 189, + WithStatement = 190, + SwitchStatement = 191, + LabeledStatement = 192, + ThrowStatement = 193, + TryStatement = 194, + DebuggerStatement = 195, + VariableDeclaration = 196, + VariableDeclarationList = 197, + FunctionDeclaration = 198, + ClassDeclaration = 199, + InterfaceDeclaration = 200, + TypeAliasDeclaration = 201, + EnumDeclaration = 202, + ModuleDeclaration = 203, + ModuleBlock = 204, + CaseBlock = 205, + ImportEqualsDeclaration = 206, + ImportDeclaration = 207, + ImportClause = 208, + NamespaceImport = 209, + NamedImports = 210, + ImportSpecifier = 211, + ExportAssignment = 212, + ExportDeclaration = 213, + NamedExports = 214, + ExportSpecifier = 215, + MissingDeclaration = 216, + ExternalModuleReference = 217, + CaseClause = 218, + DefaultClause = 219, + HeritageClause = 220, + CatchClause = 221, + PropertyAssignment = 222, + ShorthandPropertyAssignment = 223, + EnumMember = 224, + SourceFile = 225, + SyntaxList = 226, + Count = 227, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -676,6 +677,10 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } + interface HeritageClauseElement extends Node { + expression: LeftHandSideExpression; + typeArguments?: NodeArray; + } interface NewExpression extends CallExpression, PrimaryExpression { } interface TaggedTemplateExpression extends MemberExpression { @@ -787,7 +792,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -1029,7 +1034,7 @@ declare module "typescript" { 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, enclosingDeclaration: Node): SymbolVisibilityResult; + isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3903e169b4..9745c79e94 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -992,157 +992,160 @@ declare module "typescript" { TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 176, + HeritageClauseElement = 176, +>HeritageClauseElement : SyntaxKind + + Block = 177, >Block : SyntaxKind - VariableStatement = 177, + VariableStatement = 178, >VariableStatement : SyntaxKind - EmptyStatement = 178, + EmptyStatement = 179, >EmptyStatement : SyntaxKind - ExpressionStatement = 179, + ExpressionStatement = 180, >ExpressionStatement : SyntaxKind - IfStatement = 180, + IfStatement = 181, >IfStatement : SyntaxKind - DoStatement = 181, + DoStatement = 182, >DoStatement : SyntaxKind - WhileStatement = 182, + WhileStatement = 183, >WhileStatement : SyntaxKind - ForStatement = 183, + ForStatement = 184, >ForStatement : SyntaxKind - ForInStatement = 184, + ForInStatement = 185, >ForInStatement : SyntaxKind - ForOfStatement = 185, + ForOfStatement = 186, >ForOfStatement : SyntaxKind - ContinueStatement = 186, + ContinueStatement = 187, >ContinueStatement : SyntaxKind - BreakStatement = 187, + BreakStatement = 188, >BreakStatement : SyntaxKind - ReturnStatement = 188, + ReturnStatement = 189, >ReturnStatement : SyntaxKind - WithStatement = 189, + WithStatement = 190, >WithStatement : SyntaxKind - SwitchStatement = 190, + SwitchStatement = 191, >SwitchStatement : SyntaxKind - LabeledStatement = 191, + LabeledStatement = 192, >LabeledStatement : SyntaxKind - ThrowStatement = 192, + ThrowStatement = 193, >ThrowStatement : SyntaxKind - TryStatement = 193, + TryStatement = 194, >TryStatement : SyntaxKind - DebuggerStatement = 194, + DebuggerStatement = 195, >DebuggerStatement : SyntaxKind - VariableDeclaration = 195, + VariableDeclaration = 196, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 196, + VariableDeclarationList = 197, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 197, + FunctionDeclaration = 198, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 198, + ClassDeclaration = 199, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 199, + InterfaceDeclaration = 200, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 200, + TypeAliasDeclaration = 201, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 201, + EnumDeclaration = 202, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 202, + ModuleDeclaration = 203, >ModuleDeclaration : SyntaxKind - ModuleBlock = 203, + ModuleBlock = 204, >ModuleBlock : SyntaxKind - CaseBlock = 204, + CaseBlock = 205, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 205, + ImportEqualsDeclaration = 206, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 206, + ImportDeclaration = 207, >ImportDeclaration : SyntaxKind - ImportClause = 207, + ImportClause = 208, >ImportClause : SyntaxKind - NamespaceImport = 208, + NamespaceImport = 209, >NamespaceImport : SyntaxKind - NamedImports = 209, + NamedImports = 210, >NamedImports : SyntaxKind - ImportSpecifier = 210, + ImportSpecifier = 211, >ImportSpecifier : SyntaxKind - ExportAssignment = 211, + ExportAssignment = 212, >ExportAssignment : SyntaxKind - ExportDeclaration = 212, + ExportDeclaration = 213, >ExportDeclaration : SyntaxKind - NamedExports = 213, + NamedExports = 214, >NamedExports : SyntaxKind - ExportSpecifier = 214, + ExportSpecifier = 215, >ExportSpecifier : SyntaxKind - MissingDeclaration = 215, + MissingDeclaration = 216, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 216, + ExternalModuleReference = 217, >ExternalModuleReference : SyntaxKind - CaseClause = 217, + CaseClause = 218, >CaseClause : SyntaxKind - DefaultClause = 218, + DefaultClause = 219, >DefaultClause : SyntaxKind - HeritageClause = 219, + HeritageClause = 220, >HeritageClause : SyntaxKind - CatchClause = 220, + CatchClause = 221, >CatchClause : SyntaxKind - PropertyAssignment = 221, + PropertyAssignment = 222, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 222, + ShorthandPropertyAssignment = 223, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 223, + EnumMember = 224, >EnumMember : SyntaxKind - SourceFile = 224, + SourceFile = 225, >SourceFile : SyntaxKind - SyntaxList = 225, + SyntaxList = 226, >SyntaxList : SyntaxKind - Count = 226, + Count = 227, >Count : SyntaxKind FirstAssignment = 53, @@ -2100,6 +2103,19 @@ declare module "typescript" { >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 @@ -2447,10 +2463,10 @@ declare module "typescript" { >token : SyntaxKind >SyntaxKind : SyntaxKind - types?: NodeArray; ->types : NodeArray + types?: NodeArray; +>types : NodeArray >NodeArray : NodeArray ->TypeReferenceNode : TypeReferenceNode +>HeritageClauseElement : HeritageClauseElement } interface TypeAliasDeclaration extends Declaration, ModuleElement { >TypeAliasDeclaration : TypeAliasDeclaration @@ -3394,10 +3410,11 @@ declare module "typescript" { >SymbolFlags : SymbolFlags >SymbolAccessiblityResult : SymbolAccessiblityResult - isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; ->isEntityNameVisible : (entityName: Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Identifier | QualifiedName + 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 diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types index c300ae861a..a666d2cee9 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types @@ -52,7 +52,7 @@ import Backbone = require("aliasUsage1_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types index 2e792d3960..f7e2beb49d 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -40,7 +40,7 @@ import Backbone = require("aliasUsageInArray_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.types b/tests/baselines/reference/aliasUsageInFunctionExpression.types index ba66a0f1c7..392481d2d0 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.types +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types @@ -41,7 +41,7 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types index cf63eba6a6..568e885f51 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -55,7 +55,7 @@ import Backbone = require("aliasUsageInGenericFunction_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.types b/tests/baselines/reference/aliasUsageInIndexerOfClass.types index cc4b237709..e968abe597 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types @@ -49,7 +49,7 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types index b34a4300c5..2e631a41cd 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.types +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types @@ -54,7 +54,7 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index c937187f04..1a4dae9035 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types.pull b/tests/baselines/reference/aliasUsageInOrExpression.types.pull index cc45af29f8..3b138d1404 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types.pull +++ b/tests/baselines/reference/aliasUsageInOrExpression.types.pull @@ -75,7 +75,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types index e2e8b57b94..72f0aaf9e2 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types @@ -45,7 +45,7 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.types b/tests/baselines/reference/aliasUsageInVarAssignment.types index 7ca745b3d2..6b1c097ad9 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.types +++ b/tests/baselines/reference/aliasUsageInVarAssignment.types @@ -36,7 +36,7 @@ import Backbone = require("aliasUsageInVarAssignment_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here diff --git a/tests/baselines/reference/circularImportAlias.types b/tests/baselines/reference/circularImportAlias.types index ab8de414e3..b61f91d460 100644 --- a/tests/baselines/reference/circularImportAlias.types +++ b/tests/baselines/reference/circularImportAlias.types @@ -10,7 +10,7 @@ module B { export class D extends a.C { >D : D ->a : unknown +>a : typeof a >C : a.C id: number; diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index b39d65c3d6..623515a7ec 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -18,7 +18,7 @@ module M { export class O extends M.N { >O : O ->M : unknown +>M : typeof M >N : N } } diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index d46439eba1..4324884ba8 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -2,16 +2,15 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2304: Cannot find name 'boolean'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only type references are currently supported in a class 'extends' clauses. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (10 errors) ==== // classes cannot extend primitives class C extends number { } @@ -28,15 +27,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2304: Cannot find name 'Void'. class C4a extends void {} ~~~~ -!!! error TS1133: Type reference expected. +!!! error TS1109: Expression expected. class C5 extends Null { } ~~~~ !!! error TS2304: Cannot find name 'Null'. class C5a extends null { } ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. class C6 extends undefined { } ~~~~~~~~~ !!! error TS2304: Cannot find name 'undefined'. diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 8130181891..45e92dde5f 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -63,13 +63,13 @@ var C5 = (function (_super) { } return C5; })(Null); -var C5a = (function () { +var C5a = (function (_super) { + __extends(C5a, _super); function C5a() { + _super.apply(this, arguments); } return C5a; -})(); -null; -{ } +})(null); var C6 = (function (_super) { __extends(C6, _super); function C6() { diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt index cc7da5de82..c63307ae72 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -1,16 +1,13 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,24): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1109: Expression expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only type references are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (2 errors) ==== // classes cannot extend primitives class C4a extends void {} ~~~~ -!!! error TS1133: Type reference expected. +!!! error TS1109: Expression expected. class C5a extends null { } ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 06b481dbbf..4ac6b14121 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -6,16 +6,22 @@ class C5a extends null { } //// [classExtendingPrimitive2.js] // classes cannot extend primitives +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 C4a = (function () { function C4a() { } return C4a; })(); void {}; -var C5a = (function () { +var C5a = (function (_super) { + __extends(C5a, _super); function C5a() { + _super.apply(this, arguments); } return C5a; -})(); -null; -{ } +})(null); diff --git a/tests/baselines/reference/classExtendingQualifiedName2.types b/tests/baselines/reference/classExtendingQualifiedName2.types index 7706f6bada..ba96058d9b 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.types +++ b/tests/baselines/reference/classExtendingQualifiedName2.types @@ -8,7 +8,7 @@ module M { class D extends M.C { >D : D ->M : unknown +>M : typeof M >C : C } } diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index f1870d7139..f8c9e00324 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,12 +1,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (6 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ==== interface I { foo: string; } @@ -15,6 +16,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2311: A class may only extend another class. class C2 extends { foo: string; } { } // error + ~~~~~~~~~~~~~~~~ +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. + ~ +!!! error TS1005: ',' expected. var x: { foo: string; } class C3 extends x { } // error ~ @@ -31,7 +36,5 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2304: Cannot find name 'foo'. class C6 extends []{ } // error - ~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file + ~~ +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 2ae7ea71ce..30966fedaf 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -30,12 +30,13 @@ var C = (function (_super) { } return C; })(I); // error -var C2 = (function () { +var C2 = (function (_super) { + __extends(C2, _super); function C2() { + _super.apply(this, arguments); } return C2; -})(); -{ } // error +})({ foo: string }); // error var x; var C3 = (function (_super) { __extends(C3, _super); @@ -63,10 +64,10 @@ var C5 = (function (_super) { } return C5; })(foo); // error -var C6 = (function () { +var C6 = (function (_super) { + __extends(C6, _super); function C6() { + _super.apply(this, arguments); } return C6; -})(); -[]; -{ } // error +})([]); // error diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index ce5d8aed7a..f191644d5d 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,12 +1,15 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1133: Type reference expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,20): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (2 errors) ==== +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== class C2 extends { foo: string; } { } // error + ~~~~~~~~~~~~~~~~ +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. + ~ +!!! error TS1005: ',' expected. class C6 extends []{ } // error - ~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. \ No newline at end of file + ~~ +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index 7be1313776..37c0861f5e 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -4,16 +4,23 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType2.js] -var C2 = (function () { +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 C2 = (function (_super) { + __extends(C2, _super); function C2() { + _super.apply(this, arguments); } return C2; -})(); -{ } // error -var C6 = (function () { +})({ foo: string }); // error +var C6 = (function (_super) { + __extends(C6, _super); function C6() { + _super.apply(this, arguments); } return C6; -})(); -[]; -{ } // error +})([]); // error diff --git a/tests/baselines/reference/commentOnAmbientModule.types b/tests/baselines/reference/commentOnAmbientModule.types index bf57d9d11b..f0056decc2 100644 --- a/tests/baselines/reference/commentOnAmbientModule.types +++ b/tests/baselines/reference/commentOnAmbientModule.types @@ -5,7 +5,7 @@ declare module E { class foobar extends D.bar { >foobar : foobar ->D : unknown +>D : typeof D >bar : D.bar foo(); diff --git a/tests/baselines/reference/declFileGenericType.types b/tests/baselines/reference/declFileGenericType.types index 284ce8f475..50026cc3ae 100644 --- a/tests/baselines/reference/declFileGenericType.types +++ b/tests/baselines/reference/declFileGenericType.types @@ -147,14 +147,14 @@ export var g = C.F5>(); export class h extends C.A{ } >h : h ->C : unknown +>C : typeof C >A : C.A >C : unknown >B : C.B export interface i extends C.A { } >i : i ->C : unknown +>C : typeof C >A : C.A >C : unknown >B : C.B diff --git a/tests/baselines/reference/declFileGenericType2.types b/tests/baselines/reference/declFileGenericType2.types index f9345b5ff1..fed2caca7a 100644 --- a/tests/baselines/reference/declFileGenericType2.types +++ b/tests/baselines/reference/declFileGenericType2.types @@ -30,7 +30,7 @@ declare module templa.mvc { >templa : unknown >mvc : unknown >IModel : IModel ->mvc : unknown +>mvc : typeof mvc >IController : IController >ModelType : ModelType } @@ -42,7 +42,7 @@ declare module templa.mvc.composite { interface ICompositeControllerModel extends mvc.IModel { >ICompositeControllerModel : ICompositeControllerModel ->mvc : unknown +>mvc : typeof mvc >IModel : IModel getControllers(): mvc.IController[]; @@ -64,8 +64,8 @@ module templa.dom.mvc { >templa : unknown >mvc : unknown >IModel : templa.mvc.IModel ->templa : unknown ->mvc : unknown +>templa : typeof templa +>mvc : typeof templa.mvc >IController : templa.mvc.IController >ModelType : ModelType } @@ -82,8 +82,8 @@ module templa.dom.mvc { >templa : unknown >mvc : unknown >IModel : templa.mvc.IModel ->templa : unknown ->mvc : unknown +>templa : typeof templa +>mvc : typeof templa.mvc >AbstractController : templa.mvc.AbstractController >ModelType : ModelType >IElementController : IElementController @@ -110,9 +110,9 @@ module templa.dom.mvc.composite { >mvc : unknown >composite : unknown >ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel ->templa : unknown ->dom : unknown ->mvc : unknown +>templa : typeof templa +>dom : typeof dom +>mvc : typeof mvc >AbstractElementController : AbstractElementController >ModelType : ModelType diff --git a/tests/baselines/reference/declFileModuleContinuation.types b/tests/baselines/reference/declFileModuleContinuation.types index 671d9e6923..0080d7cbbf 100644 --- a/tests/baselines/reference/declFileModuleContinuation.types +++ b/tests/baselines/reference/declFileModuleContinuation.types @@ -15,7 +15,7 @@ module A.B.C { export class W implements A.C.Z { >W : W ->A : unknown +>A : typeof A >C : unknown >Z : A.C.Z } diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types index 34d263ef6b..818a31b26d 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types @@ -19,9 +19,9 @@ module X.Y.base { export class W extends A.B.Base.W { >W : W ->A : unknown ->B : unknown ->Base : unknown +>A : typeof A +>B : typeof A.B +>Base : typeof A.B.Base >W : A.B.Base.W name: string; @@ -38,9 +38,9 @@ module X.Y.base.Z { export class W extends X.Y.base.W { >W : W >TValue : TValue ->X : unknown ->Y : unknown ->base : unknown +>X : typeof X +>Y : typeof Y +>base : typeof base >W : base.W value: boolean; diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types index 8c5c4169cb..b2a1c15441 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types @@ -20,8 +20,8 @@ module X.A.B.C { } export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W ->X : unknown ->A : unknown +>X : typeof X +>A : typeof A >C : unknown >Z : X.A.C.Z } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types index 11afd69d94..e43d0b78f5 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types @@ -17,7 +17,7 @@ module X.A.B.C { export class W implements A.C.Z { // This can refer to it as A.C.Z >W : W ->A : unknown +>A : typeof A >C : unknown >Z : A.C.Z } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types index 0b17b2ce78..d45c2cf052 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types @@ -17,8 +17,8 @@ module X.A.B.C { export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W ->X : unknown ->A : unknown +>X : typeof X +>A : typeof A >C : unknown >Z : X.A.C.Z } diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.types b/tests/baselines/reference/declarationEmit_nameConflicts.types index f07a7fbb2a..e38c831493 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts.types @@ -119,13 +119,13 @@ export module M.Q { } export interface b extends M.b { } // ok >b : b ->M : unknown +>M : typeof M >b : M.C export interface I extends M.c.I { } // ok >I : I ->M : unknown ->c : unknown +>M : typeof M +>c : typeof M.N >I : M.c.I export module c { @@ -133,8 +133,8 @@ export module M.Q { export interface I extends M.c.I { } // ok >I : I ->M : unknown ->c : unknown +>M : typeof M +>c : typeof M.N >I : M.c.I } } diff --git a/tests/baselines/reference/declareDottedExtend.types b/tests/baselines/reference/declareDottedExtend.types index 5efcea51b2..6b529b5e00 100644 --- a/tests/baselines/reference/declareDottedExtend.types +++ b/tests/baselines/reference/declareDottedExtend.types @@ -14,12 +14,12 @@ import ab = A.B; class D extends ab.C{ } >D : D ->ab : unknown +>ab : typeof ab >C : ab.C class E extends A.B.C{ } >E : E ->A : unknown ->B : unknown +>A : typeof A +>B : typeof ab >C : ab.C diff --git a/tests/baselines/reference/es6ClassTest7.types b/tests/baselines/reference/es6ClassTest7.types index 9ac4a65b30..2ad5e88179 100644 --- a/tests/baselines/reference/es6ClassTest7.types +++ b/tests/baselines/reference/es6ClassTest7.types @@ -9,7 +9,7 @@ declare module M { class Bar extends M.Foo { >Bar : Bar ->M : unknown +>M : typeof M >Foo : M.Foo } diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index 16f89ab5a2..d160db9a06 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -29,7 +29,7 @@ module N { export class C3 extends M.B { >C3 : C3 ->M : unknown +>M : typeof M >B : M.B } } diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index 6525f201f5..769f6f5a60 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -60,7 +60,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // interesting stuff here @@ -72,7 +72,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel ->Backbone : unknown +>Backbone : typeof Backbone >Model : Backbone.Model // different interesting stuff here diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 2d39c0a465..1867d39070 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -191,9 +191,9 @@ module PortalFx.ViewModels.Controls.Validators { export class Validator extends Portal.Controls.Validators.Validator { >Validator : Validator >TValue : TValue ->Portal : unknown ->Controls : unknown ->Validators : unknown +>Portal : typeof Portal +>Controls : typeof Portal.Controls +>Validators : typeof Portal.Controls.Validators >Validator : Portal.Controls.Validators.Validator >TValue : TValue diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types index 1e744ce25c..eadf43d226 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types @@ -12,7 +12,7 @@ declare module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number ->EndGate : unknown +>EndGate : typeof EndGate >ICloneable : EndGate.ICloneable module EndGate.Tweening { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types index ad3182f62e..80e1a963d5 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types @@ -12,7 +12,7 @@ module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number ->EndGate : unknown +>EndGate : typeof EndGate >ICloneable : EndGate.ICloneable module EndGate.Tweening { diff --git a/tests/baselines/reference/importUsedInExtendsList1.types b/tests/baselines/reference/importUsedInExtendsList1.types index 7261c34e75..623b14e36a 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.types +++ b/tests/baselines/reference/importUsedInExtendsList1.types @@ -5,7 +5,7 @@ import foo = require('importUsedInExtendsList1_require'); class Sub extends foo.Super { } >Sub : Sub ->foo : unknown +>foo : typeof foo >Super : foo.Super var s: Sub; diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types index 2a71136613..69b2ebb608 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types @@ -14,13 +14,13 @@ module N { export class D1 extends M.C1 { } >D1 : D1 ->M : unknown +>M : typeof M >C1 : M.C1 export class D2 extends M.C2 { } >D2 : D2 >T : T ->M : unknown +>M : typeof M >C2 : M.C2 >T : T } diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt index 06abf0987d..f00c6923e8 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt @@ -1,15 +1,12 @@ -tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,29): error TS1005: ',' expected. -tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,32): error TS1005: '=>' expected. +tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: An interface can only extend a type reference. -==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (2 errors) ==== +==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (1 errors) ==== interface color {} interface blue extends color() { // error - ~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1005: '=>' expected. + ~~~~~~~ +!!! error TS2499: An interface can only extend a type reference. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js index a283722d6a..f2660dd64f 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.js @@ -7,5 +7,3 @@ interface blue extends color() { // error //// [interfaceMayNotBeExtendedWitACall.js] -(function () { -}); diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types index 7f0163cf1e..c4aec3ea8c 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.types @@ -4,7 +4,7 @@ module rionegrensis { export class caniventer extends Lanthanum.nitidus { >caniventer : caniventer ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >nitidus : Lanthanum.nitidus >petrophilus : unknown >minutilla : petrophilus.minutilla @@ -89,7 +89,7 @@ module rionegrensis { >veraecrucis : veraecrucis >T0 : T0 >T1 : T1 ->trivirgatus : unknown +>trivirgatus : typeof trivirgatus >mixtus : trivirgatus.mixtus >gabriellae : unknown >amicus : gabriellae.amicus @@ -514,7 +514,7 @@ module julianae { >oralis : oralis >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >psilurus : caurinus.psilurus cepapi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } @@ -751,7 +751,7 @@ module julianae { } export class sumatrana extends Lanthanum.jugularis { >sumatrana : sumatrana ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >jugularis : Lanthanum.jugularis wolffsohni() : Lanthanum.suillus { var x : Lanthanum.suillus; () => { var y = this; }; return x; } @@ -1276,7 +1276,7 @@ module julianae { } export class durangae extends dogramacii.aurata { >durangae : durangae ->dogramacii : unknown +>dogramacii : typeof dogramacii >aurata : dogramacii.aurata Californium() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } @@ -1429,7 +1429,7 @@ module Lanthanum { >nitidus : nitidus >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >gilbertii : argurus.gilbertii >lavali : unknown >thaeleri : lavali.thaeleri @@ -1598,7 +1598,7 @@ module Lanthanum { } export class megalonyx extends caurinus.johorensis { >megalonyx : megalonyx ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >caurinus : unknown >megaphyllus : caurinus.megaphyllus @@ -1984,7 +1984,7 @@ module rendalli { export class zuluensis extends julianae.steerii { >zuluensis : zuluensis ->julianae : unknown +>julianae : typeof julianae >steerii : julianae.steerii telfairi() : argurus.wetmorei { var x : argurus.wetmorei; () => { var y = this; }; return x; } @@ -2418,7 +2418,7 @@ module rendalli { >crenulata : crenulata >T0 : T0 >T1 : T1 ->trivirgatus : unknown +>trivirgatus : typeof trivirgatus >falconeri : trivirgatus.falconeri salvanius() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } @@ -2612,7 +2612,7 @@ module trivirgatus { >mixtus : mixtus >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >pygmaea : argurus.pygmaea >argurus : unknown >oreas : argurus.oreas @@ -3349,7 +3349,7 @@ module ruatanica { export class americanus extends imperfecta.ciliolabrum { >americanus : americanus ->imperfecta : unknown +>imperfecta : typeof imperfecta >ciliolabrum : imperfecta.ciliolabrum >argurus : unknown >germaini : argurus.germaini @@ -3418,7 +3418,7 @@ module lavali { export class wilsoni extends Lanthanum.nitidus { >wilsoni : wilsoni ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >nitidus : Lanthanum.nitidus >rionegrensis : unknown >caniventer : rionegrensis.caniventer @@ -3638,7 +3638,7 @@ module lavali { } export class otion extends howi.coludo { >otion : otion ->howi : unknown +>howi : typeof howi >coludo : howi.coludo >argurus : unknown >oreas : argurus.oreas @@ -4112,7 +4112,7 @@ module lavali { } export class thaeleri extends argurus.oreas { >thaeleri : thaeleri ->argurus : unknown +>argurus : typeof argurus >oreas : argurus.oreas coromandra() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; } @@ -4275,7 +4275,7 @@ module lavali { } export class lepturus extends Lanthanum.suillus { >lepturus : lepturus ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >suillus : Lanthanum.suillus >dammermani : unknown >melanops : dammermani.melanops @@ -4350,7 +4350,7 @@ module dogramacii { export class robustulus extends lavali.wilsoni { >robustulus : robustulus ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni fossor() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } @@ -4924,7 +4924,7 @@ module lutreolus { export class schlegeli extends lavali.beisa { >schlegeli : schlegeli ->lavali : unknown +>lavali : typeof lavali >beisa : lavali.beisa mittendorfi() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } @@ -5661,7 +5661,7 @@ module panglima { >amphibius : amphibius >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >Lanthanum : unknown >nitidus : Lanthanum.nitidus @@ -5794,7 +5794,7 @@ module panglima { >fundatus : fundatus >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >schlegeli : lutreolus.schlegeli crassulus(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } @@ -5899,7 +5899,7 @@ module panglima { >abidi : abidi >T0 : T0 >T1 : T1 ->argurus : unknown +>argurus : typeof argurus >dauricus : argurus.dauricus >argurus : unknown >germaini : argurus.germaini @@ -6113,7 +6113,7 @@ module minutus { >himalayana : himalayana >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus simoni(): argurus.netscheri> { var x: argurus.netscheri>; () => { var y = this; }; return x; } @@ -6356,7 +6356,7 @@ module caurinus { >mahaganus : mahaganus >T0 : T0 >T1 : T1 ->panglima : unknown +>panglima : typeof panglima >fundatus : panglima.fundatus >quasiater : unknown >carolinensis : quasiater.carolinensis @@ -6584,7 +6584,7 @@ module howi { >angulatus : angulatus >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni pennatus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } @@ -6791,7 +6791,7 @@ module sagitta { export class walkeri extends minutus.portoricensis { >walkeri : walkeri ->minutus : unknown +>minutus : typeof minutus >portoricensis : minutus.portoricensis maracajuensis(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } @@ -6822,7 +6822,7 @@ module minutus { >inez : inez >T0 : T0 >T1 : T1 ->samarensis : unknown +>samarensis : typeof samarensis >pelurus : samarensis.pelurus >argurus : unknown >germaini : argurus.germaini @@ -6855,7 +6855,7 @@ module macrorhinos { export class konganensis extends imperfecta.lasiurus { >konganensis : konganensis ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >caurinus : unknown >psilurus : caurinus.psilurus @@ -6870,7 +6870,7 @@ module panamensis { >linulus : linulus >T0 : T0 >T1 : T1 ->ruatanica : unknown +>ruatanica : typeof ruatanica >hector : ruatanica.hector >julianae : unknown >sumatrana : julianae.sumatrana @@ -7330,7 +7330,7 @@ module samarensis { >pelurus : pelurus >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni Palladium(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } @@ -7587,7 +7587,7 @@ module samarensis { >fuscus : fuscus >T0 : T0 >T1 : T1 ->macrorhinos : unknown +>macrorhinos : typeof macrorhinos >daphaenodon : macrorhinos.daphaenodon planifrons(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } @@ -8064,7 +8064,7 @@ module sagitta { >leptoceros : leptoceros >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >johorensis : caurinus.johorensis >argurus : unknown >peninsulae : argurus.peninsulae @@ -8175,7 +8175,7 @@ module daubentonii { >nigricans : nigricans >T0 : T0 >T1 : T1 ->sagitta : unknown +>sagitta : typeof sagitta >stolzmanni : sagitta.stolzmanni woosnami(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } @@ -8207,7 +8207,7 @@ module argurus { >pygmaea : pygmaea >T0 : T0 >T1 : T1 ->rendalli : unknown +>rendalli : typeof rendalli >moojeni : rendalli.moojeni >macrorhinos : unknown >konganensis : macrorhinos.konganensis @@ -8258,7 +8258,7 @@ module chrysaeolus { >sarasinorum : sarasinorum >T0 : T0 >T1 : T1 ->caurinus : unknown +>caurinus : typeof caurinus >psilurus : caurinus.psilurus belzebul(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } @@ -8500,7 +8500,7 @@ module argurus { export class oreas extends lavali.wilsoni { >oreas : oreas ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni salamonis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } @@ -9129,7 +9129,7 @@ module provocax { export class melanoleuca extends lavali.wilsoni { >melanoleuca : melanoleuca ->lavali : unknown +>lavali : typeof lavali >wilsoni : lavali.wilsoni Neodymium(): macrorhinos.marmosurus, lutreolus.foina> { var x: macrorhinos.marmosurus, lutreolus.foina>; () => { var y = this; }; return x; } @@ -9275,7 +9275,7 @@ module howi { export class marcanoi extends Lanthanum.megalonyx { >marcanoi : marcanoi ->Lanthanum : unknown +>Lanthanum : typeof Lanthanum >megalonyx : Lanthanum.megalonyx formosae(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } @@ -10362,7 +10362,7 @@ module gabriellae { >klossii : klossii >T0 : T0 >T1 : T1 ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >dogramacii : unknown >robustulus : dogramacii.robustulus @@ -10871,7 +10871,7 @@ module imperfecta { >ciliolabrum : ciliolabrum >T0 : T0 >T1 : T1 ->dogramacii : unknown +>dogramacii : typeof dogramacii >robustulus : dogramacii.robustulus leschenaultii(): argurus.dauricus> { var x: argurus.dauricus>; () => { var y = this; }; return x; } @@ -11034,7 +11034,7 @@ module petrophilus { >sodyi : sodyi >T0 : T0 >T1 : T1 ->quasiater : unknown +>quasiater : typeof quasiater >bobrinskoi : quasiater.bobrinskoi saundersiae(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } @@ -11167,7 +11167,7 @@ module caurinus { export class megaphyllus extends imperfecta.lasiurus> { >megaphyllus : megaphyllus ->imperfecta : unknown +>imperfecta : typeof imperfecta >lasiurus : imperfecta.lasiurus >julianae : unknown >acariensis : julianae.acariensis @@ -11600,7 +11600,7 @@ module lutreolus { >cor : cor >T0 : T0 >T1 : T1 ->panglima : unknown +>panglima : typeof panglima >fundatus : panglima.fundatus >panamensis : unknown >linulus : panamensis.linulus @@ -11846,7 +11846,7 @@ module argurus { export class germaini extends gabriellae.amicus { >germaini : germaini ->gabriellae : unknown +>gabriellae : typeof gabriellae >amicus : gabriellae.amicus sharpei(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } @@ -12058,7 +12058,7 @@ module dammermani { export class melanops extends minutus.inez { >melanops : melanops ->minutus : unknown +>minutus : typeof minutus >inez : minutus.inez >sagitta : unknown >stolzmanni : sagitta.stolzmanni @@ -12307,7 +12307,7 @@ module argurus { export class peninsulae extends patas.uralensis { >peninsulae : peninsulae ->patas : unknown +>patas : typeof patas >uralensis : patas.uralensis aitkeni(): trivirgatus.mixtus, panglima.amphibius> { var x: trivirgatus.mixtus, panglima.amphibius>; () => { var y = this; }; return x; } @@ -12771,7 +12771,7 @@ module ruatanica { >Praseodymium : Praseodymium >T0 : T0 >T1 : T1 ->ruatanica : unknown +>ruatanica : typeof ruatanica >hector : hector >lutreolus : unknown >punicus : lutreolus.punicus @@ -13118,7 +13118,7 @@ module caurinus { >johorensis : johorensis >T0 : T0 >T1 : T1 ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus maini(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } @@ -13564,7 +13564,7 @@ module caurinus { export class psilurus extends lutreolus.punicus { >psilurus : psilurus ->lutreolus : unknown +>lutreolus : typeof lutreolus >punicus : lutreolus.punicus socialis(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index c9ec44b8cd..a04b42074d 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,13 +1,12 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS1133: Type reference expected. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,30): error TS1005: ';' expected. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location. -==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (7 errors) ==== +==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (6 errors) ==== //'this' in static member initializer class ErrClass1 { static t = this; // Error @@ -53,9 +52,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): class ErrClass3 extends this { ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. } diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index f21ebedc1e..5720156de0 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -94,14 +94,13 @@ var M; //'this' as a type argument function genericFunc(x) { } genericFunc < this > (undefined); // Should be an error -var ErrClass3 = (function () { +var ErrClass3 = (function (_super) { + __extends(ErrClass3, _super); function ErrClass3() { + _super.apply(this, arguments); } return ErrClass3; -})(); -this; -{ -} +})(this); //'this' as a computed enum value var SomeEnum; (function (SomeEnum) { diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index 0453d3ed31..90264376a8 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,14 +1,13 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS1133: Type reference expected. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,30): error TS1005: ';' expected. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (8 errors) ==== +==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (7 errors) ==== //'this' in static member initializer class ErrClass1 { static t = this; // Error @@ -54,9 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod class ErrClass3 extends this { ~~~~ -!!! error TS1133: Type reference expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. } diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index e9fddd380b..eee8bcc848 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -94,14 +94,13 @@ var M; //'this' as a type argument function genericFunc(x) { } genericFunc < this > (undefined); // Should be an error -var ErrClass3 = (function () { +var ErrClass3 = (function (_super) { + __extends(ErrClass3, _super); function ErrClass3() { + _super.apply(this, arguments); } return ErrClass3; -})(); -this; -{ -} +})(this); //'this' as a computed enum value var SomeEnum; (function (SomeEnum) { diff --git a/tests/cases/fourslash/completionListInExtendsClause.ts b/tests/cases/fourslash/completionListInExtendsClause.ts index ee2acc6a12..87cd2ddec0 100644 --- a/tests/cases/fourslash/completionListInExtendsClause.ts +++ b/tests/cases/fourslash/completionListInExtendsClause.ts @@ -17,9 +17,9 @@ ////interface test3 extends IFoo./*3*/ {} ////interface test4 implements Foo./*4*/ {} - +debugger; goTo.marker("1"); -verify.completionListIsEmpty(); +verify.not.completionListIsEmpty(); goTo.marker("2"); verify.completionListIsEmpty(); @@ -28,4 +28,4 @@ goTo.marker("3"); verify.completionListIsEmpty(); goTo.marker("4"); -verify.completionListIsEmpty(); \ No newline at end of file +verify.not.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts index 53840fc3bd..2bfa9e265f 100644 --- a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts +++ b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts @@ -15,11 +15,11 @@ ////} //// ////(new C()).[|abc|]; - test.ranges().forEach(r => { goTo.position(r.start); test.ranges().forEach(range => { + debugger; verify.occurrencesAtPositionContains(range); }); verify.occurrencesAtPositionCount(test.ranges().length); diff --git a/tests/cases/fourslash/semanticClassification1.ts b/tests/cases/fourslash/semanticClassification1.ts index 4eb7f2a32e..eb04aca9d7 100644 --- a/tests/cases/fourslash/semanticClassification1.ts +++ b/tests/cases/fourslash/semanticClassification1.ts @@ -7,6 +7,7 @@ //// interface /*2*/X extends /*3*/M./*4*/I { } var c = classification; +debugger; verify.semanticClassificationsAre( c.moduleName("M", test.marker("0").position), c.interfaceName("I", test.marker("1").position), From 1bdcaa3d43db6a44bed574f93de3d422bb47bf04 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 31 Mar 2015 13:54:33 -0700 Subject: [PATCH 30/42] added tests for import\export elision --- ...eCompilationImportExportElision.errors.txt | 28 ++++++++++++++ .../separateCompilationImportExportElision.js | 37 +++++++++++++++++++ .../separateCompilationImportExportElision.ts | 17 +++++++++ 3 files changed, 82 insertions(+) create mode 100644 tests/baselines/reference/separateCompilationImportExportElision.errors.txt create mode 100644 tests/baselines/reference/separateCompilationImportExportElision.js create mode 100644 tests/cases/compiler/separateCompilationImportExportElision.ts diff --git a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt new file mode 100644 index 0000000000..db418681e8 --- /dev/null +++ b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find external module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find external module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find external module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find external module 'module'. + + +==== tests/cases/compiler/separateCompilationImportExportElision.ts (4 errors) ==== + + import {c} from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + import {c2} from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + import * as ns from "module" + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + + class C extends c2.C { + } + + let x = new c(); + let y = ns.value; + + export {c1} from "module"; + ~~~~~~~~ +!!! error TS2307: Cannot find external module 'module'. + export var z = x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationImportExportElision.js b/tests/baselines/reference/separateCompilationImportExportElision.js new file mode 100644 index 0000000000..2d255798c3 --- /dev/null +++ b/tests/baselines/reference/separateCompilationImportExportElision.js @@ -0,0 +1,37 @@ +//// [separateCompilationImportExportElision.ts] + +import {c} from "module" +import {c2} from "module" +import * as ns from "module" + +class C extends c2.C { +} + +let x = new c(); +let y = ns.value; + +export {c1} from "module"; +export var z = x; + +//// [separateCompilationImportExportElision.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 module_1 = require("module"); +var module_2 = require("module"); +var ns = require("module"); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(module_2.c2.C); +var x = new module_1.c(); +var y = ns.value; +var module_3 = require("module"); +exports.c1 = module_3.c1; +exports.z = x; diff --git a/tests/cases/compiler/separateCompilationImportExportElision.ts b/tests/cases/compiler/separateCompilationImportExportElision.ts new file mode 100644 index 0000000000..d7af74a1a6 --- /dev/null +++ b/tests/cases/compiler/separateCompilationImportExportElision.ts @@ -0,0 +1,17 @@ +// @separateCompilation: true +// @target: es5 +// @module: commonjs + +// @filename: file1.ts +import {c} from "module" +import {c2} from "module" +import * as ns from "module" + +class C extends c2.C { +} + +let x = new c(); +let y = ns.value; + +export {c1} from "module"; +export var z = x; \ No newline at end of file From f7aaf096038a291c9ddfe718e78489de67976f3f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 13:23:46 -0700 Subject: [PATCH 31/42] Add support for parsing and emitting class expressions. --- src/compiler/binder.ts | 11 +- src/compiler/checker.ts | 23 +- .../diagnosticInformationMap.generated.ts | 2 + src/compiler/diagnosticMessages.json | 8 + src/compiler/emitter.ts | 185 +- src/compiler/parser.ts | 68 +- src/compiler/types.ts | 9 +- src/compiler/utilities.ts | 6 +- .../baselines/reference/APISample_compile.js | 115 +- .../reference/APISample_compile.types | 126 +- tests/baselines/reference/APISample_linter.js | 131 +- .../reference/APISample_linter.types | 126 +- .../reference/APISample_linter.types.pull | 6384 ----------------- .../reference/APISample_transform.js | 115 +- .../reference/APISample_transform.types | 126 +- .../baselines/reference/APISample_watcher.js | 115 +- .../reference/APISample_watcher.types | 126 +- .../reference/classExpression.errors.txt | 30 +- tests/baselines/reference/classExpression.js | 13 +- .../reference/classExpression1.errors.txt | 7 + tests/baselines/reference/classExpression1.js | 9 + .../reference/classExpression2.errors.txt | 8 + tests/baselines/reference/classExpression2.js | 17 + .../reference/classExpressionES61.errors.txt | 7 + .../reference/classExpressionES61.js | 7 + .../reference/classExpressionES62.errors.txt | 8 + .../reference/classExpressionES62.js | 10 + .../reference/classInsideBlock.errors.txt | 9 + tests/baselines/reference/classInsideBlock.js | 13 + .../exportAssignNonIdentifier.errors.txt | 6 +- .../reference/exportAssignNonIdentifier.js | 3 +- .../reference/externModule.errors.txt | 11 +- tests/baselines/reference/externModule.js | 15 +- .../nestedClassDeclaration.errors.txt | 8 +- .../reference/nestedClassDeclaration.js | 13 +- ...rErrorRecovery_SwitchStatement2.errors.txt | 7 +- .../parserErrorRecovery_SwitchStatement2.js | 10 +- ...dentifiersInVariableStatements1.errors.txt | 5 +- ...InvalidIdentifiersInVariableStatements1.js | 6 + .../reference/withStatementErrors.errors.txt | 6 +- .../reference/withStatementErrors.js | 14 +- .../classDeclarations/classInsideBlock.ts | 3 + .../classExpressions/classExpression1.ts | 1 + .../classExpressions/classExpression2.ts | 2 + .../classExpressions/classExpressionES61.ts | 2 + .../classExpressions/classExpressionES62.ts | 3 + .../fourslash/getOccurrencesReturnBroken.ts | 4 +- .../fourslash/identifierErrorRecovery.ts | 2 +- 48 files changed, 906 insertions(+), 7029 deletions(-) delete mode 100644 tests/baselines/reference/APISample_linter.types.pull create mode 100644 tests/baselines/reference/classExpression1.errors.txt create mode 100644 tests/baselines/reference/classExpression1.js create mode 100644 tests/baselines/reference/classExpression2.errors.txt create mode 100644 tests/baselines/reference/classExpression2.js create mode 100644 tests/baselines/reference/classExpressionES61.errors.txt create mode 100644 tests/baselines/reference/classExpressionES61.js create mode 100644 tests/baselines/reference/classExpressionES62.errors.txt create mode 100644 tests/baselines/reference/classExpressionES62.js create mode 100644 tests/baselines/reference/classInsideBlock.errors.txt create mode 100644 tests/baselines/reference/classInsideBlock.js create mode 100644 tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts create mode 100644 tests/cases/conformance/classes/classExpressions/classExpression1.ts create mode 100644 tests/cases/conformance/classes/classExpressions/classExpression2.ts create mode 100644 tests/cases/conformance/es6/classExpressions/classExpressionES61.ts create mode 100644 tests/cases/conformance/es6/classExpressions/classExpressionES62.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 304777e040..d3dafb61e7 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -126,6 +126,7 @@ module ts { return (node).isExportEquals ? "export=" : "default"; case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: return node.flags & NodeFlags.Default ? "default" : undefined; } } @@ -168,7 +169,7 @@ module ts { addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === SyntaxKind.ClassDeclaration && symbol.exports) { + if ((node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression) && symbol.exports) { // TypeScript 1.0 spec (April 2014): 8.4 // Every class automatically contains a static property member named 'prototype', // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. @@ -286,6 +287,7 @@ module ts { case SyntaxKind.ArrowFunction: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; + case SyntaxKind.ClassExpression: case SyntaxKind.ClassDeclaration: if (node.flags & NodeFlags.Static) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -485,6 +487,9 @@ module ts { case SyntaxKind.ArrowFunction: bindAnonymousDeclaration(node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true); break; + case SyntaxKind.ClassExpression: + bindAnonymousDeclaration(node, SymbolFlags.Class, "__class", /*isBlockScopeContainer*/ false); + break; case SyntaxKind.CatchClause: bindCatchVariableDeclaration(node); break; @@ -584,9 +589,9 @@ module ts { // containing class. if (node.flags & NodeFlags.AccessibilityModifier && node.parent.kind === SyntaxKind.Constructor && - node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + (node.parent.parent.kind === SyntaxKind.ClassDeclaration || node.parent.parent.kind === SyntaxKind.ClassExpression)) { - let classDeclaration = node.parent.parent; + let classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes); } } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e6594ee271..02dfc70c6d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -422,8 +422,15 @@ module ts { result = argumentsSymbol; break loop; } - let id = (location).name; - if (id && name === id.text) { + let functionName = (location).name; + if (functionName && name === functionName.text) { + result = location.symbol; + break loop; + } + break; + case SyntaxKind.ClassExpression: + let className = (location).name; + if (className && name === className.text) { result = location.symbol; break loop; } @@ -7991,6 +7998,8 @@ module ts { return checkTypeAssertion(node); case SyntaxKind.ParenthesizedExpression: return checkExpression((node).expression, contextualMapper); + case SyntaxKind.ClassExpression: + return checkClassExpression(node); case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -9732,8 +9741,18 @@ module ts { } } + function checkClassExpression(node: ClassExpression): Type { + grammarErrorOnNode(node, Diagnostics.class_expressions_are_not_currently_supported); + forEach(node.members, checkSourceElement); + return unknownType; + } + function checkClassDeclaration(node: ClassDeclaration) { // Grammar checking + if (node.parent.kind !== SyntaxKind.ModuleBlock && node.parent.kind !== SyntaxKind.SourceFile) { + grammarErrorOnNode(node, Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); + } + checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 22e3a81ff3..0686a18c76 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -501,5 +501,7 @@ module ts { yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, Only_type_references_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only type references are currently supported in a class 'extends' clauses." }, + class_expressions_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, + class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 347ae08460..4c98702a94 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1997,5 +1997,13 @@ "Only type references are currently supported in a class 'extends' clauses.": { "category": "Error", "code": 9002 + }, + "'class' expressions are not currently supported.": { + "category": "Error", + "code": 9003 + }, + "'class' declarations are only supported directly inside a module or as a top level declaration.": { + "category": "Error", + "code": 9004 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 09e721c9cf..60a09fb20e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3193,7 +3193,7 @@ module ts { } } - function emitMemberAssignments(node: ClassDeclaration, staticFlag: NodeFlags) { + function emitMemberAssignments(node: ClassLikeDeclaration, staticFlag: NodeFlags) { forEach(node.members, member => { if (member.kind === SyntaxKind.PropertyDeclaration && (member.flags & NodeFlags.Static) === staticFlag && (member).initializer) { writeLine(); @@ -3217,7 +3217,7 @@ module ts { }); } - function emitMemberFunctionsForES5AndLower(node: ClassDeclaration) { + function emitMemberFunctionsForES5AndLower(node: ClassLikeDeclaration) { forEach(node.members, member => { if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) { if (!(member).body) { @@ -3287,7 +3287,7 @@ module ts { }); } - function emitMemberFunctionsForES6AndHigher(node: ClassDeclaration) { + function emitMemberFunctionsForES6AndHigher(node: ClassLikeDeclaration) { for (let member of node.members) { if ((member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) && !(member).body) { emitOnlyPinnedOrTripleSlashComments(member); @@ -3314,7 +3314,7 @@ module ts { } } - function emitConstructor(node: ClassDeclaration, baseTypeElement: HeritageClauseElement) { + function emitConstructor(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; @@ -3435,82 +3435,92 @@ module ts { tempParameters = saveTempParameters; } + function emitClassExpression(node: ClassExpression) { + return emitClassLikeDeclaration(node); + } + function emitClassDeclaration(node: ClassDeclaration) { + return emitClassLikeDeclaration(node); + } + + function emitClassLikeDeclaration(node: ClassLikeDeclaration) { if (languageVersion < ScriptTarget.ES6) { - emitClassDeclarationBelowES6(node); + emitClassLikeDeclarationBelowES6(node); } else { - emitClassDeclarationForES6AndHigher(node); + emitClassLikeDeclarationForES6AndHigher(node); } } - function emitClassDeclarationForES6AndHigher(node: ClassDeclaration) { + function emitClassLikeDeclarationForES6AndHigher(node: ClassLikeDeclaration) { let thisNodeIsDecorated = nodeIsDecorated(node); - if (thisNodeIsDecorated) { - // To preserve the correct runtime semantics when decorators are applied to the class, - // the emit needs to follow one of the following rules: - // - // * For a local class declaration: - // - // @dec class C { - // } - // - // The emit should be: - // - // let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For an exported class declaration: - // - // @dec export class C { - // } - // - // The emit should be: - // - // export let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For a default export of a class declaration with a name: - // - // @dec default export class C { - // } - // - // The emit should be: - // - // let C = class { - // } - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // export default C; - // - // * For a default export of a class declaration without a name: - // - // @dec default export class { - // } - // - // The emit should be: - // - // let _default = class { - // } - // _default = __decorate([dec], _default); - // export default _default; - // - if (isES6ExportedDeclaration(node) && !(node.flags & NodeFlags.Default)) { - write("export "); - } + if (node.kind === SyntaxKind.ClassDeclaration) { + if (thisNodeIsDecorated) { + // To preserve the correct runtime semantics when decorators are applied to the class, + // the emit needs to follow one of the following rules: + // + // * For a local class declaration: + // + // @dec class C { + // } + // + // The emit should be: + // + // let C = class { + // }; + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // + // * For an exported class declaration: + // + // @dec export class C { + // } + // + // The emit should be: + // + // export let C = class { + // }; + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // + // * For a default export of a class declaration with a name: + // + // @dec default export class C { + // } + // + // The emit should be: + // + // let C = class { + // } + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // C = __decorate([dec], C); + // export default C; + // + // * For a default export of a class declaration without a name: + // + // @dec default export class { + // } + // + // The emit should be: + // + // let _default = class { + // } + // _default = __decorate([dec], _default); + // export default _default; + // + if (isES6ExportedDeclaration(node) && !(node.flags & NodeFlags.Default)) { + write("export "); + } - write("let "); - emitDeclarationName(node); - write(" = "); - } - else if (isES6ExportedDeclaration(node)) { - write("export "); - if (node.flags & NodeFlags.Default) { - write("default "); + write("let "); + emitDeclarationName(node); + write(" = "); + } + else if (isES6ExportedDeclaration(node)) { + write("export "); + if (node.flags & NodeFlags.Default) { + write("default "); + } } } @@ -3588,10 +3598,14 @@ module ts { } } - function emitClassDeclarationBelowES6(node: ClassDeclaration) { - write("var "); - emitDeclarationName(node); - write(" = (function ("); + function emitClassLikeDeclarationBelowES6(node: ClassLikeDeclaration) { + if (node.kind === SyntaxKind.ClassDeclaration) { + write("var "); + emitDeclarationName(node); + write(" = "); + } + + write("(function ("); let baseTypeNode = getClassBaseTypeNode(node); if (baseTypeNode) { write("_super"); @@ -3641,30 +3655,35 @@ module ts { if (baseTypeNode) { emit(baseTypeNode.expression); } - write(");"); + write(")"); + if (node.kind === SyntaxKind.ClassDeclaration) { + write(";"); + } emitEnd(node); - emitExportMemberAssignment(node); + if (node.kind === SyntaxKind.ClassDeclaration) { + emitExportMemberAssignment(node); + } if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } } - function emitClassMemberPrefix(node: ClassDeclaration, member: Node) { + function emitClassMemberPrefix(node: ClassLikeDeclaration, member: Node) { emitDeclarationName(node); if (!(member.flags & NodeFlags.Static)) { write(".prototype"); } } - function emitDecoratorsOfClass(node: ClassDeclaration) { + function emitDecoratorsOfClass(node: ClassLikeDeclaration) { emitDecoratorsOfMembers(node, /*staticFlag*/ 0); emitDecoratorsOfMembers(node, NodeFlags.Static); emitDecoratorsOfConstructor(node); } - function emitDecoratorsOfConstructor(node: ClassDeclaration) { + function emitDecoratorsOfConstructor(node: ClassLikeDeclaration) { let constructor = getFirstConstructorWithBody(node); if (constructor) { emitDecoratorsOfParameters(node, constructor); @@ -3696,7 +3715,7 @@ module ts { writeLine(); } - function emitDecoratorsOfMembers(node: ClassDeclaration, staticFlag: NodeFlags) { + function emitDecoratorsOfMembers(node: ClassLikeDeclaration, staticFlag: NodeFlags) { forEach(node.members, member => { if ((member.flags & NodeFlags.Static) !== staticFlag) { return; @@ -3800,7 +3819,7 @@ module ts { }); } - function emitDecoratorsOfParameters(node: ClassDeclaration, member: FunctionLikeDeclaration) { + function emitDecoratorsOfParameters(node: ClassLikeDeclaration, member: FunctionLikeDeclaration) { forEach(member.parameters, (parameter, parameterIndex) => { if (!nodeIsDecorated(parameter)) { return; @@ -4768,6 +4787,8 @@ var __decorate = this.__decorate || function (decorators, target, key, value) { return emitDebuggerStatement(node); case SyntaxKind.VariableDeclaration: return emitVariableDeclaration(node); + case SyntaxKind.ClassExpression: + return emitClassExpression(node); case SyntaxKind.ClassDeclaration: return emitClassDeclaration(node); case SyntaxKind.InterfaceDeclaration: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 49bd301dc7..f728536e72 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -237,12 +237,13 @@ module ts { case SyntaxKind.Decorator: return visitNode(cbNode, (node).expression); case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, (node).name) || - visitNodes(cbNodes, (node).typeParameters) || - visitNodes(cbNodes, (node).heritageClauses) || - visitNodes(cbNodes, (node).members); + visitNode(cbNode, (node).name) || + visitNodes(cbNodes, (node).typeParameters) || + visitNodes(cbNodes, (node).heritageClauses) || + visitNodes(cbNodes, (node).members); case SyntaxKind.InterfaceDeclaration: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || @@ -2899,6 +2900,7 @@ module ts { case SyntaxKind.OpenBracketToken: case SyntaxKind.OpenBraceToken: case SyntaxKind.FunctionKeyword: + case SyntaxKind.ClassKeyword: case SyntaxKind.NewKeyword: case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: @@ -2944,8 +2946,12 @@ module ts { } function isStartOfExpressionStatement(): boolean { - // As per the grammar, neither '{' nor 'function' can start an expression statement. - return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && token !== SyntaxKind.AtToken && isStartOfExpression(); + // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. + return token !== SyntaxKind.OpenBraceToken && + token !== SyntaxKind.FunctionKeyword && + token !== SyntaxKind.ClassKeyword && + token !== SyntaxKind.AtToken && + isStartOfExpression(); } function parseExpression(): Expression { @@ -3290,8 +3296,12 @@ module ts { return parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ false); } - if (isStartOfStatement(/*inErrorRecovery:*/ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { - // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) + if (isStartOfStatement(/*inErrorRecovery:*/ true) && + !isStartOfExpressionStatement() && + token !== SyntaxKind.FunctionKeyword && + token !== SyntaxKind.ClassKeyword) { + + // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations) // // Here we try to recover from a potential error situation in the case where the // user meant to supply a block. For example, if the user wrote: @@ -3763,6 +3773,8 @@ module ts { return parseArrayLiteralExpression(); case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(); + case SyntaxKind.ClassKeyword: + return parseClassExpression(); case SyntaxKind.FunctionKeyword: return parseFunctionExpression(); case SyntaxKind.NewKeyword: @@ -4183,13 +4195,14 @@ module ts { } function isStartOfStatement(inErrorRecovery: boolean): boolean { - // Functions and variable statements are allowed as a statement. But as per the grammar, - // they also allow modifiers. So we have to check for those statements that might be - // following modifiers.This ensures that things work properly when incrementally parsing - // as the parser will produce the same FunctionDeclaraiton or VariableStatement if it has - // the same text regardless of whether it is inside a block or not. + // Functions, variable statements and classes are allowed as a statement. But as per + // the grammar, they also allow modifiers. So we have to check for those statements + // that might be following modifiers.This ensures that things work properly when + // incrementally parsing as the parser will produce the same FunctionDeclaraiton, + // VariableStatement or ClassDeclaration, if it has the same text regardless of whether + // it is inside a block or not. if (isModifier(token)) { - let result = lookAhead(parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers); + let result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return true; } @@ -4208,6 +4221,7 @@ module ts { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: case SyntaxKind.FunctionKeyword: + case SyntaxKind.ClassKeyword: case SyntaxKind.IfKeyword: case SyntaxKind.DoKeyword: case SyntaxKind.WhileKeyword: @@ -4232,7 +4246,6 @@ module ts { let isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; case SyntaxKind.InterfaceKeyword: - case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.TypeKeyword: @@ -4276,6 +4289,8 @@ module ts { return parseVariableStatement(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); + case SyntaxKind.ClassKeyword: + return parseClassDeclaration(scanner.getStartPos(), /*decorators*/ undefined, /*modifiers:*/ undefined); case SyntaxKind.SemicolonToken: return parseEmptyStatement(); case SyntaxKind.IfKeyword: @@ -4321,7 +4336,7 @@ module ts { // Even though variable statements and function declarations cannot have decorators, // we parse them here to provide better error recovery. if (isModifier(token) || token === SyntaxKind.AtToken) { - let result = tryParse(parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers); + let result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; } @@ -4331,7 +4346,7 @@ module ts { } } - function parseVariableStatementOrFunctionDeclarationWithDecoratorsOrModifiers(): FunctionDeclaration | VariableStatement { + function parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers(): FunctionDeclaration | VariableStatement | ClassDeclaration { let start = scanner.getStartPos(); let decorators = parseDecorators(); let modifiers = parseModifiers(); @@ -4351,8 +4366,12 @@ module ts { case SyntaxKind.VarKeyword: return parseVariableStatement(start, decorators, modifiers); + case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(start, decorators, modifiers); + + case SyntaxKind.ClassKeyword: + return parseClassDeclaration(start, decorators, modifiers); } return undefined; @@ -4711,14 +4730,26 @@ module ts { Debug.fail("Should not have attempted to parse class member declaration."); } + function parseClassExpression(): ClassExpression { + return parseClassDeclarationOrExpression( + /*fullStart:*/ scanner.getStartPos(), + /*decorators:*/ undefined, + /*modifiers:*/ undefined, + SyntaxKind.ClassExpression); + } + function parseClassDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray): ClassDeclaration { + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, SyntaxKind.ClassDeclaration); + } + + 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); } - var node = createNode(SyntaxKind.ClassDeclaration, fullStart); + var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(SyntaxKind.ClassKeyword); @@ -5327,6 +5358,7 @@ module ts { case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.ParenthesizedExpression: case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ClassExpression: case SyntaxKind.FunctionExpression: case SyntaxKind.Identifier: case SyntaxKind.RegularExpressionLiteral: diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a9a04c3bd3..08c8985b14 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -203,6 +203,7 @@ module ts { TemplateExpression, YieldExpression, SpreadElementExpression, + ClassExpression, OmittedExpression, // Misc TemplateSpan, @@ -855,13 +856,19 @@ module ts { _moduleElementBrand: any; } - export interface ClassDeclaration extends Declaration, ModuleElement { + export interface ClassLikeDeclaration extends Declaration { name?: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; members: NodeArray; } + export interface ClassDeclaration extends ClassLikeDeclaration, Statement { + } + + export interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { + } + export interface ClassElement extends Declaration { _classElementBrand: any; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 761e1cdb4d..e8d4ca66e0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -279,6 +279,7 @@ module ts { case SyntaxKind.VariableDeclaration: case SyntaxKind.BindingElement: case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.EnumDeclaration: @@ -670,6 +671,7 @@ module ts { case SyntaxKind.TypeAssertionExpression: case SyntaxKind.ParenthesizedExpression: case SyntaxKind.FunctionExpression: + case SyntaxKind.ClassExpression: case SyntaxKind.ArrowFunction: case SyntaxKind.VoidExpression: case SyntaxKind.DeleteExpression: @@ -942,7 +944,7 @@ module ts { node.kind === SyntaxKind.ExportAssignment && (node).expression.kind === SyntaxKind.Identifier; } - export function getClassBaseTypeNode(node: ClassDeclaration) { + export function getClassBaseTypeNode(node: ClassLikeDeclaration) { let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } @@ -1573,7 +1575,7 @@ module ts { return getLineAndCharacterOfPosition(currentSourceFile, pos).line; } - export function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { + export function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration { return forEach(node.members, member => { if (member.kind === SyntaxKind.Constructor && nodeIsPresent((member).body)) { return member; diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 92711f4b75..9bbd1bb1af 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -233,60 +233,61 @@ declare module "typescript" { TemplateExpression = 171, YieldExpression = 172, SpreadElementExpression = 173, - OmittedExpression = 174, - TemplateSpan = 175, - HeritageClauseElement = 176, - Block = 177, - VariableStatement = 178, - EmptyStatement = 179, - ExpressionStatement = 180, - IfStatement = 181, - DoStatement = 182, - WhileStatement = 183, - ForStatement = 184, - ForInStatement = 185, - ForOfStatement = 186, - ContinueStatement = 187, - BreakStatement = 188, - ReturnStatement = 189, - WithStatement = 190, - SwitchStatement = 191, - LabeledStatement = 192, - ThrowStatement = 193, - TryStatement = 194, - DebuggerStatement = 195, - VariableDeclaration = 196, - VariableDeclarationList = 197, - FunctionDeclaration = 198, - ClassDeclaration = 199, - InterfaceDeclaration = 200, - TypeAliasDeclaration = 201, - EnumDeclaration = 202, - ModuleDeclaration = 203, - ModuleBlock = 204, - CaseBlock = 205, - ImportEqualsDeclaration = 206, - ImportDeclaration = 207, - ImportClause = 208, - NamespaceImport = 209, - NamedImports = 210, - ImportSpecifier = 211, - ExportAssignment = 212, - ExportDeclaration = 213, - NamedExports = 214, - ExportSpecifier = 215, - MissingDeclaration = 216, - ExternalModuleReference = 217, - CaseClause = 218, - DefaultClause = 219, - HeritageClause = 220, - CatchClause = 221, - PropertyAssignment = 222, - ShorthandPropertyAssignment = 223, - EnumMember = 224, - SourceFile = 225, - SyntaxList = 226, - Count = 227, + ClassExpression = 174, + OmittedExpression = 175, + TemplateSpan = 176, + HeritageClauseElement = 177, + Block = 178, + VariableStatement = 179, + EmptyStatement = 180, + ExpressionStatement = 181, + IfStatement = 182, + DoStatement = 183, + WhileStatement = 184, + ForStatement = 185, + ForInStatement = 186, + ForOfStatement = 187, + ContinueStatement = 188, + BreakStatement = 189, + ReturnStatement = 190, + WithStatement = 191, + SwitchStatement = 192, + LabeledStatement = 193, + ThrowStatement = 194, + TryStatement = 195, + DebuggerStatement = 196, + VariableDeclaration = 197, + VariableDeclarationList = 198, + FunctionDeclaration = 199, + ClassDeclaration = 200, + InterfaceDeclaration = 201, + TypeAliasDeclaration = 202, + EnumDeclaration = 203, + ModuleDeclaration = 204, + ModuleBlock = 205, + CaseBlock = 206, + ImportEqualsDeclaration = 207, + ImportDeclaration = 208, + ImportClause = 209, + NamespaceImport = 210, + NamedImports = 211, + ImportSpecifier = 212, + ExportAssignment = 213, + ExportDeclaration = 214, + NamedExports = 215, + ExportSpecifier = 216, + MissingDeclaration = 217, + ExternalModuleReference = 218, + CaseClause = 219, + DefaultClause = 220, + HeritageClause = 221, + CatchClause = 222, + PropertyAssignment = 223, + ShorthandPropertyAssignment = 224, + EnumMember = 225, + SourceFile = 226, + SyntaxList = 227, + Count = 228, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -706,12 +707,16 @@ declare module "typescript" { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + 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; } diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index 31322f07ea..ca965a9161 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -717,166 +717,169 @@ declare module "typescript" { SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 174, + ClassExpression = 174, +>ClassExpression : SyntaxKind + + OmittedExpression = 175, >OmittedExpression : SyntaxKind - TemplateSpan = 175, + TemplateSpan = 176, >TemplateSpan : SyntaxKind - HeritageClauseElement = 176, + HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 177, + Block = 178, >Block : SyntaxKind - VariableStatement = 178, + VariableStatement = 179, >VariableStatement : SyntaxKind - EmptyStatement = 179, + EmptyStatement = 180, >EmptyStatement : SyntaxKind - ExpressionStatement = 180, + ExpressionStatement = 181, >ExpressionStatement : SyntaxKind - IfStatement = 181, + IfStatement = 182, >IfStatement : SyntaxKind - DoStatement = 182, + DoStatement = 183, >DoStatement : SyntaxKind - WhileStatement = 183, + WhileStatement = 184, >WhileStatement : SyntaxKind - ForStatement = 184, + ForStatement = 185, >ForStatement : SyntaxKind - ForInStatement = 185, + ForInStatement = 186, >ForInStatement : SyntaxKind - ForOfStatement = 186, + ForOfStatement = 187, >ForOfStatement : SyntaxKind - ContinueStatement = 187, + ContinueStatement = 188, >ContinueStatement : SyntaxKind - BreakStatement = 188, + BreakStatement = 189, >BreakStatement : SyntaxKind - ReturnStatement = 189, + ReturnStatement = 190, >ReturnStatement : SyntaxKind - WithStatement = 190, + WithStatement = 191, >WithStatement : SyntaxKind - SwitchStatement = 191, + SwitchStatement = 192, >SwitchStatement : SyntaxKind - LabeledStatement = 192, + LabeledStatement = 193, >LabeledStatement : SyntaxKind - ThrowStatement = 193, + ThrowStatement = 194, >ThrowStatement : SyntaxKind - TryStatement = 194, + TryStatement = 195, >TryStatement : SyntaxKind - DebuggerStatement = 195, + DebuggerStatement = 196, >DebuggerStatement : SyntaxKind - VariableDeclaration = 196, + VariableDeclaration = 197, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 197, + VariableDeclarationList = 198, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 198, + FunctionDeclaration = 199, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 199, + ClassDeclaration = 200, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 200, + InterfaceDeclaration = 201, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 201, + TypeAliasDeclaration = 202, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 202, + EnumDeclaration = 203, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 203, + ModuleDeclaration = 204, >ModuleDeclaration : SyntaxKind - ModuleBlock = 204, + ModuleBlock = 205, >ModuleBlock : SyntaxKind - CaseBlock = 205, + CaseBlock = 206, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 206, + ImportEqualsDeclaration = 207, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 207, + ImportDeclaration = 208, >ImportDeclaration : SyntaxKind - ImportClause = 208, + ImportClause = 209, >ImportClause : SyntaxKind - NamespaceImport = 209, + NamespaceImport = 210, >NamespaceImport : SyntaxKind - NamedImports = 210, + NamedImports = 211, >NamedImports : SyntaxKind - ImportSpecifier = 211, + ImportSpecifier = 212, >ImportSpecifier : SyntaxKind - ExportAssignment = 212, + ExportAssignment = 213, >ExportAssignment : SyntaxKind - ExportDeclaration = 213, + ExportDeclaration = 214, >ExportDeclaration : SyntaxKind - NamedExports = 214, + NamedExports = 215, >NamedExports : SyntaxKind - ExportSpecifier = 215, + ExportSpecifier = 216, >ExportSpecifier : SyntaxKind - MissingDeclaration = 216, + MissingDeclaration = 217, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 217, + ExternalModuleReference = 218, >ExternalModuleReference : SyntaxKind - CaseClause = 218, + CaseClause = 219, >CaseClause : SyntaxKind - DefaultClause = 219, + DefaultClause = 220, >DefaultClause : SyntaxKind - HeritageClause = 220, + HeritageClause = 221, >HeritageClause : SyntaxKind - CatchClause = 221, + CatchClause = 222, >CatchClause : SyntaxKind - PropertyAssignment = 222, + PropertyAssignment = 223, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 223, + ShorthandPropertyAssignment = 224, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 224, + EnumMember = 225, >EnumMember : SyntaxKind - SourceFile = 225, + SourceFile = 226, >SourceFile : SyntaxKind - SyntaxList = 226, + SyntaxList = 227, >SyntaxList : SyntaxKind - Count = 227, + Count = 228, >Count : SyntaxKind FirstAssignment = 53, @@ -2131,10 +2134,9 @@ declare module "typescript" { _moduleElementBrand: any; >_moduleElementBrand : any } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration + interface ClassLikeDeclaration extends Declaration { +>ClassLikeDeclaration : ClassLikeDeclaration >Declaration : Declaration ->ModuleElement : ModuleElement name?: Identifier; >name : Identifier @@ -2154,6 +2156,16 @@ declare module "typescript" { >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 diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index dc96584dc5..d7d3ece0c8 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -264,60 +264,61 @@ declare module "typescript" { TemplateExpression = 171, YieldExpression = 172, SpreadElementExpression = 173, - OmittedExpression = 174, - TemplateSpan = 175, - HeritageClauseElement = 176, - Block = 177, - VariableStatement = 178, - EmptyStatement = 179, - ExpressionStatement = 180, - IfStatement = 181, - DoStatement = 182, - WhileStatement = 183, - ForStatement = 184, - ForInStatement = 185, - ForOfStatement = 186, - ContinueStatement = 187, - BreakStatement = 188, - ReturnStatement = 189, - WithStatement = 190, - SwitchStatement = 191, - LabeledStatement = 192, - ThrowStatement = 193, - TryStatement = 194, - DebuggerStatement = 195, - VariableDeclaration = 196, - VariableDeclarationList = 197, - FunctionDeclaration = 198, - ClassDeclaration = 199, - InterfaceDeclaration = 200, - TypeAliasDeclaration = 201, - EnumDeclaration = 202, - ModuleDeclaration = 203, - ModuleBlock = 204, - CaseBlock = 205, - ImportEqualsDeclaration = 206, - ImportDeclaration = 207, - ImportClause = 208, - NamespaceImport = 209, - NamedImports = 210, - ImportSpecifier = 211, - ExportAssignment = 212, - ExportDeclaration = 213, - NamedExports = 214, - ExportSpecifier = 215, - MissingDeclaration = 216, - ExternalModuleReference = 217, - CaseClause = 218, - DefaultClause = 219, - HeritageClause = 220, - CatchClause = 221, - PropertyAssignment = 222, - ShorthandPropertyAssignment = 223, - EnumMember = 224, - SourceFile = 225, - SyntaxList = 226, - Count = 227, + ClassExpression = 174, + OmittedExpression = 175, + TemplateSpan = 176, + HeritageClauseElement = 177, + Block = 178, + VariableStatement = 179, + EmptyStatement = 180, + ExpressionStatement = 181, + IfStatement = 182, + DoStatement = 183, + WhileStatement = 184, + ForStatement = 185, + ForInStatement = 186, + ForOfStatement = 187, + ContinueStatement = 188, + BreakStatement = 189, + ReturnStatement = 190, + WithStatement = 191, + SwitchStatement = 192, + LabeledStatement = 193, + ThrowStatement = 194, + TryStatement = 195, + DebuggerStatement = 196, + VariableDeclaration = 197, + VariableDeclarationList = 198, + FunctionDeclaration = 199, + ClassDeclaration = 200, + InterfaceDeclaration = 201, + TypeAliasDeclaration = 202, + EnumDeclaration = 203, + ModuleDeclaration = 204, + ModuleBlock = 205, + CaseBlock = 206, + ImportEqualsDeclaration = 207, + ImportDeclaration = 208, + ImportClause = 209, + NamespaceImport = 210, + NamedImports = 211, + ImportSpecifier = 212, + ExportAssignment = 213, + ExportDeclaration = 214, + NamedExports = 215, + ExportSpecifier = 216, + MissingDeclaration = 217, + ExternalModuleReference = 218, + CaseClause = 219, + DefaultClause = 220, + HeritageClause = 221, + CatchClause = 222, + PropertyAssignment = 223, + ShorthandPropertyAssignment = 224, + EnumMember = 225, + SourceFile = 226, + SyntaxList = 227, + Count = 228, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -737,12 +738,16 @@ declare module "typescript" { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + 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; } @@ -2047,21 +2052,21 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 184 /* ForStatement */: - case 185 /* ForInStatement */: - case 183 /* WhileStatement */: - case 182 /* DoStatement */: - if (node.statement.kind !== 177 /* Block */) { + case 185 /* ForStatement */: + case 186 /* ForInStatement */: + case 184 /* WhileStatement */: + case 183 /* DoStatement */: + if (node.statement.kind !== 178 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 181 /* IfStatement */: + case 182 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 177 /* Block */) { + if (ifStatement.thenStatement.kind !== 178 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 177 /* Block */ && ifStatement.elseStatement.kind !== 181 /* IfStatement */) { + ifStatement.elseStatement.kind !== 178 /* Block */ && ifStatement.elseStatement.kind !== 182 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 57473b8981..e68910b26e 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -863,166 +863,169 @@ declare module "typescript" { SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 174, + ClassExpression = 174, +>ClassExpression : SyntaxKind + + OmittedExpression = 175, >OmittedExpression : SyntaxKind - TemplateSpan = 175, + TemplateSpan = 176, >TemplateSpan : SyntaxKind - HeritageClauseElement = 176, + HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 177, + Block = 178, >Block : SyntaxKind - VariableStatement = 178, + VariableStatement = 179, >VariableStatement : SyntaxKind - EmptyStatement = 179, + EmptyStatement = 180, >EmptyStatement : SyntaxKind - ExpressionStatement = 180, + ExpressionStatement = 181, >ExpressionStatement : SyntaxKind - IfStatement = 181, + IfStatement = 182, >IfStatement : SyntaxKind - DoStatement = 182, + DoStatement = 183, >DoStatement : SyntaxKind - WhileStatement = 183, + WhileStatement = 184, >WhileStatement : SyntaxKind - ForStatement = 184, + ForStatement = 185, >ForStatement : SyntaxKind - ForInStatement = 185, + ForInStatement = 186, >ForInStatement : SyntaxKind - ForOfStatement = 186, + ForOfStatement = 187, >ForOfStatement : SyntaxKind - ContinueStatement = 187, + ContinueStatement = 188, >ContinueStatement : SyntaxKind - BreakStatement = 188, + BreakStatement = 189, >BreakStatement : SyntaxKind - ReturnStatement = 189, + ReturnStatement = 190, >ReturnStatement : SyntaxKind - WithStatement = 190, + WithStatement = 191, >WithStatement : SyntaxKind - SwitchStatement = 191, + SwitchStatement = 192, >SwitchStatement : SyntaxKind - LabeledStatement = 192, + LabeledStatement = 193, >LabeledStatement : SyntaxKind - ThrowStatement = 193, + ThrowStatement = 194, >ThrowStatement : SyntaxKind - TryStatement = 194, + TryStatement = 195, >TryStatement : SyntaxKind - DebuggerStatement = 195, + DebuggerStatement = 196, >DebuggerStatement : SyntaxKind - VariableDeclaration = 196, + VariableDeclaration = 197, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 197, + VariableDeclarationList = 198, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 198, + FunctionDeclaration = 199, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 199, + ClassDeclaration = 200, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 200, + InterfaceDeclaration = 201, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 201, + TypeAliasDeclaration = 202, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 202, + EnumDeclaration = 203, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 203, + ModuleDeclaration = 204, >ModuleDeclaration : SyntaxKind - ModuleBlock = 204, + ModuleBlock = 205, >ModuleBlock : SyntaxKind - CaseBlock = 205, + CaseBlock = 206, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 206, + ImportEqualsDeclaration = 207, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 207, + ImportDeclaration = 208, >ImportDeclaration : SyntaxKind - ImportClause = 208, + ImportClause = 209, >ImportClause : SyntaxKind - NamespaceImport = 209, + NamespaceImport = 210, >NamespaceImport : SyntaxKind - NamedImports = 210, + NamedImports = 211, >NamedImports : SyntaxKind - ImportSpecifier = 211, + ImportSpecifier = 212, >ImportSpecifier : SyntaxKind - ExportAssignment = 212, + ExportAssignment = 213, >ExportAssignment : SyntaxKind - ExportDeclaration = 213, + ExportDeclaration = 214, >ExportDeclaration : SyntaxKind - NamedExports = 214, + NamedExports = 215, >NamedExports : SyntaxKind - ExportSpecifier = 215, + ExportSpecifier = 216, >ExportSpecifier : SyntaxKind - MissingDeclaration = 216, + MissingDeclaration = 217, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 217, + ExternalModuleReference = 218, >ExternalModuleReference : SyntaxKind - CaseClause = 218, + CaseClause = 219, >CaseClause : SyntaxKind - DefaultClause = 219, + DefaultClause = 220, >DefaultClause : SyntaxKind - HeritageClause = 220, + HeritageClause = 221, >HeritageClause : SyntaxKind - CatchClause = 221, + CatchClause = 222, >CatchClause : SyntaxKind - PropertyAssignment = 222, + PropertyAssignment = 223, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 223, + ShorthandPropertyAssignment = 224, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 224, + EnumMember = 225, >EnumMember : SyntaxKind - SourceFile = 225, + SourceFile = 226, >SourceFile : SyntaxKind - SyntaxList = 226, + SyntaxList = 227, >SyntaxList : SyntaxKind - Count = 227, + Count = 228, >Count : SyntaxKind FirstAssignment = 53, @@ -2277,10 +2280,9 @@ declare module "typescript" { _moduleElementBrand: any; >_moduleElementBrand : any } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration + interface ClassLikeDeclaration extends Declaration { +>ClassLikeDeclaration : ClassLikeDeclaration >Declaration : Declaration ->ModuleElement : ModuleElement name?: Identifier; >name : Identifier @@ -2300,6 +2302,16 @@ declare module "typescript" { >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 diff --git a/tests/baselines/reference/APISample_linter.types.pull b/tests/baselines/reference/APISample_linter.types.pull deleted file mode 100644 index 74632737ca..0000000000 --- a/tests/baselines/reference/APISample_linter.types.pull +++ /dev/null @@ -1,6384 +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 - - OmittedExpression = 174, ->OmittedExpression : SyntaxKind - - TemplateSpan = 175, ->TemplateSpan : SyntaxKind - - HeritageClauseElement = 176, ->HeritageClauseElement : SyntaxKind - - Block = 177, ->Block : SyntaxKind - - VariableStatement = 178, ->VariableStatement : SyntaxKind - - EmptyStatement = 179, ->EmptyStatement : SyntaxKind - - ExpressionStatement = 180, ->ExpressionStatement : SyntaxKind - - IfStatement = 181, ->IfStatement : SyntaxKind - - DoStatement = 182, ->DoStatement : SyntaxKind - - WhileStatement = 183, ->WhileStatement : SyntaxKind - - ForStatement = 184, ->ForStatement : SyntaxKind - - ForInStatement = 185, ->ForInStatement : SyntaxKind - - ForOfStatement = 186, ->ForOfStatement : SyntaxKind - - ContinueStatement = 187, ->ContinueStatement : SyntaxKind - - BreakStatement = 188, ->BreakStatement : SyntaxKind - - ReturnStatement = 189, ->ReturnStatement : SyntaxKind - - WithStatement = 190, ->WithStatement : SyntaxKind - - SwitchStatement = 191, ->SwitchStatement : SyntaxKind - - LabeledStatement = 192, ->LabeledStatement : SyntaxKind - - ThrowStatement = 193, ->ThrowStatement : SyntaxKind - - TryStatement = 194, ->TryStatement : SyntaxKind - - DebuggerStatement = 195, ->DebuggerStatement : SyntaxKind - - VariableDeclaration = 196, ->VariableDeclaration : SyntaxKind - - VariableDeclarationList = 197, ->VariableDeclarationList : SyntaxKind - - FunctionDeclaration = 198, ->FunctionDeclaration : SyntaxKind - - ClassDeclaration = 199, ->ClassDeclaration : SyntaxKind - - InterfaceDeclaration = 200, ->InterfaceDeclaration : SyntaxKind - - TypeAliasDeclaration = 201, ->TypeAliasDeclaration : SyntaxKind - - EnumDeclaration = 202, ->EnumDeclaration : SyntaxKind - - ModuleDeclaration = 203, ->ModuleDeclaration : SyntaxKind - - ModuleBlock = 204, ->ModuleBlock : SyntaxKind - - CaseBlock = 205, ->CaseBlock : SyntaxKind - - ImportEqualsDeclaration = 206, ->ImportEqualsDeclaration : SyntaxKind - - ImportDeclaration = 207, ->ImportDeclaration : SyntaxKind - - ImportClause = 208, ->ImportClause : SyntaxKind - - NamespaceImport = 209, ->NamespaceImport : SyntaxKind - - NamedImports = 210, ->NamedImports : SyntaxKind - - ImportSpecifier = 211, ->ImportSpecifier : SyntaxKind - - ExportAssignment = 212, ->ExportAssignment : SyntaxKind - - ExportDeclaration = 213, ->ExportDeclaration : SyntaxKind - - NamedExports = 214, ->NamedExports : SyntaxKind - - ExportSpecifier = 215, ->ExportSpecifier : SyntaxKind - - MissingDeclaration = 216, ->MissingDeclaration : SyntaxKind - - ExternalModuleReference = 217, ->ExternalModuleReference : SyntaxKind - - CaseClause = 218, ->CaseClause : SyntaxKind - - DefaultClause = 219, ->DefaultClause : SyntaxKind - - HeritageClause = 220, ->HeritageClause : SyntaxKind - - CatchClause = 221, ->CatchClause : SyntaxKind - - PropertyAssignment = 222, ->PropertyAssignment : SyntaxKind - - ShorthandPropertyAssignment = 223, ->ShorthandPropertyAssignment : SyntaxKind - - EnumMember = 224, ->EnumMember : SyntaxKind - - SourceFile = 225, ->SourceFile : SyntaxKind - - SyntaxList = 226, ->SyntaxList : SyntaxKind - - Count = 227, ->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 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 ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration ->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 ->ClassElement : ClassElement - } - 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 Statement, ModuleElement { ->ImportDeclaration : ImportDeclaration ->Statement : Statement ->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 - - getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; ->getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration ->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: Expression | Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult ->entityName : Expression | Identifier | 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 - - codepage?: number; ->codepage : number - - 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 - - noLibCheck?: boolean; ->noLibCheck : 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 - - [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" { - /** 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 - } - 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 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 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 a29467c1c4..aac968cade 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -265,60 +265,61 @@ declare module "typescript" { TemplateExpression = 171, YieldExpression = 172, SpreadElementExpression = 173, - OmittedExpression = 174, - TemplateSpan = 175, - HeritageClauseElement = 176, - Block = 177, - VariableStatement = 178, - EmptyStatement = 179, - ExpressionStatement = 180, - IfStatement = 181, - DoStatement = 182, - WhileStatement = 183, - ForStatement = 184, - ForInStatement = 185, - ForOfStatement = 186, - ContinueStatement = 187, - BreakStatement = 188, - ReturnStatement = 189, - WithStatement = 190, - SwitchStatement = 191, - LabeledStatement = 192, - ThrowStatement = 193, - TryStatement = 194, - DebuggerStatement = 195, - VariableDeclaration = 196, - VariableDeclarationList = 197, - FunctionDeclaration = 198, - ClassDeclaration = 199, - InterfaceDeclaration = 200, - TypeAliasDeclaration = 201, - EnumDeclaration = 202, - ModuleDeclaration = 203, - ModuleBlock = 204, - CaseBlock = 205, - ImportEqualsDeclaration = 206, - ImportDeclaration = 207, - ImportClause = 208, - NamespaceImport = 209, - NamedImports = 210, - ImportSpecifier = 211, - ExportAssignment = 212, - ExportDeclaration = 213, - NamedExports = 214, - ExportSpecifier = 215, - MissingDeclaration = 216, - ExternalModuleReference = 217, - CaseClause = 218, - DefaultClause = 219, - HeritageClause = 220, - CatchClause = 221, - PropertyAssignment = 222, - ShorthandPropertyAssignment = 223, - EnumMember = 224, - SourceFile = 225, - SyntaxList = 226, - Count = 227, + ClassExpression = 174, + OmittedExpression = 175, + TemplateSpan = 176, + HeritageClauseElement = 177, + Block = 178, + VariableStatement = 179, + EmptyStatement = 180, + ExpressionStatement = 181, + IfStatement = 182, + DoStatement = 183, + WhileStatement = 184, + ForStatement = 185, + ForInStatement = 186, + ForOfStatement = 187, + ContinueStatement = 188, + BreakStatement = 189, + ReturnStatement = 190, + WithStatement = 191, + SwitchStatement = 192, + LabeledStatement = 193, + ThrowStatement = 194, + TryStatement = 195, + DebuggerStatement = 196, + VariableDeclaration = 197, + VariableDeclarationList = 198, + FunctionDeclaration = 199, + ClassDeclaration = 200, + InterfaceDeclaration = 201, + TypeAliasDeclaration = 202, + EnumDeclaration = 203, + ModuleDeclaration = 204, + ModuleBlock = 205, + CaseBlock = 206, + ImportEqualsDeclaration = 207, + ImportDeclaration = 208, + ImportClause = 209, + NamespaceImport = 210, + NamedImports = 211, + ImportSpecifier = 212, + ExportAssignment = 213, + ExportDeclaration = 214, + NamedExports = 215, + ExportSpecifier = 216, + MissingDeclaration = 217, + ExternalModuleReference = 218, + CaseClause = 219, + DefaultClause = 220, + HeritageClause = 221, + CatchClause = 222, + PropertyAssignment = 223, + ShorthandPropertyAssignment = 224, + EnumMember = 225, + SourceFile = 226, + SyntaxList = 227, + Count = 228, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -738,12 +739,16 @@ declare module "typescript" { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + 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; } diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 68ce9de45b..9c546b8c82 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -813,166 +813,169 @@ declare module "typescript" { SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 174, + ClassExpression = 174, +>ClassExpression : SyntaxKind + + OmittedExpression = 175, >OmittedExpression : SyntaxKind - TemplateSpan = 175, + TemplateSpan = 176, >TemplateSpan : SyntaxKind - HeritageClauseElement = 176, + HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 177, + Block = 178, >Block : SyntaxKind - VariableStatement = 178, + VariableStatement = 179, >VariableStatement : SyntaxKind - EmptyStatement = 179, + EmptyStatement = 180, >EmptyStatement : SyntaxKind - ExpressionStatement = 180, + ExpressionStatement = 181, >ExpressionStatement : SyntaxKind - IfStatement = 181, + IfStatement = 182, >IfStatement : SyntaxKind - DoStatement = 182, + DoStatement = 183, >DoStatement : SyntaxKind - WhileStatement = 183, + WhileStatement = 184, >WhileStatement : SyntaxKind - ForStatement = 184, + ForStatement = 185, >ForStatement : SyntaxKind - ForInStatement = 185, + ForInStatement = 186, >ForInStatement : SyntaxKind - ForOfStatement = 186, + ForOfStatement = 187, >ForOfStatement : SyntaxKind - ContinueStatement = 187, + ContinueStatement = 188, >ContinueStatement : SyntaxKind - BreakStatement = 188, + BreakStatement = 189, >BreakStatement : SyntaxKind - ReturnStatement = 189, + ReturnStatement = 190, >ReturnStatement : SyntaxKind - WithStatement = 190, + WithStatement = 191, >WithStatement : SyntaxKind - SwitchStatement = 191, + SwitchStatement = 192, >SwitchStatement : SyntaxKind - LabeledStatement = 192, + LabeledStatement = 193, >LabeledStatement : SyntaxKind - ThrowStatement = 193, + ThrowStatement = 194, >ThrowStatement : SyntaxKind - TryStatement = 194, + TryStatement = 195, >TryStatement : SyntaxKind - DebuggerStatement = 195, + DebuggerStatement = 196, >DebuggerStatement : SyntaxKind - VariableDeclaration = 196, + VariableDeclaration = 197, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 197, + VariableDeclarationList = 198, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 198, + FunctionDeclaration = 199, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 199, + ClassDeclaration = 200, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 200, + InterfaceDeclaration = 201, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 201, + TypeAliasDeclaration = 202, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 202, + EnumDeclaration = 203, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 203, + ModuleDeclaration = 204, >ModuleDeclaration : SyntaxKind - ModuleBlock = 204, + ModuleBlock = 205, >ModuleBlock : SyntaxKind - CaseBlock = 205, + CaseBlock = 206, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 206, + ImportEqualsDeclaration = 207, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 207, + ImportDeclaration = 208, >ImportDeclaration : SyntaxKind - ImportClause = 208, + ImportClause = 209, >ImportClause : SyntaxKind - NamespaceImport = 209, + NamespaceImport = 210, >NamespaceImport : SyntaxKind - NamedImports = 210, + NamedImports = 211, >NamedImports : SyntaxKind - ImportSpecifier = 211, + ImportSpecifier = 212, >ImportSpecifier : SyntaxKind - ExportAssignment = 212, + ExportAssignment = 213, >ExportAssignment : SyntaxKind - ExportDeclaration = 213, + ExportDeclaration = 214, >ExportDeclaration : SyntaxKind - NamedExports = 214, + NamedExports = 215, >NamedExports : SyntaxKind - ExportSpecifier = 215, + ExportSpecifier = 216, >ExportSpecifier : SyntaxKind - MissingDeclaration = 216, + MissingDeclaration = 217, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 217, + ExternalModuleReference = 218, >ExternalModuleReference : SyntaxKind - CaseClause = 218, + CaseClause = 219, >CaseClause : SyntaxKind - DefaultClause = 219, + DefaultClause = 220, >DefaultClause : SyntaxKind - HeritageClause = 220, + HeritageClause = 221, >HeritageClause : SyntaxKind - CatchClause = 221, + CatchClause = 222, >CatchClause : SyntaxKind - PropertyAssignment = 222, + PropertyAssignment = 223, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 223, + ShorthandPropertyAssignment = 224, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 224, + EnumMember = 225, >EnumMember : SyntaxKind - SourceFile = 225, + SourceFile = 226, >SourceFile : SyntaxKind - SyntaxList = 226, + SyntaxList = 227, >SyntaxList : SyntaxKind - Count = 227, + Count = 228, >Count : SyntaxKind FirstAssignment = 53, @@ -2227,10 +2230,9 @@ declare module "typescript" { _moduleElementBrand: any; >_moduleElementBrand : any } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration + interface ClassLikeDeclaration extends Declaration { +>ClassLikeDeclaration : ClassLikeDeclaration >Declaration : Declaration ->ModuleElement : ModuleElement name?: Identifier; >name : Identifier @@ -2250,6 +2252,16 @@ declare module "typescript" { >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 diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 918768222b..e3280bfb2c 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -302,60 +302,61 @@ declare module "typescript" { TemplateExpression = 171, YieldExpression = 172, SpreadElementExpression = 173, - OmittedExpression = 174, - TemplateSpan = 175, - HeritageClauseElement = 176, - Block = 177, - VariableStatement = 178, - EmptyStatement = 179, - ExpressionStatement = 180, - IfStatement = 181, - DoStatement = 182, - WhileStatement = 183, - ForStatement = 184, - ForInStatement = 185, - ForOfStatement = 186, - ContinueStatement = 187, - BreakStatement = 188, - ReturnStatement = 189, - WithStatement = 190, - SwitchStatement = 191, - LabeledStatement = 192, - ThrowStatement = 193, - TryStatement = 194, - DebuggerStatement = 195, - VariableDeclaration = 196, - VariableDeclarationList = 197, - FunctionDeclaration = 198, - ClassDeclaration = 199, - InterfaceDeclaration = 200, - TypeAliasDeclaration = 201, - EnumDeclaration = 202, - ModuleDeclaration = 203, - ModuleBlock = 204, - CaseBlock = 205, - ImportEqualsDeclaration = 206, - ImportDeclaration = 207, - ImportClause = 208, - NamespaceImport = 209, - NamedImports = 210, - ImportSpecifier = 211, - ExportAssignment = 212, - ExportDeclaration = 213, - NamedExports = 214, - ExportSpecifier = 215, - MissingDeclaration = 216, - ExternalModuleReference = 217, - CaseClause = 218, - DefaultClause = 219, - HeritageClause = 220, - CatchClause = 221, - PropertyAssignment = 222, - ShorthandPropertyAssignment = 223, - EnumMember = 224, - SourceFile = 225, - SyntaxList = 226, - Count = 227, + ClassExpression = 174, + OmittedExpression = 175, + TemplateSpan = 176, + HeritageClauseElement = 177, + Block = 178, + VariableStatement = 179, + EmptyStatement = 180, + ExpressionStatement = 181, + IfStatement = 182, + DoStatement = 183, + WhileStatement = 184, + ForStatement = 185, + ForInStatement = 186, + ForOfStatement = 187, + ContinueStatement = 188, + BreakStatement = 189, + ReturnStatement = 190, + WithStatement = 191, + SwitchStatement = 192, + LabeledStatement = 193, + ThrowStatement = 194, + TryStatement = 195, + DebuggerStatement = 196, + VariableDeclaration = 197, + VariableDeclarationList = 198, + FunctionDeclaration = 199, + ClassDeclaration = 200, + InterfaceDeclaration = 201, + TypeAliasDeclaration = 202, + EnumDeclaration = 203, + ModuleDeclaration = 204, + ModuleBlock = 205, + CaseBlock = 206, + ImportEqualsDeclaration = 207, + ImportDeclaration = 208, + ImportClause = 209, + NamespaceImport = 210, + NamedImports = 211, + ImportSpecifier = 212, + ExportAssignment = 213, + ExportDeclaration = 214, + NamedExports = 215, + ExportSpecifier = 216, + MissingDeclaration = 217, + ExternalModuleReference = 218, + CaseClause = 219, + DefaultClause = 220, + HeritageClause = 221, + CatchClause = 222, + PropertyAssignment = 223, + ShorthandPropertyAssignment = 224, + EnumMember = 225, + SourceFile = 226, + SyntaxList = 227, + Count = 228, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, @@ -775,12 +776,16 @@ declare module "typescript" { interface ModuleElement extends Node { _moduleElementBrand: any; } - interface ClassDeclaration extends Declaration, ModuleElement { + 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; } diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 9745c79e94..6507fa41e2 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -986,166 +986,169 @@ declare module "typescript" { SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 174, + ClassExpression = 174, +>ClassExpression : SyntaxKind + + OmittedExpression = 175, >OmittedExpression : SyntaxKind - TemplateSpan = 175, + TemplateSpan = 176, >TemplateSpan : SyntaxKind - HeritageClauseElement = 176, + HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 177, + Block = 178, >Block : SyntaxKind - VariableStatement = 178, + VariableStatement = 179, >VariableStatement : SyntaxKind - EmptyStatement = 179, + EmptyStatement = 180, >EmptyStatement : SyntaxKind - ExpressionStatement = 180, + ExpressionStatement = 181, >ExpressionStatement : SyntaxKind - IfStatement = 181, + IfStatement = 182, >IfStatement : SyntaxKind - DoStatement = 182, + DoStatement = 183, >DoStatement : SyntaxKind - WhileStatement = 183, + WhileStatement = 184, >WhileStatement : SyntaxKind - ForStatement = 184, + ForStatement = 185, >ForStatement : SyntaxKind - ForInStatement = 185, + ForInStatement = 186, >ForInStatement : SyntaxKind - ForOfStatement = 186, + ForOfStatement = 187, >ForOfStatement : SyntaxKind - ContinueStatement = 187, + ContinueStatement = 188, >ContinueStatement : SyntaxKind - BreakStatement = 188, + BreakStatement = 189, >BreakStatement : SyntaxKind - ReturnStatement = 189, + ReturnStatement = 190, >ReturnStatement : SyntaxKind - WithStatement = 190, + WithStatement = 191, >WithStatement : SyntaxKind - SwitchStatement = 191, + SwitchStatement = 192, >SwitchStatement : SyntaxKind - LabeledStatement = 192, + LabeledStatement = 193, >LabeledStatement : SyntaxKind - ThrowStatement = 193, + ThrowStatement = 194, >ThrowStatement : SyntaxKind - TryStatement = 194, + TryStatement = 195, >TryStatement : SyntaxKind - DebuggerStatement = 195, + DebuggerStatement = 196, >DebuggerStatement : SyntaxKind - VariableDeclaration = 196, + VariableDeclaration = 197, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 197, + VariableDeclarationList = 198, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 198, + FunctionDeclaration = 199, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 199, + ClassDeclaration = 200, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 200, + InterfaceDeclaration = 201, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 201, + TypeAliasDeclaration = 202, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 202, + EnumDeclaration = 203, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 203, + ModuleDeclaration = 204, >ModuleDeclaration : SyntaxKind - ModuleBlock = 204, + ModuleBlock = 205, >ModuleBlock : SyntaxKind - CaseBlock = 205, + CaseBlock = 206, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 206, + ImportEqualsDeclaration = 207, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 207, + ImportDeclaration = 208, >ImportDeclaration : SyntaxKind - ImportClause = 208, + ImportClause = 209, >ImportClause : SyntaxKind - NamespaceImport = 209, + NamespaceImport = 210, >NamespaceImport : SyntaxKind - NamedImports = 210, + NamedImports = 211, >NamedImports : SyntaxKind - ImportSpecifier = 211, + ImportSpecifier = 212, >ImportSpecifier : SyntaxKind - ExportAssignment = 212, + ExportAssignment = 213, >ExportAssignment : SyntaxKind - ExportDeclaration = 213, + ExportDeclaration = 214, >ExportDeclaration : SyntaxKind - NamedExports = 214, + NamedExports = 215, >NamedExports : SyntaxKind - ExportSpecifier = 215, + ExportSpecifier = 216, >ExportSpecifier : SyntaxKind - MissingDeclaration = 216, + MissingDeclaration = 217, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 217, + ExternalModuleReference = 218, >ExternalModuleReference : SyntaxKind - CaseClause = 218, + CaseClause = 219, >CaseClause : SyntaxKind - DefaultClause = 219, + DefaultClause = 220, >DefaultClause : SyntaxKind - HeritageClause = 220, + HeritageClause = 221, >HeritageClause : SyntaxKind - CatchClause = 221, + CatchClause = 222, >CatchClause : SyntaxKind - PropertyAssignment = 222, + PropertyAssignment = 223, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 223, + ShorthandPropertyAssignment = 224, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 224, + EnumMember = 225, >EnumMember : SyntaxKind - SourceFile = 225, + SourceFile = 226, >SourceFile : SyntaxKind - SyntaxList = 226, + SyntaxList = 227, >SyntaxList : SyntaxKind - Count = 227, + Count = 228, >Count : SyntaxKind FirstAssignment = 53, @@ -2400,10 +2403,9 @@ declare module "typescript" { _moduleElementBrand: any; >_moduleElementBrand : any } - interface ClassDeclaration extends Declaration, ModuleElement { ->ClassDeclaration : ClassDeclaration + interface ClassLikeDeclaration extends Declaration { +>ClassLikeDeclaration : ClassLikeDeclaration >Declaration : Declaration ->ModuleElement : ModuleElement name?: Identifier; >name : Identifier @@ -2423,6 +2425,16 @@ declare module "typescript" { >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 diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt index f5028814ac..c8266d0e87 100644 --- a/tests/baselines/reference/classExpression.errors.txt +++ b/tests/baselines/reference/classExpression.errors.txt @@ -1,36 +1,24 @@ -tests/cases/conformance/classes/classExpression.ts(1,9): error TS1109: Expression expected. -tests/cases/conformance/classes/classExpression.ts(5,10): error TS1109: Expression expected. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS1005: ':' expected. -tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot find name 'C2'. -tests/cases/conformance/classes/classExpression.ts(5,19): error TS1005: ',' expected. -tests/cases/conformance/classes/classExpression.ts(7,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/classes/classExpression.ts(10,13): error TS1109: Expression expected. +tests/cases/conformance/classes/classExpression.ts(1,15): error TS9003: 'class' expressions are not currently supported. +tests/cases/conformance/classes/classExpression.ts(5,16): error TS9003: 'class' expressions are not currently supported. +tests/cases/conformance/classes/classExpression.ts(10,19): error TS9003: 'class' expressions are not currently supported. -==== tests/cases/conformance/classes/classExpression.ts (7 errors) ==== +==== tests/cases/conformance/classes/classExpression.ts (3 errors) ==== var x = class C { - ~~~~~ -!!! error TS1109: Expression expected. + ~ +!!! error TS9003: 'class' expressions are not currently supported. } var y = { foo: class C2 { - ~~~~~ -!!! error TS1109: Expression expected. ~~ -!!! error TS1005: ':' expected. - ~~ -!!! error TS2304: Cannot find name 'C2'. - ~ -!!! error TS1005: ',' expected. +!!! error TS9003: 'class' expressions are not currently supported. } } - ~ -!!! error TS1128: Declaration or statement expected. module M { var z = class C4 { - ~~~~~ -!!! error TS1109: Expression expected. + ~~ +!!! error TS9003: 'class' expressions are not currently supported. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExpression.js b/tests/baselines/reference/classExpression.js index 6bcf0f46f7..8f3270d13e 100644 --- a/tests/baselines/reference/classExpression.js +++ b/tests/baselines/reference/classExpression.js @@ -13,18 +13,21 @@ module M { } //// [classExpression.js] -var x = ; -var C = (function () { +var x = (function () { function C() { } return C; })(); var y = { - foo: , class: C2 }, _a = void 0; + foo: (function () { + function C2() { + } + return C2; + })() +}; var M; (function (M) { - var z = ; - var C4 = (function () { + var z = (function () { function C4() { } return C4; diff --git a/tests/baselines/reference/classExpression1.errors.txt b/tests/baselines/reference/classExpression1.errors.txt new file mode 100644 index 0000000000..9d7d14d857 --- /dev/null +++ b/tests/baselines/reference/classExpression1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/classes/classExpressions/classExpression1.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/classes/classExpressions/classExpression1.ts (1 errors) ==== + var v = class C {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression1.js b/tests/baselines/reference/classExpression1.js new file mode 100644 index 0000000000..68c7bc5e1e --- /dev/null +++ b/tests/baselines/reference/classExpression1.js @@ -0,0 +1,9 @@ +//// [classExpression1.ts] +var v = class C {}; + +//// [classExpression1.js] +var v = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/classExpression2.errors.txt b/tests/baselines/reference/classExpression2.errors.txt new file mode 100644 index 0000000000..e2f3ccd77c --- /dev/null +++ b/tests/baselines/reference/classExpression2.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/classes/classExpressions/classExpression2.ts(2,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/classes/classExpressions/classExpression2.ts (1 errors) ==== + class D { } + var v = class C extends D {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js new file mode 100644 index 0000000000..4220b88fb1 --- /dev/null +++ b/tests/baselines/reference/classExpression2.js @@ -0,0 +1,17 @@ +//// [classExpression2.ts] +class D { } +var v = class C extends D {}; + +//// [classExpression2.js] +var D = (function () { + function D() { + } + return D; +})(); +var v = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(D); diff --git a/tests/baselines/reference/classExpressionES61.errors.txt b/tests/baselines/reference/classExpressionES61.errors.txt new file mode 100644 index 0000000000..abaa5ab893 --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/classExpressions/classExpressionES61.ts(1,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/es6/classExpressions/classExpressionES61.ts (1 errors) ==== + var v = class C {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES61.js b/tests/baselines/reference/classExpressionES61.js new file mode 100644 index 0000000000..afef090903 --- /dev/null +++ b/tests/baselines/reference/classExpressionES61.js @@ -0,0 +1,7 @@ +//// [classExpressionES61.ts] +var v = class C {}; + +//// [classExpressionES61.js] +var v = class C { +} +; diff --git a/tests/baselines/reference/classExpressionES62.errors.txt b/tests/baselines/reference/classExpressionES62.errors.txt new file mode 100644 index 0000000000..1e28367a17 --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/classExpressions/classExpressionES62.ts(2,15): error TS9003: 'class' expressions are not currently supported. + + +==== tests/cases/conformance/es6/classExpressions/classExpressionES62.ts (1 errors) ==== + class D { } + var v = class C extends D {}; + ~ +!!! error TS9003: 'class' expressions are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionES62.js b/tests/baselines/reference/classExpressionES62.js new file mode 100644 index 0000000000..79cede7300 --- /dev/null +++ b/tests/baselines/reference/classExpressionES62.js @@ -0,0 +1,10 @@ +//// [classExpressionES62.ts] +class D { } +var v = class C extends D {}; + +//// [classExpressionES62.js] +class D { +} +var v = class C extends D { +} +; diff --git a/tests/baselines/reference/classInsideBlock.errors.txt b/tests/baselines/reference/classInsideBlock.errors.txt new file mode 100644 index 0000000000..369e77735e --- /dev/null +++ b/tests/baselines/reference/classInsideBlock.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts (1 errors) ==== + function foo() { + class C { } + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/classInsideBlock.js b/tests/baselines/reference/classInsideBlock.js new file mode 100644 index 0000000000..55b3b0bbea --- /dev/null +++ b/tests/baselines/reference/classInsideBlock.js @@ -0,0 +1,13 @@ +//// [classInsideBlock.ts] +function foo() { + class C { } +} + +//// [classInsideBlock.js] +function foo() { + var C = (function () { + function C() { + } + return C; + })(); +} diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 9c9f1aa687..2935308909 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1109: Expression expected. +tests/cases/conformance/externalModules/foo3.ts(1,16): error TS9003: 'class' expressions are not currently supported. tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected. @@ -14,8 +14,8 @@ tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression ==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ==== export = class Foo3 {}; // Error, not an expression - ~~~~~ -!!! error TS1109: Expression expected. + ~~~~ +!!! error TS9003: 'class' expressions are not currently supported. ==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ==== export = true; // Ok diff --git a/tests/baselines/reference/exportAssignNonIdentifier.js b/tests/baselines/reference/exportAssignNonIdentifier.js index ffa2fb9ba5..343405c862 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.js +++ b/tests/baselines/reference/exportAssignNonIdentifier.js @@ -33,12 +33,11 @@ module.exports = typeof x; //// [foo2.js] module.exports = "sausages"; //// [foo3.js] -var Foo3 = (function () { +module.exports = (function () { function Foo3() { } return Foo3; })(); -; // Error, not an expression //// [foo4.js] module.exports = true; //// [foo5.js] diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index eff17eb858..d16c71ab05 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -2,18 +2,15 @@ tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'decla tests/cases/compiler/externModule.ts(1,9): error TS1005: ';' expected. tests/cases/compiler/externModule.ts(1,9): error TS2304: Cannot find name 'module'. tests/cases/compiler/externModule.ts(1,16): error TS1005: ';' expected. -tests/cases/compiler/externModule.ts(2,5): error TS1129: Statement expected. -tests/cases/compiler/externModule.ts(2,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. tests/cases/compiler/externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(18,6): error TS2390: Constructor implementation is missing. tests/cases/compiler/externModule.ts(20,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(26,13): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/externModule.ts(28,13): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/externModule.ts (13 errors) ==== +==== tests/cases/compiler/externModule.ts (10 errors) ==== declare module { ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. @@ -24,10 +21,6 @@ tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or stateme ~ !!! error TS1005: ';' expected. export class XDate { - ~~~~~~ -!!! error TS1129: Statement expected. - ~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public getDay():number; ~~~~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. @@ -68,8 +61,6 @@ tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or stateme !!! error TS2391: Function implementation is missing or not immediately following the declaration. } } - ~ -!!! error TS1128: Declaration or statement expected. var d=new XDate(); d.getDay(); diff --git a/tests/baselines/reference/externModule.js b/tests/baselines/reference/externModule.js index 719b68451a..bf175f0eef 100644 --- a/tests/baselines/reference/externModule.js +++ b/tests/baselines/reference/externModule.js @@ -42,13 +42,14 @@ n=XDate.UTC(1964,2,1); //// [externModule.js] declare; module; -{ } -var XDate = (function () { - function XDate() { - } - return XDate; -})(); -exports.XDate = XDate; +{ + var XDate = (function () { + function XDate() { + } + return XDate; + })(); + exports.XDate = XDate; +} var d = new XDate(); d.getDay(); d = new XDate(1978, 2); diff --git a/tests/baselines/reference/nestedClassDeclaration.errors.txt b/tests/baselines/reference/nestedClassDeclaration.errors.txt index f5c5e41ad9..f897c38d68 100644 --- a/tests/baselines/reference/nestedClassDeclaration.errors.txt +++ b/tests/baselines/reference/nestedClassDeclaration.errors.txt @@ -1,14 +1,12 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(7,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/classes/nestedClassDeclaration.ts(10,5): error TS1129: Statement expected. -tests/cases/conformance/classes/nestedClassDeclaration.ts(12,1): error TS1128: Declaration or statement expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS1005: ':' expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: Cannot find name 'C4'. tests/cases/conformance/classes/nestedClassDeclaration.ts(15,14): error TS1005: ',' expected. tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/classes/nestedClassDeclaration.ts (8 errors) ==== +==== tests/cases/conformance/classes/nestedClassDeclaration.ts (6 errors) ==== // nested classes are not allowed class C { @@ -23,12 +21,8 @@ tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: D function foo() { class C3 { - ~~~~~ -!!! error TS1129: Statement expected. } } - ~ -!!! error TS1128: Declaration or statement expected. var x = { class C4 { diff --git a/tests/baselines/reference/nestedClassDeclaration.js b/tests/baselines/reference/nestedClassDeclaration.js index 70445b3372..2fee6f08ab 100644 --- a/tests/baselines/reference/nestedClassDeclaration.js +++ b/tests/baselines/reference/nestedClassDeclaration.js @@ -30,11 +30,12 @@ var C2 = (function () { } return C2; })(); -function foo() { } -var C3 = (function () { - function C3() { - } - return C3; -})(); +function foo() { + var C3 = (function () { + function C3() { + } + return C3; + })(); +} var x = { class: C4 }, _a = void 0; diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt index 12e8c8b650..86bc6fbfd7 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(3,13): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(5,1): error TS1130: 'case' or 'default' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts(6,2): error TS1005: '}' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parserErrorRecovery_SwitchStatement2.ts (3 errors) ==== class C { constructor() { switch (e) { @@ -12,4 +13,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/SwitchStatements/parser class D { ~~~~~ !!! error TS1130: 'case' or 'default' expected. - } \ No newline at end of file + } + +!!! error TS1005: '}' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js index d7000bc23d..0fd532dde1 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js @@ -11,11 +11,11 @@ var C = (function () { function C() { switch (e) { } + var D = (function () { + function D() { + } + return D; + })(); } return C; })(); -var D = (function () { - function D() { - } - return D; -})(); diff --git a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt index c57ca1e302..35b279b443 100644 --- a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt +++ b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(1,5): error TS1134: Variable declaration expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(3,5): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts(3,10): error TS1003: Identifier expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInvalidIdentifiersInVariableStatements1.ts (3 errors) ==== var export; ~~~~~~ !!! error TS1134: Variable declaration expected. @@ -10,5 +11,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/VariableLists/parserInv var class; ~~~~~ !!! error TS1134: Variable declaration expected. + ~ +!!! error TS1003: Identifier expected. var bar; \ No newline at end of file diff --git a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js index 09fcffc1b0..422b012246 100644 --- a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js +++ b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js @@ -9,4 +9,10 @@ var bar; var ; var foo; var ; +var = (function () { + function () { + } + return ; +})(); +; var bar; diff --git a/tests/baselines/reference/withStatementErrors.errors.txt b/tests/baselines/reference/withStatementErrors.errors.txt index 623e35c855..ba399f5119 100644 --- a/tests/baselines/reference/withStatementErrors.errors.txt +++ b/tests/baselines/reference/withStatementErrors.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/withStatementErrors.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -tests/cases/compiler/withStatementErrors.ts(11,5): error TS1129: Statement expected. +tests/cases/compiler/withStatementErrors.ts(13,5): error TS1129: Statement expected. tests/cases/compiler/withStatementErrors.ts(17,1): error TS1128: Declaration or statement expected. @@ -17,10 +17,10 @@ tests/cases/compiler/withStatementErrors.ts(17,1): error TS1128: Declaration or bar(); // no error class C {} // error - ~~~~~ -!!! error TS1129: Statement expected. interface I {} // error + ~~~~~~~~~ +!!! error TS1129: Statement expected. module M {} // error diff --git a/tests/baselines/reference/withStatementErrors.js b/tests/baselines/reference/withStatementErrors.js index 5a4e0635db..43236c94d8 100644 --- a/tests/baselines/reference/withStatementErrors.js +++ b/tests/baselines/reference/withStatementErrors.js @@ -23,10 +23,10 @@ with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { bing = true; // no error bang = true; // no error function bar() { } // no error - bar(); -} // no error -var C = (function () { - function C() { - } - return C; -})(); // error + bar(); // no error + var C = (function () { + function C() { + } + return C; + })(); +} // error diff --git a/tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts b/tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts new file mode 100644 index 0000000000..efc3ccff9a --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts @@ -0,0 +1,3 @@ +function foo() { + class C { } +} \ No newline at end of file diff --git a/tests/cases/conformance/classes/classExpressions/classExpression1.ts b/tests/cases/conformance/classes/classExpressions/classExpression1.ts new file mode 100644 index 0000000000..809557f49a --- /dev/null +++ b/tests/cases/conformance/classes/classExpressions/classExpression1.ts @@ -0,0 +1 @@ +var v = class C {}; \ No newline at end of file diff --git a/tests/cases/conformance/classes/classExpressions/classExpression2.ts b/tests/cases/conformance/classes/classExpressions/classExpression2.ts new file mode 100644 index 0000000000..6365cd07eb --- /dev/null +++ b/tests/cases/conformance/classes/classExpressions/classExpression2.ts @@ -0,0 +1,2 @@ +class D { } +var v = class C extends D {}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/classExpressions/classExpressionES61.ts b/tests/cases/conformance/es6/classExpressions/classExpressionES61.ts new file mode 100644 index 0000000000..611a2fd4bc --- /dev/null +++ b/tests/cases/conformance/es6/classExpressions/classExpressionES61.ts @@ -0,0 +1,2 @@ +// @target: es6 +var v = class C {}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/classExpressions/classExpressionES62.ts b/tests/cases/conformance/es6/classExpressions/classExpressionES62.ts new file mode 100644 index 0000000000..97ca36a416 --- /dev/null +++ b/tests/cases/conformance/es6/classExpressions/classExpressionES62.ts @@ -0,0 +1,3 @@ +// @target: es6 +class D { } +var v = class C extends D {}; \ No newline at end of file diff --git a/tests/cases/fourslash/getOccurrencesReturnBroken.ts b/tests/cases/fourslash/getOccurrencesReturnBroken.ts index 08ec794f7e..2327a62d12 100644 --- a/tests/cases/fourslash/getOccurrencesReturnBroken.ts +++ b/tests/cases/fourslash/getOccurrencesReturnBroken.ts @@ -44,11 +44,13 @@ for (var i = 1; i <= test.markers().length; i++) { switch (i) { case 0: case 1: - case 4: verify.occurrencesAtPositionCount(0); break; case 3: verify.occurrencesAtPositionCount(1); // 'return' is an instance member break; + case 4: + verify.occurrencesAtPositionCount(4); + break; } } \ No newline at end of file diff --git a/tests/cases/fourslash/identifierErrorRecovery.ts b/tests/cases/fourslash/identifierErrorRecovery.ts index 3ba5d11469..cb266584b0 100644 --- a/tests/cases/fourslash/identifierErrorRecovery.ts +++ b/tests/cases/fourslash/identifierErrorRecovery.ts @@ -8,7 +8,7 @@ verify.errorExistsBetweenMarkers("1", "2"); verify.errorExistsBetweenMarkers("3", "4"); -verify.numberOfErrorsInCurrentFile(2); +verify.numberOfErrorsInCurrentFile(3); goTo.eof(); verify.completionListContains("foo"); verify.completionListContains("bar"); From b363a459ff8325d110b2614f9ede154def494a55 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 14:12:35 -0700 Subject: [PATCH 32/42] Add support for semicolons in class bodies --- src/compiler/binder.ts | 1 - src/compiler/emitter.ts | 14 +- src/compiler/parser.ts | 13 +- src/compiler/types.ts | 6 + .../baselines/reference/APISample_compile.js | 106 +++++++-------- .../reference/APISample_compile.types | 112 ++++++++-------- tests/baselines/reference/APISample_linter.js | 122 +++++++++--------- .../reference/APISample_linter.types | 112 ++++++++-------- .../reference/APISample_transform.js | 106 +++++++-------- .../reference/APISample_transform.types | 112 ++++++++-------- .../baselines/reference/APISample_watcher.js | 106 +++++++-------- .../reference/APISample_watcher.types | 112 ++++++++-------- .../classWithSemicolonClassElement1.js | 12 ++ .../classWithSemicolonClassElement1.types | 6 + .../classWithSemicolonClassElement2.js | 14 ++ .../classWithSemicolonClassElement2.types | 7 + .../classWithSemicolonClassElementES61.js | 9 ++ .../classWithSemicolonClassElementES61.types | 6 + .../classWithSemicolonClassElementES62.js | 11 ++ .../classWithSemicolonClassElementES62.types | 7 + .../reference/es6ClassTest3.errors.txt | 23 ---- tests/baselines/reference/es6ClassTest3.js | 2 + tests/baselines/reference/es6ClassTest3.types | 37 ++++++ .../reference/exportDeclareClass1.errors.txt | 12 +- .../reference/parser0_004152.errors.txt | 5 +- tests/baselines/reference/parser0_004152.js | 1 + .../parserErrantSemicolonInClass1.errors.txt | 17 ++- .../parserErrantSemicolonInClass1.js | 1 + ...sWhenHittingUnexpectedSemicolon.errors.txt | 11 -- ...sRecoversWhenHittingUnexpectedSemicolon.js | 1 + ...coversWhenHittingUnexpectedSemicolon.types | 11 ++ .../reference/primitiveMembers.errors.txt | 8 +- tests/baselines/reference/primitiveMembers.js | 2 + .../classWithSemicolonClassElement1.ts | 3 + .../classWithSemicolonClassElement2.ts | 4 + .../classWithSemicolonClassElementES61.ts | 4 + .../classWithSemicolonClassElementES62.ts | 5 + 37 files changed, 666 insertions(+), 475 deletions(-) create mode 100644 tests/baselines/reference/classWithSemicolonClassElement1.js create mode 100644 tests/baselines/reference/classWithSemicolonClassElement1.types create mode 100644 tests/baselines/reference/classWithSemicolonClassElement2.js create mode 100644 tests/baselines/reference/classWithSemicolonClassElement2.types create mode 100644 tests/baselines/reference/classWithSemicolonClassElementES61.js create mode 100644 tests/baselines/reference/classWithSemicolonClassElementES61.types create mode 100644 tests/baselines/reference/classWithSemicolonClassElementES62.js create mode 100644 tests/baselines/reference/classWithSemicolonClassElementES62.types delete mode 100644 tests/baselines/reference/es6ClassTest3.errors.txt create mode 100644 tests/baselines/reference/es6ClassTest3.types delete mode 100644 tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt create mode 100644 tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types create mode 100644 tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts create mode 100644 tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts create mode 100644 tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts create mode 100644 tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index d3dafb61e7..0ae33d08fd 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -126,7 +126,6 @@ module ts { return (node).isExportEquals ? "export=" : "default"; case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: return node.flags & NodeFlags.Default ? "default" : undefined; } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 60a09fb20e..dc532972b4 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3219,7 +3219,11 @@ module ts { function emitMemberFunctionsForES5AndLower(node: ClassLikeDeclaration) { forEach(node.members, member => { - if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) { + if (member.kind === SyntaxKind.SemicolonClassElement) { + writeLine(); + write(";"); + } + else if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) { if (!(member).body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -3292,7 +3296,9 @@ module ts { if ((member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) && !(member).body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature || member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) { + else if (member.kind === SyntaxKind.MethodDeclaration || + member.kind === SyntaxKind.GetAccessor || + member.kind === SyntaxKind.SetAccessor) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -3311,6 +3317,10 @@ module ts { emitEnd(member); emitTrailingComments(member); } + else if (member.kind === SyntaxKind.SemicolonClassElement) { + writeLine(); + write(";"); + } } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f728536e72..2972fba397 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1609,7 +1609,11 @@ module ts { case ParsingContext.TypeMembers: return isStartOfTypeMember(); case ParsingContext.ClassMembers: - return lookAhead(isClassMemberStart); + // We allow semicolons as class elements (as specified by ES6) as long as we're + // not in error recovery. If we're in error recovery, we don't want an errant + // semicolon to be treated as a class member (since they're almost always used + // for statements. + return lookAhead(isClassMemberStart) || (token === SyntaxKind.SemicolonToken && !inErrorRecovery); case ParsingContext.EnumMembers: // Include open bracket computed properties. This technically also lets in indexers, // which would be a candidate for improved error reporting. @@ -1996,6 +2000,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.PropertyDeclaration: + case SyntaxKind.SemicolonClassElement: return true; } } @@ -4692,6 +4697,12 @@ module ts { } function parseClassElement(): ClassElement { + if (token === SyntaxKind.SemicolonToken) { + let result = createNode(SyntaxKind.SemicolonClassElement); + nextToken(); + return finishNode(result); + } + let fullStart = getNodePos(); let decorators = parseDecorators(); let modifiers = parseModifiers(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 08c8985b14..82af3dfde0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -208,6 +208,7 @@ module ts { // Misc TemplateSpan, HeritageClauseElement, + SemicolonClassElement, // Element Block, VariableStatement, @@ -538,6 +539,11 @@ module ts { body?: Block; } + // For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. + export interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } + // See the comment on MethodDeclaration for the intuition behind AccessorDeclaration being a // ClassElement and an ObjectLiteralElement. export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 9bbd1bb1af..3d49f24613 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -237,57 +237,58 @@ declare module "typescript" { OmittedExpression = 175, TemplateSpan = 176, HeritageClauseElement = 177, - Block = 178, - VariableStatement = 179, - EmptyStatement = 180, - ExpressionStatement = 181, - IfStatement = 182, - DoStatement = 183, - WhileStatement = 184, - ForStatement = 185, - ForInStatement = 186, - ForOfStatement = 187, - ContinueStatement = 188, - BreakStatement = 189, - ReturnStatement = 190, - WithStatement = 191, - SwitchStatement = 192, - LabeledStatement = 193, - ThrowStatement = 194, - TryStatement = 195, - DebuggerStatement = 196, - VariableDeclaration = 197, - VariableDeclarationList = 198, - FunctionDeclaration = 199, - ClassDeclaration = 200, - InterfaceDeclaration = 201, - TypeAliasDeclaration = 202, - EnumDeclaration = 203, - ModuleDeclaration = 204, - ModuleBlock = 205, - CaseBlock = 206, - ImportEqualsDeclaration = 207, - ImportDeclaration = 208, - ImportClause = 209, - NamespaceImport = 210, - NamedImports = 211, - ImportSpecifier = 212, - ExportAssignment = 213, - ExportDeclaration = 214, - NamedExports = 215, - ExportSpecifier = 216, - MissingDeclaration = 217, - ExternalModuleReference = 218, - CaseClause = 219, - DefaultClause = 220, - HeritageClause = 221, - CatchClause = 222, - PropertyAssignment = 223, - ShorthandPropertyAssignment = 224, - EnumMember = 225, - SourceFile = 226, - SyntaxList = 227, - Count = 228, + 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, @@ -471,6 +472,9 @@ declare module "typescript" { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index ca965a9161..2f25a4a588 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -729,157 +729,160 @@ declare module "typescript" { HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 178, + SemicolonClassElement = 178, +>SemicolonClassElement : SyntaxKind + + Block = 179, >Block : SyntaxKind - VariableStatement = 179, + VariableStatement = 180, >VariableStatement : SyntaxKind - EmptyStatement = 180, + EmptyStatement = 181, >EmptyStatement : SyntaxKind - ExpressionStatement = 181, + ExpressionStatement = 182, >ExpressionStatement : SyntaxKind - IfStatement = 182, + IfStatement = 183, >IfStatement : SyntaxKind - DoStatement = 183, + DoStatement = 184, >DoStatement : SyntaxKind - WhileStatement = 184, + WhileStatement = 185, >WhileStatement : SyntaxKind - ForStatement = 185, + ForStatement = 186, >ForStatement : SyntaxKind - ForInStatement = 186, + ForInStatement = 187, >ForInStatement : SyntaxKind - ForOfStatement = 187, + ForOfStatement = 188, >ForOfStatement : SyntaxKind - ContinueStatement = 188, + ContinueStatement = 189, >ContinueStatement : SyntaxKind - BreakStatement = 189, + BreakStatement = 190, >BreakStatement : SyntaxKind - ReturnStatement = 190, + ReturnStatement = 191, >ReturnStatement : SyntaxKind - WithStatement = 191, + WithStatement = 192, >WithStatement : SyntaxKind - SwitchStatement = 192, + SwitchStatement = 193, >SwitchStatement : SyntaxKind - LabeledStatement = 193, + LabeledStatement = 194, >LabeledStatement : SyntaxKind - ThrowStatement = 194, + ThrowStatement = 195, >ThrowStatement : SyntaxKind - TryStatement = 195, + TryStatement = 196, >TryStatement : SyntaxKind - DebuggerStatement = 196, + DebuggerStatement = 197, >DebuggerStatement : SyntaxKind - VariableDeclaration = 197, + VariableDeclaration = 198, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 198, + VariableDeclarationList = 199, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 199, + FunctionDeclaration = 200, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 200, + ClassDeclaration = 201, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 201, + InterfaceDeclaration = 202, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 202, + TypeAliasDeclaration = 203, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 203, + EnumDeclaration = 204, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 204, + ModuleDeclaration = 205, >ModuleDeclaration : SyntaxKind - ModuleBlock = 205, + ModuleBlock = 206, >ModuleBlock : SyntaxKind - CaseBlock = 206, + CaseBlock = 207, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 207, + ImportEqualsDeclaration = 208, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 208, + ImportDeclaration = 209, >ImportDeclaration : SyntaxKind - ImportClause = 209, + ImportClause = 210, >ImportClause : SyntaxKind - NamespaceImport = 210, + NamespaceImport = 211, >NamespaceImport : SyntaxKind - NamedImports = 211, + NamedImports = 212, >NamedImports : SyntaxKind - ImportSpecifier = 212, + ImportSpecifier = 213, >ImportSpecifier : SyntaxKind - ExportAssignment = 213, + ExportAssignment = 214, >ExportAssignment : SyntaxKind - ExportDeclaration = 214, + ExportDeclaration = 215, >ExportDeclaration : SyntaxKind - NamedExports = 215, + NamedExports = 216, >NamedExports : SyntaxKind - ExportSpecifier = 216, + ExportSpecifier = 217, >ExportSpecifier : SyntaxKind - MissingDeclaration = 217, + MissingDeclaration = 218, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 218, + ExternalModuleReference = 219, >ExternalModuleReference : SyntaxKind - CaseClause = 219, + CaseClause = 220, >CaseClause : SyntaxKind - DefaultClause = 220, + DefaultClause = 221, >DefaultClause : SyntaxKind - HeritageClause = 221, + HeritageClause = 222, >HeritageClause : SyntaxKind - CatchClause = 222, + CatchClause = 223, >CatchClause : SyntaxKind - PropertyAssignment = 223, + PropertyAssignment = 224, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 224, + ShorthandPropertyAssignment = 225, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 225, + EnumMember = 226, >EnumMember : SyntaxKind - SourceFile = 226, + SourceFile = 227, >SourceFile : SyntaxKind - SyntaxList = 227, + SyntaxList = 228, >SyntaxList : SyntaxKind - Count = 228, + Count = 229, >Count : SyntaxKind FirstAssignment = 53, @@ -1436,6 +1439,13 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index d7d3ece0c8..71e67ebec6 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -268,57 +268,58 @@ declare module "typescript" { OmittedExpression = 175, TemplateSpan = 176, HeritageClauseElement = 177, - Block = 178, - VariableStatement = 179, - EmptyStatement = 180, - ExpressionStatement = 181, - IfStatement = 182, - DoStatement = 183, - WhileStatement = 184, - ForStatement = 185, - ForInStatement = 186, - ForOfStatement = 187, - ContinueStatement = 188, - BreakStatement = 189, - ReturnStatement = 190, - WithStatement = 191, - SwitchStatement = 192, - LabeledStatement = 193, - ThrowStatement = 194, - TryStatement = 195, - DebuggerStatement = 196, - VariableDeclaration = 197, - VariableDeclarationList = 198, - FunctionDeclaration = 199, - ClassDeclaration = 200, - InterfaceDeclaration = 201, - TypeAliasDeclaration = 202, - EnumDeclaration = 203, - ModuleDeclaration = 204, - ModuleBlock = 205, - CaseBlock = 206, - ImportEqualsDeclaration = 207, - ImportDeclaration = 208, - ImportClause = 209, - NamespaceImport = 210, - NamedImports = 211, - ImportSpecifier = 212, - ExportAssignment = 213, - ExportDeclaration = 214, - NamedExports = 215, - ExportSpecifier = 216, - MissingDeclaration = 217, - ExternalModuleReference = 218, - CaseClause = 219, - DefaultClause = 220, - HeritageClause = 221, - CatchClause = 222, - PropertyAssignment = 223, - ShorthandPropertyAssignment = 224, - EnumMember = 225, - SourceFile = 226, - SyntaxList = 227, - Count = 228, + 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, @@ -502,6 +503,9 @@ declare module "typescript" { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; @@ -2052,21 +2056,21 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 185 /* ForStatement */: - case 186 /* ForInStatement */: - case 184 /* WhileStatement */: - case 183 /* DoStatement */: - if (node.statement.kind !== 178 /* Block */) { + 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 182 /* IfStatement */: + case 183 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 178 /* Block */) { + 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 !== 178 /* Block */ && ifStatement.elseStatement.kind !== 182 /* 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; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index e68910b26e..eb4a2f8a02 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -875,157 +875,160 @@ declare module "typescript" { HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 178, + SemicolonClassElement = 178, +>SemicolonClassElement : SyntaxKind + + Block = 179, >Block : SyntaxKind - VariableStatement = 179, + VariableStatement = 180, >VariableStatement : SyntaxKind - EmptyStatement = 180, + EmptyStatement = 181, >EmptyStatement : SyntaxKind - ExpressionStatement = 181, + ExpressionStatement = 182, >ExpressionStatement : SyntaxKind - IfStatement = 182, + IfStatement = 183, >IfStatement : SyntaxKind - DoStatement = 183, + DoStatement = 184, >DoStatement : SyntaxKind - WhileStatement = 184, + WhileStatement = 185, >WhileStatement : SyntaxKind - ForStatement = 185, + ForStatement = 186, >ForStatement : SyntaxKind - ForInStatement = 186, + ForInStatement = 187, >ForInStatement : SyntaxKind - ForOfStatement = 187, + ForOfStatement = 188, >ForOfStatement : SyntaxKind - ContinueStatement = 188, + ContinueStatement = 189, >ContinueStatement : SyntaxKind - BreakStatement = 189, + BreakStatement = 190, >BreakStatement : SyntaxKind - ReturnStatement = 190, + ReturnStatement = 191, >ReturnStatement : SyntaxKind - WithStatement = 191, + WithStatement = 192, >WithStatement : SyntaxKind - SwitchStatement = 192, + SwitchStatement = 193, >SwitchStatement : SyntaxKind - LabeledStatement = 193, + LabeledStatement = 194, >LabeledStatement : SyntaxKind - ThrowStatement = 194, + ThrowStatement = 195, >ThrowStatement : SyntaxKind - TryStatement = 195, + TryStatement = 196, >TryStatement : SyntaxKind - DebuggerStatement = 196, + DebuggerStatement = 197, >DebuggerStatement : SyntaxKind - VariableDeclaration = 197, + VariableDeclaration = 198, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 198, + VariableDeclarationList = 199, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 199, + FunctionDeclaration = 200, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 200, + ClassDeclaration = 201, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 201, + InterfaceDeclaration = 202, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 202, + TypeAliasDeclaration = 203, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 203, + EnumDeclaration = 204, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 204, + ModuleDeclaration = 205, >ModuleDeclaration : SyntaxKind - ModuleBlock = 205, + ModuleBlock = 206, >ModuleBlock : SyntaxKind - CaseBlock = 206, + CaseBlock = 207, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 207, + ImportEqualsDeclaration = 208, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 208, + ImportDeclaration = 209, >ImportDeclaration : SyntaxKind - ImportClause = 209, + ImportClause = 210, >ImportClause : SyntaxKind - NamespaceImport = 210, + NamespaceImport = 211, >NamespaceImport : SyntaxKind - NamedImports = 211, + NamedImports = 212, >NamedImports : SyntaxKind - ImportSpecifier = 212, + ImportSpecifier = 213, >ImportSpecifier : SyntaxKind - ExportAssignment = 213, + ExportAssignment = 214, >ExportAssignment : SyntaxKind - ExportDeclaration = 214, + ExportDeclaration = 215, >ExportDeclaration : SyntaxKind - NamedExports = 215, + NamedExports = 216, >NamedExports : SyntaxKind - ExportSpecifier = 216, + ExportSpecifier = 217, >ExportSpecifier : SyntaxKind - MissingDeclaration = 217, + MissingDeclaration = 218, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 218, + ExternalModuleReference = 219, >ExternalModuleReference : SyntaxKind - CaseClause = 219, + CaseClause = 220, >CaseClause : SyntaxKind - DefaultClause = 220, + DefaultClause = 221, >DefaultClause : SyntaxKind - HeritageClause = 221, + HeritageClause = 222, >HeritageClause : SyntaxKind - CatchClause = 222, + CatchClause = 223, >CatchClause : SyntaxKind - PropertyAssignment = 223, + PropertyAssignment = 224, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 224, + ShorthandPropertyAssignment = 225, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 225, + EnumMember = 226, >EnumMember : SyntaxKind - SourceFile = 226, + SourceFile = 227, >SourceFile : SyntaxKind - SyntaxList = 227, + SyntaxList = 228, >SyntaxList : SyntaxKind - Count = 228, + Count = 229, >Count : SyntaxKind FirstAssignment = 53, @@ -1582,6 +1585,13 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index aac968cade..cacd6bed77 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -269,57 +269,58 @@ declare module "typescript" { OmittedExpression = 175, TemplateSpan = 176, HeritageClauseElement = 177, - Block = 178, - VariableStatement = 179, - EmptyStatement = 180, - ExpressionStatement = 181, - IfStatement = 182, - DoStatement = 183, - WhileStatement = 184, - ForStatement = 185, - ForInStatement = 186, - ForOfStatement = 187, - ContinueStatement = 188, - BreakStatement = 189, - ReturnStatement = 190, - WithStatement = 191, - SwitchStatement = 192, - LabeledStatement = 193, - ThrowStatement = 194, - TryStatement = 195, - DebuggerStatement = 196, - VariableDeclaration = 197, - VariableDeclarationList = 198, - FunctionDeclaration = 199, - ClassDeclaration = 200, - InterfaceDeclaration = 201, - TypeAliasDeclaration = 202, - EnumDeclaration = 203, - ModuleDeclaration = 204, - ModuleBlock = 205, - CaseBlock = 206, - ImportEqualsDeclaration = 207, - ImportDeclaration = 208, - ImportClause = 209, - NamespaceImport = 210, - NamedImports = 211, - ImportSpecifier = 212, - ExportAssignment = 213, - ExportDeclaration = 214, - NamedExports = 215, - ExportSpecifier = 216, - MissingDeclaration = 217, - ExternalModuleReference = 218, - CaseClause = 219, - DefaultClause = 220, - HeritageClause = 221, - CatchClause = 222, - PropertyAssignment = 223, - ShorthandPropertyAssignment = 224, - EnumMember = 225, - SourceFile = 226, - SyntaxList = 227, - Count = 228, + 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, @@ -503,6 +504,9 @@ declare module "typescript" { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 9c546b8c82..284588b13f 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -825,157 +825,160 @@ declare module "typescript" { HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 178, + SemicolonClassElement = 178, +>SemicolonClassElement : SyntaxKind + + Block = 179, >Block : SyntaxKind - VariableStatement = 179, + VariableStatement = 180, >VariableStatement : SyntaxKind - EmptyStatement = 180, + EmptyStatement = 181, >EmptyStatement : SyntaxKind - ExpressionStatement = 181, + ExpressionStatement = 182, >ExpressionStatement : SyntaxKind - IfStatement = 182, + IfStatement = 183, >IfStatement : SyntaxKind - DoStatement = 183, + DoStatement = 184, >DoStatement : SyntaxKind - WhileStatement = 184, + WhileStatement = 185, >WhileStatement : SyntaxKind - ForStatement = 185, + ForStatement = 186, >ForStatement : SyntaxKind - ForInStatement = 186, + ForInStatement = 187, >ForInStatement : SyntaxKind - ForOfStatement = 187, + ForOfStatement = 188, >ForOfStatement : SyntaxKind - ContinueStatement = 188, + ContinueStatement = 189, >ContinueStatement : SyntaxKind - BreakStatement = 189, + BreakStatement = 190, >BreakStatement : SyntaxKind - ReturnStatement = 190, + ReturnStatement = 191, >ReturnStatement : SyntaxKind - WithStatement = 191, + WithStatement = 192, >WithStatement : SyntaxKind - SwitchStatement = 192, + SwitchStatement = 193, >SwitchStatement : SyntaxKind - LabeledStatement = 193, + LabeledStatement = 194, >LabeledStatement : SyntaxKind - ThrowStatement = 194, + ThrowStatement = 195, >ThrowStatement : SyntaxKind - TryStatement = 195, + TryStatement = 196, >TryStatement : SyntaxKind - DebuggerStatement = 196, + DebuggerStatement = 197, >DebuggerStatement : SyntaxKind - VariableDeclaration = 197, + VariableDeclaration = 198, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 198, + VariableDeclarationList = 199, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 199, + FunctionDeclaration = 200, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 200, + ClassDeclaration = 201, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 201, + InterfaceDeclaration = 202, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 202, + TypeAliasDeclaration = 203, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 203, + EnumDeclaration = 204, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 204, + ModuleDeclaration = 205, >ModuleDeclaration : SyntaxKind - ModuleBlock = 205, + ModuleBlock = 206, >ModuleBlock : SyntaxKind - CaseBlock = 206, + CaseBlock = 207, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 207, + ImportEqualsDeclaration = 208, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 208, + ImportDeclaration = 209, >ImportDeclaration : SyntaxKind - ImportClause = 209, + ImportClause = 210, >ImportClause : SyntaxKind - NamespaceImport = 210, + NamespaceImport = 211, >NamespaceImport : SyntaxKind - NamedImports = 211, + NamedImports = 212, >NamedImports : SyntaxKind - ImportSpecifier = 212, + ImportSpecifier = 213, >ImportSpecifier : SyntaxKind - ExportAssignment = 213, + ExportAssignment = 214, >ExportAssignment : SyntaxKind - ExportDeclaration = 214, + ExportDeclaration = 215, >ExportDeclaration : SyntaxKind - NamedExports = 215, + NamedExports = 216, >NamedExports : SyntaxKind - ExportSpecifier = 216, + ExportSpecifier = 217, >ExportSpecifier : SyntaxKind - MissingDeclaration = 217, + MissingDeclaration = 218, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 218, + ExternalModuleReference = 219, >ExternalModuleReference : SyntaxKind - CaseClause = 219, + CaseClause = 220, >CaseClause : SyntaxKind - DefaultClause = 220, + DefaultClause = 221, >DefaultClause : SyntaxKind - HeritageClause = 221, + HeritageClause = 222, >HeritageClause : SyntaxKind - CatchClause = 222, + CatchClause = 223, >CatchClause : SyntaxKind - PropertyAssignment = 223, + PropertyAssignment = 224, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 224, + ShorthandPropertyAssignment = 225, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 225, + EnumMember = 226, >EnumMember : SyntaxKind - SourceFile = 226, + SourceFile = 227, >SourceFile : SyntaxKind - SyntaxList = 227, + SyntaxList = 228, >SyntaxList : SyntaxKind - Count = 228, + Count = 229, >Count : SyntaxKind FirstAssignment = 53, @@ -1532,6 +1535,13 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index e3280bfb2c..5b04b7cff1 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -306,57 +306,58 @@ declare module "typescript" { OmittedExpression = 175, TemplateSpan = 176, HeritageClauseElement = 177, - Block = 178, - VariableStatement = 179, - EmptyStatement = 180, - ExpressionStatement = 181, - IfStatement = 182, - DoStatement = 183, - WhileStatement = 184, - ForStatement = 185, - ForInStatement = 186, - ForOfStatement = 187, - ContinueStatement = 188, - BreakStatement = 189, - ReturnStatement = 190, - WithStatement = 191, - SwitchStatement = 192, - LabeledStatement = 193, - ThrowStatement = 194, - TryStatement = 195, - DebuggerStatement = 196, - VariableDeclaration = 197, - VariableDeclarationList = 198, - FunctionDeclaration = 199, - ClassDeclaration = 200, - InterfaceDeclaration = 201, - TypeAliasDeclaration = 202, - EnumDeclaration = 203, - ModuleDeclaration = 204, - ModuleBlock = 205, - CaseBlock = 206, - ImportEqualsDeclaration = 207, - ImportDeclaration = 208, - ImportClause = 209, - NamespaceImport = 210, - NamedImports = 211, - ImportSpecifier = 212, - ExportAssignment = 213, - ExportDeclaration = 214, - NamedExports = 215, - ExportSpecifier = 216, - MissingDeclaration = 217, - ExternalModuleReference = 218, - CaseClause = 219, - DefaultClause = 220, - HeritageClause = 221, - CatchClause = 222, - PropertyAssignment = 223, - ShorthandPropertyAssignment = 224, - EnumMember = 225, - SourceFile = 226, - SyntaxList = 227, - Count = 228, + 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, @@ -540,6 +541,9 @@ declare module "typescript" { interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { body?: Block; } + interface SemicolonClassElement extends ClassElement { + _semicolonClassElementBrand: any; + } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; body: Block; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 6507fa41e2..077d5fb8c6 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -998,157 +998,160 @@ declare module "typescript" { HeritageClauseElement = 177, >HeritageClauseElement : SyntaxKind - Block = 178, + SemicolonClassElement = 178, +>SemicolonClassElement : SyntaxKind + + Block = 179, >Block : SyntaxKind - VariableStatement = 179, + VariableStatement = 180, >VariableStatement : SyntaxKind - EmptyStatement = 180, + EmptyStatement = 181, >EmptyStatement : SyntaxKind - ExpressionStatement = 181, + ExpressionStatement = 182, >ExpressionStatement : SyntaxKind - IfStatement = 182, + IfStatement = 183, >IfStatement : SyntaxKind - DoStatement = 183, + DoStatement = 184, >DoStatement : SyntaxKind - WhileStatement = 184, + WhileStatement = 185, >WhileStatement : SyntaxKind - ForStatement = 185, + ForStatement = 186, >ForStatement : SyntaxKind - ForInStatement = 186, + ForInStatement = 187, >ForInStatement : SyntaxKind - ForOfStatement = 187, + ForOfStatement = 188, >ForOfStatement : SyntaxKind - ContinueStatement = 188, + ContinueStatement = 189, >ContinueStatement : SyntaxKind - BreakStatement = 189, + BreakStatement = 190, >BreakStatement : SyntaxKind - ReturnStatement = 190, + ReturnStatement = 191, >ReturnStatement : SyntaxKind - WithStatement = 191, + WithStatement = 192, >WithStatement : SyntaxKind - SwitchStatement = 192, + SwitchStatement = 193, >SwitchStatement : SyntaxKind - LabeledStatement = 193, + LabeledStatement = 194, >LabeledStatement : SyntaxKind - ThrowStatement = 194, + ThrowStatement = 195, >ThrowStatement : SyntaxKind - TryStatement = 195, + TryStatement = 196, >TryStatement : SyntaxKind - DebuggerStatement = 196, + DebuggerStatement = 197, >DebuggerStatement : SyntaxKind - VariableDeclaration = 197, + VariableDeclaration = 198, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 198, + VariableDeclarationList = 199, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 199, + FunctionDeclaration = 200, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 200, + ClassDeclaration = 201, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 201, + InterfaceDeclaration = 202, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 202, + TypeAliasDeclaration = 203, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 203, + EnumDeclaration = 204, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 204, + ModuleDeclaration = 205, >ModuleDeclaration : SyntaxKind - ModuleBlock = 205, + ModuleBlock = 206, >ModuleBlock : SyntaxKind - CaseBlock = 206, + CaseBlock = 207, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 207, + ImportEqualsDeclaration = 208, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 208, + ImportDeclaration = 209, >ImportDeclaration : SyntaxKind - ImportClause = 209, + ImportClause = 210, >ImportClause : SyntaxKind - NamespaceImport = 210, + NamespaceImport = 211, >NamespaceImport : SyntaxKind - NamedImports = 211, + NamedImports = 212, >NamedImports : SyntaxKind - ImportSpecifier = 212, + ImportSpecifier = 213, >ImportSpecifier : SyntaxKind - ExportAssignment = 213, + ExportAssignment = 214, >ExportAssignment : SyntaxKind - ExportDeclaration = 214, + ExportDeclaration = 215, >ExportDeclaration : SyntaxKind - NamedExports = 215, + NamedExports = 216, >NamedExports : SyntaxKind - ExportSpecifier = 216, + ExportSpecifier = 217, >ExportSpecifier : SyntaxKind - MissingDeclaration = 217, + MissingDeclaration = 218, >MissingDeclaration : SyntaxKind - ExternalModuleReference = 218, + ExternalModuleReference = 219, >ExternalModuleReference : SyntaxKind - CaseClause = 219, + CaseClause = 220, >CaseClause : SyntaxKind - DefaultClause = 220, + DefaultClause = 221, >DefaultClause : SyntaxKind - HeritageClause = 221, + HeritageClause = 222, >HeritageClause : SyntaxKind - CatchClause = 222, + CatchClause = 223, >CatchClause : SyntaxKind - PropertyAssignment = 223, + PropertyAssignment = 224, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 224, + ShorthandPropertyAssignment = 225, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 225, + EnumMember = 226, >EnumMember : SyntaxKind - SourceFile = 226, + SourceFile = 227, >SourceFile : SyntaxKind - SyntaxList = 227, + SyntaxList = 228, >SyntaxList : SyntaxKind - Count = 228, + Count = 229, >Count : SyntaxKind FirstAssignment = 53, @@ -1705,6 +1708,13 @@ declare module "typescript" { 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 diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.js b/tests/baselines/reference/classWithSemicolonClassElement1.js new file mode 100644 index 0000000000..3838316e11 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.js @@ -0,0 +1,12 @@ +//// [classWithSemicolonClassElement1.ts] +class C { + ; +} + +//// [classWithSemicolonClassElement1.js] +var C = (function () { + function C() { + } + ; + return C; +})(); diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.types b/tests/baselines/reference/classWithSemicolonClassElement1.types new file mode 100644 index 0000000000..d3315c4cd0 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts === +class C { +>C : C + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.js b/tests/baselines/reference/classWithSemicolonClassElement2.js new file mode 100644 index 0000000000..77af51bce6 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.js @@ -0,0 +1,14 @@ +//// [classWithSemicolonClassElement2.ts] +class C { + ; + ; +} + +//// [classWithSemicolonClassElement2.js] +var C = (function () { + function C() { + } + ; + ; + return C; +})(); diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.types b/tests/baselines/reference/classWithSemicolonClassElement2.types new file mode 100644 index 0000000000..ce638e79fc --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts === +class C { +>C : C + + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.js b/tests/baselines/reference/classWithSemicolonClassElementES61.js new file mode 100644 index 0000000000..27f020257f --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.js @@ -0,0 +1,9 @@ +//// [classWithSemicolonClassElementES61.ts] +class C { + ; +} + +//// [classWithSemicolonClassElementES61.js] +class C { + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.types b/tests/baselines/reference/classWithSemicolonClassElementES61.types new file mode 100644 index 0000000000..974f269d33 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts === +class C { +>C : C + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.js b/tests/baselines/reference/classWithSemicolonClassElementES62.js new file mode 100644 index 0000000000..068286c25c --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.js @@ -0,0 +1,11 @@ +//// [classWithSemicolonClassElementES62.ts] +class C { + ; + ; +} + +//// [classWithSemicolonClassElementES62.js] +class C { + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.types b/tests/baselines/reference/classWithSemicolonClassElementES62.types new file mode 100644 index 0000000000..9f96fbb5eb --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts === +class C { +>C : C + + ; + ; +} diff --git a/tests/baselines/reference/es6ClassTest3.errors.txt b/tests/baselines/reference/es6ClassTest3.errors.txt deleted file mode 100644 index 5eb310f338..0000000000 --- a/tests/baselines/reference/es6ClassTest3.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/compiler/es6ClassTest3.ts(3,22): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/es6ClassTest3.ts(4,23): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - - -==== tests/cases/compiler/es6ClassTest3.ts (2 errors) ==== - module M { - class Visibility { - public foo() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private bar() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private x: number; - public y: number; - public z: number; - - constructor() { - this.x = 1; - this.y = 2; - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest3.js b/tests/baselines/reference/es6ClassTest3.js index dc9f1c6715..572bd07963 100644 --- a/tests/baselines/reference/es6ClassTest3.js +++ b/tests/baselines/reference/es6ClassTest3.js @@ -23,7 +23,9 @@ var M; this.y = 2; } Visibility.prototype.foo = function () { }; + ; Visibility.prototype.bar = function () { }; + ; return Visibility; })(); })(M || (M = {})); diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types new file mode 100644 index 0000000000..ba0f2036f0 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/es6ClassTest3.ts === +module M { +>M : typeof M + + class Visibility { +>Visibility : Visibility + + public foo() { }; +>foo : () => void + + private bar() { }; +>bar : () => void + + private x: number; +>x : number + + public y: number; +>y : number + + public z: number; +>z : number + + constructor() { + this.x = 1; +>this.x = 1 : number +>this.x : number +>this : Visibility +>x : number + + this.y = 2; +>this.y = 2 : number +>this.y : number +>this : Visibility +>y : number + } + } +} diff --git a/tests/baselines/reference/exportDeclareClass1.errors.txt b/tests/baselines/reference/exportDeclareClass1.errors.txt index c93dc5d0b0..247b0511ed 100644 --- a/tests/baselines/reference/exportDeclareClass1.errors.txt +++ b/tests/baselines/reference/exportDeclareClass1.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/exportDeclareClass1.ts(2,24): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/exportDeclareClass1.ts(3,34): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1184: An implementation cannot be declared in ambient contexts. +tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1184: An implementation cannot be declared in ambient contexts. ==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ==== export declare class eaC { static tF() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. static tsF(param:any) { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1184: An implementation cannot be declared in ambient contexts. }; export declare class eaC2 { diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index 97b9bfe34a..43a8945ffe 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -32,11 +32,10 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,86): error T tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error TS1005: ';' expected. -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,98): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'. -==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (36 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (35 errors) ==== export class Game { ~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. @@ -107,8 +106,6 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T !!! error TS2300: Duplicate identifier '0'. ~ !!! error TS1005: ';' expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. private prevConfig: SeedCoords[][]; ~~~~~~~~~~ !!! error TS2304: Cannot find name 'SeedCoords'. diff --git a/tests/baselines/reference/parser0_004152.js b/tests/baselines/reference/parser0_004152.js index cce49f68fc..cd6a20742a 100644 --- a/tests/baselines/reference/parser0_004152.js +++ b/tests/baselines/reference/parser0_004152.js @@ -9,6 +9,7 @@ var Game = (function () { function Game() { this.position = new DisplayPosition([]); } + ; return Game; })(); exports.Game = Game; diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt index 7e71ec8fc6..aec80ad934 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt @@ -1,7 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(9,21): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(18,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(24,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (4 errors) ==== class a { //constructor (); constructor (n: number); @@ -11,23 +14,29 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonIn } public pgF() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. public pv; public get d() { + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 30; } public set d() { + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } public static get p2() { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return { x: 30, y: 40 }; } private static d2() { } private static get p3() { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "string"; } private pv3; diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.js b/tests/baselines/reference/parserErrantSemicolonInClass1.js index f761b04ca7..f3834da7e7 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.js +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.js @@ -40,6 +40,7 @@ var a = (function () { function a(ns) { } a.prototype.pgF = function () { }; + ; Object.defineProperty(a.prototype, "d", { get: function () { return 30; diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt deleted file mode 100644 index 09eabb5b58..0000000000 --- a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts(2,19): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - - -==== tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts (1 errors) ==== - class C { - public f() { }; - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - private m; - } - \ No newline at end of file diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js index 8b197fd35a..59129f91b9 100644 --- a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js +++ b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js @@ -10,5 +10,6 @@ var C = (function () { function C() { } C.prototype.f = function () { }; + ; return C; })(); diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types new file mode 100644 index 0000000000..6fdfccfa7f --- /dev/null +++ b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts === +class C { +>C : C + + public f() { }; +>f : () => void + + private m; +>m : any +} + diff --git a/tests/baselines/reference/primitiveMembers.errors.txt b/tests/baselines/reference/primitiveMembers.errors.txt index 801d3fac45..da8b75f9bc 100644 --- a/tests/baselines/reference/primitiveMembers.errors.txt +++ b/tests/baselines/reference/primitiveMembers.errors.txt @@ -1,10 +1,8 @@ tests/cases/compiler/primitiveMembers.ts(5,3): error TS2339: Property 'toBAZ' does not exist on type 'number'. tests/cases/compiler/primitiveMembers.ts(11,1): error TS2322: Type 'Number' is not assignable to type 'number'. -tests/cases/compiler/primitiveMembers.ts(24,35): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -==== tests/cases/compiler/primitiveMembers.ts (4 errors) ==== +==== tests/cases/compiler/primitiveMembers.ts (2 errors) ==== var x = 5; var r = /yo/; r.source; @@ -33,11 +31,7 @@ tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. class baz { public bar(): void { }; } - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. class foo extends baz { public bar(){ return undefined}; } - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index bf3f1a1710..629d55ed0f 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -58,6 +58,7 @@ var baz = (function () { function baz() { } baz.prototype.bar = function () { }; + ; return baz; })(); var foo = (function (_super) { @@ -66,5 +67,6 @@ var foo = (function (_super) { _super.apply(this, arguments); } foo.prototype.bar = function () { return undefined; }; + ; return foo; })(baz); diff --git a/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts b/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts new file mode 100644 index 0000000000..6571258d9d --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts @@ -0,0 +1,3 @@ +class C { + ; +} \ No newline at end of file diff --git a/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts b/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts new file mode 100644 index 0000000000..716c8b58ae --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts @@ -0,0 +1,4 @@ +class C { + ; + ; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts b/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts new file mode 100644 index 0000000000..e1c31c16ad --- /dev/null +++ b/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts @@ -0,0 +1,4 @@ +//@target: es6 +class C { + ; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts b/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts new file mode 100644 index 0000000000..d83200da62 --- /dev/null +++ b/tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts @@ -0,0 +1,5 @@ +//@target: es6 +class C { + ; + ; +} \ No newline at end of file From c59ce68c63c8886211f87b993d1f33264706419a Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 14:30:31 -0700 Subject: [PATCH 33/42] Fix comment. --- src/compiler/utilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index e8d4ca66e0..d59aedf068 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1770,7 +1770,7 @@ module ts { } } - // Returns true if this heritage clause element's expression contains something unsupported + // Returns false if this heritage clause element's expression contains something unsupported // (i.e. not a name or dotted name). export function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean { return isSupportedHeritageClauseElementExpression(node.expression); From 99581fe5ef99643389e8e355ae4a8f1610739b3e Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 14:31:12 -0700 Subject: [PATCH 34/42] Remove blank line. --- src/compiler/checker.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 02dfc70c6d..5d1c38eb82 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1268,7 +1268,6 @@ module ts { } function isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult { - // get symbol of the first identifier of the entityName let meaning: SymbolFlags; if (entityName.parent.kind === SyntaxKind.TypeQuery) { From 785cb5597724c698b59d06bcc65904c34c3720d7 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 14:32:36 -0700 Subject: [PATCH 35/42] Add explanatory comment. --- src/compiler/checker.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5d1c38eb82..80ccd46e6c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3327,6 +3327,8 @@ module ts { if (!links.resolvedType) { let type: Type; + // We don't currently support heritage clauses with complex expressions in them. + // For these cases, we just set the type to be the unknownType. if (node.kind !== SyntaxKind.HeritageClauseElement || isSupportedHeritageClauseElement(node)) { let typeNameOrExpression = node.kind === SyntaxKind.TypeReference ? (node).typeName From fe5ed072fce3d5bbd2d780f43ff91688b6ce3c3d Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 14:58:30 -0700 Subject: [PATCH 36/42] Add file that was errantly removed. --- .../reference/APISample_linter.types.pull | 6412 +++++++++++++++++ 1 file changed, 6412 insertions(+) create mode 100644 tests/baselines/reference/APISample_linter.types.pull diff --git a/tests/baselines/reference/APISample_linter.types.pull b/tests/baselines/reference/APISample_linter.types.pull new file mode 100644 index 0000000000..759a8390d6 --- /dev/null +++ b/tests/baselines/reference/APISample_linter.types.pull @@ -0,0 +1,6412 @@ +=== 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 Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>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 + + getExportsOfExternalModule(node: ImportDeclaration): Symbol[]; +>getExportsOfExternalModule : (node: ImportDeclaration) => Symbol[] +>node : ImportDeclaration +>ImportDeclaration : ImportDeclaration +>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: Expression | Identifier | QualifiedName, enclosingDeclaration: Node) => SymbolVisibilityResult +>entityName : Expression | Identifier | 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" { + /** 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 + } + 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 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 93ff9e69d71595cfddc069caf3d4eee9e8c7c7e3 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 16:03:08 -0700 Subject: [PATCH 37/42] CR feedback. --- src/compiler/checker.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c8cbd3ef74..991824f025 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -787,7 +787,7 @@ module ts { // Resolves a qualified name and any involved aliases function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags): Symbol { - if (getFullWidth(name) === 0) { + if (nodeIsMissing(name)) { return undefined; } @@ -803,7 +803,7 @@ module ts { let right = name.kind === SyntaxKind.QualifiedName ? (name).right : (name).name; let namespace = resolveEntityName(left, SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || getFullWidth(right) === 0) { + if (!namespace || namespace === unknownSymbol || nodeIsMissing(right)) { return undefined; } symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); @@ -4986,7 +4986,7 @@ module ts { function getResolvedSymbol(node: Identifier): Symbol { let links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (getFullWidth(node) > 0 && resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!nodeIsMissing(node) && resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } @@ -6484,7 +6484,7 @@ module ts { let templateExpression = tagExpression.template; let lastSpan = lastOrUndefined(templateExpression.templateSpans); Debug.assert(lastSpan !== undefined); // we should always have at least one span. - callIsIncomplete = getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated; + callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, @@ -8477,7 +8477,7 @@ module ts { let isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; function reportImplementationExpectedError(node: FunctionLikeDeclaration): void { - if (node.name && getFullWidth(node.name) === 0) { + if (node.name && nodeIsMissing(node.name)) { return; } @@ -10330,7 +10330,7 @@ module ts { function checkExternalImportOrExportDeclaration(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean { let moduleName = getExternalModuleName(node); - if (getFullWidth(moduleName) !== 0 && moduleName.kind !== SyntaxKind.StringLiteral) { + if (!nodeIsMissing(moduleName) && moduleName.kind !== SyntaxKind.StringLiteral) { error(moduleName, Diagnostics.String_literal_expected); return false; } @@ -11077,7 +11077,7 @@ module ts { return resolveEntityName(entityName, meaning); } else if (isExpression(entityName)) { - if (getFullWidth(entityName) === 0) { + if (nodeIsMissing(entityName)) { // Missing entity name. return undefined; } From ee3ba3bf753d230c32255530a4cc460c22b468c8 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 17:23:52 -0700 Subject: [PATCH 38/42] CR feedback. --- src/compiler/checker.ts | 104 ++++++++++-------- src/compiler/declarationEmitter.ts | 4 +- .../diagnosticInformationMap.generated.ts | 6 +- src/compiler/diagnosticMessages.json | 6 +- src/compiler/emitter.ts | 4 +- src/compiler/utilities.ts | 4 +- src/services/services.ts | 4 +- .../classExtendingPrimitive.errors.txt | 4 +- .../classExtendingPrimitive2.errors.txt | 4 +- .../classExtendsEveryObjectType.errors.txt | 8 +- .../classExtendsEveryObjectType2.errors.txt | 8 +- ...terfaceMayNotBeExtendedWitACall.errors.txt | 4 +- .../thisInInvalidContexts.errors.txt | 4 +- ...InInvalidContextsExternalModule.errors.txt | 4 +- .../completionListInExtendsClause.ts | 1 - ...etOccurrencesPropertyInAliasedInterface.ts | 1 - .../fourslash/semanticClassification1.ts | 1 - 17 files changed, 92 insertions(+), 79 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 991824f025..fe93ffb582 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -589,7 +589,7 @@ module ts { if (moduleSymbol.flags & SymbolFlags.Variable) { let typeAnnotation = (moduleSymbol.valueDeclaration).type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromNode(typeAnnotation), name); } } } @@ -638,7 +638,7 @@ module ts { if (symbol.flags & SymbolFlags.Variable) { var typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromNode(typeAnnotation), name)); } } } @@ -2106,7 +2106,7 @@ module ts { } // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); + return getTypeFromNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let func = declaration.parent; @@ -2243,7 +2243,7 @@ module ts { return links.type = checkExpression(exportAssignment.expression); } else if (exportAssignment.type) { - return links.type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(exportAssignment.type); + return links.type = getTypeFromNode(exportAssignment.type); } else { return links.type = anyType; @@ -2275,11 +2275,11 @@ module ts { function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { - return accessor.type && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(accessor.type); + return accessor.type && getTypeFromNode(accessor.type); } else { let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromNode(setterTypeAnnotation); } } return undefined; @@ -2445,9 +2445,9 @@ module ts { } type.baseTypes = []; let declaration = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); - let baseTypeNode = getClassBaseTypeNode(declaration); + let baseTypeNode = getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(baseTypeNode); + let baseType = getTypeFromHeritageClauseElement(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & TypeFlags.Class) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2488,7 +2488,7 @@ module ts { forEach(symbol.declarations, declaration => { if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { forEach(getInterfaceBaseTypeNodes(declaration), node => { - let baseType = getTypeFromTypeReferenceOrHeritageClauseElement(node); + let baseType = getTypeFromHeritageClauseElement(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -2520,7 +2520,7 @@ module ts { if (!links.declaredType) { links.declaredType = resolvingType; let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - let type = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); + let type = getTypeFromNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -3062,7 +3062,7 @@ module ts { returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromNode(declaration.type); } else { // TypeScript 1.0 spec (April 2014): @@ -3220,7 +3220,7 @@ module ts { function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { let declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromNode(declaration.type) : anyType : undefined; } @@ -3231,7 +3231,7 @@ module ts { type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + type.constraint = getTypeFromNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -3328,6 +3328,14 @@ module ts { } } + function getTypeFromTypeReference(node: TypeReferenceNode): Type { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + + function getTypeFromHeritageClauseElement(node: HeritageClauseElement): Type { + return getTypeFromTypeReferenceOrHeritageClauseElement(node); + } + function getTypeFromTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement): Type { let links = getNodeLinks(node); if (!links.resolvedType) { @@ -3354,7 +3362,7 @@ module ts { if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { let typeParameters = (type).typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement)); + type = createTypeReference(type, map(node.typeArguments, getTypeFromNode)); } else { error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); @@ -3448,7 +3456,7 @@ module ts { function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromNode(node.elementType)); } return links.resolvedType; } @@ -3466,7 +3474,7 @@ module ts { function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement)); + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromNode)); } return links.resolvedType; } @@ -3562,7 +3570,7 @@ module ts { function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement), /*noSubtypeReduction*/ true); + links.resolvedType = getUnionType(map(node.types, getTypeFromNode), /*noSubtypeReduction*/ true); } return links.resolvedType; } @@ -3594,7 +3602,7 @@ module ts { return links.resolvedType; } - function getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { + function getTypeFromNode(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: return anyType; @@ -3611,9 +3619,9 @@ module ts { case SyntaxKind.StringLiteral: return getTypeFromStringLiteral(node); case SyntaxKind.TypeReference: - return getTypeFromTypeReferenceOrHeritageClauseElement(node); + return getTypeFromTypeReference(node); case SyntaxKind.HeritageClauseElement: - return getTypeFromTypeReferenceOrHeritageClauseElement(node); + return getTypeFromHeritageClauseElement(node); case SyntaxKind.TypeQuery: return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: @@ -3623,7 +3631,7 @@ module ts { case SyntaxKind.UnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((node).type); + return getTypeFromNode((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: @@ -5492,7 +5500,7 @@ module ts { let isCallExpression = node.parent.kind === SyntaxKind.CallExpression && (node.parent).expression === node; let enclosingClass = getAncestor(node, SyntaxKind.ClassDeclaration); let baseClass: Type; - if (enclosingClass && getClassBaseTypeNode(enclosingClass)) { + if (enclosingClass && getClassExtendsHeritageClauseElement(enclosingClass)) { let classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); baseClass = classType.baseTypes.length && classType.baseTypes[0]; } @@ -5624,7 +5632,7 @@ module ts { let declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(declaration.type); + return getTypeFromNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let type = getContextuallyTypedParameterType(declaration); @@ -5827,7 +5835,7 @@ module ts { case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: - return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement((parent).type); + return getTypeFromNode((parent).type); case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: @@ -6628,7 +6636,7 @@ module ts { let typeArgumentsAreAssignable = true; for (let i = 0; i < typeParameters.length; i++) { let typeArgNode = typeArguments[i]; - let typeArgument = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(typeArgNode); + let typeArgument = getTypeFromNode(typeArgNode); // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { @@ -6702,7 +6710,7 @@ module ts { function getEffectiveTypeArguments(callExpression: CallExpression): TypeNode[] { if (callExpression.expression.kind === SyntaxKind.SuperKeyword) { let containingClass = getAncestor(callExpression, SyntaxKind.ClassDeclaration); - let baseClassTypeNode = containingClass && getClassBaseTypeNode(containingClass); + let baseClassTypeNode = containingClass && getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { @@ -7110,7 +7118,7 @@ module ts { function checkTypeAssertion(node: TypeAssertion): Type { let exprType = checkExpression(node.expression); - let targetType = getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type); + let targetType = getTypeFromNode(node.type); if (produceDiagnostics && targetType !== unknownType) { let widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -7289,7 +7297,7 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromNode(node.type)); } if (node.body) { @@ -7299,7 +7307,7 @@ module ts { else { let exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromNode(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -8234,7 +8242,7 @@ module ts { // TS 1.0 spec (April 2014): 8.3.2 // Constructors of classes with no extends clause may not contain super calls, whereas // constructors of derived classes must contain at least one super call somewhere in their function body. - if (getClassBaseTypeNode(node.parent)) { + if (getClassExtendsHeritageClauseElement(node.parent)) { if (containsSuperCall(node.body)) { // The first statement in the body of a constructor must be a super call if both of the following are true: @@ -8305,6 +8313,14 @@ module ts { checkDecorators(node); } + function checkTypeReferenceNode(node: TypeReferenceNode) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + + function checkHeritageClauseElement(node: HeritageClauseElement) { + return checkTypeReferenceOrHeritageClauseElement(node); + } + function checkTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); @@ -8800,7 +8816,7 @@ module ts { checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromNode(node.type)); } // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -8900,7 +8916,7 @@ module ts { return; } - if (getClassBaseTypeNode(enclosingClass)) { + if (getClassExtendsHeritageClauseElement(enclosingClass)) { let isDeclaration = node.kind !== SyntaxKind.Identifier; if (isDeclaration) { error(node, Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); @@ -9772,14 +9788,14 @@ module ts { let symbol = getSymbolOfNode(node); let type = getDeclaredTypeOfSymbol(symbol); let staticType = getTypeOfSymbol(symbol); - let baseTypeNode = getClassBaseTypeNode(node); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { if (!isSupportedHeritageClauseElement(baseTypeNode)) { - error(baseTypeNode.expression, Diagnostics.Only_type_references_are_currently_supported_in_a_class_extends_clauses); + error(baseTypeNode.expression, Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !isInAmbientContext(node); - checkTypeReferenceOrHeritageClauseElement(baseTypeNode); + checkHeritageClauseElement(baseTypeNode); } if (type.baseTypes.length) { if (produceDiagnostics) { @@ -9802,16 +9818,16 @@ module ts { checkExpressionOrQualifiedName(baseTypeNode.expression); } - let implementedTypeNodes = getClassImplementedTypeNodes(node); + let implementedTypeNodes = getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { forEach(implementedTypeNodes, typeRefNode => { if (!isSupportedHeritageClauseElement(typeRefNode)) { - error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_type_references); + error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkTypeReferenceOrHeritageClauseElement(typeRefNode); + checkHeritageClauseElement(typeRefNode); if (produceDiagnostics) { - let t = getTypeFromTypeReferenceOrHeritageClauseElement(typeRefNode); + let t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { let declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -9933,7 +9949,7 @@ module ts { if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromNode(tp1.constraint), getTypeFromNode(tp2.constraint))) { return false; } } @@ -10006,10 +10022,10 @@ module ts { } forEach(getInterfaceBaseTypeNodes(node), heritageElement => { if (!isSupportedHeritageClauseElement(heritageElement)) { - error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_a_type_reference); + error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkTypeReferenceOrHeritageClauseElement(heritageElement); + checkHeritageClauseElement(heritageElement); }); forEach(node.members, checkSourceElement); @@ -10551,7 +10567,7 @@ module ts { case SyntaxKind.SetAccessor: return checkAccessorDeclaration(node); case SyntaxKind.TypeReference: - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceNode(node); case SyntaxKind.TypeQuery: return checkTypeQuery(node); case SyntaxKind.TypeLiteral: @@ -11193,7 +11209,7 @@ module ts { } if (isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node); + return getTypeFromNode(node); } if (isExpression(node)) { diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 7e089cbafe..7d41a72435 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -892,11 +892,11 @@ module ts { let prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); - let baseTypeNode = getClassBaseTypeNode(node); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { emitHeritageClause([baseTypeNode], /*isImplementsList*/ false); } - emitHeritageClause(getClassImplementedTypeNodes(node), /*isImplementsList*/ true); + emitHeritageClause(getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true); write(" {"); writeLine(); increaseIndent(); diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 344f289c18..3e9017786e 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -353,8 +353,8 @@ module ts { The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, - An_interface_can_only_extend_a_type_reference: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend a type reference." }, - A_class_can_only_implement_type_references: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement type references." }, + An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, + A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -507,7 +507,7 @@ module ts { You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, - Only_type_references_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only type references are currently supported in a class 'extends' clauses." }, + Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, class_expressions_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "'class' expressions are not currently supported." }, class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." }, }; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f1f578da41..f6edb3150b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1403,11 +1403,11 @@ "category": "Error", "code": 2498 }, - "An interface can only extend a type reference.": { + "An interface can only extend an identifier/qualified-name with optional type arguments.": { "category": "Error", "code": 2499 }, - "A class can only implement type references.": { + "A class can only implement an identifier/qualified-name with optional type arguments.": { "category": "Error", "code": 2500 }, @@ -2021,7 +2021,7 @@ "category": "Error", "code": 9001 }, - "Only type references are currently supported in a class 'extends' clauses.": { + "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.": { "category": "Error", "code": 9002 }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 1b0d769298..6ec4ea2389 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3547,7 +3547,7 @@ module ts { emitDeclarationName(node); } - var baseTypeNode = getClassBaseTypeNode(node); + var baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write(" extends "); emit(baseTypeNode.expression); @@ -3621,7 +3621,7 @@ module ts { } write("(function ("); - let baseTypeNode = getClassBaseTypeNode(node); + let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { write("_super"); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2f4f29c508..a30462594b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -951,12 +951,12 @@ module ts { node.kind === SyntaxKind.ExportAssignment && (node).expression.kind === SyntaxKind.Identifier; } - export function getClassBaseTypeNode(node: ClassLikeDeclaration) { + export function getClassExtendsHeritageClauseElement(node: ClassLikeDeclaration) { let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } - export function getClassImplementedTypeNodes(node: ClassDeclaration) { + export function getClassImplementsHeritageClauseElements(node: ClassDeclaration) { let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ImplementsKeyword); return heritageClause ? heritageClause.types : undefined; } diff --git a/src/services/services.ts b/src/services/services.ts index d865cdf9f8..55ebc30bfe 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4948,8 +4948,8 @@ module ts { if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { forEach(symbol.getDeclarations(), declaration => { if (declaration.kind === SyntaxKind.ClassDeclaration) { - getPropertySymbolFromTypeReference(getClassBaseTypeNode(declaration)); - forEach(getClassImplementedTypeNodes(declaration), getPropertySymbolFromTypeReference); + getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(declaration)); + forEach(getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { forEach(getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index 4324884ba8..ae039640e9 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -4,7 +4,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class. @@ -33,7 +33,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2304: Cannot find name 'Null'. class C5a extends null { } ~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. class C6 extends undefined { } ~~~~~~~~~ !!! error TS2304: Cannot find name 'undefined'. diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt index c63307ae72..3bba9b9e04 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1109: Expression expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (2 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS1109: Expression expected. class C5a extends null { } ~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index f8c9e00324..75eced5313 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ==== @@ -17,7 +17,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C2 extends { foo: string; } { } // error ~~~~~~~~~~~~~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. ~ !!! error TS1005: ',' expected. var x: { foo: string; } @@ -37,4 +37,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C6 extends []{ } // error ~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index f191644d5d..45a63030d0 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== class C2 extends { foo: string; } { } // error ~~~~~~~~~~~~~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. ~ !!! error TS1005: ',' expected. class C6 extends []{ } // error ~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. \ No newline at end of file +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt index f00c6923e8..f6ec9e02bb 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: An interface can only extend a type reference. +tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: An interface can only extend an identifier/qualified-name with optional type arguments. ==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,24): error TS2499: A interface blue extends color() { // error ~~~~~~~ -!!! error TS2499: An interface can only extend a type reference. +!!! error TS2499: An interface can only extend an identifier/qualified-name with optional type arguments. } \ No newline at end of file diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index a04b42074d..481c4747c9 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location. @@ -52,7 +52,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): class ErrClass3 extends this { ~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. } diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index 90264376a8..a8bf99de27 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS9002: Only type references are currently supported in a class 'extends' clauses. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. @@ -53,7 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod class ErrClass3 extends this { ~~~~ -!!! error TS9002: Only type references are currently supported in a class 'extends' clauses. +!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. } diff --git a/tests/cases/fourslash/completionListInExtendsClause.ts b/tests/cases/fourslash/completionListInExtendsClause.ts index 87cd2ddec0..b765f77d5d 100644 --- a/tests/cases/fourslash/completionListInExtendsClause.ts +++ b/tests/cases/fourslash/completionListInExtendsClause.ts @@ -17,7 +17,6 @@ ////interface test3 extends IFoo./*3*/ {} ////interface test4 implements Foo./*4*/ {} -debugger; goTo.marker("1"); verify.not.completionListIsEmpty(); diff --git a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts index 2bfa9e265f..87ec260601 100644 --- a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts +++ b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts @@ -19,7 +19,6 @@ test.ranges().forEach(r => { goTo.position(r.start); test.ranges().forEach(range => { - debugger; verify.occurrencesAtPositionContains(range); }); verify.occurrencesAtPositionCount(test.ranges().length); diff --git a/tests/cases/fourslash/semanticClassification1.ts b/tests/cases/fourslash/semanticClassification1.ts index eb04aca9d7..4eb7f2a32e 100644 --- a/tests/cases/fourslash/semanticClassification1.ts +++ b/tests/cases/fourslash/semanticClassification1.ts @@ -7,7 +7,6 @@ //// interface /*2*/X extends /*3*/M./*4*/I { } var c = classification; -debugger; verify.semanticClassificationsAre( c.moduleName("M", test.marker("0").position), c.interfaceName("I", test.marker("1").position), From cfda7df900568c38e82dddec8b4cff17352f9f05 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 31 Mar 2015 17:35:26 -0700 Subject: [PATCH 39/42] revert fix for #2456 'Import namespace exports should be immutable' --- src/compiler/checker.ts | 21 ---- ...externalModuleImmutableBindings.errors.txt | 104 ++---------------- .../externalModuleImmutableBindings.js | 3 + .../externalModuleImmutableBindings.ts | 2 + 4 files changed, 16 insertions(+), 114 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f59aaa6449..c0b5fe6669 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7354,23 +7354,6 @@ module ts { } } - function isImportedNameFromExternalModule(n: Node): boolean { - switch (n.kind) { - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.PropertyAccessExpression: { - // all bindings for external module should be immutable - // so attempt to use a.b or a[b] as lhs will always fail - // no matter what b is - let symbol = findSymbol((n).expression); - return symbol && symbol.flags & SymbolFlags.Alias && isExternalModuleSymbol(resolveAlias(symbol)); - } - case SyntaxKind.ParenthesizedExpression: - return isImportedNameFromExternalModule((n).expression); - default: - return false; - } - } - if (!isReferenceOrErrorExpression(n)) { error(n, invalidReferenceMessage); return false; @@ -7381,10 +7364,6 @@ module ts { return false; } - if (isImportedNameFromExternalModule(n)) { - error(n, invalidReferenceMessage); - } - return true; } diff --git a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt index 09cc7b3329..8ab07c2685 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt +++ b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt @@ -1,164 +1,82 @@ -tests/cases/compiler/f2.ts(5,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(6,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(7,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(7,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(8,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(10,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(11,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(13,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(15,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(16,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(17,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/f2.ts(20,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(21,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(22,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(23,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. -tests/cases/compiler/f2.ts(25,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(26,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(9,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. tests/cases/compiler/f2.ts(27,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(28,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(29,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(29,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(30,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(30,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(31,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(32,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(34,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(35,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(29,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(32,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. tests/cases/compiler/f2.ts(36,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(37,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(38,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(38,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(39,6): error TS2487: Invalid left-hand side in 'for...of' statement. -tests/cases/compiler/f2.ts(39,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(40,6): error TS2406: Invalid left-hand side in 'for...in' statement. -tests/cases/compiler/f2.ts(41,6): error TS2487: Invalid left-hand side in 'for...of' statement. +tests/cases/compiler/f2.ts(38,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. +tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. ==== tests/cases/compiler/f1.ts (0 errors) ==== export var x = 1; -==== tests/cases/compiler/f2.ts (38 errors) ==== +==== tests/cases/compiler/f2.ts (10 errors) ==== + + // all mutations below are illegal and should be fixed import * as stuff from 'f1'; var n = 'baz'; stuff.x = 0; - ~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff['x'] = 1; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff.blah = 2; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. stuff[n] = 3; - ~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. stuff.x++; - ~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff['x']++; - ~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff['blah']++; - ~~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. stuff[n]++; - ~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff.x) = 0; - ~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff['x']) = 1; - ~~~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff.blah) = 2; - ~~~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. (stuff[n]) = 3; - ~~~~~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. (stuff.x)++; - ~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff['x'])++; - ~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff['blah'])++; - ~~~~~~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (stuff[n])++; - ~~~~~~~~~~ -!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. for (stuff.x in []) {} ~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (stuff.x of []) {} - ~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for (stuff['x'] in []) {} ~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (stuff['x'] of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for (stuff.blah in []) {} - ~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for (stuff.blah of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for (stuff[n] in []) {} - ~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. for (stuff[n] of []) {} - ~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff.x) in []) {} ~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for ((stuff.x) of []) {} - ~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff['x']) in []) {} ~~~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for ((stuff['x']) of []) {} - ~~~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. for ((stuff.blah) in []) {} - ~~~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for ((stuff.blah) of []) {} - ~~~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. for ((stuff[n]) in []) {} - ~~~~~~~~~~ -!!! error TS2406: Invalid left-hand side in 'for...in' statement. for ((stuff[n]) of []) {} - ~~~~~~~~~~ -!!! error TS2487: Invalid left-hand side in 'for...of' statement. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleImmutableBindings.js b/tests/baselines/reference/externalModuleImmutableBindings.js index ed9b4c00af..5e5ba6c229 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.js +++ b/tests/baselines/reference/externalModuleImmutableBindings.js @@ -4,6 +4,8 @@ export var x = 1; //// [f2.ts] + +// all mutations below are illegal and should be fixed import * as stuff from 'f1'; var n = 'baz'; @@ -52,6 +54,7 @@ for ((stuff[n]) of []) {} //// [f1.js] exports.x = 1; //// [f2.js] +// all mutations below are illegal and should be fixed var stuff = require('f1'); var n = 'baz'; stuff.x = 0; diff --git a/tests/cases/compiler/externalModuleImmutableBindings.ts b/tests/cases/compiler/externalModuleImmutableBindings.ts index 9ed3d278a3..2321961f6f 100644 --- a/tests/cases/compiler/externalModuleImmutableBindings.ts +++ b/tests/cases/compiler/externalModuleImmutableBindings.ts @@ -3,6 +3,8 @@ export var x = 1; // @Filename: f2.ts + +// all mutations below are illegal and should be fixed import * as stuff from 'f1'; var n = 'baz'; From afc38c2956e0a5cd8b3e27c934bf204e3658b7d1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 17:36:15 -0700 Subject: [PATCH 40/42] Rename method. --- src/compiler/checker.ts | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fe93ffb582..fa3c845ec3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -589,7 +589,7 @@ module ts { if (moduleSymbol.flags & SymbolFlags.Variable) { let typeAnnotation = (moduleSymbol.valueDeclaration).type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromNode(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); } } } @@ -638,7 +638,7 @@ module ts { if (symbol.flags & SymbolFlags.Variable) { var typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromNode(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); } } } @@ -2106,7 +2106,7 @@ module ts { } // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let func = declaration.parent; @@ -2243,7 +2243,7 @@ module ts { return links.type = checkExpression(exportAssignment.expression); } else if (exportAssignment.type) { - return links.type = getTypeFromNode(exportAssignment.type); + return links.type = getTypeFromTypeNodeOrHeritageClauseElement(exportAssignment.type); } else { return links.type = anyType; @@ -2275,11 +2275,11 @@ module ts { function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { - return accessor.type && getTypeFromNode(accessor.type); + return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); } else { let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromNode(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); } } return undefined; @@ -2520,7 +2520,7 @@ module ts { if (!links.declaredType) { links.declaredType = resolvingType; let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - let type = getTypeFromNode(declaration.type); + let type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -3062,7 +3062,7 @@ module ts { returnType = classType; } else if (declaration.type) { - returnType = getTypeFromNode(declaration.type); + returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } else { // TypeScript 1.0 spec (April 2014): @@ -3220,7 +3220,7 @@ module ts { function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { let declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromNode(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType : undefined; } @@ -3231,7 +3231,7 @@ module ts { type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + type.constraint = getTypeFromTypeNodeOrHeritageClauseElement((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -3362,7 +3362,7 @@ module ts { if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { let typeParameters = (type).typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, map(node.typeArguments, getTypeFromNode)); + type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); } else { error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); @@ -3456,7 +3456,7 @@ module ts { function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromNode(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); } return links.resolvedType; } @@ -3474,7 +3474,7 @@ module ts { function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromNode)); + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); } return links.resolvedType; } @@ -3570,7 +3570,7 @@ module ts { function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(map(node.types, getTypeFromNode), /*noSubtypeReduction*/ true); + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), /*noSubtypeReduction*/ true); } return links.resolvedType; } @@ -3602,7 +3602,7 @@ module ts { return links.resolvedType; } - function getTypeFromNode(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { + function getTypeFromTypeNodeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: return anyType; @@ -3631,7 +3631,7 @@ module ts { case SyntaxKind.UnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromNode((node).type); + return getTypeFromTypeNodeOrHeritageClauseElement((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: @@ -5632,7 +5632,7 @@ module ts { let declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromNode(declaration.type); + return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let type = getContextuallyTypedParameterType(declaration); @@ -5835,7 +5835,7 @@ module ts { case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: - return getTypeFromNode((parent).type); + return getTypeFromTypeNodeOrHeritageClauseElement((parent).type); case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: @@ -6636,7 +6636,7 @@ module ts { let typeArgumentsAreAssignable = true; for (let i = 0; i < typeParameters.length; i++) { let typeArgNode = typeArguments[i]; - let typeArgument = getTypeFromNode(typeArgNode); + let typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { @@ -7118,7 +7118,7 @@ module ts { function checkTypeAssertion(node: TypeAssertion): Type { let exprType = checkExpression(node.expression); - let targetType = getTypeFromNode(node.type); + let targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); if (produceDiagnostics && targetType !== unknownType) { let widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -7297,7 +7297,7 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } if (node.body) { @@ -7307,7 +7307,7 @@ module ts { else { let exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromNode(node.type), node.body, /*headMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -8816,7 +8816,7 @@ module ts { checkSourceElement(node.body); if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromNode(node.type)); + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); } // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -9949,7 +9949,7 @@ module ts { if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromNode(tp1.constraint), getTypeFromNode(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { return false; } } @@ -10959,7 +10959,7 @@ module ts { return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement; } - function isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node: Node): boolean { + function isTypeNodeOrHeritageClauseElement(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { return true; } @@ -11208,8 +11208,8 @@ module ts { return unknownType; } - if (isTypeNodeOrStringLiteralTypeOrHeritageClauseElement(node)) { - return getTypeFromNode(node); + if (isTypeNodeOrHeritageClauseElement(node)) { + return getTypeFromTypeNodeOrHeritageClauseElement(node); } if (isExpression(node)) { From 27f6f8f9190e6e3f78121d471c750c6c95793bf3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 31 Mar 2015 18:00:02 -0700 Subject: [PATCH 41/42] Keep comments in debug builds. --- Jakefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jakefile b/Jakefile index 665bb807b4..2eb87494f2 100644 --- a/Jakefile +++ b/Jakefile @@ -222,15 +222,17 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; var options = "--module commonjs -noImplicitAny"; - if (!keepComments) { - options += " -removeComments"; + // Keep comments when specifically requested + // or when in debug mode. + if (!(keepComments || useDebugMode)) { + options += " --removeComments"; } if (generateDeclarations) { options += " --declaration"; } - if (useDebugMode || preserveConstEnums) { + if (preserveConstEnums || useDebugMode) { options += " --preserveConstEnums"; } From 3df576d112de95308cb2328ef7a9f1b1c12954e1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 31 Mar 2015 18:11:54 -0700 Subject: [PATCH 42/42] Adding a couple of class tests. --- .../reference/classExpressionTest1.errors.txt | 18 ++++++++++++ .../reference/classExpressionTest1.js | 29 +++++++++++++++++++ .../reference/classExpressionTest2.errors.txt | 21 ++++++++++++++ .../reference/classExpressionTest2.js | 29 +++++++++++++++++++ tests/cases/compiler/classExpressionTest1.ts | 12 ++++++++ tests/cases/compiler/classExpressionTest2.ts | 12 ++++++++ 6 files changed, 121 insertions(+) create mode 100644 tests/baselines/reference/classExpressionTest1.errors.txt create mode 100644 tests/baselines/reference/classExpressionTest1.js create mode 100644 tests/baselines/reference/classExpressionTest2.errors.txt create mode 100644 tests/baselines/reference/classExpressionTest2.js create mode 100644 tests/cases/compiler/classExpressionTest1.ts create mode 100644 tests/cases/compiler/classExpressionTest2.ts diff --git a/tests/baselines/reference/classExpressionTest1.errors.txt b/tests/baselines/reference/classExpressionTest1.errors.txt new file mode 100644 index 0000000000..4d7e1cda63 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest1.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/classExpressionTest1.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + + +==== tests/cases/compiler/classExpressionTest1.ts (1 errors) ==== + function M() { + class C { + ~ +!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration. + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new C(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest1.js b/tests/baselines/reference/classExpressionTest1.js new file mode 100644 index 0000000000..e91cdebb8c --- /dev/null +++ b/tests/baselines/reference/classExpressionTest1.js @@ -0,0 +1,29 @@ +//// [classExpressionTest1.ts] +function M() { + class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new C(); + return v.f(); +} + +//// [classExpressionTest1.js] +function M() { + var C = (function () { + function C() { + } + C.prototype.f = function () { + var t; + var x; + return { t: t, x: x }; + }; + return C; + })(); + var v = new C(); + return v.f(); +} diff --git a/tests/baselines/reference/classExpressionTest2.errors.txt b/tests/baselines/reference/classExpressionTest2.errors.txt new file mode 100644 index 0000000000..424eb59061 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/classExpressionTest2.ts(2,19): error TS9003: 'class' expressions are not currently supported. +tests/cases/compiler/classExpressionTest2.ts(5,20): error TS2304: Cannot find name 'X'. + + +==== tests/cases/compiler/classExpressionTest2.ts (2 errors) ==== + function M() { + var m = class C { + ~ +!!! error TS9003: 'class' expressions are not currently supported. + f() { + var t: T; + var x: X; + ~ +!!! error TS2304: Cannot find name 'X'. + return { t, x }; + } + } + + var v = new m(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest2.js b/tests/baselines/reference/classExpressionTest2.js new file mode 100644 index 0000000000..ebb5c1e21b --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.js @@ -0,0 +1,29 @@ +//// [classExpressionTest2.ts] +function M() { + var m = class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new m(); + return v.f(); +} + +//// [classExpressionTest2.js] +function M() { + var m = (function () { + function C() { + } + C.prototype.f = function () { + var t; + var x; + return { t: t, x: x }; + }; + return C; + })(); + var v = new m(); + return v.f(); +} diff --git a/tests/cases/compiler/classExpressionTest1.ts b/tests/cases/compiler/classExpressionTest1.ts new file mode 100644 index 0000000000..b299a2fd73 --- /dev/null +++ b/tests/cases/compiler/classExpressionTest1.ts @@ -0,0 +1,12 @@ +function M() { + class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new C(); + return v.f(); +} \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionTest2.ts b/tests/cases/compiler/classExpressionTest2.ts new file mode 100644 index 0000000000..c0b9792b82 --- /dev/null +++ b/tests/cases/compiler/classExpressionTest2.ts @@ -0,0 +1,12 @@ +function M() { + var m = class C { + f() { + var t: T; + var x: X; + return { t, x }; + } + } + + var v = new m(); + return v.f(); +} \ No newline at end of file