Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AbstractKeyword

AbstractKeyword: ModifierToken<AbstractKeyword>

AccessExpression

AccessibilityModifier

AccessibilityModifier: PublicKeyword | PrivateKeyword | ProtectedKeyword

AccessorDeclaration

AdditiveOperator

AdditiveOperator: PlusToken | MinusToken

AdditiveOperatorOrHigher

AffectedFileResult

AffectedFileResult<T>: { affected: SourceFile | Program; result: T } | undefined

Type parameters

  • T

ArrayBindingElement

ArrayBindingElement: BindingElement | OmittedExpression

ArrayBindingOrAssignmentElement

ArrayBindingOrAssignmentPattern

ArrayBindingOrAssignmentPattern: ArrayBindingPattern | ArrayLiteralExpression

AssertionExpression

AssertionExpression: TypeAssertion | AsExpression

AssertsKeyword

AssertsKeyword: KeywordToken<AssertsKeyword>

AssertsToken

AssertsToken: AssertsKeyword
deprecated

Use AssertsKeyword instead.

AssignmentOperator

AssignmentOperatorOrHigher

AssignmentOperatorToken

AssignmentOperatorToken: Token<AssignmentOperator>

AssignmentPattern

AsteriskToken

AsyncKeyword

AwaitKeyword

AwaitKeyword: KeywordToken<AwaitKeyword>

AwaitKeywordToken

AwaitKeywordToken: AwaitKeyword
deprecated

Use AwaitKeyword instead.

BaseType

BinaryOperator

BinaryOperatorToken

BinaryOperatorToken: Token<BinaryOperator>

BindingName

BindingName: Identifier | BindingPattern

BindingOrAssignmentElement

BindingOrAssignmentElementRestIndicator

BindingOrAssignmentElementRestIndicator: DotDotDotToken | SpreadElement | SpreadAssignment

BindingOrAssignmentElementTarget

BindingOrAssignmentPattern

BindingPattern

BitwiseOperator

BitwiseOperator: AmpersandToken | BarToken | CaretToken

BitwiseOperatorOrHigher

BitwiseOperatorOrHigher: EqualityOperatorOrHigher | BitwiseOperator

BlockLike

BooleanLiteral

BooleanLiteral: TrueLiteral | FalseLiteral

BreakOrContinueStatement

BreakOrContinueStatement: BreakStatement | ContinueStatement

CallLikeExpression

CaseOrDefaultClause

CaseOrDefaultClause: CaseClause | DefaultClause

ClassLikeDeclaration

ClassLikeDeclaration: ClassDeclaration | ClassExpression

ClassMemberModifier

CodeActionCommand

CodeActionCommand: InstallPackageAction

ColonToken

CommentKind

CompilerOptionsValue

CompilerOptionsValue: string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined

CompletionsTriggerCharacter

CompletionsTriggerCharacter: "." | "\"" | "'" | "`" | "/" | "@" | "<" | "#"

CompoundAssignmentOperator

ConciseBody

ConciseBody: FunctionBody | Expression

ConstKeyword

CreateProgram

CreateProgram<T>: (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]) => T

Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program

Type parameters

Type declaration

CustomTransformerFactory

CustomTransformerFactory: (context: TransformationContext) => CustomTransformer

Type declaration

DeclarationName

DeclarationWithTypeParameterChildren

DeclarationWithTypeParameters

DeclareKeyword

DeclareKeyword: ModifierToken<DeclareKeyword>

DefaultKeyword

DefaultKeyword: ModifierToken<DefaultKeyword>

DestructuringAssignment

DestructuringPattern

DiagnosticReporter

DiagnosticReporter: (diagnostic: Diagnostic) => void

Type declaration

DirectoryWatcherCallback

DirectoryWatcherCallback: (fileName: string) => void

Type declaration

    • (fileName: string): void
    • Parameters

      • fileName: string

      Returns void

DocumentRegistryBucketKey

DocumentRegistryBucketKey: string & { __bucketKey: any }

DotDotDotToken

DotToken

EmitHelperUniqueNameCallback

EmitHelperUniqueNameCallback: (name: string) => string

Type declaration

    • (name: string): string
    • Parameters

      • name: string

      Returns string

EndOfFileToken

EntityName

EntityNameExpression

EntityNameOrEntityNameExpression

EntityNameOrEntityNameExpression: EntityName | EntityNameExpression

EqualityOperator

EqualityOperatorOrHigher

EqualityOperatorOrHigher: RelationalOperatorOrHigher | EqualityOperator

EqualsGreaterThanToken

EqualsGreaterThanToken: PunctuationToken<EqualsGreaterThanToken>

EqualsToken

ErrorCallback

ErrorCallback: (message: DiagnosticMessage, length: number) => void

Type declaration

ExclamationToken

ExponentiationOperator

ExponentiationOperator: AsteriskAsteriskToken

ExportKeyword

FileWatcherCallback

FileWatcherCallback: (fileName: string, eventKind: FileWatcherEventKind) => void

Type declaration

FlowNode

FlowType

FlowType: Type | IncompleteType

ForInOrOfStatement

ForInOrOfStatement: ForInStatement | ForOfStatement

ForInitializer

FunctionBody

FunctionBody: Block

FunctionLike

FunctionLike: SignatureDeclaration
deprecated

Use SignatureDeclaration

FunctionLikeDeclaration

FunctionOrConstructorTypeNode

FunctionOrConstructorTypeNode: FunctionTypeNode | ConstructorTypeNode

HasExpressionInitializer

HasInitializer

HasJSDoc

HasType

HasTypeArguments

ImportOrExportSpecifier

ImportOrExportSpecifier: ImportSpecifier | ExportSpecifier

IncrementExpression

IncrementExpression: UpdateExpression

Deprecated, please use UpdateExpression

InvalidatedProject

Type parameters

JSDocNamespaceBody

JSDocSyntaxKind

JSDocTypeReferencingNode

JsFileExtensionInfo

JsFileExtensionInfo: FileExtensionInfo
deprecated

Use FileExtensionInfo instead.

JsonObjectExpression

JsxAttributeLike

JsxAttributeLike: JsxAttribute | JsxSpreadAttribute

JsxChild

JsxOpeningLikeElement

JsxOpeningLikeElement: JsxSelfClosingElement | JsxOpeningElement

JsxTagNameExpression

JsxTokenSyntaxKind

KeywordSyntaxKind

KeywordTypeSyntaxKind

LiteralSyntaxKind

LiteralToken

LogicalOperator

LogicalOperatorOrHigher

LogicalOperatorOrHigher: BitwiseOperatorOrHigher | LogicalOperator

LogicalOrCoalescingAssignmentOperator

MinusToken

Modifier

ModifierSyntaxKind

ModifiersArray

ModifiersArray: NodeArray<Modifier>

ModuleBody

ModuleName

ModuleReference

MultiplicativeOperator

MultiplicativeOperator: AsteriskToken | SlashToken | PercentToken

MultiplicativeOperatorOrHigher

MultiplicativeOperatorOrHigher: ExponentiationOperator | MultiplicativeOperator

NamedExportBindings

NamedExportBindings: NamespaceExport | NamedExports

NamedImportBindings

NamedImportBindings: NamespaceImport | NamedImports

NamedImportsOrExports

NamedImportsOrExports: NamedImports | NamedExports

NamespaceBody

ObjectBindingOrAssignmentElement

ObjectBindingOrAssignmentPattern

ObjectBindingOrAssignmentPattern: ObjectBindingPattern | ObjectLiteralExpression

ObjectLiteralElementLike

Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute.

ObjectTypeDeclaration

OptionalChain

OrganizeImportsScope

OrganizeImportsScope: CombinedCodeFixScope

ParameterPropertyDeclaration

ParameterPropertyDeclaration: ParameterDeclaration & { name: Identifier; parent: ConstructorDeclaration }

ParameterPropertyModifier

ParameterPropertyModifier: AccessibilityModifier | ReadonlyKeyword

Path

Path: string & { __pathBrand: any }

PlusToken

PostfixUnaryOperator

PostfixUnaryOperator: PlusPlusToken | MinusMinusToken

PrefixUnaryOperator

PrivateKeyword

PrivateKeyword: ModifierToken<PrivateKeyword>

PropertyName

PropertyNameLiteral

ProtectedKeyword

ProtectedKeyword: ModifierToken<ProtectedKeyword>

PseudoLiteralSyntaxKind

PseudoLiteralSyntaxKind: TemplateHead | TemplateMiddle | TemplateTail

PseudoLiteralToken

PseudoLiteralToken: TemplateHead | TemplateMiddle | TemplateTail

PublicKeyword

PunctuationSyntaxKind

QuestionDotToken

QuestionToken

ReadonlyKeyword

ReadonlyKeyword: ModifierToken<ReadonlyKeyword>

ReadonlyToken

ReadonlyToken: ReadonlyKeyword
deprecated

Use ReadonlyKeyword instead.

RefactorTriggerReason

RefactorTriggerReason: "implicit" | "invoked"

RelationalOperator

RelationalOperatorOrHigher

RelationalOperatorOrHigher: ShiftOperatorOrHigher | RelationalOperator

RenameInfo

ReportEmitErrorSummary

ReportEmitErrorSummary: (errorCount: number) => void

Type declaration

    • (errorCount: number): void
    • Parameters

      • errorCount: number

      Returns void

ResolvedConfigFileName

ResolvedConfigFileName: string & { _isResolvedConfigFileName: never }

Branded string for keeping track of when we've turned an ambiguous path specified like "./blah" to an absolute path to an actual tsconfig file, e.g. "/root/blah/tsconfig.json"

ShiftOperator

ShiftOperatorOrHigher

ShiftOperatorOrHigher: AdditiveOperatorOrHigher | ShiftOperator

SignatureDeclaration

SignatureHelpRetriggerCharacter

SignatureHelpRetriggerCharacter: SignatureHelpTriggerCharacter | ")"

SignatureHelpTriggerCharacter

SignatureHelpTriggerCharacter: "," | "(" | "<"

SignatureHelpTriggerReason

StaticKeyword

StringLiteralLike

StructuredType

SuperProperty

SymbolTable

SymbolTable based on ES6 Map interface.

TemplateLiteral

TemplateLiteralToken

TokenSyntaxKind

Transformer

Transformer<T>: (node: T) => T

A function that transforms a node.

Type parameters

Type declaration

    • (node: T): T
    • Parameters

      • node: T

      Returns T

TransformerFactory

TransformerFactory<T>: (context: TransformationContext) => Transformer<T>

A function that is used to initialize and return a Transformer callback, which in turn will be used to transform one or more nodes.

Type parameters

Type declaration

TriviaSyntaxKind

TypeOfTag

TypeOfTag: "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function"

TypeOnlyCompatibleAliasDeclaration

TypePredicate

TypeReferenceType

TypeVariable

UnionOrIntersectionTypeNode

UnionOrIntersectionTypeNode: UnionTypeNode | IntersectionTypeNode

UnparsedNode

UnparsedSourceText

UnparsedSourceText: UnparsedPrepend | UnparsedTextLike

VariableLikeDeclaration

VisitResult

VisitResult<T>: T | T[] | undefined

Type parameters

Visitor

Visitor: (node: Node) => VisitResult<Node>

A function that accepts and possibly transforms a node.

Type declaration

WatchStatusReporter

WatchStatusReporter: (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void

Type declaration

WithMetadata

WithMetadata<T>: T & { metadata?: unknown }

Type parameters

  • T

WriteFileCallback

WriteFileCallback: (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void

Type declaration

    • (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]): void
    • Parameters

      • fileName: string
      • data: string
      • writeByteOrderMark: boolean
      • Optional onError: (message: string) => void
          • (message: string): void
          • Parameters

            • message: string

            Returns void

      • Optional sourceFiles: readonly SourceFile[]

      Returns void

__String

__String: (string & { __escapedIdentifier: void }) | (void & { __escapedIdentifier: void }) | InternalSymbolName

This represents a string whose leading underscore have been escaped by adding extra leading underscores. The shape of this brand is rather unique compared to others we've used. Instead of just an intersection of a string and an object, it is that union-ed with an intersection of void and an object. This makes it wholly incompatible with a normal string (which is good, it cannot be misused on assignment or on usage), while still being comparable with a normal string via === (also good) and castable from a string.

Variables

Const factory

factory: NodeFactory

Const servicesVersion

servicesVersion: "0.8" = "0.8"

The version of the language service API

Let sys

sys: System

Let unchangedTextChangeRange

unchangedTextChangeRange: TextChangeRange

Const version

version: string

The version of the TypeScript compiler release

Const versionMajorMinor

versionMajorMinor: "4.2" = "4.2"

Functions

addEmitHelper

  • addEmitHelper<T>(node: T, helper: EmitHelper): T

addEmitHelpers

  • addEmitHelpers<T>(node: T, helpers: EmitHelper[] | undefined): T

addSyntheticLeadingComment

addSyntheticTrailingComment

classicNameResolver

collapseTextChangeRangesAcrossMultipleVersions

  • Called to merge all the changes that occurred across several versions of a script snapshot into a single change. i.e. if a user keeps making successive edits to a script we will have a text change from V1 to V2, V2 to V3, ..., Vn.

    This function will then merge those changes into a single change range valid between V1 and Vn.

    Parameters

    Returns TextChangeRange

convertCompilerOptionsFromJson

  • convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { errors: Diagnostic[]; options: CompilerOptions }

convertToObject

convertTypeAcquisitionFromJson

  • convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): { errors: Diagnostic[]; options: TypeAcquisition }

couldStartTrivia

  • couldStartTrivia(text: string, pos: number): boolean

createAbstractBuilder

Const createAdd

Const createArrayBindingPattern

Const createArrayLiteral

Const createArrayTypeNode

Const createArrowFunction

Const createAsExpression

Const createAssignment

Const createAwait

Const createBigIntLiteral

Const createBinary

Const createBindingElement

Const createBlock

  • createBlock(statements: readonly Statement[], multiLine?: boolean): Block
  • deprecated

    Use factory.createBlock or the factory supplied by your transformation context instead.

    Parameters

    • statements: readonly Statement[]
    • Optional multiLine: boolean

    Returns Block

Const createBreak

createBuilderStatusReporter

Const createBundle

Const createCall

Const createCallChain

Const createCallSignature

Const createCaseBlock

Const createCaseClause

Const createCatchClause

Const createClassDeclaration

Const createClassExpression

createClassifier

Const createComma

Const createCommaList

createCompilerHost

Const createComputedPropertyName

Const createConditional

Const createConditionalTypeNode

Const createConstructSignature

Const createConstructor

Const createConstructorTypeNode

Const createContinue

Const createDebuggerStatement

Const createDecorator

Const createDefaultClause

Const createDelete

Const createDo

createDocumentRegistry

  • createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry

Const createElementAccess

Const createElementAccessChain

createEmitAndSemanticDiagnosticsBuilderProgram

Const createEmptyStatement

Const createEnumDeclaration

Const createEnumMember

Const createExportAssignment

Const createExportDeclaration

Const createExportDefault

Const createExportSpecifier

Const createExpressionStatement

Const createExpressionWithTypeArguments

Const createExternalModuleExport

Const createExternalModuleReference

Const createFalse

Const createFileLevelUniqueName

  • createFileLevelUniqueName(text: string): Identifier
  • deprecated

    Use factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel) or the factory supplied by your transformation context instead.

    Parameters

    • text: string

    Returns Identifier

Const createFor

Const createForIn

Const createForOf

Const createFunctionDeclaration

Const createFunctionExpression

Const createFunctionTypeNode

Const createGetAccessor

Const createHeritageClause

Const createIdentifier

  • deprecated

    Use factory.createIdentifier or the factory supplied by your transformation context instead.

    Parameters

    • text: string

    Returns Identifier

Const createIf

Const createImmediatelyInvokedArrowFunction

Const createImmediatelyInvokedFunctionExpression

Const createImportClause

Const createImportDeclaration

Const createImportEqualsDeclaration

Const createImportSpecifier

Const createImportTypeNode

createIncrementalCompilerHost

createIncrementalProgram

Const createIndexSignature

Const createIndexedAccessTypeNode

Const createInferTypeNode

createInputFiles

  • createInputFiles(javascriptText: string, declarationText: string): InputFiles
  • createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles
  • createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles
  • Parameters

    • javascriptText: string
    • declarationText: string

    Returns InputFiles

  • Parameters

    • readFileText: (path: string) => string | undefined
        • (path: string): string | undefined
        • Parameters

          • path: string

          Returns string | undefined

    • javascriptPath: string
    • javascriptMapPath: string | undefined
    • declarationPath: string
    • declarationMapPath: string | undefined
    • buildInfoPath: string | undefined

    Returns InputFiles

  • Parameters

    • javascriptText: string
    • declarationText: string
    • javascriptMapPath: string | undefined
    • javascriptMapText: string | undefined
    • declarationMapPath: string | undefined
    • declarationMapText: string | undefined

    Returns InputFiles

Const createInterfaceDeclaration

Const createIntersectionTypeNode

Const createJSDocAugmentsTag

Const createJSDocAuthorTag

Const createJSDocCallbackTag

Const createJSDocClassTag

Const createJSDocComment

  • createJSDocComment(comment?: string, tags?: readonly JSDocTag[]): JSDoc
  • deprecated

    Use factory.createJSDocComment or the factory supplied by your transformation context instead.

    Parameters

    • Optional comment: string
    • Optional tags: readonly JSDocTag[]

    Returns JSDoc

Const createJSDocEnumTag

Const createJSDocImplementsTag

Const createJSDocParamTag

Const createJSDocParameterTag

Const createJSDocPrivateTag

Const createJSDocPropertyTag

Const createJSDocProtectedTag

Const createJSDocPublicTag

Const createJSDocReadonlyTag

Const createJSDocReturnTag

Const createJSDocSignature

Const createJSDocTag

Const createJSDocTemplateTag

Const createJSDocThisTag

Const createJSDocTypeExpression

Const createJSDocTypeLiteral

Const createJSDocTypeTag

Const createJSDocTypedefTag

Const createJsxAttribute

Const createJsxAttributes

Const createJsxClosingElement

Const createJsxElement

Const createJsxExpression

Const createJsxFragment

Const createJsxJsxClosingFragment

Const createJsxOpeningElement

Const createJsxOpeningFragment

Const createJsxSelfClosingElement

Const createJsxSpreadAttribute

Const createJsxText

  • createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText
  • deprecated

    Use factory.createJsxText or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional containsOnlyTriviaWhiteSpaces: boolean

    Returns JsxText

Const createKeywordTypeNode

Const createLabel

createLanguageService

createLanguageServiceSourceFile

Const createLessThan

Const createLiteral

  • deprecated

    Use factory.createStringLiteral, factory.createStringLiteralFromNode, factory.createNumericLiteral, factory.createBigIntLiteral, factory.createTrue, factory.createFalse, or the factory supplied by your transformation context instead.

    Parameters

    Returns StringLiteral

  • deprecated

    Use factory.createStringLiteral, factory.createStringLiteralFromNode, factory.createNumericLiteral, factory.createBigIntLiteral, factory.createTrue, factory.createFalse, or the factory supplied by your transformation context instead.

    Parameters

    Returns NumericLiteral

  • deprecated

    Use factory.createStringLiteral, factory.createStringLiteralFromNode, factory.createNumericLiteral, factory.createBigIntLiteral, factory.createTrue, factory.createFalse, or the factory supplied by your transformation context instead.

    Parameters

    • value: boolean

    Returns BooleanLiteral

  • deprecated

    Use factory.createStringLiteral, factory.createStringLiteralFromNode, factory.createNumericLiteral, factory.createBigIntLiteral, factory.createTrue, factory.createFalse, or the factory supplied by your transformation context instead.

    Parameters

    Returns PrimaryExpression

Const createLiteralTypeNode

Const createLogicalAnd

Const createLogicalNot

Const createLogicalOr

Const createLoopVariable

Const createMappedTypeNode

Const createMetaProperty

Const createMethod

Const createMethodSignature

Const createModifier

Const createModifiersFromModifierFlags

Const createModuleBlock

Const createModuleDeclaration

createModuleResolutionCache

Const createNamedExports

Const createNamedImports

Const createNamespaceExport

Const createNamespaceExportDeclaration

Const createNamespaceImport

Const createNew

Const createNoSubstitutionTemplateLiteral

Const createNode

Const createNodeArray

  • createNodeArray<T>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>
  • deprecated

    Use factory.createNodeArray or the factory supplied by your transformation context instead.

    Type parameters

    Parameters

    • Optional elements: readonly T[]
    • Optional hasTrailingComma: boolean

    Returns NodeArray<T>

Const createNonNullChain

Const createNonNullExpression

Const createNotEmittedStatement

Const createNull

Const createNumericLiteral

  • deprecated

    Use factory.createNumericLiteral or the factory supplied by your transformation context instead.

    Parameters

    • value: string | number
    • Optional numericLiteralFlags: TokenFlags

    Returns NumericLiteral

Const createObjectBindingPattern

Const createObjectLiteral

Const createOmittedExpression

Const createOptimisticUniqueName

  • createOptimisticUniqueName(text: string): Identifier
  • deprecated

    Use factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic) or the factory supplied by your transformation context instead.

    Parameters

    • text: string

    Returns Identifier

Const createOptionalTypeNode

Const createParameter

Const createParen

Const createParenthesizedType

Const createPartiallyEmittedExpression

Const createPostfix

Const createPostfixIncrement

Const createPrefix

createPrinter

Const createPrivateIdentifier

createProgram

  • Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' that represent a compilation unit.

    Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.

    Parameters

    Returns Program

    A 'Program' object.

  • Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' that represent a compilation unit.

    Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.

    Parameters

    • rootNames: readonly string[]

      A set of root files.

    • options: CompilerOptions

      The compiler options which should be used.

    • Optional host: CompilerHost

      The host interacts with the underlying file system.

    • Optional oldProgram: Program

      Reuses an old program structure.

    • Optional configFileParsingDiagnostics: readonly Diagnostic[]

      error during config file parsing

    Returns Program

    A 'Program' object.

Const createProperty

Const createPropertyAccess

Const createPropertyAccessChain

Const createPropertyAssignment

Const createPropertySignature

Const createQualifiedName

Const createRegularExpressionLiteral

Const createRestTypeNode

Const createReturn

createScanner

createSemanticDiagnosticsBuilderProgram

Const createSemicolonClassElement

Const createSetAccessor

Const createShorthandPropertyAssignment

createSolutionBuilder

createSolutionBuilderHost

createSolutionBuilderWithWatch

createSolutionBuilderWithWatchHost

createSourceFile

createSourceMapSource

  • createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource
  • Create an external source map source file reference

    Parameters

    • fileName: string
    • text: string
    • Optional skipTrivia: (pos: number) => number
        • (pos: number): number
        • Parameters

          • pos: number

          Returns number

    Returns SourceMapSource

Const createSpread

Const createSpreadAssignment

Const createStatement

Const createStrictEquality

Const createStrictInequality

Const createStringLiteral

  • createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral
  • createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean): StringLiteral
  • deprecated

    Use factory.createStringLiteral or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional isSingleQuote: boolean

    Returns StringLiteral

  • deprecated

    Use factory.createStringLiteral or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional isSingleQuote: boolean
    • Optional hasExtendedUnicodeEscape: boolean

    Returns StringLiteral

Const createStringLiteralFromNode

Const createSubtract

Const createSuper

Const createSwitch

Const createTaggedTemplate

Const createTempVariable

Const createTemplateExpression

Const createTemplateHead

  • deprecated

    Use factory.createTemplateHead or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateHead

  • deprecated

    Use factory.createTemplateHead or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateHead

Const createTemplateMiddle

  • deprecated

    Use factory.createTemplateMiddle or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateMiddle

  • deprecated

    Use factory.createTemplateMiddle or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateMiddle

Const createTemplateSpan

Const createTemplateTail

  • deprecated

    Use factory.createTemplateTail or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • Optional rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateTail

  • deprecated

    Use factory.createTemplateTail or the factory supplied by your transformation context instead.

    Parameters

    • text: string
    • rawText: string
    • Optional templateFlags: TokenFlags

    Returns TemplateTail

createTextChangeRange

createTextSpan

  • createTextSpan(start: number, length: number): TextSpan

createTextSpanFromBounds

  • createTextSpanFromBounds(start: number, end: number): TextSpan

Const createThis

Const createThisTypeNode

Const createThrow

Const createToken

  • createToken<TKind>(kind: TKind): Token<TKind>
  • deprecated

    Use factory.createToken or the factory supplied by your transformation context instead.

    Type parameters

    Parameters

    • kind: TKind

    Returns Token<TKind>

Const createTrue

Const createTry

Const createTupleTypeNode

Const createTypeAliasDeclaration

Const createTypeAssertion

Const createTypeLiteralNode

Const createTypeOf

Const createTypeOperatorNode

Const createTypeParameterDeclaration

Const createTypePredicateNode

Const createTypePredicateNodeWithModifier

Const createTypeQueryNode

Const createTypeReferenceNode

Const createUnionTypeNode

Const createUniqueName

createUnparsedSourceFile

  • createUnparsedSourceFile(text: string): UnparsedSource
  • createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource
  • createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource

Const createVariableDeclaration

Const createVariableDeclarationList

Const createVariableStatement

Const createVoid

Const createVoidZero

createWatchCompilerHost

createWatchProgram

Const createWhile

Const createWith

Const createYield

decodedTextSpanIntersectsWith

  • decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean
  • Parameters

    • start1: number
    • length1: number
    • start2: number
    • length2: number

    Returns boolean

displayPartsToString

disposeEmitNodes

  • disposeEmitNodes(sourceFile: SourceFile | undefined): void

escapeLeadingUnderscores

  • escapeLeadingUnderscores(identifier: string): __String
  • Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like 'proto'

    Parameters

    • identifier: string

    Returns __String

findAncestor

  • findAncestor<T>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined
  • findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined
  • Iterates through the parent chain of a node and performs the callback on each parent until the callback returns a truthy value, then returns that value. If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" At that point findAncestor returns undefined.

    Type parameters

    Parameters

    • node: Node | undefined
    • callback: (element: Node) => element is T
        • (element: Node): element is T
        • Parameters

          Returns element is T

    Returns T | undefined

  • Parameters

    • node: Node | undefined
    • callback: (element: Node) => boolean | "quit"
        • (element: Node): boolean | "quit"
        • Parameters

          Returns boolean | "quit"

    Returns Node | undefined

findConfigFile

  • findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined
  • Parameters

    • searchPath: string
    • fileExists: (fileName: string) => boolean
        • (fileName: string): boolean
        • Parameters

          • fileName: string

          Returns boolean

    • Optional configName: string

    Returns string | undefined

flattenDiagnosticMessageText

  • flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string

forEachChild

  • forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined
  • Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.

    remarks

    forEachChild must visit the children of a node in the order that they appear in the source code. The language service depends on this property to locate nodes by position.

    Type parameters

    • T

    Parameters

    • node: Node

      a given node to visit its children

    • cbNode: (node: Node) => T | undefined

      a callback to be invoked for all child nodes

        • (node: Node): T | undefined
        • Parameters

          Returns T | undefined

    • Optional cbNodes: (nodes: NodeArray<Node>) => T | undefined

      a callback to be invoked for embedded array

    Returns T | undefined

forEachLeadingCommentRange

  • forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined
  • forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined
  • Type parameters

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean

          Returns U

    Returns U | undefined

  • Type parameters

    • T

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean
          • state: T

          Returns U

    • state: T

    Returns U | undefined

forEachTrailingCommentRange

  • forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined
  • forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined
  • Type parameters

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean

          Returns U

    Returns U | undefined

  • Type parameters

    • T

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean
          • state: T

          Returns U

    • state: T

    Returns U | undefined

formatDiagnostic

formatDiagnostics

formatDiagnosticsWithColorAndContext

getAllJSDocTags

  • getAllJSDocTags<T>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[]

getAllJSDocTagsOfKind

getAutomaticTypeDirectiveNames

  • Given a set of options, returns the set of type directive names that should be included for this program automatically. This list could either come from the config file, or from enumerating the types root + initial secondary types lookup location. More type directives might appear in the program later as a result of loading actual source files; this list is only the set of defaults that are implicitly included.

    Parameters

    Returns string[]

getCombinedModifierFlags

getCombinedNodeFlags

getCommentRange

getConfigFileParsingDiagnostics

getConstantValue

getDefaultCompilerOptions

getDefaultFormatCodeSettings

getDefaultLibFileName

getDefaultLibFilePath

  • Get the path of the default library files (lib.d.ts) as distributed with the typescript node package. The functionality is not supported if the ts module is consumed outside of a node module.

    Parameters

    Returns string

getEffectiveConstraintOfTypeParameter

getEffectiveTypeParameterDeclarations

getEffectiveTypeRoots

getEmitHelpers

Const getGeneratedNameForNode

getJSDocAugmentsTag

getJSDocClassTag

getJSDocDeprecatedTag

getJSDocEnumTag

getJSDocImplementsTags

getJSDocParameterTags

  • Gets the JSDoc parameter tags for the node if present.

    remarks

    Returns any JSDoc param tag whose name matches the provided parameter, whether a param tag on a containing function expression, or a param tag on a variable declaration whose initializer is the containing function. The tags closest to the node are returned first, so in the previous example, the param tag on the containing function expression would be first.

    For binding patterns, parameter tags are matched by position.

    Parameters

    Returns readonly JSDocParameterTag[]

getJSDocPrivateTag

getJSDocProtectedTag

getJSDocPublicTag

getJSDocReadonlyTag

getJSDocReturnTag

getJSDocReturnType

  • Gets the return type node for the node if provided via JSDoc return tag or type tag.

    remarks

    getJSDocReturnTag just gets the whole JSDoc tag. This function gets the type from inside the braces, after the fat arrow, etc.

    Parameters

    Returns TypeNode | undefined

getJSDocTags

getJSDocTemplateTag

getJSDocThisTag

getJSDocType

  • Gets the type node for the node if provided via JSDoc.

    remarks

    The search includes any JSDoc param tag that relates to the provided parameter, for example a type tag on the parameter itself, or a param tag on a containing function expression, or a param tag on a variable declaration whose initializer is the containing function. The tags closest to the node are examined first, so in the previous example, the type tag directly on the node would be returned.

    Parameters

    Returns TypeNode | undefined

getJSDocTypeParameterTags

  • Gets the JSDoc type parameter tags for the node if present.

    remarks

    Returns any JSDoc template tag whose names match the provided parameter, whether a template tag on a containing function expression, or a template tag on a variable declaration whose initializer is the containing function. The tags closest to the node are returned first, so in the previous example, the template tag on the containing function expression would be first.

    Parameters

    Returns readonly JSDocTemplateTag[]

getJSDocTypeTag

getLeadingCommentRanges

  • getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined

getLineAndCharacterOfPosition

Const getMutableClone

  • getMutableClone<T>(node: T): T
  • Creates a shallow, memberwise clone of a node for mutation with its pos, end, and parent set.

    NOTE: It is unsafe to change any properties of a Node that relate to its AST children, as those changes won't be captured with respect to transformations.

    deprecated

    Use an appropriate factory.update... method instead, use setCommentRange or setSourceMapRange, and avoid setting parent.

    Type parameters

    Parameters

    • node: T

    Returns T

getNameOfDeclaration

getNameOfJSDocTypedef

getNodeMajorVersion

  • getNodeMajorVersion(): number | undefined

getOriginalNode

  • getOriginalNode(node: Node): Node
  • getOriginalNode<T>(node: Node, nodeTest: (node: Node) => node is T): T
  • getOriginalNode(node: Node | undefined): Node | undefined
  • getOriginalNode<T>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined

getOutputFileNames

  • getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[]

getParseTreeNode

  • getParseTreeNode(node: Node | undefined): Node | undefined
  • getParseTreeNode<T>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined
  • Gets the original parse tree node for a node.

    Parameters

    • node: Node | undefined

      The original node.

    Returns Node | undefined

    The original parse tree node if found; otherwise, undefined.

  • Gets the original parse tree node for a node.

    Type parameters

    Parameters

    • node: T | undefined

      The original node.

    • Optional nodeTest: (node: Node) => node is T

      A callback used to ensure the correct type of parse tree node is returned.

        • (node: Node): node is T
        • Parameters

          Returns node is T

    Returns T | undefined

    The original parse tree node if found; otherwise, undefined.

getParsedCommandLineOfConfigFile

getPositionOfLineAndCharacter

  • getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number

getPreEmitDiagnostics

getShebang

  • getShebang(text: string): string | undefined

getSourceMapRange

getSupportedCodeFixes

  • getSupportedCodeFixes(): string[]

getSyntheticLeadingComments

getSyntheticTrailingComments

getTokenSourceMapRange

getTrailingCommentRanges

  • getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined

getTsBuildInfoEmitOutputFilePath

  • getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined

getTypeParameterOwner

hasJSDocParameterTags

hasOnlyExpressionInitializer

idText

isAccessor

isArrayBindingPattern

isArrayLiteralExpression

isArrayTypeNode

isArrowFunction

isAsExpression

isAssertionExpression

isAwaitExpression

isBigIntLiteral

isBinaryExpression

isBindingElement

isBindingName

isBlock

isBreakOrContinueStatement

isBreakStatement

isBundle

isCallChain

isCallExpression

isCallLikeExpression

isCallOrNewExpression

isCallSignatureDeclaration

isCaseBlock

isCaseClause

isCaseOrDefaultClause

isCatchClause

isClassDeclaration

isClassElement

isClassExpression

isClassLike

isClassOrTypeElement

isCommaListExpression

isComputedPropertyName

isConditionalExpression

isConditionalTypeNode

isConstTypeReference

  • isConstTypeReference(node: Node): boolean

isConstructSignatureDeclaration

isConstructorDeclaration

isConstructorTypeNode

isContinueStatement

isDebuggerStatement

isDecorator

isDefaultClause

isDeleteExpression

isDoStatement

isElementAccessChain

isElementAccessExpression

isEmptyBindingElement

isEmptyBindingPattern

isEmptyStatement

isEntityName

isEnumDeclaration

isEnumMember

isExportAssignment

isExportDeclaration

isExportSpecifier

isExpressionStatement

isExpressionWithTypeArguments

isExternalModule

isExternalModuleNameRelative

  • isExternalModuleNameRelative(moduleName: string): boolean

isExternalModuleReference

isForInStatement

isForOfStatement

isForStatement

isFunctionDeclaration

isFunctionExpression

isFunctionLike

isFunctionOrConstructorTypeNode

isFunctionTypeNode

isGetAccessor

isGetAccessorDeclaration

isHeritageClause

isIdentifier

isIdentifierOrPrivateIdentifier

isIdentifierPart

isIdentifierStart

  • isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean

isIfStatement

isImportClause

isImportDeclaration

isImportEqualsDeclaration

isImportOrExportSpecifier

isImportSpecifier

isImportTypeNode

isIndexSignatureDeclaration

isIndexedAccessTypeNode

isInferTypeNode

isInterfaceDeclaration

isIntersectionTypeNode

isIterationStatement

isJSDoc

isJSDocAllType

isJSDocAugmentsTag

isJSDocAuthorTag

isJSDocCallbackTag

isJSDocClassTag

isJSDocCommentContainingNode

  • isJSDocCommentContainingNode(node: Node): boolean

isJSDocDeprecatedTag

isJSDocEnumTag

isJSDocFunctionType

isJSDocImplementsTag

isJSDocNameReference

isJSDocNamepathType

isJSDocNonNullableType

isJSDocNullableType

isJSDocOptionalType

isJSDocParameterTag

isJSDocPrivateTag

isJSDocPropertyLikeTag

isJSDocPropertyTag

isJSDocProtectedTag

isJSDocPublicTag

isJSDocReadonlyTag

isJSDocReturnTag

isJSDocSeeTag

isJSDocSignature

isJSDocTemplateTag

isJSDocThisTag

isJSDocTypeExpression

isJSDocTypeLiteral

isJSDocTypeTag

isJSDocTypedefTag

isJSDocUnknownTag

isJSDocUnknownType

isJSDocVariadicType

isJsxAttribute

isJsxAttributes

isJsxClosingElement

isJsxClosingFragment

isJsxElement

isJsxExpression

isJsxFragment

isJsxOpeningElement

isJsxOpeningFragment

isJsxOpeningLikeElement

isJsxSelfClosingElement

isJsxSpreadAttribute

isJsxText

isLabeledStatement

isLineBreak

  • isLineBreak(ch: number): boolean

isLiteralExpression

isLiteralTypeNode

isMappedTypeNode

isMetaProperty

isMethodDeclaration

isMethodSignature

isMissingDeclaration

isModifier

isModuleBlock

isModuleDeclaration

isNamedExportBindings

isNamedExports

isNamedImports

isNamedTupleMember

isNamespaceExport

isNamespaceExportDeclaration

isNamespaceImport

isNewExpression

isNoSubstitutionTemplateLiteral

isNonNullChain

isNonNullExpression

isNotEmittedStatement

isNullishCoalesce

  • isNullishCoalesce(node: Node): boolean

isNumericLiteral

isObjectBindingPattern

isObjectLiteralElement

isObjectLiteralElementLike

isObjectLiteralExpression

isOmittedExpression

isOptionalChain

isOptionalTypeNode

isParameter

isParameterPropertyDeclaration

isParenthesizedExpression

isParenthesizedTypeNode

isParseTreeNode

  • isParseTreeNode(node: Node): boolean
  • Gets a value indicating whether a node originated in the parse tree.

    Parameters

    • node: Node

      The node to test.

    Returns boolean

isPartiallyEmittedExpression

isPostfixUnaryExpression

isPrefixUnaryExpression

isPrivateIdentifier

isPropertyAccessChain

isPropertyAccessExpression

isPropertyAccessOrQualifiedName

isPropertyAssignment

isPropertyDeclaration

isPropertyName

isPropertySignature

isQualifiedName

isRegularExpressionLiteral

isRestTypeNode

isReturnStatement

isSemicolonClassElement

isSetAccessor

isSetAccessorDeclaration

isShorthandPropertyAssignment

isSourceFile

isSpreadAssignment

isSpreadElement

isStringLiteral

isStringLiteralLike

isStringTextContainingNode

isSwitchStatement

isSyntheticExpression

isTaggedTemplateExpression

isTemplateExpression

isTemplateHead

isTemplateLiteral

isTemplateLiteralToken

isTemplateLiteralTypeNode

isTemplateLiteralTypeSpan

isTemplateMiddle

isTemplateMiddleOrTemplateTail

isTemplateSpan

isTemplateTail

isThisTypeNode

isThrowStatement

isToken

  • isToken(n: Node): boolean
  • True if node is of some token syntax kind. For example, this is true for an IfKeyword but not for an IfStatement. Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.

    Parameters

    Returns boolean

isTryStatement

isTupleTypeNode

isTypeAliasDeclaration

Const isTypeAssertion

isTypeAssertionExpression

isTypeElement

isTypeLiteralNode

isTypeNode

  • Node test that determines whether a node is a valid type node. This differs from the isPartOfTypeNode function which determines whether a node is part of a TypeNode.

    Parameters

    Returns node is TypeNode

isTypeOfExpression

isTypeOnlyImportOrExportDeclaration

isTypeOperatorNode

isTypeParameterDeclaration

isTypePredicateNode

isTypeQueryNode

isTypeReferenceNode

isUnionTypeNode

isUnparsedNode

isUnparsedPrepend

isUnparsedSource

isUnparsedTextLike

isVariableDeclaration

isVariableDeclarationList

isVariableStatement

isVoidExpression

isWhileStatement

isWhiteSpaceLike

  • isWhiteSpaceLike(ch: number): boolean

isWhiteSpaceSingleLine

  • isWhiteSpaceSingleLine(ch: number): boolean
  • Does not include line breaks. For that, see isWhiteSpaceLike.

    Parameters

    • ch: number

    Returns boolean

isWithStatement

isYieldExpression

moveEmitHelpers

  • moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void

moveSyntheticComments

  • moveSyntheticComments<T>(node: T, original: Node): T

nodeModuleNameResolver

parseCommandLine

  • parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine
  • Parameters

    • commandLine: readonly string[]
    • Optional readFile: (path: string) => string | undefined
        • (path: string): string | undefined
        • Parameters

          • path: string

          Returns string | undefined

    Returns ParsedCommandLine

parseConfigFileTextToJson

  • parseConfigFileTextToJson(fileName: string, jsonText: string): { config?: any; error?: Diagnostic }
  • Parse the text of the tsconfig.json file

    Parameters

    • fileName: string

      The path to the config file

    • jsonText: string

      The text of the config file

    Returns { config?: any; error?: Diagnostic }

    • Optional config?: any
    • Optional error?: Diagnostic

parseIsolatedEntityName

parseJsonConfigFileContent

parseJsonSourceFileConfigFileContent

parseJsonText

preProcessFile

  • preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo

readBuilderProgram

readConfigFile

  • readConfigFile(fileName: string, readFile: (path: string) => string | undefined): { config?: any; error?: Diagnostic }
  • Read tsconfig.json file

    Parameters

    • fileName: string

      The path to the config file

    • readFile: (path: string) => string | undefined
        • (path: string): string | undefined
        • Parameters

          • path: string

          Returns string | undefined

    Returns { config?: any; error?: Diagnostic }

    • Optional config?: any
    • Optional error?: Diagnostic

readJsonConfigFile

  • readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile
  • Read tsconfig.json file

    Parameters

    • fileName: string

      The path to the config file

    • readFile: (path: string) => string | undefined
        • (path: string): string | undefined
        • Parameters

          • path: string

          Returns string | undefined

    Returns TsConfigSourceFile

reduceEachLeadingCommentRange

  • 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 | undefined
  • Type parameters

    • T

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean
          • state: T
          • memo: U

          Returns U

    • state: T
    • initial: U

    Returns U | undefined

reduceEachTrailingCommentRange

  • 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 | undefined
  • Type parameters

    • T

    • U

    Parameters

    • text: string
    • pos: number
    • cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U
        • (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U): U
        • Parameters

          • pos: number
          • end: number
          • kind: CommentKind
          • hasTrailingNewLine: boolean
          • state: T
          • memo: U

          Returns U

    • state: T
    • initial: U

    Returns U | undefined

removeEmitHelper

resolveModuleName

resolveModuleNameFromCache

resolveProjectReferencePath

resolveTripleslashReference

  • resolveTripleslashReference(moduleName: string, containingFile: string): string

resolveTypeReferenceDirective

setCommentRange

  • setCommentRange<T>(node: T, range: TextRange): T

setConstantValue

setEmitFlags

  • setEmitFlags<T>(node: T, emitFlags: EmitFlags): T

setOriginalNode

  • setOriginalNode<T>(node: T, original: Node | undefined): T

setSourceMapRange

setSyntheticLeadingComments

setSyntheticTrailingComments

setTextRange

  • setTextRange<T>(range: T, location: TextRange | undefined): T

setTokenSourceMapRange

skipPartiallyEmittedExpressions

sortAndDeduplicateDiagnostics

symbolName

  • symbolName(symbol: Symbol): string

textChangeRangeIsUnchanged

textChangeRangeNewSpan

textSpanContainsPosition

  • textSpanContainsPosition(span: TextSpan, position: number): boolean

textSpanContainsTextSpan

textSpanEnd

textSpanIntersection

textSpanIntersectsWith

  • textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean

textSpanIntersectsWithPosition

  • textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean

textSpanIntersectsWithTextSpan

textSpanIsEmpty

  • textSpanIsEmpty(span: TextSpan): boolean

textSpanOverlap

textSpanOverlapsWith

toEditorSettings

tokenToString

  • tokenToString(t: SyntaxKind): string | undefined

transform

  • Transform one or more nodes using the supplied transformers.

    Type parameters

    Parameters

    • source: T | T[]

      A single Node or an array of Node objects.

    • transformers: TransformerFactory<T>[]

      An array of TransformerFactory callbacks used to process the transformation.

    • Optional compilerOptions: CompilerOptions

      Optional compiler options.

    Returns TransformationResult<T>

transpile

  • transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string

transpileModule

unescapeLeadingUnderscores

  • unescapeLeadingUnderscores(identifier: __String): string
  • Remove extra underscore from escaped identifier text content.

    Parameters

    • identifier: __String

      The escaped identifier text.

    Returns string

    The unescaped identifier text.

Const updateArrayBindingPattern

Const updateArrayLiteral

Const updateArrayTypeNode

Const updateArrowFunction

Const updateAsExpression

Const updateAwait

Const updateBinary

Const updateBindingElement

Const updateBlock

Const updateBreak

Const updateBundle

Const updateCall

Const updateCallChain

Const updateCallSignature

Const updateCaseBlock

Const updateCaseClause

Const updateCatchClause

Const updateClassDeclaration

Const updateClassExpression

Const updateCommaList

Const updateComputedPropertyName

Const updateConditional

Const updateConditionalTypeNode

Const updateConstructSignature

Const updateConstructor

Const updateConstructorTypeNode

Const updateContinue

Const updateDecorator

Const updateDefaultClause

Const updateDelete

Const updateDo

Const updateElementAccess

Const updateElementAccessChain

Const updateEnumDeclaration

Const updateEnumMember

Const updateExportAssignment

Const updateExportDeclaration

Const updateExportSpecifier

Const updateExpressionStatement

Const updateExpressionWithTypeArguments

Const updateExternalModuleReference

Const updateFor

Const updateForIn

Const updateForOf

Const updateFunctionDeclaration

Const updateFunctionExpression

Const updateFunctionTypeNode

Const updateGetAccessor

Const updateHeritageClause

Const updateIf

Const updateImportClause

Const updateImportDeclaration

Const updateImportEqualsDeclaration

Const updateImportSpecifier

Const updateImportTypeNode

Const updateIndexSignature

Const updateIndexedAccessTypeNode

Const updateInferTypeNode

Const updateInterfaceDeclaration

Const updateIntersectionTypeNode

Const updateJsxAttribute

Const updateJsxAttributes

Const updateJsxClosingElement

Const updateJsxElement

Const updateJsxExpression

Const updateJsxFragment

Const updateJsxOpeningElement

Const updateJsxSelfClosingElement

Const updateJsxSpreadAttribute

Const updateJsxText

  • updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText
  • deprecated

    Use factory.updateJsxText or the factory supplied by your transformation context instead.

    Parameters

    • node: JsxText
    • text: string
    • Optional containsOnlyTriviaWhiteSpaces: boolean

    Returns JsxText

Const updateLabel

updateLanguageServiceSourceFile

Const updateLiteralTypeNode

Const updateMappedTypeNode

Const updateMetaProperty

Const updateMethod

Const updateMethodSignature

Const updateModuleBlock

Const updateModuleDeclaration

Const updateNamedExports

Const updateNamedImports

Const updateNamespaceExport

Const updateNamespaceExportDeclaration

Const updateNamespaceImport

Const updateNew

Const updateNonNullChain

Const updateNonNullExpression

Const updateObjectBindingPattern

Const updateObjectLiteral

Const updateOptionalTypeNode

Const updateParameter

Const updateParen

Const updateParenthesizedType

Const updatePartiallyEmittedExpression

Const updatePostfix

Const updatePrefix

Const updateProperty

Const updatePropertyAccess

Const updatePropertyAccessChain

Const updatePropertyAssignment

Const updatePropertySignature

Const updateQualifiedName

Const updateRestTypeNode

Const updateReturn

Const updateSetAccessor

Const updateShorthandPropertyAssignment

updateSourceFile

Const updateSourceFileNode

Const updateSpread

Const updateSpreadAssignment

Const updateStatement

Const updateSwitch

Const updateTaggedTemplate

Const updateTemplateExpression

Const updateTemplateSpan

Const updateThrow

Const updateTry

Const updateTupleTypeNode

Const updateTypeAliasDeclaration

Const updateTypeAssertion

Const updateTypeLiteralNode

Const updateTypeOf

Const updateTypeOperatorNode

Const updateTypeParameterDeclaration

Const updateTypePredicateNode

Const updateTypePredicateNodeWithModifier

Const updateTypeQueryNode

Const updateTypeReferenceNode

Const updateUnionTypeNode

Const updateVariableDeclaration

Const updateVariableDeclarationList

Const updateVariableStatement

Const updateVoid

Const updateWhile

Const updateWith

Const updateYield

validateLocaleAndSetLanguage

  • validateLocaleAndSetLanguage(locale: string, sys: { fileExists: any; getExecutingFilePath: any; readFile: any; resolvePath: any }, errors?: Push<Diagnostic>): void
  • Checks to see if the locale is in the appropriate format, and if it is, attempts to set the appropriate language.

    Parameters

    • locale: string
    • sys: { fileExists: any; getExecutingFilePath: any; readFile: any; resolvePath: any }
      • fileExists: function
        • fileExists(fileName: string): boolean
      • getExecutingFilePath: function
        • getExecutingFilePath(): string
      • readFile: function
        • readFile(fileName: string): string
      • resolvePath: function
        • resolvePath(path: string): string
    • Optional errors: Push<Diagnostic>

    Returns void

visitEachChild

  • Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.

    Type parameters

    Parameters

    • node: T

      The Node whose children will be visited.

    • visitor: Visitor

      The callback used to visit each child.

    • context: TransformationContext

      A lexical environment context for the visitor.

    Returns T

  • Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.

    Type parameters

    Parameters

    • node: T | undefined

      The Node whose children will be visited.

    • visitor: Visitor

      The callback used to visit each child.

    • context: TransformationContext

      A lexical environment context for the visitor.

    • Optional nodesVisitor: typeof visitNodes
    • Optional tokenVisitor: Visitor

    Returns T | undefined

visitFunctionBody

visitLexicalEnvironment

visitNode

  • visitNode<T>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T
  • visitNode<T>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined
  • Visits a Node using the supplied visitor, possibly returning a new Node in its place.

    Type parameters

    Parameters

    • node: T

      The Node to visit.

    • visitor: Visitor | undefined

      The callback used to visit the Node.

    • Optional test: (node: Node) => boolean

      A callback to execute to verify the Node is valid.

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • Optional lift: (node: readonly Node[]) => T

      An optional callback to execute to lift a NodeArray into a valid Node.

        • (node: readonly Node[]): T
        • Parameters

          • node: readonly Node[]

          Returns T

    Returns T

  • Visits a Node using the supplied visitor, possibly returning a new Node in its place.

    Type parameters

    Parameters

    • node: T | undefined

      The Node to visit.

    • visitor: Visitor | undefined

      The callback used to visit the Node.

    • Optional test: (node: Node) => boolean

      A callback to execute to verify the Node is valid.

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • Optional lift: (node: readonly Node[]) => T

      An optional callback to execute to lift a NodeArray into a valid Node.

        • (node: readonly Node[]): T
        • Parameters

          • node: readonly Node[]

          Returns T

    Returns T | undefined

visitNodes

  • visitNodes<T>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>
  • visitNodes<T>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined
  • Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.

    Type parameters

    Parameters

    • nodes: NodeArray<T>

      The NodeArray to visit.

    • visitor: Visitor | undefined

      The callback used to visit a Node.

    • Optional test: (node: Node) => boolean

      A node test to execute for each node.

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • Optional start: number

      An optional value indicating the starting offset at which to start visiting.

    • Optional count: number

      An optional value indicating the maximum number of nodes to visit.

    Returns NodeArray<T>

  • Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.

    Type parameters

    Parameters

    • nodes: NodeArray<T> | undefined

      The NodeArray to visit.

    • visitor: Visitor | undefined

      The callback used to visit a Node.

    • Optional test: (node: Node) => boolean

      A node test to execute for each node.

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • Optional start: number

      An optional value indicating the starting offset at which to start visiting.

    • Optional count: number

      An optional value indicating the maximum number of nodes to visit.

    Returns NodeArray<T> | undefined

visitParameterList

walkUpBindingElementsAndPatterns

Generated using TypeDoc