diff options
Diffstat (limited to 'node_modules/typescript/lib/tsserverlibrary.d.ts')
-rw-r--r-- | node_modules/typescript/lib/tsserverlibrary.d.ts | 1432 |
1 files changed, 738 insertions, 694 deletions
diff --git a/node_modules/typescript/lib/tsserverlibrary.d.ts b/node_modules/typescript/lib/tsserverlibrary.d.ts index 44bd394e3..28ee05e76 100644 --- a/node_modules/typescript/lib/tsserverlibrary.d.ts +++ b/node_modules/typescript/lib/tsserverlibrary.d.ts @@ -18,7 +18,7 @@ declare namespace ts { [index: string]: T; } interface Map<T> { - get(key: string): T; + get(key: string): T | undefined; has(key: string): boolean; set(key: string, value: T): this; delete(key: string): boolean; @@ -66,323 +66,325 @@ declare namespace ts { NumericLiteral = 8, StringLiteral = 9, JsxText = 10, - RegularExpressionLiteral = 11, - NoSubstitutionTemplateLiteral = 12, - TemplateHead = 13, - TemplateMiddle = 14, - TemplateTail = 15, - OpenBraceToken = 16, - CloseBraceToken = 17, - OpenParenToken = 18, - CloseParenToken = 19, - OpenBracketToken = 20, - CloseBracketToken = 21, - DotToken = 22, - DotDotDotToken = 23, - SemicolonToken = 24, - CommaToken = 25, - LessThanToken = 26, - LessThanSlashToken = 27, - GreaterThanToken = 28, - LessThanEqualsToken = 29, - GreaterThanEqualsToken = 30, - EqualsEqualsToken = 31, - ExclamationEqualsToken = 32, - EqualsEqualsEqualsToken = 33, - ExclamationEqualsEqualsToken = 34, - EqualsGreaterThanToken = 35, - PlusToken = 36, - MinusToken = 37, - AsteriskToken = 38, - AsteriskAsteriskToken = 39, - SlashToken = 40, - PercentToken = 41, - PlusPlusToken = 42, - MinusMinusToken = 43, - LessThanLessThanToken = 44, - GreaterThanGreaterThanToken = 45, - GreaterThanGreaterThanGreaterThanToken = 46, - AmpersandToken = 47, - BarToken = 48, - CaretToken = 49, - ExclamationToken = 50, - TildeToken = 51, - AmpersandAmpersandToken = 52, - BarBarToken = 53, - QuestionToken = 54, - ColonToken = 55, - AtToken = 56, - EqualsToken = 57, - PlusEqualsToken = 58, - MinusEqualsToken = 59, - AsteriskEqualsToken = 60, - AsteriskAsteriskEqualsToken = 61, - SlashEqualsToken = 62, - PercentEqualsToken = 63, - LessThanLessThanEqualsToken = 64, - GreaterThanGreaterThanEqualsToken = 65, - GreaterThanGreaterThanGreaterThanEqualsToken = 66, - AmpersandEqualsToken = 67, - BarEqualsToken = 68, - CaretEqualsToken = 69, - Identifier = 70, - BreakKeyword = 71, - CaseKeyword = 72, - CatchKeyword = 73, - ClassKeyword = 74, - ConstKeyword = 75, - ContinueKeyword = 76, - DebuggerKeyword = 77, - DefaultKeyword = 78, - DeleteKeyword = 79, - DoKeyword = 80, - ElseKeyword = 81, - EnumKeyword = 82, - ExportKeyword = 83, - ExtendsKeyword = 84, - FalseKeyword = 85, - FinallyKeyword = 86, - ForKeyword = 87, - FunctionKeyword = 88, - IfKeyword = 89, - ImportKeyword = 90, - InKeyword = 91, - InstanceOfKeyword = 92, - NewKeyword = 93, - NullKeyword = 94, - ReturnKeyword = 95, - SuperKeyword = 96, - SwitchKeyword = 97, - ThisKeyword = 98, - ThrowKeyword = 99, - TrueKeyword = 100, - TryKeyword = 101, - TypeOfKeyword = 102, - VarKeyword = 103, - VoidKeyword = 104, - WhileKeyword = 105, - WithKeyword = 106, - ImplementsKeyword = 107, - InterfaceKeyword = 108, - LetKeyword = 109, - PackageKeyword = 110, - PrivateKeyword = 111, - ProtectedKeyword = 112, - PublicKeyword = 113, - StaticKeyword = 114, - YieldKeyword = 115, - AbstractKeyword = 116, - AsKeyword = 117, - AnyKeyword = 118, - AsyncKeyword = 119, - AwaitKeyword = 120, - BooleanKeyword = 121, - ConstructorKeyword = 122, - DeclareKeyword = 123, - GetKeyword = 124, - IsKeyword = 125, - KeyOfKeyword = 126, - ModuleKeyword = 127, - NamespaceKeyword = 128, - NeverKeyword = 129, - ReadonlyKeyword = 130, - RequireKeyword = 131, - NumberKeyword = 132, - ObjectKeyword = 133, - SetKeyword = 134, - StringKeyword = 135, - SymbolKeyword = 136, - TypeKeyword = 137, - UndefinedKeyword = 138, - FromKeyword = 139, - GlobalKeyword = 140, - OfKeyword = 141, - QualifiedName = 142, - ComputedPropertyName = 143, - TypeParameter = 144, - Parameter = 145, - Decorator = 146, - PropertySignature = 147, - PropertyDeclaration = 148, - MethodSignature = 149, - MethodDeclaration = 150, - Constructor = 151, - GetAccessor = 152, - SetAccessor = 153, - CallSignature = 154, - ConstructSignature = 155, - IndexSignature = 156, - TypePredicate = 157, - TypeReference = 158, - FunctionType = 159, - ConstructorType = 160, - TypeQuery = 161, - TypeLiteral = 162, - ArrayType = 163, - TupleType = 164, - UnionType = 165, - IntersectionType = 166, - ParenthesizedType = 167, - ThisType = 168, - TypeOperator = 169, - IndexedAccessType = 170, - MappedType = 171, - LiteralType = 172, - ObjectBindingPattern = 173, - ArrayBindingPattern = 174, - BindingElement = 175, - ArrayLiteralExpression = 176, - ObjectLiteralExpression = 177, - PropertyAccessExpression = 178, - ElementAccessExpression = 179, - CallExpression = 180, - NewExpression = 181, - TaggedTemplateExpression = 182, - TypeAssertionExpression = 183, - ParenthesizedExpression = 184, - FunctionExpression = 185, - ArrowFunction = 186, - DeleteExpression = 187, - TypeOfExpression = 188, - VoidExpression = 189, - AwaitExpression = 190, - PrefixUnaryExpression = 191, - PostfixUnaryExpression = 192, - BinaryExpression = 193, - ConditionalExpression = 194, - TemplateExpression = 195, - YieldExpression = 196, - SpreadElement = 197, - ClassExpression = 198, - OmittedExpression = 199, - ExpressionWithTypeArguments = 200, - AsExpression = 201, - NonNullExpression = 202, - MetaProperty = 203, - TemplateSpan = 204, - SemicolonClassElement = 205, - Block = 206, - VariableStatement = 207, - EmptyStatement = 208, - ExpressionStatement = 209, - IfStatement = 210, - DoStatement = 211, - WhileStatement = 212, - ForStatement = 213, - ForInStatement = 214, - ForOfStatement = 215, - ContinueStatement = 216, - BreakStatement = 217, - ReturnStatement = 218, - WithStatement = 219, - SwitchStatement = 220, - LabeledStatement = 221, - ThrowStatement = 222, - TryStatement = 223, - DebuggerStatement = 224, - VariableDeclaration = 225, - VariableDeclarationList = 226, - FunctionDeclaration = 227, - ClassDeclaration = 228, - InterfaceDeclaration = 229, - TypeAliasDeclaration = 230, - EnumDeclaration = 231, - ModuleDeclaration = 232, - ModuleBlock = 233, - CaseBlock = 234, - NamespaceExportDeclaration = 235, - ImportEqualsDeclaration = 236, - ImportDeclaration = 237, - ImportClause = 238, - NamespaceImport = 239, - NamedImports = 240, - ImportSpecifier = 241, - ExportAssignment = 242, - ExportDeclaration = 243, - NamedExports = 244, - ExportSpecifier = 245, - MissingDeclaration = 246, - ExternalModuleReference = 247, - JsxElement = 248, - JsxSelfClosingElement = 249, - JsxOpeningElement = 250, - JsxClosingElement = 251, - JsxAttribute = 252, - JsxAttributes = 253, - JsxSpreadAttribute = 254, - JsxExpression = 255, - CaseClause = 256, - DefaultClause = 257, - HeritageClause = 258, - CatchClause = 259, - PropertyAssignment = 260, - ShorthandPropertyAssignment = 261, - SpreadAssignment = 262, - EnumMember = 263, - SourceFile = 264, - Bundle = 265, - JSDocTypeExpression = 266, - JSDocAllType = 267, - JSDocUnknownType = 268, - JSDocArrayType = 269, - JSDocUnionType = 270, - JSDocTupleType = 271, - JSDocNullableType = 272, - JSDocNonNullableType = 273, - JSDocRecordType = 274, - JSDocRecordMember = 275, - JSDocTypeReference = 276, - JSDocOptionalType = 277, - JSDocFunctionType = 278, - JSDocVariadicType = 279, - JSDocConstructorType = 280, - JSDocThisType = 281, - JSDocComment = 282, - JSDocTag = 283, - JSDocAugmentsTag = 284, - JSDocParameterTag = 285, - JSDocReturnTag = 286, - JSDocTypeTag = 287, - JSDocTemplateTag = 288, - JSDocTypedefTag = 289, - JSDocPropertyTag = 290, - JSDocTypeLiteral = 291, - JSDocLiteralType = 292, - SyntaxList = 293, - NotEmittedStatement = 294, - PartiallyEmittedExpression = 295, - MergeDeclarationMarker = 296, - EndOfDeclarationMarker = 297, - Count = 298, - FirstAssignment = 57, - LastAssignment = 69, - FirstCompoundAssignment = 58, - LastCompoundAssignment = 69, - FirstReservedWord = 71, - LastReservedWord = 106, - FirstKeyword = 71, - LastKeyword = 141, - FirstFutureReservedWord = 107, - LastFutureReservedWord = 115, - FirstTypeNode = 157, - LastTypeNode = 172, - FirstPunctuation = 16, - LastPunctuation = 69, + JsxTextAllWhiteSpaces = 11, + RegularExpressionLiteral = 12, + NoSubstitutionTemplateLiteral = 13, + TemplateHead = 14, + TemplateMiddle = 15, + TemplateTail = 16, + OpenBraceToken = 17, + CloseBraceToken = 18, + OpenParenToken = 19, + CloseParenToken = 20, + OpenBracketToken = 21, + CloseBracketToken = 22, + DotToken = 23, + DotDotDotToken = 24, + SemicolonToken = 25, + CommaToken = 26, + LessThanToken = 27, + LessThanSlashToken = 28, + GreaterThanToken = 29, + LessThanEqualsToken = 30, + GreaterThanEqualsToken = 31, + EqualsEqualsToken = 32, + ExclamationEqualsToken = 33, + EqualsEqualsEqualsToken = 34, + ExclamationEqualsEqualsToken = 35, + EqualsGreaterThanToken = 36, + PlusToken = 37, + MinusToken = 38, + AsteriskToken = 39, + AsteriskAsteriskToken = 40, + SlashToken = 41, + PercentToken = 42, + PlusPlusToken = 43, + MinusMinusToken = 44, + LessThanLessThanToken = 45, + GreaterThanGreaterThanToken = 46, + GreaterThanGreaterThanGreaterThanToken = 47, + AmpersandToken = 48, + BarToken = 49, + CaretToken = 50, + ExclamationToken = 51, + TildeToken = 52, + AmpersandAmpersandToken = 53, + BarBarToken = 54, + QuestionToken = 55, + ColonToken = 56, + AtToken = 57, + EqualsToken = 58, + PlusEqualsToken = 59, + MinusEqualsToken = 60, + AsteriskEqualsToken = 61, + AsteriskAsteriskEqualsToken = 62, + SlashEqualsToken = 63, + PercentEqualsToken = 64, + LessThanLessThanEqualsToken = 65, + GreaterThanGreaterThanEqualsToken = 66, + GreaterThanGreaterThanGreaterThanEqualsToken = 67, + AmpersandEqualsToken = 68, + BarEqualsToken = 69, + CaretEqualsToken = 70, + Identifier = 71, + BreakKeyword = 72, + CaseKeyword = 73, + CatchKeyword = 74, + ClassKeyword = 75, + ConstKeyword = 76, + ContinueKeyword = 77, + DebuggerKeyword = 78, + DefaultKeyword = 79, + DeleteKeyword = 80, + DoKeyword = 81, + ElseKeyword = 82, + EnumKeyword = 83, + ExportKeyword = 84, + ExtendsKeyword = 85, + FalseKeyword = 86, + FinallyKeyword = 87, + ForKeyword = 88, + FunctionKeyword = 89, + IfKeyword = 90, + ImportKeyword = 91, + InKeyword = 92, + InstanceOfKeyword = 93, + NewKeyword = 94, + NullKeyword = 95, + ReturnKeyword = 96, + SuperKeyword = 97, + SwitchKeyword = 98, + ThisKeyword = 99, + ThrowKeyword = 100, + TrueKeyword = 101, + TryKeyword = 102, + TypeOfKeyword = 103, + VarKeyword = 104, + VoidKeyword = 105, + WhileKeyword = 106, + WithKeyword = 107, + ImplementsKeyword = 108, + InterfaceKeyword = 109, + LetKeyword = 110, + PackageKeyword = 111, + PrivateKeyword = 112, + ProtectedKeyword = 113, + PublicKeyword = 114, + StaticKeyword = 115, + YieldKeyword = 116, + AbstractKeyword = 117, + AsKeyword = 118, + AnyKeyword = 119, + AsyncKeyword = 120, + AwaitKeyword = 121, + BooleanKeyword = 122, + ConstructorKeyword = 123, + DeclareKeyword = 124, + GetKeyword = 125, + IsKeyword = 126, + KeyOfKeyword = 127, + ModuleKeyword = 128, + NamespaceKeyword = 129, + NeverKeyword = 130, + ReadonlyKeyword = 131, + RequireKeyword = 132, + NumberKeyword = 133, + ObjectKeyword = 134, + SetKeyword = 135, + StringKeyword = 136, + SymbolKeyword = 137, + TypeKeyword = 138, + UndefinedKeyword = 139, + FromKeyword = 140, + GlobalKeyword = 141, + OfKeyword = 142, + QualifiedName = 143, + ComputedPropertyName = 144, + TypeParameter = 145, + Parameter = 146, + Decorator = 147, + PropertySignature = 148, + PropertyDeclaration = 149, + MethodSignature = 150, + MethodDeclaration = 151, + Constructor = 152, + GetAccessor = 153, + SetAccessor = 154, + CallSignature = 155, + ConstructSignature = 156, + IndexSignature = 157, + TypePredicate = 158, + TypeReference = 159, + FunctionType = 160, + ConstructorType = 161, + TypeQuery = 162, + TypeLiteral = 163, + ArrayType = 164, + TupleType = 165, + UnionType = 166, + IntersectionType = 167, + ParenthesizedType = 168, + ThisType = 169, + TypeOperator = 170, + IndexedAccessType = 171, + MappedType = 172, + LiteralType = 173, + ObjectBindingPattern = 174, + ArrayBindingPattern = 175, + BindingElement = 176, + ArrayLiteralExpression = 177, + ObjectLiteralExpression = 178, + PropertyAccessExpression = 179, + ElementAccessExpression = 180, + CallExpression = 181, + NewExpression = 182, + TaggedTemplateExpression = 183, + TypeAssertionExpression = 184, + ParenthesizedExpression = 185, + FunctionExpression = 186, + ArrowFunction = 187, + DeleteExpression = 188, + TypeOfExpression = 189, + VoidExpression = 190, + AwaitExpression = 191, + PrefixUnaryExpression = 192, + PostfixUnaryExpression = 193, + BinaryExpression = 194, + ConditionalExpression = 195, + TemplateExpression = 196, + YieldExpression = 197, + SpreadElement = 198, + ClassExpression = 199, + OmittedExpression = 200, + ExpressionWithTypeArguments = 201, + AsExpression = 202, + NonNullExpression = 203, + MetaProperty = 204, + TemplateSpan = 205, + SemicolonClassElement = 206, + Block = 207, + VariableStatement = 208, + EmptyStatement = 209, + ExpressionStatement = 210, + IfStatement = 211, + DoStatement = 212, + WhileStatement = 213, + ForStatement = 214, + ForInStatement = 215, + ForOfStatement = 216, + ContinueStatement = 217, + BreakStatement = 218, + ReturnStatement = 219, + WithStatement = 220, + SwitchStatement = 221, + LabeledStatement = 222, + ThrowStatement = 223, + TryStatement = 224, + DebuggerStatement = 225, + VariableDeclaration = 226, + VariableDeclarationList = 227, + FunctionDeclaration = 228, + ClassDeclaration = 229, + InterfaceDeclaration = 230, + TypeAliasDeclaration = 231, + EnumDeclaration = 232, + ModuleDeclaration = 233, + ModuleBlock = 234, + CaseBlock = 235, + NamespaceExportDeclaration = 236, + ImportEqualsDeclaration = 237, + ImportDeclaration = 238, + ImportClause = 239, + NamespaceImport = 240, + NamedImports = 241, + ImportSpecifier = 242, + ExportAssignment = 243, + ExportDeclaration = 244, + NamedExports = 245, + ExportSpecifier = 246, + MissingDeclaration = 247, + ExternalModuleReference = 248, + JsxElement = 249, + JsxSelfClosingElement = 250, + JsxOpeningElement = 251, + JsxClosingElement = 252, + JsxAttribute = 253, + JsxAttributes = 254, + JsxSpreadAttribute = 255, + JsxExpression = 256, + CaseClause = 257, + DefaultClause = 258, + HeritageClause = 259, + CatchClause = 260, + PropertyAssignment = 261, + ShorthandPropertyAssignment = 262, + SpreadAssignment = 263, + EnumMember = 264, + SourceFile = 265, + Bundle = 266, + JSDocTypeExpression = 267, + JSDocAllType = 268, + JSDocUnknownType = 269, + JSDocArrayType = 270, + JSDocUnionType = 271, + JSDocTupleType = 272, + JSDocNullableType = 273, + JSDocNonNullableType = 274, + JSDocRecordType = 275, + JSDocRecordMember = 276, + JSDocTypeReference = 277, + JSDocOptionalType = 278, + JSDocFunctionType = 279, + JSDocVariadicType = 280, + JSDocConstructorType = 281, + JSDocThisType = 282, + JSDocComment = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocParameterTag = 286, + JSDocReturnTag = 287, + JSDocTypeTag = 288, + JSDocTemplateTag = 289, + JSDocTypedefTag = 290, + JSDocPropertyTag = 291, + JSDocTypeLiteral = 292, + JSDocLiteralType = 293, + SyntaxList = 294, + NotEmittedStatement = 295, + PartiallyEmittedExpression = 296, + CommaListExpression = 297, + MergeDeclarationMarker = 298, + EndOfDeclarationMarker = 299, + Count = 300, + FirstAssignment = 58, + LastAssignment = 70, + FirstCompoundAssignment = 59, + LastCompoundAssignment = 70, + FirstReservedWord = 72, + LastReservedWord = 107, + FirstKeyword = 72, + LastKeyword = 142, + FirstFutureReservedWord = 108, + LastFutureReservedWord = 116, + FirstTypeNode = 158, + LastTypeNode = 173, + FirstPunctuation = 17, + LastPunctuation = 70, FirstToken = 0, - LastToken = 141, + LastToken = 142, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, - LastLiteralToken = 12, - FirstTemplateToken = 12, - LastTemplateToken = 15, - FirstBinaryOperator = 26, - LastBinaryOperator = 69, - FirstNode = 142, - FirstJSDocNode = 266, - LastJSDocNode = 292, - FirstJSDocTagNode = 282, - LastJSDocTagNode = 292, + LastLiteralToken = 13, + FirstTemplateToken = 13, + LastTemplateToken = 16, + FirstBinaryOperator = 27, + LastBinaryOperator = 70, + FirstNode = 143, + FirstJSDocNode = 267, + LastJSDocNode = 293, + FirstJSDocTagNode = 283, + LastJSDocTagNode = 293, } const enum NodeFlags { None = 0, @@ -481,9 +483,11 @@ declare namespace ts { type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern; interface Declaration extends Node { _declarationBrand: any; + } + interface NamedDeclaration extends Declaration { name?: DeclarationName; } - interface DeclarationStatement extends Declaration, Statement { + interface DeclarationStatement extends NamedDeclaration, Statement { name?: Identifier | StringLiteral | NumericLiteral; } interface ComputedPropertyName extends Node { @@ -494,7 +498,7 @@ declare namespace ts { kind: SyntaxKind.Decorator; expression: LeftHandSideExpression; } - interface TypeParameterDeclaration extends Declaration { + interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; parent?: DeclarationWithTypeParameters; name: Identifier; @@ -502,7 +506,7 @@ declare namespace ts { default?: TypeNode; expression?: Expression; } - interface SignatureDeclaration extends Declaration { + interface SignatureDeclaration extends NamedDeclaration { name?: PropertyName; typeParameters?: NodeArray<TypeParameterDeclaration>; parameters: NodeArray<ParameterDeclaration>; @@ -515,7 +519,7 @@ declare namespace ts { kind: SyntaxKind.ConstructSignature; } type BindingName = Identifier | BindingPattern; - interface VariableDeclaration extends Declaration { + interface VariableDeclaration extends NamedDeclaration { kind: SyntaxKind.VariableDeclaration; parent?: VariableDeclarationList | CatchClause; name: BindingName; @@ -527,7 +531,7 @@ declare namespace ts { parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; declarations: NodeArray<VariableDeclaration>; } - interface ParameterDeclaration extends Declaration { + interface ParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.Parameter; parent?: SignatureDeclaration; dotDotDotToken?: DotDotDotToken; @@ -536,7 +540,7 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } - interface BindingElement extends Declaration { + interface BindingElement extends NamedDeclaration { kind: SyntaxKind.BindingElement; parent?: BindingPattern; propertyName?: PropertyName; @@ -558,7 +562,7 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } - interface ObjectLiteralElement extends Declaration { + interface ObjectLiteralElement extends NamedDeclaration { _objectLiteralBrandBrand: any; name?: PropertyName; } @@ -580,7 +584,7 @@ declare namespace ts { kind: SyntaxKind.SpreadAssignment; expression: Expression; } - interface VariableLikeDeclaration extends Declaration { + interface VariableLikeDeclaration extends NamedDeclaration { propertyName?: PropertyName; dotDotDotToken?: DotDotDotToken; name: DeclarationName; @@ -588,7 +592,7 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } - interface PropertyLikeDeclaration extends Declaration { + interface PropertyLikeDeclaration extends NamedDeclaration { name: PropertyName; } interface ObjectBindingPattern extends Node { @@ -925,7 +929,7 @@ declare namespace ts { } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; - interface PropertyAccessExpression extends MemberExpression, Declaration { + interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; name: Identifier; @@ -990,7 +994,7 @@ declare namespace ts { } interface MetaProperty extends PrimaryExpression { kind: SyntaxKind.MetaProperty; - keywordToken: SyntaxKind; + keywordToken: SyntaxKind.NewKeyword; name: Identifier; } interface JsxElement extends PrimaryExpression { @@ -1040,6 +1044,7 @@ declare namespace ts { } interface JsxText extends Node { kind: SyntaxKind.JsxText; + containsOnlyWhiteSpaces: boolean; parent?: JsxElement; } type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; @@ -1049,6 +1054,10 @@ declare namespace ts { interface NotEmittedStatement extends Statement { kind: SyntaxKind.NotEmittedStatement; } + interface CommaListExpression extends Expression { + kind: SyntaxKind.CommaListExpression; + elements: NodeArray<Expression>; + } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1170,7 +1179,7 @@ declare namespace ts { block: Block; } type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration; - interface ClassLikeDeclaration extends Declaration { + interface ClassLikeDeclaration extends NamedDeclaration { name?: Identifier; typeParameters?: NodeArray<TypeParameterDeclaration>; heritageClauses?: NodeArray<HeritageClause>; @@ -1183,11 +1192,11 @@ declare namespace ts { interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { kind: SyntaxKind.ClassExpression; } - interface ClassElement extends Declaration { + interface ClassElement extends NamedDeclaration { _classElementBrand: any; name?: PropertyName; } - interface TypeElement extends Declaration { + interface TypeElement extends NamedDeclaration { _typeElementBrand: any; name?: PropertyName; questionToken?: QuestionToken; @@ -1211,7 +1220,7 @@ declare namespace ts { typeParameters?: NodeArray<TypeParameterDeclaration>; type: TypeNode; } - interface EnumMember extends Declaration { + interface EnumMember extends NamedDeclaration { kind: SyntaxKind.EnumMember; parent?: EnumDeclaration; name: PropertyName; @@ -1264,13 +1273,13 @@ declare namespace ts { moduleSpecifier: Expression; } type NamedImportBindings = NamespaceImport | NamedImports; - interface ImportClause extends Declaration { + interface ImportClause extends NamedDeclaration { kind: SyntaxKind.ImportClause; parent?: ImportDeclaration; name?: Identifier; namedBindings?: NamedImportBindings; } - interface NamespaceImport extends Declaration { + interface NamespaceImport extends NamedDeclaration { kind: SyntaxKind.NamespaceImport; parent?: ImportClause; name: Identifier; @@ -1296,13 +1305,13 @@ declare namespace ts { elements: NodeArray<ExportSpecifier>; } type NamedImportsOrExports = NamedImports | NamedExports; - interface ImportSpecifier extends Declaration { + interface ImportSpecifier extends NamedDeclaration { kind: SyntaxKind.ImportSpecifier; parent?: NamedImports; propertyName?: Identifier; name: Identifier; } - interface ExportSpecifier extends Declaration { + interface ExportSpecifier extends NamedDeclaration { kind: SyntaxKind.ExportSpecifier; parent?: NamedExports; propertyName?: Identifier; @@ -1433,7 +1442,7 @@ declare namespace ts { kind: SyntaxKind.JSDocTypeTag; typeExpression: JSDocTypeExpression; } - interface JSDocTypedefTag extends JSDocTag, Declaration { + interface JSDocTypedefTag extends JSDocTag, NamedDeclaration { kind: SyntaxKind.JSDocTypedefTag; fullName?: JSDocNamespaceDeclaration | Identifier; name?: Identifier; @@ -1611,10 +1620,10 @@ declare namespace ts { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo; + getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; + getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; + getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined; getBaseTypes(type: InterfaceType): BaseType[]; getBaseTypeOfLiteralType(type: Type): Type; getWidenedType(type: Type): Type; @@ -1624,11 +1633,11 @@ declare namespace ts { signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; + getSymbolAtLocation(node: Node): Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; - getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol; + getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; + getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; @@ -1638,37 +1647,47 @@ declare namespace ts { getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; + getContextualType(node: Expression): Type | undefined; + getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature | undefined; + getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean | undefined; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; isUnknownSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; + getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type; + getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; getJsxIntrinsicTagNames(): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; getApparentType(type: Type): Type; + getSuggestionForNonexistentProperty(node: Identifier, containingType: Type): string | undefined; + getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; } enum NodeBuilderFlags { None = 0, - allowThisInObjectLiteral = 1, - allowQualifedNameInPlaceOfIdentifier = 2, - allowTypeParameterInQualifiedName = 4, - allowAnonymousIdentifier = 8, - allowEmptyUnionOrIntersection = 16, - allowEmptyTuple = 32, + NoTruncation = 1, + WriteArrayAsGenericType = 2, + WriteTypeArgumentsOfSignature = 32, + UseFullyQualifiedType = 64, + SuppressAnyReturnType = 256, + WriteTypeParametersInQualifiedName = 512, + AllowThisInObjectLiteral = 1024, + AllowQualifedNameInPlaceOfIdentifier = 2048, + AllowAnonymousIdentifier = 8192, + AllowEmptyUnionOrIntersection = 16384, + AllowEmptyTuple = 32768, + IgnoreErrors = 60416, + InObjectTypeLiteral = 1048576, + InTypeAlias = 8388608, } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -1693,23 +1712,24 @@ declare namespace ts { clear(): void; trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError(): void; - reportIllegalExtends(): void; + reportPrivateInBaseOfClassExpression(propertyName: string): void; } const enum TypeFormatFlags { None = 0, WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - InFirstTypeArgument = 256, - InTypeAlias = 512, - UseTypeAliasValue = 1024, - SuppressAnyReturnType = 2048, - AddUndefined = 4096, + UseTypeOfFunction = 4, + NoTruncation = 8, + WriteArrowStyleSignature = 16, + WriteOwnNameForAnyLike = 32, + WriteTypeArgumentsOfSignature = 64, + InElementType = 128, + UseFullyQualifiedType = 256, + InFirstTypeArgument = 512, + InTypeAlias = 1024, + UseTypeAliasValue = 2048, + SuppressAnyReturnType = 4096, + AddUndefined = 8192, + WriteClassExpressionAsTypeLiteral = 16384, } const enum SymbolFormatFlags { None = 0, @@ -1829,18 +1849,18 @@ declare namespace ts { Index = 262144, IndexedAccess = 524288, NonPrimitive = 16777216, - Literal = 480, + Literal = 224, StringOrNumberLiteral = 96, PossiblyFalsy = 7406, StringLike = 262178, - NumberLike = 340, + NumberLike = 84, BooleanLike = 136, EnumLike = 272, UnionOrIntersection = 196608, StructuredType = 229376, StructuredOrTypeVariable = 1032192, TypeVariable = 540672, - Narrowable = 17810431, + Narrowable = 17810175, NotUnionOrUnit = 16810497, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -1852,15 +1872,17 @@ declare namespace ts { aliasTypeArguments?: Type[]; } interface LiteralType extends Type { - text: string; + value: string | number; freshType?: LiteralType; regularType?: LiteralType; } - interface EnumType extends Type { - memberTypes: EnumLiteralType[]; + interface StringLiteralType extends LiteralType { + value: string; + } + interface NumberLiteralType extends LiteralType { + value: number; } - interface EnumLiteralType extends LiteralType { - baseType: EnumType & UnionType; + interface EnumType extends Type { } const enum ObjectFlags { Class = 1, @@ -1894,7 +1916,7 @@ declare namespace ts { } interface TypeReference extends ObjectType { target: GenericType; - typeArguments: Type[]; + typeArguments?: Type[]; } interface GenericType extends InterfaceType, TypeReference { } @@ -1930,7 +1952,7 @@ declare namespace ts { } interface Signature { declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; + typeParameters?: TypeParameter[]; parameters: Symbol[]; } const enum IndexKind { @@ -1959,12 +1981,13 @@ declare namespace ts { next?: DiagnosticMessageChain; } interface Diagnostic { - file: SourceFile; - start: number; - length: number; + file: SourceFile | undefined; + start: number | undefined; + length: number | undefined; messageText: string | DiagnosticMessageChain; category: DiagnosticCategory; code: number; + source?: string; } enum DiagnosticCategory { Warning = 0, @@ -2192,14 +2215,16 @@ declare namespace ts { HelperName = 4096, ExportName = 8192, LocalName = 16384, - Indented = 32768, - NoIndentation = 65536, - AsyncFunctionBody = 131072, - ReuseTempVariableScope = 262144, - CustomPrologue = 524288, - NoHoisting = 1048576, - HasEndOfDeclarationMarker = 2097152, - Iterator = 4194304, + InternalName = 32768, + Indented = 65536, + NoIndentation = 131072, + AsyncFunctionBody = 262144, + ReuseTempVariableScope = 524288, + CustomPrologue = 1048576, + NoHoisting = 2097152, + HasEndOfDeclarationMarker = 4194304, + Iterator = 8388608, + NoAsciiEscaping = 16777216, } interface EmitHelper { readonly name: string; @@ -2268,7 +2293,7 @@ declare namespace ts { } } declare namespace ts { - const version = "2.3.0-dev.20170419"; + const version = "2.4.0-dev.20170524"; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; @@ -2354,17 +2379,17 @@ declare namespace ts { function tokenToString(t: SyntaxKind): string; function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; + function isWhiteSpaceLike(ch: number): boolean; function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; - function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U; + function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; + function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; - function getShebang(text: string): string; + function getShebang(text: string): string | undefined; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; @@ -2391,9 +2416,6 @@ declare namespace ts { }; } declare namespace ts { - interface Push<T> { - push(value: T): void; - } function moduleHasNonRelativeName(moduleName: string): boolean; function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean; @@ -2452,6 +2474,7 @@ declare namespace ts { function getParseTreeNode(node: Node): Node; function getParseTreeNode<T extends Node>(node: Node, nodeTest?: (node: Node) => node is T): T; function unescapeIdentifier(identifier: string): string; + function getNameOfDeclaration(declaration: Declaration): DeclarationName | undefined; } declare namespace ts { function createNodeArray<T extends Node>(elements?: T[], hasTrailingComma?: boolean): NodeArray<T>; @@ -2462,6 +2485,7 @@ declare namespace ts { function createLiteral(value: string | number | boolean): PrimaryExpression; function createNumericLiteral(value: string): NumericLiteral; function createIdentifier(text: string): Identifier; + function updateIdentifier(node: Identifier, typeArguments: NodeArray<TypeNode> | undefined): Identifier; function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; function createLoopVariable(): Identifier; function createUniqueName(text: string): Identifier; @@ -2476,56 +2500,19 @@ declare namespace ts { function updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; function createComputedPropertyName(expression: Expression): ComputedPropertyName; function updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; - function createSignatureDeclaration(kind: SyntaxKind, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): SignatureDeclaration; - function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; - function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): FunctionTypeNode; - function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; - function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructorTypeNode; - function createCallSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; - function updateCallSignatureDeclaration(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration; - function createConstructSignatureDeclaration(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; - function updateConstructSignatureDeclaration(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration; - function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; - function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; - function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; - function createThisTypeNode(): ThisTypeNode; - function createLiteralTypeNode(literal: Expression): LiteralTypeNode; - function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; - function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; - function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode; - function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; - function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; - function createTypeQueryNode(exprName: EntityName): TypeQueryNode; - function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; - function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; - function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; - function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType, types: TypeNode[]): UnionTypeNode; - function createUnionOrIntersectionTypeNode(kind: SyntaxKind.IntersectionType, types: TypeNode[]): IntersectionTypeNode; - function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionOrIntersectionTypeNode; - function updateUnionOrIntersectionTypeNode(node: UnionOrIntersectionTypeNode, types: NodeArray<TypeNode>): UnionOrIntersectionTypeNode; - function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; - function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode; - function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; - function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; - function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function createTypeParameterDeclaration(name: string | Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; function updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; - function createPropertySignature(name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function updatePropertySignature(node: PropertySignature, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function createIndexSignatureDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - function updateIndexSignatureDeclaration(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; function createParameter(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; function updateParameter(node: ParameterDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; function createDecorator(expression: Expression): Decorator; function updateDecorator(node: Decorator, expression: Expression): Decorator; + function createPropertySignature(modifiers: Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; + function updatePropertySignature(node: PropertySignature, modifiers: Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; function createProperty(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; function updateProperty(node: PropertyDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, type: TypeNode | undefined, initializer: Expression): PropertyDeclaration; - function createMethodDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; + function createMethodSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; + function createMethod(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; function updateMethod(node: MethodDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; function createConstructor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; function updateConstructor(node: ConstructorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; @@ -2533,6 +2520,45 @@ declare namespace ts { function updateGetAccessor(node: GetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; function createSetAccessor(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; function updateSetAccessor(node: SetAccessorDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: PropertyName, parameters: ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; + function createCallSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; + function updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration; + function createConstructSignature(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; + function updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration; + function createIndexSignature(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function updateIndexSignature(node: IndexSignatureDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, parameters: ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; + function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; + function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; + function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; + function createTypeReferenceNode(typeName: string | EntityName, typeArguments: TypeNode[] | undefined): TypeReferenceNode; + function updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode; + function createFunctionTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): FunctionTypeNode; + function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): FunctionTypeNode; + function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined): ConstructorTypeNode; + function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructorTypeNode; + function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; + function createTypeLiteralNode(members: TypeElement[]): TypeLiteralNode; + function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode; + function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; + function createTupleTypeNode(elementTypes: TypeNode[]): TupleTypeNode; + function updateTypleTypeNode(node: TupleTypeNode, elementTypes: TypeNode[]): TupleTypeNode; + function createUnionTypeNode(types: TypeNode[]): UnionTypeNode; + function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode; + function createIntersectionTypeNode(types: TypeNode[]): IntersectionTypeNode; + function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode; + function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: TypeNode[]): UnionTypeNode | IntersectionTypeNode; + function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; + function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; + function createThisTypeNode(): ThisTypeNode; + function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; + function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createLiteralTypeNode(literal: Expression): LiteralTypeNode; + function updateLiteralTypeNode(node: LiteralTypeNode, literal: Expression): LiteralTypeNode; function createObjectBindingPattern(elements: BindingElement[]): ObjectBindingPattern; function updateObjectBindingPattern(node: ObjectBindingPattern, elements: BindingElement[]): ObjectBindingPattern; function createArrayBindingPattern(elements: ArrayBindingElement[]): ArrayBindingPattern; @@ -2574,7 +2600,7 @@ declare namespace ts { function createPostfix(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; - function updateBinary(node: BinaryExpression, left: Expression, right: Expression): BinaryExpression; + function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken): BinaryExpression; function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; @@ -2594,16 +2620,15 @@ declare namespace ts { function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; function createNonNullExpression(expression: Expression): NonNullExpression; function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; + function updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; function updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; + function createSemicolonClassElement(): SemicolonClassElement; function createBlock(statements: Statement[], multiLine?: boolean): Block; function updateBlock(node: Block, statements: Statement[]): Block; function createVariableStatement(modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList | VariableDeclaration[]): VariableStatement; function updateVariableStatement(node: VariableStatement, modifiers: Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; - function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; - function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; - function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; - function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; function createEmptyStatement(): EmptyStatement; function createStatement(expression: Expression): ExpressionStatement; function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; @@ -2635,10 +2660,19 @@ declare namespace ts { function updateThrow(node: ThrowStatement, expression: Expression): ThrowStatement; function createTry(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; function updateTry(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; + function createDebuggerStatement(): DebuggerStatement; + function createVariableDeclaration(name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; + function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; + function createVariableDeclarationList(declarations: VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; + function updateVariableDeclarationList(node: VariableDeclarationList, declarations: VariableDeclaration[]): VariableDeclarationList; function createFunctionDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; function updateFunctionDeclaration(node: FunctionDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; function createClassDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; function updateClassDeclaration(node: ClassDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier | undefined, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[], members: ClassElement[]): ClassDeclaration; + function createInterfaceDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[] | undefined, members: TypeElement[]): InterfaceDeclaration; + function updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, typeParameters: TypeParameterDeclaration[] | undefined, heritageClauses: HeritageClause[] | undefined, members: TypeElement[]): InterfaceDeclaration; + function createTypeAliasDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, typeParameters: TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; + function updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, typeParameters: TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; function createEnumDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, members: EnumMember[]): EnumDeclaration; function updateEnumDeclaration(node: EnumDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, members: EnumMember[]): EnumDeclaration; function createModuleDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; @@ -2647,12 +2681,14 @@ declare namespace ts { function updateModuleBlock(node: ModuleBlock, statements: Statement[]): ModuleBlock; function createCaseBlock(clauses: CaseOrDefaultClause[]): CaseBlock; function updateCaseBlock(node: CaseBlock, clauses: CaseOrDefaultClause[]): CaseBlock; + function createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration; + function updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; function createImportEqualsDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; function createImportDeclaration(decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier?: Expression): ImportDeclaration; function updateImportDeclaration(node: ImportDeclaration, decorators: Decorator[] | undefined, modifiers: Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration; - function createImportClause(name: Identifier, namedBindings: NamedImportBindings): ImportClause; - function updateImportClause(node: ImportClause, name: Identifier, namedBindings: NamedImportBindings): ImportClause; + function createImportClause(name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + function updateImportClause(node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; function createNamespaceImport(name: Identifier): NamespaceImport; function updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; function createNamedImports(elements: ImportSpecifier[]): NamedImports; @@ -2677,20 +2713,20 @@ declare namespace ts { function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes): JsxOpeningElement; function createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; function updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; - function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; - function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; function updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression): JsxAttribute; + function createJsxAttributes(properties: JsxAttributeLike[]): JsxAttributes; + function updateJsxAttributes(node: JsxAttributes, properties: JsxAttributeLike[]): JsxAttributes; function createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; function updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; function createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; function updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; - function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; - function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; function createCaseClause(expression: Expression, statements: Statement[]): CaseClause; function updateCaseClause(node: CaseClause, expression: Expression, statements: Statement[]): CaseClause; function createDefaultClause(statements: Statement[]): DefaultClause; function updateDefaultClause(node: DefaultClause, statements: Statement[]): DefaultClause; + function createHeritageClause(token: HeritageClause["token"], types: ExpressionWithTypeArguments[]): HeritageClause; + function updateHeritageClause(node: HeritageClause, types: ExpressionWithTypeArguments[]): HeritageClause; function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; @@ -2706,6 +2742,8 @@ declare namespace ts { function createNotEmittedStatement(original: Node): NotEmittedStatement; function createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; function updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; + function createCommaList(elements: Expression[]): CommaListExpression; + function updateCommaList(node: CommaListExpression, elements: Expression[]): CommaListExpression; function createBundle(sourceFiles: SourceFile[]): Bundle; function updateBundle(node: Bundle, sourceFiles: SourceFile[]): Bundle; function createComma(left: Expression, right: Expression): Expression; @@ -2739,8 +2777,8 @@ declare namespace ts { function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[]): T; function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; - function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number; - function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number): PropertyAccessExpression | ElementAccessExpression; + function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number; + function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: string | number): PropertyAccessExpression | ElementAccessExpression; function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T; function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T; function removeEmitHelper(node: Node, helper: EmitHelper): boolean; @@ -2750,7 +2788,7 @@ declare namespace ts { } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; - function forEachChild<T>(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; + function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile; function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName; function isExternalModule(file: SourceFile): boolean; @@ -2783,6 +2821,7 @@ declare namespace ts { getNewLine(): string; } function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string; + function formatDiagnosticsWithColorAndContext(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; } @@ -2802,31 +2841,31 @@ declare namespace ts { getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; - forEachChild<T>(cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; + forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; } interface Symbol { getFlags(): SymbolFlags; getName(): string; - getDeclarations(): Declaration[]; + getDeclarations(): Declaration[] | undefined; getDocumentationComment(): SymbolDisplayPart[]; getJsDocTags(): JSDocTagInfo[]; } interface Type { getFlags(): TypeFlags; - getSymbol(): Symbol; + getSymbol(): Symbol | undefined; getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; + getProperty(propertyName: string): Symbol | undefined; getApparentProperties(): Symbol[]; getCallSignatures(): Signature[]; getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - getBaseTypes(): BaseType[]; + getStringIndexType(): Type | undefined; + getNumberIndexType(): Type | undefined; + getBaseTypes(): BaseType[] | undefined; getNonNullableType(): Type; } interface Signature { getDeclaration(): SignatureDeclaration; - getTypeParameters(): TypeParameter[]; + getTypeParameters(): TypeParameter[] | undefined; getParameters(): Symbol[]; getReturnType(): Type; getDocumentationComment(): SymbolDisplayPart[]; @@ -2925,6 +2964,8 @@ declare namespace ts { getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; + getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; + getRefactorCodeActions(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string): CodeAction[] | undefined; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -2935,11 +2976,11 @@ declare namespace ts { } interface ClassifiedSpan { textSpan: TextSpan; - classificationType: string; + classificationType: ClassificationTypeNames; } interface NavigationBarItem { text: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; spans: TextSpan[]; childItems: NavigationBarItem[]; @@ -2949,7 +2990,7 @@ declare namespace ts { } interface NavigationTree { text: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; spans: TextSpan[]; childItems?: NavigationTree[]; @@ -2975,6 +3016,10 @@ declare namespace ts { description: string; changes: FileTextChanges[]; } + interface ApplicableRefactorInfo { + name: string; + description: string; + } interface TextInsertion { newText: string; caretOffset: number; @@ -2991,35 +3036,35 @@ declare namespace ts { isInString?: true; } interface ImplementationLocation extends DocumentSpan { - kind: string; + kind: ScriptElementKind; displayParts: SymbolDisplayPart[]; } interface DocumentHighlights { fileName: string; highlightSpans: HighlightSpan[]; } - namespace HighlightSpanKind { - const none = "none"; - const definition = "definition"; - const reference = "reference"; - const writtenReference = "writtenReference"; + const enum HighlightSpanKind { + none = "none", + definition = "definition", + reference = "reference", + writtenReference = "writtenReference", } interface HighlightSpan { fileName?: string; isInString?: true; textSpan: TextSpan; - kind: string; + kind: HighlightSpanKind; } interface NavigateToItem { name: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; matchKind: string; isCaseSensitive: boolean; fileName: string; textSpan: TextSpan; containerName: string; - containerKind: string; + containerKind: ScriptElementKind; } enum IndentStyle { None = 0, @@ -3079,9 +3124,9 @@ declare namespace ts { interface DefinitionInfo { fileName: string; textSpan: TextSpan; - kind: string; + kind: ScriptElementKind; name: string; - containerKind: string; + containerKind: ScriptElementKind; containerName: string; } interface ReferencedSymbolDefinitionInfo extends DefinitionInfo { @@ -3124,7 +3169,7 @@ declare namespace ts { text?: string; } interface QuickInfo { - kind: string; + kind: ScriptElementKind; kindModifiers: string; textSpan: TextSpan; displayParts: SymbolDisplayPart[]; @@ -3136,7 +3181,7 @@ declare namespace ts { localizedErrorMessage: string; displayName: string; fullDisplayName: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; triggerSpan: TextSpan; } @@ -3170,14 +3215,14 @@ declare namespace ts { } interface CompletionEntry { name: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; sortText: string; replacementSpan?: TextSpan; } interface CompletionEntryDetails { name: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; @@ -3235,75 +3280,75 @@ declare namespace ts { getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; } - namespace ScriptElementKind { - const unknown = ""; - const warning = "warning"; - const keyword = "keyword"; - const scriptElement = "script"; - const moduleElement = "module"; - const classElement = "class"; - const localClassElement = "local class"; - const interfaceElement = "interface"; - const typeElement = "type"; - const enumElement = "enum"; - const enumMemberElement = "enum member"; - const variableElement = "var"; - const localVariableElement = "local var"; - const functionElement = "function"; - const localFunctionElement = "local function"; - const memberFunctionElement = "method"; - const memberGetAccessorElement = "getter"; - const memberSetAccessorElement = "setter"; - const memberVariableElement = "property"; - const constructorImplementationElement = "constructor"; - const callSignatureElement = "call"; - const indexSignatureElement = "index"; - const constructSignatureElement = "construct"; - const parameterElement = "parameter"; - const typeParameterElement = "type parameter"; - const primitiveType = "primitive type"; - const label = "label"; - const alias = "alias"; - const constElement = "const"; - const letElement = "let"; - const directory = "directory"; - const externalModuleName = "external module name"; - const jsxAttribute = "JSX attribute"; - } - namespace ScriptElementKindModifier { - const none = ""; - const publicMemberModifier = "public"; - const privateMemberModifier = "private"; - const protectedMemberModifier = "protected"; - const exportedModifier = "export"; - const ambientModifier = "declare"; - const staticModifier = "static"; - const abstractModifier = "abstract"; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAliasName: string; - static parameterName: string; - static docCommentTagName: string; - static jsxOpenTagName: string; - static jsxCloseTagName: string; - static jsxSelfClosingTagName: string; - static jsxAttribute: string; - static jsxText: string; - static jsxAttributeStringLiteralValue: string; + const enum ScriptElementKind { + unknown = "", + warning = "warning", + keyword = "keyword", + scriptElement = "script", + moduleElement = "module", + classElement = "class", + localClassElement = "local class", + interfaceElement = "interface", + typeElement = "type", + enumElement = "enum", + enumMemberElement = "enum member", + variableElement = "var", + localVariableElement = "local var", + functionElement = "function", + localFunctionElement = "local function", + memberFunctionElement = "method", + memberGetAccessorElement = "getter", + memberSetAccessorElement = "setter", + memberVariableElement = "property", + constructorImplementationElement = "constructor", + callSignatureElement = "call", + indexSignatureElement = "index", + constructSignatureElement = "construct", + parameterElement = "parameter", + typeParameterElement = "type parameter", + primitiveType = "primitive type", + label = "label", + alias = "alias", + constElement = "const", + letElement = "let", + directory = "directory", + externalModuleName = "external module name", + jsxAttribute = "JSX attribute", + } + const enum ScriptElementKindModifier { + none = "", + publicMemberModifier = "public", + privateMemberModifier = "private", + protectedMemberModifier = "protected", + exportedModifier = "export", + ambientModifier = "declare", + staticModifier = "static", + abstractModifier = "abstract", + } + const enum ClassificationTypeNames { + comment = "comment", + identifier = "identifier", + keyword = "keyword", + numericLiteral = "number", + operator = "operator", + stringLiteral = "string", + whiteSpace = "whitespace", + text = "text", + punctuation = "punctuation", + className = "class name", + enumName = "enum name", + interfaceName = "interface name", + moduleName = "module name", + typeParameterName = "type parameter name", + typeAliasName = "type alias name", + parameterName = "parameter name", + docCommentTagName = "doc comment tag name", + jsxOpenTagName = "jsx open tag name", + jsxCloseTagName = "jsx close tag name", + jsxSelfClosingTagName = "jsx self closing tag name", + jsxAttribute = "jsx attribute", + jsxText = "jsx text", + jsxAttributeStringLiteralValue = "jsx attribute string literal value", } const enum ClassificationType { comment = 1, @@ -3361,6 +3406,7 @@ declare namespace ts { reportDiagnostics?: boolean; moduleName?: string; renamedDependencies?: MapLike<string>; + transformers?: CustomTransformers; } interface TranspileOutput { outputText: string; @@ -3559,51 +3605,54 @@ declare namespace ts.server { } } declare namespace ts.server.protocol { - namespace CommandTypes { - type Brace = "brace"; - type BraceCompletion = "braceCompletion"; - type Change = "change"; - type Close = "close"; - type Completions = "completions"; - type CompletionDetails = "completionEntryDetails"; - type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; - type CompileOnSaveEmitFile = "compileOnSaveEmitFile"; - type Configure = "configure"; - type Definition = "definition"; - type Implementation = "implementation"; - type Exit = "exit"; - type Format = "format"; - type Formatonkey = "formatonkey"; - type Geterr = "geterr"; - type GeterrForProject = "geterrForProject"; - type SemanticDiagnosticsSync = "semanticDiagnosticsSync"; - type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; - type NavBar = "navbar"; - type Navto = "navto"; - type NavTree = "navtree"; - type NavTreeFull = "navtree-full"; - type Occurrences = "occurrences"; - type DocumentHighlights = "documentHighlights"; - type Open = "open"; - type Quickinfo = "quickinfo"; - type References = "references"; - type Reload = "reload"; - type Rename = "rename"; - type Saveto = "saveto"; - type SignatureHelp = "signatureHelp"; - type TypeDefinition = "typeDefinition"; - type ProjectInfo = "projectInfo"; - type ReloadProjects = "reloadProjects"; - type Unknown = "unknown"; - type OpenExternalProject = "openExternalProject"; - type OpenExternalProjects = "openExternalProjects"; - type CloseExternalProject = "closeExternalProject"; - type TodoComments = "todoComments"; - type Indentation = "indentation"; - type DocCommentTemplate = "docCommentTemplate"; - type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; - type GetCodeFixes = "getCodeFixes"; - type GetSupportedCodeFixes = "getSupportedCodeFixes"; + const enum CommandTypes { + Brace = "brace", + BraceCompletion = "braceCompletion", + Change = "change", + Close = "close", + Completions = "completions", + CompletionDetails = "completionEntryDetails", + CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", + CompileOnSaveEmitFile = "compileOnSaveEmitFile", + Configure = "configure", + Definition = "definition", + Implementation = "implementation", + Exit = "exit", + Format = "format", + Formatonkey = "formatonkey", + Geterr = "geterr", + GeterrForProject = "geterrForProject", + SemanticDiagnosticsSync = "semanticDiagnosticsSync", + SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", + NavBar = "navbar", + Navto = "navto", + NavTree = "navtree", + NavTreeFull = "navtree-full", + Occurrences = "occurrences", + DocumentHighlights = "documentHighlights", + Open = "open", + Quickinfo = "quickinfo", + References = "references", + Reload = "reload", + Rename = "rename", + Saveto = "saveto", + SignatureHelp = "signatureHelp", + TypeDefinition = "typeDefinition", + ProjectInfo = "projectInfo", + ReloadProjects = "reloadProjects", + Unknown = "unknown", + OpenExternalProject = "openExternalProject", + OpenExternalProjects = "openExternalProjects", + CloseExternalProject = "closeExternalProject", + TodoComments = "todoComments", + Indentation = "indentation", + DocCommentTemplate = "docCommentTemplate", + CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", + GetCodeFixes = "getCodeFixes", + GetSupportedCodeFixes = "getSupportedCodeFixes", + GetApplicableRefactors = "getApplicableRefactors", + GetRefactorCodeActions = "getRefactorCodeActions", + GetRefactorCodeActionsFull = "getRefactorCodeActions-full", } interface Message { seq: number; @@ -3698,15 +3747,44 @@ declare namespace ts.server.protocol { line: number; offset: number; } + type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs; + interface GetApplicableRefactorsRequest extends Request { + command: CommandTypes.GetApplicableRefactors; + arguments: GetApplicableRefactorsRequestArgs; + } + type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs; + interface ApplicableRefactorInfo { + name: string; + description: string; + } + interface GetApplicableRefactorsResponse extends Response { + body?: ApplicableRefactorInfo[]; + } + interface GetRefactorCodeActionsRequest extends Request { + command: CommandTypes.GetRefactorCodeActions; + arguments: GetRefactorCodeActionsRequestArgs; + } + type GetRefactorCodeActionsRequestArgs = FileLocationOrRangeRequestArgs & { + refactorName: string; + }; + type RefactorCodeActions = { + actions: protocol.CodeAction[]; + renameLocation?: number; + }; + interface GetRefactorCodeActionsResponse extends Response { + body: RefactorCodeActions; + } interface CodeFixRequest extends Request { command: CommandTypes.GetCodeFixes; arguments: CodeFixRequestArgs; } - interface CodeFixRequestArgs extends FileRequestArgs { + interface FileRangeRequestArgs extends FileRequestArgs { startLine: number; startOffset: number; endLine: number; endOffset: number; + } + interface CodeFixRequestArgs extends FileRangeRequestArgs { errorCodes?: number[]; } interface GetCodeFixesResponse extends Response { @@ -3779,7 +3857,7 @@ declare namespace ts.server.protocol { arguments: DocumentHighlightsRequestArgs; } interface HighlightSpan extends TextSpan { - kind: string; + kind: HighlightSpanKind; } interface DocumentHighlightsItem { file: string; @@ -3818,7 +3896,7 @@ declare namespace ts.server.protocol { localizedErrorMessage?: string; displayName: string; fullDisplayName: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; } interface SpanGroup { @@ -3869,6 +3947,7 @@ declare namespace ts.server.protocol { interface OpenRequestArgs extends FileRequestArgs { fileContent?: string; scriptKindName?: ScriptKindName; + projectRootPath?: string; } type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; interface OpenRequest extends Request { @@ -3937,7 +4016,7 @@ declare namespace ts.server.protocol { command: CommandTypes.Quickinfo; } interface QuickInfoResponseBody { - kind: string; + kind: ScriptElementKind; kindModifiers: string; start: Location; end: Location; @@ -4004,14 +4083,14 @@ declare namespace ts.server.protocol { } interface CompletionEntry { name: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; sortText: string; replacementSpan?: TextSpan; } interface CompletionEntryDetails { name: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; @@ -4102,7 +4181,9 @@ declare namespace ts.server.protocol { start: Location; end: Location; text: string; + category: string; code?: number; + source?: string; } interface DiagnosticEventBody { file: string; @@ -4157,7 +4238,7 @@ declare namespace ts.server.protocol { } interface NavtoItem { name: string; - kind: string; + kind: ScriptElementKind; matchKind?: string; isCaseSensitive?: boolean; kindModifiers?: string; @@ -4165,7 +4246,7 @@ declare namespace ts.server.protocol { start: Location; end: Location; containerName?: string; - containerKind?: string; + containerKind?: ScriptElementKind; } interface NavtoResponse extends Response { body?: NavtoItem[]; @@ -4191,7 +4272,7 @@ declare namespace ts.server.protocol { } interface NavigationBarItem { text: string; - kind: string; + kind: ScriptElementKind; kindModifiers?: string; spans: TextSpan[]; childItems?: NavigationBarItem[]; @@ -4199,7 +4280,7 @@ declare namespace ts.server.protocol { } interface NavigationTree { text: string; - kind: string; + kind: ScriptElementKind; kindModifiers: string; spans: TextSpan[]; childItems?: NavigationTree[]; @@ -4256,12 +4337,11 @@ declare namespace ts.server.protocol { interface NavTreeResponse extends Response { body?: NavigationTree; } - namespace IndentStyle { - type None = "None"; - type Block = "Block"; - type Smart = "Smart"; + const enum IndentStyle { + None = "None", + Block = "Block", + Smart = "Smart", } - type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart; interface EditorSettings { baseIndentSize?: number; indentSize?: number; @@ -4282,6 +4362,7 @@ declare namespace ts.server.protocol { insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; + insertSpaceAfterTypeAssertion?: boolean; insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; @@ -4291,15 +4372,19 @@ declare namespace ts.server.protocol { allowSyntheticDefaultImports?: boolean; allowUnreachableCode?: boolean; allowUnusedLabels?: boolean; + alwaysStrict?: boolean; baseUrl?: string; charset?: string; + checkJs?: boolean; declaration?: boolean; declarationDir?: string; disableSizeLimit?: boolean; + downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; forceConsistentCasingInFileNames?: boolean; + importHelpers?: boolean; inlineSourceMap?: boolean; inlineSources?: boolean; isolatedModules?: boolean; @@ -4339,6 +4424,7 @@ declare namespace ts.server.protocol { skipDefaultLibCheck?: boolean; sourceMap?: boolean; sourceRoot?: string; + strict?: boolean; strictNullChecks?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; @@ -4348,40 +4434,35 @@ declare namespace ts.server.protocol { typeRoots?: string[]; [option: string]: CompilerOptionsValue | undefined; } - namespace JsxEmit { - type None = "None"; - type Preserve = "Preserve"; - type ReactNative = "ReactNative"; - type React = "React"; - } - type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative; - namespace ModuleKind { - type None = "None"; - type CommonJS = "CommonJS"; - type AMD = "AMD"; - type UMD = "UMD"; - type System = "System"; - type ES6 = "ES6"; - type ES2015 = "ES2015"; - } - type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015; - namespace ModuleResolutionKind { - type Classic = "Classic"; - type Node = "Node"; - } - type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node; - namespace NewLineKind { - type Crlf = "Crlf"; - type Lf = "Lf"; - } - type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf; - namespace ScriptTarget { - type ES3 = "ES3"; - type ES5 = "ES5"; - type ES6 = "ES6"; - type ES2015 = "ES2015"; - } - type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015; + const enum JsxEmit { + None = "None", + Preserve = "Preserve", + ReactNative = "ReactNative", + React = "React", + } + const enum ModuleKind { + None = "None", + CommonJS = "CommonJS", + AMD = "AMD", + UMD = "UMD", + System = "System", + ES6 = "ES6", + ES2015 = "ES2015", + } + const enum ModuleResolutionKind { + Classic = "Classic", + Node = "Node", + } + const enum NewLineKind { + Crlf = "Crlf", + Lf = "Lf", + } + const enum ScriptTarget { + ES3 = "ES3", + ES5 = "ES5", + ES6 = "ES6", + ES2015 = "ES2015", + } } declare namespace ts.server { interface ServerCancellationToken extends HostCancellationToken { @@ -4394,54 +4475,9 @@ declare namespace ts.server { project: Project; } interface EventSender { - event(payload: any, eventName: string): void; - } - namespace CommandNames { - const Brace: protocol.CommandTypes.Brace; - const BraceCompletion: protocol.CommandTypes.BraceCompletion; - const Change: protocol.CommandTypes.Change; - const Close: protocol.CommandTypes.Close; - const Completions: protocol.CommandTypes.Completions; - const CompletionDetails: protocol.CommandTypes.CompletionDetails; - const CompileOnSaveAffectedFileList: protocol.CommandTypes.CompileOnSaveAffectedFileList; - const CompileOnSaveEmitFile: protocol.CommandTypes.CompileOnSaveEmitFile; - const Configure: protocol.CommandTypes.Configure; - const Definition: protocol.CommandTypes.Definition; - const Exit: protocol.CommandTypes.Exit; - const Format: protocol.CommandTypes.Format; - const Formatonkey: protocol.CommandTypes.Formatonkey; - const Geterr: protocol.CommandTypes.Geterr; - const GeterrForProject: protocol.CommandTypes.GeterrForProject; - const Implementation: protocol.CommandTypes.Implementation; - const SemanticDiagnosticsSync: protocol.CommandTypes.SemanticDiagnosticsSync; - const SyntacticDiagnosticsSync: protocol.CommandTypes.SyntacticDiagnosticsSync; - const NavBar: protocol.CommandTypes.NavBar; - const NavTree: protocol.CommandTypes.NavTree; - const NavTreeFull: protocol.CommandTypes.NavTreeFull; - const Navto: protocol.CommandTypes.Navto; - const Occurrences: protocol.CommandTypes.Occurrences; - const DocumentHighlights: protocol.CommandTypes.DocumentHighlights; - const Open: protocol.CommandTypes.Open; - const Quickinfo: protocol.CommandTypes.Quickinfo; - const References: protocol.CommandTypes.References; - const Reload: protocol.CommandTypes.Reload; - const Rename: protocol.CommandTypes.Rename; - const Saveto: protocol.CommandTypes.Saveto; - const SignatureHelp: protocol.CommandTypes.SignatureHelp; - const TypeDefinition: protocol.CommandTypes.TypeDefinition; - const ProjectInfo: protocol.CommandTypes.ProjectInfo; - const ReloadProjects: protocol.CommandTypes.ReloadProjects; - const Unknown: protocol.CommandTypes.Unknown; - const OpenExternalProject: protocol.CommandTypes.OpenExternalProject; - const OpenExternalProjects: protocol.CommandTypes.OpenExternalProjects; - const CloseExternalProject: protocol.CommandTypes.CloseExternalProject; - const TodoComments: protocol.CommandTypes.TodoComments; - const Indentation: protocol.CommandTypes.Indentation; - const DocCommentTemplate: protocol.CommandTypes.DocCommentTemplate; - const CompilerOptionsForInferredProjects: protocol.CommandTypes.CompilerOptionsForInferredProjects; - const GetCodeFixes: protocol.CommandTypes.GetCodeFixes; - const GetSupportedCodeFixes: protocol.CommandTypes.GetSupportedCodeFixes; + event<T>(payload: T, eventName: string): void; } + export import CommandNames = protocol.CommandTypes; function formatMessage<T extends protocol.Message>(msg: T, logger: server.Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; interface SessionOptions { host: ServerHost; @@ -4456,6 +4492,7 @@ declare namespace ts.server { throttleWaitMilliseconds?: number; globalPlugins?: string[]; pluginProbeLocations?: string[]; + allowLocalPluginLoads?: boolean; } class Session implements EventSender { private readonly gcTimer; @@ -4477,7 +4514,7 @@ declare namespace ts.server { logError(err: Error, cmd: string): void; send(msg: protocol.Message): void; configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: ts.Diagnostic[]): void; - event(info: any, eventName: string): void; + event<T>(info: T, eventName: string): void; output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void; private semanticCheck(file, project); private syntacticCheck(file, project); @@ -4505,7 +4542,7 @@ declare namespace ts.server { private getDefaultProject(args); private getRenameLocations(args, simplifiedResult); private getReferences(args, simplifiedResult); - private openClientFile(fileName, fileContent?, scriptKind?); + private openClientFile(fileName, fileContent?, scriptKind?, projectRootPath?); private getPosition(args, scriptInfo); private getFileAndProject(args, errorOnMissingProject?); private getFileAndProjectWithoutRefreshingInferredProjects(args, errorOnMissingProject?); @@ -4540,7 +4577,12 @@ declare namespace ts.server { private getNavigationTree(args, simplifiedResult); private getNavigateToItems(args, simplifiedResult); private getSupportedCodeFixes(); + private isLocation(locationOrSpan); + private extractPositionAndRange(args, scriptInfo); + private getApplicableRefactors(args); + private getRefactorCodeActions(args, simplifiedResult); private getCodeFixes(args, simplifiedResult); + private getStartAndEndPosition(args, scriptInfo); private mapCodeAction(codeAction, scriptInfo); private convertTextChangeToCodeEdit(change, scriptInfo); private getBraceMatching(args, simplifiedResult); @@ -5033,6 +5075,7 @@ declare namespace ts.server { throttleWaitMilliseconds?: number; globalPlugins?: string[]; pluginProbeLocations?: string[]; + allowLocalPluginLoads?: boolean; } class ProjectService { readonly typingsCache: TypingsCache; @@ -5062,6 +5105,7 @@ declare namespace ts.server { private readonly eventHandler?; readonly globalPlugins: ReadonlyArray<string>; readonly pluginProbeLocations: ReadonlyArray<string>; + readonly allowLocalPluginLoads: boolean; constructor(opts: ProjectServiceOptions); ensureInferredProjectsUpToDate_TestOnly(): void; getCompilerOptionsForInferredProjects(): CompilerOptions; @@ -5086,8 +5130,8 @@ declare namespace ts.server { private removeProject(project); private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles); private closeOpenFile(info); - private openOrUpdateConfiguredProjectForFile(fileName); - private findConfigFile(searchPath); + private openOrUpdateConfiguredProjectForFile(fileName, projectRootPath?); + private findConfigFile(searchPath, projectRootPath?); private printProjects(); private findConfiguredProjectByProjectName(configFileName); private findExternalProjectByProjectName(projectFileName); @@ -5111,8 +5155,8 @@ declare namespace ts.server { closeLog(): void; reloadProjects(): void; refreshInferredProjects(): void; - openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind): OpenConfiguredProjectResult; - openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): OpenConfiguredProjectResult; + openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; + openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; closeClientFile(uncheckedFileName: string): void; private collectChanges(lastKnownProjectVersions, currentProjects, result); private closeConfiguredProject(configFile); |