(accessor? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(add-emit-helper node helper)Adds an EmitHelper to a node.
Parameters:
node: Thelper: EmitHelperReturns: T
Adds an EmitHelper to a node. **Parameters:** - `node`: `T` - `helper`: `EmitHelper` **Returns:** `T`
(add-emit-helpers node)(add-emit-helpers node helpers)Add EmitHelpers to a node.
Parameters:
node: Thelpers: EmitHelper[] | undefinedReturns: T
Add EmitHelpers to a node. **Parameters:** - `node`: `T` - `helpers`: `EmitHelper[] | undefined` **Returns:** `T`
(add-synthetic-leading-comment node kind text)(add-synthetic-leading-comment node kind text has-trailing-new-line?)Parameters:
node: Tkind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTriviatext: stringhas-trailing-new-line?: boolean | undefinedReturns: T
**Parameters:** - `node`: `T` - `kind`: `SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia` - `text`: `string` - `has-trailing-new-line?`: `boolean | undefined` **Returns:** `T`
(add-synthetic-trailing-comment node kind text)(add-synthetic-trailing-comment node kind text has-trailing-new-line?)Parameters:
node: Tkind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTriviatext: stringhas-trailing-new-line?: boolean | undefinedReturns: T
**Parameters:** - `node`: `T` - `kind`: `SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia` - `text`: `string` - `has-trailing-new-line?`: `boolean | undefined` **Returns:** `T`
(all-js-doc-tags node predicate)Gets all JSDoc tags that match a specified predicate
Parameters:
node: Nodepredicate: (tag: JSDocTag) => tag is TReturns: readonly T[]
Gets all JSDoc tags that match a specified predicate **Parameters:** - `node`: `Node` - `predicate`: `(tag: JSDocTag) => tag is T` **Returns:** `readonly T[]`
(all-js-doc-tags-of-kind node kind)Gets all JSDoc tags of a specified kind
Parameters:
node: Nodekind: SyntaxKindReturns: readonly JSDocTag[]
Gets all JSDoc tags of a specified kind **Parameters:** - `node`: `Node` - `kind`: `SyntaxKind` **Returns:** `readonly JSDocTag[]`
(array-binding-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(array-binding-pattern? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(array-literal-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(array-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(arrow-function? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(as-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(assert-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(assert-entry? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(assertion-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(asserts-keyword? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(asterisk-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(auto-accessor-property-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(automatic-type-directive-names options host)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:
options: CompilerOptionshost: ModuleResolutionHostReturns: string[]
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:** - `options`: `CompilerOptions` - `host`: `ModuleResolutionHost` **Returns:** `string[]`
(await-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(await-keyword? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(big-int-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(binary-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(binary-operator-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(binding-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(binding-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(block? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(break-or-continue-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(break-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(bundle? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(bundler-module-name-resolver module-name containing-file compiler-options host)(bundler-module-name-resolver module-name
containing-file
compiler-options
host
cache)(bundler-module-name-resolver module-name
containing-file
compiler-options
host
cache
redirected-reference)Parameters:
module-name: stringcontaining-file: stringcompiler-options: CompilerOptionshost: ModuleResolutionHostcache: ModuleResolutionCache | undefinedredirected-reference: ResolvedProjectReference | undefinedReturns: ResolvedModuleWithFailedLookupLocations
**Parameters:** - `module-name`: `string` - `containing-file`: `string` - `compiler-options`: `CompilerOptions` - `host`: `ModuleResolutionHost` - `cache`: `ModuleResolutionCache | undefined` - `redirected-reference`: `ResolvedProjectReference | undefined` **Returns:** `ResolvedModuleWithFailedLookupLocations`
(call-chain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(call-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(call-like-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(call-or-new-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(call-signature-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(can-have-decorators? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(can-have-modifiers? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(case-block? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(case-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(case-or-default-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(catch-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-or-type-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(class-static-block-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(classic-name-resolver module-name containing-file compiler-options host)(classic-name-resolver module-name containing-file compiler-options host cache)(classic-name-resolver module-name
containing-file
compiler-options
host
cache
redirected-reference)Parameters:
module-name: stringcontaining-file: stringcompiler-options: CompilerOptionshost: ModuleResolutionHostcache: NonRelativeModuleNameResolutionCache | undefinedredirected-reference: ResolvedProjectReference | undefinedReturns: ResolvedModuleWithFailedLookupLocations
**Parameters:** - `module-name`: `string` - `containing-file`: `string` - `compiler-options`: `CompilerOptions` - `host`: `ModuleResolutionHost` - `cache`: `NonRelativeModuleNameResolutionCache | undefined` - `redirected-reference`: `ResolvedProjectReference | undefined` **Returns:** `ResolvedModuleWithFailedLookupLocations`
(collapse-text-change-ranges-across-multiple-versions changes)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:
changes: readonly TextChangeRange[]Returns: TextChangeRange
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:** - `changes`: `readonly TextChangeRange[]` **Returns:** `TextChangeRange`
(colon-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(combined-modifier-flags node)Parameters:
node: DeclarationReturns: ModifierFlags
**Parameters:** - `node`: `Declaration` **Returns:** `ModifierFlags`
(combined-node-flags node)Parameters:
node: NodeReturns: NodeFlags
**Parameters:** - `node`: `Node` **Returns:** `NodeFlags`
(comma-list-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(comment-range node)Gets a custom text range to use when emitting comments.
Parameters:
node: NodeReturns: TextRange
Gets a custom text range to use when emitting comments. **Parameters:** - `node`: `Node` **Returns:** `TextRange`
(computed-property-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(concise-body? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(conditional-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(conditional-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(config-file-parsing-diagnostics config-file-parse-result)Parameters:
config-file-parse-result: ParsedCommandLineReturns: readonly Diagnostic[]
**Parameters:** - `config-file-parse-result`: `ParsedCommandLine` **Returns:** `readonly Diagnostic[]`
(const-type-reference? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(constant-value node)Gets the constant value to emit for an expression representing an enum.
Parameters:
node: AccessExpressionReturns: string | number | undefined
Gets the constant value to emit for an expression representing an enum. **Parameters:** - `node`: `AccessExpression` **Returns:** `string | number | undefined`
(construct-signature-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(constructor-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(constructor-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(continue-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(convert-compiler-options-from-json json-options base-path)(convert-compiler-options-from-json json-options base-path config-file-name)Parameters:
json-options: anybase-path: stringconfig-file-name: string | undefinedReturns: { options: CompilerOptions; errors: Diagnostic[]; }
**Parameters:**
- `json-options`: `any`
- `base-path`: `string`
- `config-file-name`: `string | undefined`
**Returns:** `{ options: CompilerOptions; errors: Diagnostic[]; }`(convert-to-object source-file errors)Convert the json syntax tree into the json value
Parameters:
source-file: JsonSourceFileerrors: Diagnostic[]Returns: any
Convert the json syntax tree into the json value **Parameters:** - `source-file`: `JsonSourceFile` - `errors`: `Diagnostic[]` **Returns:** `any`
(convert-type-acquisition-from-json json-options base-path)(convert-type-acquisition-from-json json-options base-path config-file-name)Parameters:
json-options: anybase-path: stringconfig-file-name: string | undefinedReturns: { options: TypeAcquisition; errors: Diagnostic[]; }
**Parameters:**
- `json-options`: `any`
- `base-path`: `string`
- `config-file-name`: `string | undefined`
**Returns:** `{ options: TypeAcquisition; errors: Diagnostic[]; }`(could-start-trivia? text pos)Parameters:
text: stringpos: numberReturns: boolean
**Parameters:** - `text`: `string` - `pos`: `number` **Returns:** `boolean`
(create-abstract-builder)(create-abstract-builder root-names)(create-abstract-builder new-program host)(create-abstract-builder root-names options)(create-abstract-builder new-program host old-program)(create-abstract-builder root-names options host)(create-abstract-builder new-program
host
old-program
config-file-parsing-diagnostics)(create-abstract-builder root-names options host old-program)(create-abstract-builder root-names
options
host
old-program
config-file-parsing-diagnostics)(create-abstract-builder root-names
options
host
old-program
config-file-parsing-diagnostics
project-references)Creates a builder thats just abstraction over program and can be used with watch
Parameters:
new-program: Programroot-names: readonly string[] | undefinedoptions: CompilerOptions | undefinedhost: CompilerHost | undefinedold-program: BuilderProgram | undefinedconfig-file-parsing-diagnostics: readonly Diagnostic[] | undefinedproject-references: readonly ProjectReference[] | undefinedReturns: BuilderProgram
Creates a builder thats just abstraction over program and can be used with watch **Parameters:** - `new-program`: `Program` - `root-names`: `readonly string[] | undefined` - `options`: `CompilerOptions | undefined` - `host`: `CompilerHost | undefined` - `old-program`: `BuilderProgram | undefined` - `config-file-parsing-diagnostics`: `readonly Diagnostic[] | undefined` - `project-references`: `readonly ProjectReference[] | undefined` **Returns:** `BuilderProgram`
(create-builder-status-reporter system)(create-builder-status-reporter system pretty?)Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
Parameters:
system: Systempretty?: boolean | undefinedReturns: DiagnosticReporter
Create a function that reports watch status by writing to the system and handles the formating of the diagnostic **Parameters:** - `system`: `System` - `pretty?`: `boolean | undefined` **Returns:** `DiagnosticReporter`
(create-classifier)The classifier is used for syntactic highlighting in editors via the TSServer
Returns: Classifier
The classifier is used for syntactic highlighting in editors via the TSServer **Returns:** `Classifier`
(create-compiler-host options)(create-compiler-host options set-parent-nodes?)Parameters:
options: CompilerOptionsset-parent-nodes?: boolean | undefinedReturns: CompilerHost
**Parameters:** - `options`: `CompilerOptions` - `set-parent-nodes?`: `boolean | undefined` **Returns:** `CompilerHost`
(create-document-registry)(create-document-registry use-case-sensitive-file-names?)(create-document-registry use-case-sensitive-file-names? current-directory)(create-document-registry use-case-sensitive-file-names?
current-directory
js-doc-parsing-mode)Parameters:
use-case-sensitive-file-names?: boolean | undefinedcurrent-directory: string | undefinedjs-doc-parsing-mode: JSDocParsingMode | undefinedReturns: DocumentRegistry
**Parameters:** - `use-case-sensitive-file-names?`: `boolean | undefined` - `current-directory`: `string | undefined` - `js-doc-parsing-mode`: `JSDocParsingMode | undefined` **Returns:** `DocumentRegistry`
(create-emit-and-semantic-diagnostics-builder-program)(create-emit-and-semantic-diagnostics-builder-program root-names)(create-emit-and-semantic-diagnostics-builder-program new-program host)(create-emit-and-semantic-diagnostics-builder-program root-names options)(create-emit-and-semantic-diagnostics-builder-program new-program
host
old-program)(create-emit-and-semantic-diagnostics-builder-program root-names options host)(create-emit-and-semantic-diagnostics-builder-program
new-program
host
old-program
config-file-parsing-diagnostics)(create-emit-and-semantic-diagnostics-builder-program root-names
options
host
old-program)(create-emit-and-semantic-diagnostics-builder-program
root-names
options
host
old-program
config-file-parsing-diagnostics)(create-emit-and-semantic-diagnostics-builder-program
root-names
options
host
old-program
config-file-parsing-diagnostics
project-references)Create the builder that can handle the changes in program and iterate through changed files to emit the those files and manage semantic diagnostics cache as well
Parameters:
new-program: Programroot-names: readonly string[] | undefinedoptions: CompilerOptions | undefinedhost: CompilerHost | undefinedold-program: EmitAndSemanticDiagnosticsBuilderProgram | undefinedconfig-file-parsing-diagnostics: readonly Diagnostic[] | undefinedproject-references: readonly ProjectReference[] | undefinedReturns: EmitAndSemanticDiagnosticsBuilderProgram
Create the builder that can handle the changes in program and iterate through changed files to emit the those files and manage semantic diagnostics cache as well **Parameters:** - `new-program`: `Program` - `root-names`: `readonly string[] | undefined` - `options`: `CompilerOptions | undefined` - `host`: `CompilerHost | undefined` - `old-program`: `EmitAndSemanticDiagnosticsBuilderProgram | undefined` - `config-file-parsing-diagnostics`: `readonly Diagnostic[] | undefined` - `project-references`: `readonly ProjectReference[] | undefined` **Returns:** `EmitAndSemanticDiagnosticsBuilderProgram`
(create-incremental-compiler-host options)(create-incremental-compiler-host options system)Parameters:
options: CompilerOptionssystem: System | undefinedReturns: CompilerHost
**Parameters:** - `options`: `CompilerOptions` - `system`: `System | undefined` **Returns:** `CompilerHost`
(create-incremental-program
root-names-options-config-file-parsing-diagnostics-project-references-host-create-program)Parameters:
root-names-options-config-file-parsing-diagnostics-project-references-host-create-program: IncrementalProgramOptions<T>Returns: T
**Parameters:** - `root-names-options-config-file-parsing-diagnostics-project-references-host-create-program`: `IncrementalProgramOptions<T>` **Returns:** `T`
(create-input-files javascript-text declaration-text)(create-input-files read-file-text javascript-path)(create-input-files javascript-text declaration-text javascript-map-path)(create-input-files read-file-text javascript-path javascript-map-path)(create-input-files javascript-text
declaration-text
javascript-map-path
javascript-map-text)(create-input-files read-file-text
javascript-path
javascript-map-path
declaration-path)(create-input-files javascript-text
declaration-text
javascript-map-path
javascript-map-text
declaration-map-path)(create-input-files read-file-text
javascript-path
javascript-map-path
declaration-path
declaration-map-path)(create-input-files javascript-text
declaration-text
javascript-map-path
javascript-map-text
declaration-map-path
declaration-map-text)(create-input-files read-file-text
javascript-path
javascript-map-path
declaration-path
declaration-map-path
build-info-path)Parameters:
javascript-text: stringread-file-text: (path: string) => string | undefineddeclaration-text: stringjavascript-path: stringjavascript-map-path: string | undefineddeclaration-path: stringjavascript-map-text: string | undefineddeclaration-map-path: string | undefinedbuild-info-path: string | undefineddeclaration-map-text: string | undefinedReturns: InputFiles
**Parameters:** - `javascript-text`: `string` - `read-file-text`: `(path: string) => string | undefined` - `declaration-text`: `string` - `javascript-path`: `string` - `javascript-map-path`: `string | undefined` - `declaration-path`: `string` - `javascript-map-text`: `string | undefined` - `declaration-map-path`: `string | undefined` - `build-info-path`: `string | undefined` - `declaration-map-text`: `string | undefined` **Returns:** `InputFiles`
(create-language-service host)(create-language-service host document-registry)(create-language-service host
document-registry
syntax-only-or-language-service-mode?)Parameters:
host: LanguageServiceHostdocument-registry: DocumentRegistry | undefinedsyntax-only-or-language-service-mode?: boolean | LanguageServiceMode | undefinedReturns: LanguageService
**Parameters:** - `host`: `LanguageServiceHost` - `document-registry`: `DocumentRegistry | undefined` - `syntax-only-or-language-service-mode?`: `boolean | LanguageServiceMode | undefined` **Returns:** `LanguageService`
(create-language-service-source-file file-name
script-snapshot
script-target-or-options
version
set-node-parents?)(create-language-service-source-file file-name
script-snapshot
script-target-or-options
version
set-node-parents?
script-kind)Parameters:
file-name: stringscript-snapshot: IScriptSnapshotscript-target-or-options: ScriptTarget | CreateSourceFileOptionsversion: stringset-node-parents?: booleanscript-kind: ScriptKind | undefinedReturns: SourceFile
**Parameters:** - `file-name`: `string` - `script-snapshot`: `IScriptSnapshot` - `script-target-or-options`: `ScriptTarget | CreateSourceFileOptions` - `version`: `string` - `set-node-parents?`: `boolean` - `script-kind`: `ScriptKind | undefined` **Returns:** `SourceFile`
(create-module-resolution-cache current-directory canonical-file-name)(create-module-resolution-cache current-directory canonical-file-name options)(create-module-resolution-cache current-directory
canonical-file-name
options
package-json-info-cache)Parameters:
current-directory: stringcanonical-file-name: (s: string) => stringoptions: CompilerOptions | undefinedpackage-json-info-cache: PackageJsonInfoCache | undefinedReturns: ModuleResolutionCache
**Parameters:** - `current-directory`: `string` - `canonical-file-name`: `(s: string) => string` - `options`: `CompilerOptions | undefined` - `package-json-info-cache`: `PackageJsonInfoCache | undefined` **Returns:** `ModuleResolutionCache`
(create-printer)(create-printer printer-options)(create-printer printer-options handlers)Parameters:
printer-options: PrinterOptions | undefinedhandlers: PrintHandlers | undefinedReturns: Printer
**Parameters:** - `printer-options`: `PrinterOptions | undefined` - `handlers`: `PrintHandlers | undefined` **Returns:** `Printer`
(create-program create-program-options)(create-program root-names options)(create-program root-names options host)(create-program root-names options host old-program)(create-program root-names
options
host
old-program
config-file-parsing-diagnostics)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:
create-program-options: CreateProgramOptions - - The options for creating a program.root-names: readonly string[] - - A set of root files.options: CompilerOptions - - The compiler options which should be used.host: CompilerHost | undefined - - The host interacts with the underlying file system.old-program: Program | undefined - - Reuses an old program structure.config-file-parsing-diagnostics: readonly Diagnostic[] | undefined - - error during config file parsingReturns: 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:** - `create-program-options`: `CreateProgramOptions` - - The options for creating a program. - `root-names`: `readonly string[]` - - A set of root files. - `options`: `CompilerOptions` - - The compiler options which should be used. - `host`: `CompilerHost | undefined` - - The host interacts with the underlying file system. - `old-program`: `Program | undefined` - - Reuses an old program structure. - `config-file-parsing-diagnostics`: `readonly Diagnostic[] | undefined` - - error during config file parsing **Returns:** `Program` - A 'Program' object.
(create-scanner language-version skip-trivia?)(create-scanner language-version skip-trivia? language-variant)(create-scanner language-version skip-trivia? language-variant text-initial)(create-scanner language-version
skip-trivia?
language-variant
text-initial
on-error)(create-scanner language-version
skip-trivia?
language-variant
text-initial
on-error
start)(create-scanner language-version
skip-trivia?
language-variant
text-initial
on-error
start
length)Parameters:
language-version: ScriptTargetskip-trivia?: booleanlanguage-variant: LanguageVariant | undefinedtext-initial: string | undefinedon-error: ErrorCallback | undefinedstart: number | undefinedlength: number | undefinedReturns: Scanner
**Parameters:** - `language-version`: `ScriptTarget` - `skip-trivia?`: `boolean` - `language-variant`: `LanguageVariant | undefined` - `text-initial`: `string | undefined` - `on-error`: `ErrorCallback | undefined` - `start`: `number | undefined` - `length`: `number | undefined` **Returns:** `Scanner`
(create-semantic-diagnostics-builder-program)(create-semantic-diagnostics-builder-program root-names)(create-semantic-diagnostics-builder-program new-program host)(create-semantic-diagnostics-builder-program root-names options)(create-semantic-diagnostics-builder-program new-program host old-program)(create-semantic-diagnostics-builder-program root-names options host)(create-semantic-diagnostics-builder-program new-program
host
old-program
config-file-parsing-diagnostics)(create-semantic-diagnostics-builder-program root-names
options
host
old-program)(create-semantic-diagnostics-builder-program root-names
options
host
old-program
config-file-parsing-diagnostics)(create-semantic-diagnostics-builder-program root-names
options
host
old-program
config-file-parsing-diagnostics
project-references)Create the builder to manage semantic diagnostics and cache them
Parameters:
new-program: Programroot-names: readonly string[] | undefinedoptions: CompilerOptions | undefinedhost: CompilerHost | undefinedold-program: SemanticDiagnosticsBuilderProgram | undefinedconfig-file-parsing-diagnostics: readonly Diagnostic[] | undefinedproject-references: readonly ProjectReference[] | undefinedReturns: SemanticDiagnosticsBuilderProgram
Create the builder to manage semantic diagnostics and cache them **Parameters:** - `new-program`: `Program` - `root-names`: `readonly string[] | undefined` - `options`: `CompilerOptions | undefined` - `host`: `CompilerHost | undefined` - `old-program`: `SemanticDiagnosticsBuilderProgram | undefined` - `config-file-parsing-diagnostics`: `readonly Diagnostic[] | undefined` - `project-references`: `readonly ProjectReference[] | undefined` **Returns:** `SemanticDiagnosticsBuilderProgram`
(create-solution-builder host root-names default-options)Parameters:
host: SolutionBuilderHost<T>root-names: readonly string[]default-options: BuildOptionsReturns: SolutionBuilder<T>
**Parameters:** - `host`: `SolutionBuilderHost<T>` - `root-names`: `readonly string[]` - `default-options`: `BuildOptions` **Returns:** `SolutionBuilder<T>`
(create-solution-builder-host)(create-solution-builder-host system)(create-solution-builder-host system create-program)(create-solution-builder-host system create-program report-diagnostic)(create-solution-builder-host system
create-program
report-diagnostic
report-solution-builder-status)(create-solution-builder-host system
create-program
report-diagnostic
report-solution-builder-status
report-error-summary)Parameters:
system: System | undefinedcreate-program: CreateProgram<T> | undefinedreport-diagnostic: DiagnosticReporter | undefinedreport-solution-builder-status: DiagnosticReporter | undefinedreport-error-summary: ReportEmitErrorSummary | undefinedReturns: SolutionBuilderHost<T>
**Parameters:** - `system`: `System | undefined` - `create-program`: `CreateProgram<T> | undefined` - `report-diagnostic`: `DiagnosticReporter | undefined` - `report-solution-builder-status`: `DiagnosticReporter | undefined` - `report-error-summary`: `ReportEmitErrorSummary | undefined` **Returns:** `SolutionBuilderHost<T>`
(create-solution-builder-with-watch host root-names default-options)(create-solution-builder-with-watch host
root-names
default-options
base-watch-options)Parameters:
host: SolutionBuilderWithWatchHost<T>root-names: readonly string[]default-options: BuildOptionsbase-watch-options: WatchOptions | undefinedReturns: SolutionBuilder<T>
**Parameters:** - `host`: `SolutionBuilderWithWatchHost<T>` - `root-names`: `readonly string[]` - `default-options`: `BuildOptions` - `base-watch-options`: `WatchOptions | undefined` **Returns:** `SolutionBuilder<T>`
(create-solution-builder-with-watch-host)(create-solution-builder-with-watch-host system)(create-solution-builder-with-watch-host system create-program)(create-solution-builder-with-watch-host system
create-program
report-diagnostic)(create-solution-builder-with-watch-host system
create-program
report-diagnostic
report-solution-builder-status)(create-solution-builder-with-watch-host system
create-program
report-diagnostic
report-solution-builder-status
report-watch-status)Parameters:
system: System | undefinedcreate-program: CreateProgram<T> | undefinedreport-diagnostic: DiagnosticReporter | undefinedreport-solution-builder-status: DiagnosticReporter | undefinedreport-watch-status: WatchStatusReporter | undefinedReturns: SolutionBuilderWithWatchHost<T>
**Parameters:** - `system`: `System | undefined` - `create-program`: `CreateProgram<T> | undefined` - `report-diagnostic`: `DiagnosticReporter | undefined` - `report-solution-builder-status`: `DiagnosticReporter | undefined` - `report-watch-status`: `WatchStatusReporter | undefined` **Returns:** `SolutionBuilderWithWatchHost<T>`
(create-source-file file-name source-text language-version-or-options)(create-source-file file-name
source-text
language-version-or-options
set-parent-nodes?)(create-source-file file-name
source-text
language-version-or-options
set-parent-nodes?
script-kind)Parameters:
file-name: stringsource-text: stringlanguage-version-or-options: ScriptTarget | CreateSourceFileOptionsset-parent-nodes?: boolean | undefinedscript-kind: ScriptKind | undefinedReturns: SourceFile
**Parameters:** - `file-name`: `string` - `source-text`: `string` - `language-version-or-options`: `ScriptTarget | CreateSourceFileOptions` - `set-parent-nodes?`: `boolean | undefined` - `script-kind`: `ScriptKind | undefined` **Returns:** `SourceFile`
(create-source-map-source file-name text)(create-source-map-source file-name text skip-trivia)Create an external source map source file reference
Parameters:
file-name: stringtext: stringskip-trivia: ((pos: number) => number) | undefinedReturns: SourceMapSource
Create an external source map source file reference **Parameters:** - `file-name`: `string` - `text`: `string` - `skip-trivia`: `((pos: number) => number) | undefined` **Returns:** `SourceMapSource`
(create-text-change-range span new-length)Parameters:
span: TextSpannew-length: numberReturns: TextChangeRange
**Parameters:** - `span`: `TextSpan` - `new-length`: `number` **Returns:** `TextChangeRange`
(create-text-span start length)Parameters:
start: numberlength: numberReturns: TextSpan
**Parameters:** - `start`: `number` - `length`: `number` **Returns:** `TextSpan`
(create-text-span-from-bounds start end)Parameters:
start: numberend: numberReturns: TextSpan
**Parameters:** - `start`: `number` - `end`: `number` **Returns:** `TextSpan`
(create-type-reference-directive-resolution-cache current-directory
canonical-file-name)(create-type-reference-directive-resolution-cache current-directory
canonical-file-name
options)(create-type-reference-directive-resolution-cache current-directory
canonical-file-name
options
package-json-info-cache)Parameters:
current-directory: stringcanonical-file-name: (s: string) => stringoptions: CompilerOptions | undefinedpackage-json-info-cache: PackageJsonInfoCache | undefinedReturns: TypeReferenceDirectiveResolutionCache
**Parameters:** - `current-directory`: `string` - `canonical-file-name`: `(s: string) => string` - `options`: `CompilerOptions | undefined` - `package-json-info-cache`: `PackageJsonInfoCache | undefined` **Returns:** `TypeReferenceDirectiveResolutionCache`
(create-unparsed-source-file text)(create-unparsed-source-file input-file type)(create-unparsed-source-file text map-path)(create-unparsed-source-file input-file type strip-internal?)(create-unparsed-source-file text map-path map)Parameters:
input-file: InputFilestext: stringmap-path: string | undefinedtype: "js" | "dts"map: string | undefinedstrip-internal?: boolean | undefinedReturns: UnparsedSource
**Parameters:** - `input-file`: `InputFiles` - `text`: `string` - `map-path`: `string | undefined` - `type`: `"js" | "dts"` - `map`: `string | undefined` - `strip-internal?`: `boolean | undefined` **Returns:** `UnparsedSource`
(create-watch-compiler-host config-file-name)(create-watch-compiler-host config-file-name options-to-extend)(create-watch-compiler-host config-file-name options-to-extend system)(create-watch-compiler-host root-files options system)(create-watch-compiler-host config-file-name
options-to-extend
system
create-program)(create-watch-compiler-host root-files options system create-program)(create-watch-compiler-host config-file-name
options-to-extend
system
create-program
report-diagnostic)(create-watch-compiler-host root-files
options
system
create-program
report-diagnostic)(create-watch-compiler-host config-file-name
options-to-extend
system
create-program
report-diagnostic
report-watch-status)(create-watch-compiler-host root-files
options
system
create-program
report-diagnostic
report-watch-status)(create-watch-compiler-host config-file-name
options-to-extend
system
create-program
report-diagnostic
report-watch-status
watch-options-to-extend)(create-watch-compiler-host root-files
options
system
create-program
report-diagnostic
report-watch-status
project-references)(create-watch-compiler-host config-file-name
options-to-extend
system
create-program
report-diagnostic
report-watch-status
watch-options-to-extend
extra-file-extensions)(create-watch-compiler-host root-files
options
system
create-program
report-diagnostic
report-watch-status
project-references
watch-options)Create the watch compiler host for either configFile or fileNames and its options
Parameters:
config-file-name: stringroot-files: string[]options: CompilerOptionsoptions-to-extend: CompilerOptions | undefinedsystem: Systemcreate-program: CreateProgram<T> | undefinedreport-diagnostic: DiagnosticReporter | undefinedreport-watch-status: WatchStatusReporter | undefinedproject-references: readonly ProjectReference[] | undefinedwatch-options-to-extend: WatchOptions | undefinedextra-file-extensions: readonly FileExtensionInfo[] | undefinedwatch-options: WatchOptions | undefinedReturns: WatchCompilerHostOfFilesAndCompilerOptions<T>
Create the watch compiler host for either configFile or fileNames and its options **Parameters:** - `config-file-name`: `string` - `root-files`: `string[]` - `options`: `CompilerOptions` - `options-to-extend`: `CompilerOptions | undefined` - `system`: `System` - `create-program`: `CreateProgram<T> | undefined` - `report-diagnostic`: `DiagnosticReporter | undefined` - `report-watch-status`: `WatchStatusReporter | undefined` - `project-references`: `readonly ProjectReference[] | undefined` - `watch-options-to-extend`: `WatchOptions | undefined` - `extra-file-extensions`: `readonly FileExtensionInfo[] | undefined` - `watch-options`: `WatchOptions | undefined` **Returns:** `WatchCompilerHostOfFilesAndCompilerOptions<T>`
(create-watch-program host)Creates the watch from the host for root files and compiler options Creates the watch from the host for config file
Parameters:
host: WatchCompilerHostOfConfigFile<T>Returns: WatchOfConfigFile<T>
Creates the watch from the host for root files and compiler options Creates the watch from the host for config file **Parameters:** - `host`: `WatchCompilerHostOfConfigFile<T>` **Returns:** `WatchOfConfigFile<T>`
(debugger-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(declaration-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(decoded-text-span-intersects-with? start-1 length-1 start-2 length-2)Parameters:
start-1: numberlength-1: numberstart-2: numberlength-2: numberReturns: boolean
**Parameters:** - `start-1`: `number` - `length-1`: `number` - `start-2`: `number` - `length-2`: `number` **Returns:** `boolean`
(decorator? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(decorators node)Parameters:
node: HasDecoratorsReturns: readonly Decorator[] | undefined
**Parameters:** - `node`: `HasDecorators` **Returns:** `readonly Decorator[] | undefined`
(default-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(default-compiler-options)Returns: CompilerOptions
**Returns:** `CompilerOptions`
(default-format-code-settings)(default-format-code-settings new-line-character)Parameters:
new-line-character: string | undefinedReturns: FormatCodeSettings
**Parameters:** - `new-line-character`: `string | undefined` **Returns:** `FormatCodeSettings`
(default-lib-file-name options)Parameters:
options: CompilerOptionsReturns: string
**Parameters:** - `options`: `CompilerOptions` **Returns:** `string`
(default-lib-file-path options)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:
options: CompilerOptionsReturns: string
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:** - `options`: `CompilerOptions` **Returns:** `string`
(delete-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(display-parts-to-string)(display-parts-to-string display-parts)Parameters:
display-parts: SymbolDisplayPart[] | undefinedReturns: string
**Parameters:** - `display-parts`: `SymbolDisplayPart[] | undefined` **Returns:** `string`
(dispose-emit-nodes)(dispose-emit-nodes source-file)Clears any EmitNode entries from parse-tree nodes.
Parameters:
source-file: SourceFile | undefined - A source file.Returns: void
Clears any `EmitNode` entries from parse-tree nodes. **Parameters:** - `source-file`: `SourceFile | undefined` - A source file. **Returns:** `void`
(do-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(dot-dot-dot-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(effective-constraint-of-type-parameter node)Parameters:
node: TypeParameterDeclarationReturns: TypeNode | undefined
**Parameters:** - `node`: `TypeParameterDeclaration` **Returns:** `TypeNode | undefined`
(effective-type-parameter-declarations node)Gets the effective type parameters. If the node was parsed in a
JavaScript file, gets the type parameters from the @template tag from JSDoc.
This does not return type parameters from a jsdoc reference to a generic type, eg
type Id = <T>(x: T) => T /**
Parameters:
node: DeclarationWithTypeParametersReturns: readonly TypeParameterDeclaration[]
Gets the effective type parameters. If the node was parsed in a JavaScript file, gets the type parameters from the `@template` tag from JSDoc. This does *not* return type parameters from a jsdoc reference to a generic type, eg type Id = <T>(x: T) => T /** **Parameters:** - `node`: `DeclarationWithTypeParameters` **Returns:** `readonly TypeParameterDeclaration[]`
(effective-type-roots options host)Parameters:
options: CompilerOptionshost: GetEffectiveTypeRootsHostReturns: string[] | undefined
**Parameters:** - `options`: `CompilerOptions` - `host`: `GetEffectiveTypeRootsHost` **Returns:** `string[] | undefined`
(element-access-chain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(element-access-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(emit-helpers node)Gets the EmitHelpers of a node.
Parameters:
node: NodeReturns: EmitHelper[] | undefined
Gets the EmitHelpers of a node. **Parameters:** - `node`: `Node` **Returns:** `EmitHelper[] | undefined`
(empty-binding-element? node)Parameters:
node: ArrayBindingElementReturns: boolean
**Parameters:** - `node`: `ArrayBindingElement` **Returns:** `boolean`
(empty-binding-pattern? node)Parameters:
node: BindingNameReturns: boolean
**Parameters:** - `node`: `BindingName` **Returns:** `boolean`
(empty-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(entity-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(enum-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(enum-member? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(equals-greater-than-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(escape-leading-underscores identifier)Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like 'proto'
Parameters:
identifier: stringReturns: __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`
(exclamation-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(export-assignment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(export-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(export-specifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(expression-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(expression-with-type-arguments? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(expression? node)Determines whether a node is an expression based only on its kind.
Parameters:
node: NodeReturns: boolean
Determines whether a node is an expression based only on its kind. **Parameters:** - `node`: `Node` **Returns:** `boolean`
(external-module-name-relative? module-name)Parameters:
module-name: stringReturns: boolean
**Parameters:** - `module-name`: `string` **Returns:** `boolean`
(external-module-reference? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(external-module? file)Parameters:
file: SourceFileReturns: boolean
**Parameters:** - `file`: `SourceFile` **Returns:** `boolean`
(find-ancestor)(find-ancestor node)(find-ancestor node callback)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.
Parameters:
node: Node | undefinedcallback: (element: Node) => boolean | "quit"Returns: 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. **Parameters:** - `node`: `Node | undefined` - `callback`: `(element: Node) => boolean | "quit"` **Returns:** `Node | undefined`
(find-config-file search-path file-exists)(find-config-file search-path file-exists config-name)Parameters:
search-path: stringfile-exists: (fileName: string) => booleanconfig-name: string | undefinedReturns: string | undefined
**Parameters:** - `search-path`: `string` - `file-exists`: `(fileName: string) => boolean` - `config-name`: `string | undefined` **Returns:** `string | undefined`
(flatten-diagnostic-message-text)(flatten-diagnostic-message-text diag)(flatten-diagnostic-message-text diag new-line)(flatten-diagnostic-message-text diag new-line indent)Parameters:
diag: string | DiagnosticMessageChain | undefinednew-line: stringindent: number | undefinedReturns: string
**Parameters:** - `diag`: `string | DiagnosticMessageChain | undefined` - `new-line`: `string` - `indent`: `number | undefined` **Returns:** `string`
(for-each-child node cb-node)(for-each-child node cb-node cb-nodes)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.
Parameters:
node: Node - a given node to visit its childrencb-node: (node: Node) => T | undefined - a callback to be invoked for all child nodescb-nodes: ((nodes: NodeArray<Node>) => T | undefined) | undefined - a callback to be invoked for embedded arrayReturns: 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. **Parameters:** - `node`: `Node` - a given node to visit its children - `cb-node`: `(node: Node) => T | undefined` - a callback to be invoked for all child nodes - `cb-nodes`: `((nodes: NodeArray<Node>) => T | undefined) | undefined` - a callback to be invoked for embedded array **Returns:** `T | undefined`
(for-each-leading-comment-range text pos cb)(for-each-leading-comment-range text pos cb state)Parameters:
text: stringpos: numbercb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => Ustate: TReturns: U | undefined
**Parameters:** - `text`: `string` - `pos`: `number` - `cb`: `(pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U` - `state`: `T` **Returns:** `U | undefined`
(for-each-trailing-comment-range text pos cb)(for-each-trailing-comment-range text pos cb state)Parameters:
text: stringpos: numbercb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => Ustate: TReturns: U | undefined
**Parameters:** - `text`: `string` - `pos`: `number` - `cb`: `(pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U` - `state`: `T` **Returns:** `U | undefined`
(for-in-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(for-initializer? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(for-of-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(for-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(format-diagnostic diagnostic host)Parameters:
diagnostic: Diagnostichost: FormatDiagnosticsHostReturns: string
**Parameters:** - `diagnostic`: `Diagnostic` - `host`: `FormatDiagnosticsHost` **Returns:** `string`
(format-diagnostics diagnostics host)Parameters:
diagnostics: readonly Diagnostic[]host: FormatDiagnosticsHostReturns: string
**Parameters:** - `diagnostics`: `readonly Diagnostic[]` - `host`: `FormatDiagnosticsHost` **Returns:** `string`
(format-diagnostics-with-color-and-context diagnostics host)Parameters:
diagnostics: readonly Diagnostic[]host: FormatDiagnosticsHostReturns: string
**Parameters:** - `diagnostics`: `readonly Diagnostic[]` - `host`: `FormatDiagnosticsHost` **Returns:** `string`
(function-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(function-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(function-like?)(function-like? node)Parameters:
node: Node | undefinedReturns: boolean
**Parameters:** - `node`: `Node | undefined` **Returns:** `boolean`
(function-or-constructor-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(function-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(get-accessor-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(get-accessor? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(has-js-doc-parameter-tags? node)Return true if the node has JSDoc parameter tags.
Parameters:
node: GetAccessorDeclaration | SetAccessorDeclaration | ArrowFunction | CallSignatureDeclaration | ... 9 more ... | MethodSignatureReturns: boolean
Return true if the node has JSDoc parameter tags. **Parameters:** - `node`: `GetAccessorDeclaration | SetAccessorDeclaration | ArrowFunction | CallSignatureDeclaration | ... 9 more ... | MethodSignature` **Returns:** `boolean`
(has-only-expression-initializer? node)True if has initializer node attached to it.
Parameters:
node: NodeReturns: boolean
True if has initializer node attached to it. **Parameters:** - `node`: `Node` **Returns:** `boolean`
(has-rest-parameter? s)Parameters:
s: JSDocSignature | SignatureDeclarationReturns: boolean
**Parameters:** - `s`: `JSDocSignature | SignatureDeclaration` **Returns:** `boolean`
(heritage-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(id-text identifier-or-private-name)Parameters:
identifier-or-private-name: Identifier | PrivateIdentifierReturns: string
**Parameters:** - `identifier-or-private-name`: `Identifier | PrivateIdentifier` **Returns:** `string`
(identifier-or-this-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(identifier-part? ch)(identifier-part? ch language-version)(identifier-part? ch language-version identifier-variant)Parameters:
ch: numberlanguage-version: ScriptTarget | undefinedidentifier-variant: LanguageVariant | undefinedReturns: boolean
**Parameters:** - `ch`: `number` - `language-version`: `ScriptTarget | undefined` - `identifier-variant`: `LanguageVariant | undefined` **Returns:** `boolean`
(identifier-start? ch)(identifier-start? ch language-version)Parameters:
ch: numberlanguage-version: ScriptTarget | undefinedReturns: boolean
**Parameters:** - `ch`: `number` - `language-version`: `ScriptTarget | undefined` **Returns:** `boolean`
(identifier-to-keyword-kind node)If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the SyntaxKind for the matching keyword.
Parameters:
node: IdentifierReturns: KeywordSyntaxKind | undefined
If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the SyntaxKind for the matching keyword. **Parameters:** - `node`: `Identifier` **Returns:** `KeywordSyntaxKind | undefined`
(identifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(if-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(implied-node-format-for-file file-name)(implied-node-format-for-file file-name package-json-info-cache)(implied-node-format-for-file file-name package-json-info-cache host)(implied-node-format-for-file file-name package-json-info-cache host options)A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
options parameter.
Parameters:
file-name: string - The file name to check the format of (it need not exist on disk)package-json-info-cache: PackageJsonInfoCache | undefined - A cache for package file lookups - it's best to have a cache when this function is called oftenhost: ModuleResolutionHost - The ModuleResolutionHost which can perform the filesystem lookups for package json dataoptions: CompilerOptions - The compiler options to perform the analysis under - relevant options are moduleResolution and traceResolutionReturns: ResolutionMode - undefined if the path has no relevant implied format, ModuleKind.ESNext for esm format, and ModuleKind.CommonJS for cjs format
A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the `options` parameter. **Parameters:** - `file-name`: `string` - The file name to check the format of (it need not exist on disk) - `package-json-info-cache`: `PackageJsonInfoCache | undefined` - A cache for package file lookups - it's best to have a cache when this function is called often - `host`: `ModuleResolutionHost` - The ModuleResolutionHost which can perform the filesystem lookups for package json data - `options`: `CompilerOptions` - The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution` **Returns:** `ResolutionMode` - `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
(import-attribute-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-attribute? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-attributes? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-clause? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-equals-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-or-export-specifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-specifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-type-assertion-container? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(import-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(index-signature-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(indexed-access-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(infer-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(interface-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(internal-declaration? node)(internal-declaration? node source-file)Parameters:
node: Nodesource-file: SourceFile | undefinedReturns: boolean
**Parameters:** - `node`: `Node` - `source-file`: `SourceFile | undefined` **Returns:** `boolean`
(intersection-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(iteration-statement? node look-in-labeled-statements)(iteration-statement? node look-in-labeled-statements?)Parameters:
node: Nodelook-in-labeled-statements: falselook-in-labeled-statements?: booleanReturns: boolean
**Parameters:** - `node`: `Node` - `look-in-labeled-statements`: `false` - `look-in-labeled-statements?`: `boolean` **Returns:** `boolean`
(js-doc-all-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-augments-tag node)Gets the JSDoc augments tag for the node if present
Parameters:
node: NodeReturns: JSDocAugmentsTag | undefined
Gets the JSDoc augments tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocAugmentsTag | undefined`
(js-doc-augments-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-author-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-callback-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-class-tag node)Gets the JSDoc class tag for the node if present
Parameters:
node: NodeReturns: JSDocClassTag | undefined
Gets the JSDoc class tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocClassTag | undefined`
(js-doc-class-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-comment-containing-node? node)True if node is of a kind that may contain comment text.
Parameters:
node: NodeReturns: boolean
True if node is of a kind that may contain comment text. **Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-comments-and-tags host-node)This function checks multiple locations for JSDoc comments that apply to a host node. At each location, the whole comment may apply to the node, or only a specific tag in the comment. In the first case, location adds the entire {@link JSDoc } object. In the second case, it adds the applicable {@link JSDocTag }.
For example, a JSDoc comment before a parameter adds the entire {@link JSDoc }. But a
@param tag on the parent function only adds the {@link JSDocTag } for the @param.
/** JSDoc will be returned for `a` *\/
const a = 0
/**
* Entire JSDoc will be returned for `b`
*
**Parameters:**
- `host-node`: `Node`
**Returns:** `readonly (JSDocTag | JSDoc)[]`
This function checks multiple locations for JSDoc comments that apply to a host node.
At each location, the whole comment may apply to the node, or only a specific tag in
the comment. In the first case, location adds the entire {@link JSDoc } object. In the
second case, it adds the applicable {@link JSDocTag }.
For example, a JSDoc comment before a parameter adds the entire {@link JSDoc }. But a
`@param` tag on the parent function only adds the {@link JSDocTag } for the `@param`.
```ts
/** JSDoc will be returned for `a` *\/
const a = 0
/**
* Entire JSDoc will be returned for `b`
*
**Parameters:**
- `host-node`: `Node`
**Returns:** `readonly (JSDocTag | JSDoc)[]`(js-doc-deprecated-tag node)Gets the JSDoc deprecated tag for the node if present
Parameters:
node: NodeReturns: JSDocDeprecatedTag | undefined
Gets the JSDoc deprecated tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocDeprecatedTag | undefined`
(js-doc-deprecated-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-enum-tag node)Gets the JSDoc enum tag for the node if present
Parameters:
node: NodeReturns: JSDocEnumTag | undefined
Gets the JSDoc enum tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocEnumTag | undefined`
(js-doc-enum-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-function-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-implements-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-implements-tags node)Gets the JSDoc implements tags for the node if present
Parameters:
node: NodeReturns: readonly JSDocImplementsTag[]
Gets the JSDoc implements tags for the node if present **Parameters:** - `node`: `Node` **Returns:** `readonly JSDocImplementsTag[]`
(js-doc-link-code? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-link-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-link-plain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-link? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-member-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-name-reference? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-namepath-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-non-nullable-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-nullable-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-optional-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-overload-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-override-tag-no-cache node)Parameters:
node: NodeReturns: JSDocOverrideTag | undefined
**Parameters:** - `node`: `Node` **Returns:** `JSDocOverrideTag | undefined`
(js-doc-override-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-parameter-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-parameter-tags param)Gets the JSDoc parameter tags for the node if present.
Parameters:
param: ParameterDeclarationReturns: readonly JSDocParameterTag[]
Gets the JSDoc parameter tags for the node if present. **Parameters:** - `param`: `ParameterDeclaration` **Returns:** `readonly JSDocParameterTag[]`
(js-doc-private-tag node)Gets the JSDoc private tag for the node if present
Parameters:
node: NodeReturns: JSDocPrivateTag | undefined
Gets the JSDoc private tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocPrivateTag | undefined`
(js-doc-private-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-property-like-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-property-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-protected-tag node)Gets the JSDoc protected tag for the node if present
Parameters:
node: NodeReturns: JSDocProtectedTag | undefined
Gets the JSDoc protected tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocProtectedTag | undefined`
(js-doc-protected-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-public-tag node)Gets the JSDoc public tag for the node if present
Parameters:
node: NodeReturns: JSDocPublicTag | undefined
Gets the JSDoc public tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocPublicTag | undefined`
(js-doc-public-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-readonly-tag node)Gets the JSDoc protected tag for the node if present
Parameters:
node: NodeReturns: JSDocReadonlyTag | undefined
Gets the JSDoc protected tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocReadonlyTag | undefined`
(js-doc-readonly-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-return-tag node)Gets the JSDoc return tag for the node if present
Parameters:
node: NodeReturns: JSDocReturnTag | undefined
Gets the JSDoc return tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocReturnTag | undefined`
(js-doc-return-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-return-type node)Gets the return type node for the node if provided via JSDoc return tag or type tag.
Parameters:
node: NodeReturns: TypeNode | undefined
Gets the return type node for the node if provided via JSDoc return tag or type tag. **Parameters:** - `node`: `Node` **Returns:** `TypeNode | undefined`
(js-doc-satisfies-tag node)Parameters:
node: NodeReturns: JSDocSatisfiesTag | undefined
**Parameters:** - `node`: `Node` **Returns:** `JSDocSatisfiesTag | undefined`
(js-doc-satisfies-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-see-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-signature? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-tags node)Get all JSDoc tags related to a node, including those on parent nodes.
Parameters:
node: NodeReturns: readonly JSDocTag[]
Get all JSDoc tags related to a node, including those on parent nodes. **Parameters:** - `node`: `Node` **Returns:** `readonly JSDocTag[]`
(js-doc-template-tag node)Gets the JSDoc template tag for the node if present
Parameters:
node: NodeReturns: JSDocTemplateTag | undefined
Gets the JSDoc template tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocTemplateTag | undefined`
(js-doc-template-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-this-tag node)Gets the JSDoc this tag for the node if present
Parameters:
node: NodeReturns: JSDocThisTag | undefined
Gets the JSDoc this tag for the node if present **Parameters:** - `node`: `Node` **Returns:** `JSDocThisTag | undefined`
(js-doc-this-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-throws-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-type node)Gets the type node for the node if provided via JSDoc.
Parameters:
node: NodeReturns: TypeNode | undefined
Gets the type node for the node if provided via JSDoc. **Parameters:** - `node`: `Node` **Returns:** `TypeNode | undefined`
(js-doc-type-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-type-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-type-parameter-tags param)Gets the JSDoc type parameter tags for the node if present.
Parameters:
param: TypeParameterDeclarationReturns: readonly JSDocTemplateTag[]
Gets the JSDoc type parameter tags for the node if present. **Parameters:** - `param`: `TypeParameterDeclaration` **Returns:** `readonly JSDocTemplateTag[]`
(js-doc-type-tag node)Gets the JSDoc type tag for the node if present and valid
Parameters:
node: NodeReturns: JSDocTypeTag | undefined
Gets the JSDoc type tag for the node if present and valid **Parameters:** - `node`: `Node` **Returns:** `JSDocTypeTag | undefined`
(js-doc-type-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-typedef-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-unknown-tag? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-unknown-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc-variadic-type? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(js-doc? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-attribute-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-attribute? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-attributes? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-child? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-closing-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-closing-fragment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-fragment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-namespaced-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-opening-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-opening-fragment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-opening-like-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-self-closing-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-spread-attribute? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-tag-name-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(jsx-text? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(labeled-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(leading-comment-ranges text pos)Parameters:
text: stringpos: numberReturns: CommentRange[] | undefined
**Parameters:** - `text`: `string` - `pos`: `number` **Returns:** `CommentRange[] | undefined`
(left-hand-side-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(line-and-character-of-position source-file position)Parameters:
source-file: SourceFileLikeposition: numberReturns: LineAndCharacter
**Parameters:** - `source-file`: `SourceFileLike` - `position`: `number` **Returns:** `LineAndCharacter`
(line-break? ch)Parameters:
ch: numberReturns: boolean
**Parameters:** - `ch`: `number` **Returns:** `boolean`
(literal-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(literal-type-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(literal-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(mapped-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(member-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(meta-property? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(method-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(method-signature? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(minus-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(missing-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(mode-for-file-reference ref)(mode-for-file-reference ref containing-file-mode)Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
Parameters:
ref: string | FileReferencecontaining-file-mode: ResolutionModeReturns: ResolutionMode
Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file. **Parameters:** - `ref`: `string | FileReference` - `containing-file-mode`: `ResolutionMode` **Returns:** `ResolutionMode`
(mode-for-resolution-at-index file index compiler-options)Use program.getModeForResolutionAtIndex, which retrieves the correct compilerOptions, instead of this function whenever possible.
Calculates the final resolution mode for an import at some index within a file's imports list. This is the resolution mode
explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
--module node16 or nodenext, this may depend on the file's impliedNodeFormat. In --module preserve, it depends only on the
input syntax of the reference. In other module modes, when overriding import attributes are not provided, this function returns
undefined, as the result would have no impact on module resolution, emit, or type checking.
Parameters:
file: SourceFile - File to fetch the resolution mode withinindex: number - Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentationscompiler-options: CompilerOptions - The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
should be the options of the referenced project, not the referencing project.Returns: ResolutionMode
Use `program.getModeForResolutionAtIndex`, which retrieves the correct `compilerOptions`, instead of this function whenever possible. Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no impact on module resolution, emit, or type checking. **Parameters:** - `file`: `SourceFile` - File to fetch the resolution mode within - `index`: `number` - Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations - `compiler-options`: `CompilerOptions` - The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options should be the options of the referenced project, not the referencing project. **Returns:** `ResolutionMode`
(mode-for-usage-location file usage compiler-options)Use program.getModeForUsageLocation, which retrieves the correct compilerOptions, instead of this function whenever possible.
Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
attributes, if present, or the syntax the usage would have if emitted to JavaScript. In --module node16 or nodenext, this may
depend on the file's impliedNodeFormat. In --module preserve, it depends only on the input syntax of the reference. In other
module modes, when overriding import attributes are not provided, this function returns undefined, as the result would have no
impact on module resolution, emit, or type checking.
Parameters:
file: { impliedNodeFormat?: ResolutionMode; } - The file the import or import-like reference is contained withinusage: StringLiteralLike - The module reference stringcompiler-options: CompilerOptions - The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
should be the options of the referenced project, not the referencing project.Returns: ModuleKind.CommonJS | ModuleKind.ESNext | undefined - The final resolution mode of the import
Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
`module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
impact on module resolution, emit, or type checking.
**Parameters:**
- `file`: `{ impliedNodeFormat?: ResolutionMode; }` - The file the import or import-like reference is contained within
- `usage`: `StringLiteralLike` - The module reference string
- `compiler-options`: `CompilerOptions` - The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
should be the options of the referenced project, not the referencing project.
**Returns:** `ModuleKind.CommonJS | ModuleKind.ESNext | undefined` - The final resolution mode of the import(modifier-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(modifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(modifiers node)Parameters:
node: HasModifiersReturns: readonly Modifier[] | undefined
**Parameters:** - `node`: `HasModifiers` **Returns:** `readonly Modifier[] | undefined`
(module-block? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(module-body? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(module-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(module-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(module-reference? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(move-emit-helpers source target predicate)Moves matching emit helpers from a source node to a target node.
Parameters:
source: Nodetarget: Nodepredicate: (helper: EmitHelper) => booleanReturns: void
Moves matching emit helpers from a source node to a target node. **Parameters:** - `source`: `Node` - `target`: `Node` - `predicate`: `(helper: EmitHelper) => boolean` **Returns:** `void`
(move-synthetic-comments node original)Parameters:
node: Toriginal: NodeReturns: T
**Parameters:** - `node`: `T` - `original`: `Node` **Returns:** `T`
(name-of-declaration)(name-of-declaration declaration)Parameters:
declaration: Declaration | Expression | undefinedReturns: DeclarationName | undefined
**Parameters:** - `declaration`: `Declaration | Expression | undefined` **Returns:** `DeclarationName | undefined`
(name-of-js-doc-typedef declaration)Parameters:
declaration: JSDocTypedefTagReturns: Identifier | PrivateIdentifier | undefined
**Parameters:** - `declaration`: `JSDocTypedefTag` **Returns:** `Identifier | PrivateIdentifier | undefined`
(named-export-bindings? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(named-exports? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(named-import-bindings? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(named-imports? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(named-tuple-member? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(namespace-export-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(namespace-export? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(namespace-import? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(new-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(no-substitution-template-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(node-module-name-resolver module-name containing-file compiler-options host)(node-module-name-resolver module-name
containing-file
compiler-options
host
cache)(node-module-name-resolver module-name
containing-file
compiler-options
host
cache
redirected-reference)Parameters:
module-name: stringcontaining-file: stringcompiler-options: CompilerOptionshost: ModuleResolutionHostcache: ModuleResolutionCache | undefinedredirected-reference: ResolvedProjectReference | undefinedReturns: ResolvedModuleWithFailedLookupLocations
**Parameters:** - `module-name`: `string` - `containing-file`: `string` - `compiler-options`: `CompilerOptions` - `host`: `ModuleResolutionHost` - `cache`: `ModuleResolutionCache | undefined` - `redirected-reference`: `ResolvedProjectReference | undefined` **Returns:** `ResolvedModuleWithFailedLookupLocations`
(non-null-chain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(non-null-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(not-emitted-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(nullish-coalesce? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(numeric-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(object-binding-pattern? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(object-literal-element-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(object-literal-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(object-literal-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(omitted-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(optional-chain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(optional-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(original-node)(original-node node)(original-node node node-test)Parameters:
node: Node | undefinednode-test: (node: Node) => node is TReturns: T | undefined
**Parameters:** - `node`: `Node | undefined` - `node-test`: `(node: Node) => node is T` **Returns:** `T | undefined`
(output-file-names command-line input-file-name ignore-case?)Parameters:
command-line: ParsedCommandLineinput-file-name: stringignore-case?: booleanReturns: readonly string[]
**Parameters:** - `command-line`: `ParsedCommandLine` - `input-file-name`: `string` - `ignore-case?`: `boolean` **Returns:** `readonly string[]`
(parameter-property-declaration? node parent)Parameters:
node: Nodeparent: NodeReturns: boolean
**Parameters:** - `node`: `Node` - `parent`: `Node` **Returns:** `boolean`
(parameter? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(parenthesized-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(parenthesized-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(parse-command-line command-line)(parse-command-line command-line read-file)Parameters:
command-line: readonly string[]read-file: ((path: string) => string | undefined) | undefinedReturns: ParsedCommandLine
**Parameters:** - `command-line`: `readonly string[]` - `read-file`: `((path: string) => string | undefined) | undefined` **Returns:** `ParsedCommandLine`
(parse-config-file-text-to-json file-name json-text)Parse the text of the tsconfig.json file
Parameters:
file-name: string - The path to the config filejson-text: string - The text of the config fileReturns: { config?: any; error?: Diagnostic | undefined; }
Parse the text of the tsconfig.json file
**Parameters:**
- `file-name`: `string` - The path to the config file
- `json-text`: `string` - The text of the config file
**Returns:** `{ config?: any; error?: Diagnostic | undefined; }`(parse-isolated-entity-name text language-version)Parameters:
text: stringlanguage-version: ScriptTargetReturns: EntityName | undefined
**Parameters:** - `text`: `string` - `language-version`: `ScriptTarget` **Returns:** `EntityName | undefined`
(parse-json-config-file-content json host base-path)(parse-json-config-file-content json host base-path existing-options)(parse-json-config-file-content json
host
base-path
existing-options
config-file-name)(parse-json-config-file-content json
host
base-path
existing-options
config-file-name
resolution-stack)(parse-json-config-file-content json
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions)(parse-json-config-file-content json
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions
extended-config-cache)(parse-json-config-file-content json
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions
extended-config-cache
existing-watch-options)Parse the contents of a config file (tsconfig.json).
Parameters:
json: any - The contents of the config file to parsehost: ParseConfigHost - Instance of ParseConfigHost used to enumerate files in folder.base-path: string - A root directory to resolve relative path entries in the config
file to. e.g. outDirexisting-options: CompilerOptions | undefinedconfig-file-name: string | undefinedresolution-stack: Path[] | undefinedextra-file-extensions: readonly FileExtensionInfo[] | undefinedextended-config-cache: anyexisting-watch-options: WatchOptions | undefinedReturns: ParsedCommandLine
Parse the contents of a config file (tsconfig.json). **Parameters:** - `json`: `any` - The contents of the config file to parse - `host`: `ParseConfigHost` - Instance of ParseConfigHost used to enumerate files in folder. - `base-path`: `string` - A root directory to resolve relative path entries in the config file to. e.g. outDir - `existing-options`: `CompilerOptions | undefined` - `config-file-name`: `string | undefined` - `resolution-stack`: `Path[] | undefined` - `extra-file-extensions`: `readonly FileExtensionInfo[] | undefined` - `extended-config-cache`: `any` - `existing-watch-options`: `WatchOptions | undefined` **Returns:** `ParsedCommandLine`
(parse-json-source-file-config-file-content source-file host base-path)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options
config-file-name)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options
config-file-name
resolution-stack)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions
extended-config-cache)(parse-json-source-file-config-file-content source-file
host
base-path
existing-options
config-file-name
resolution-stack
extra-file-extensions
extended-config-cache
existing-watch-options)Parse the contents of a config file (tsconfig.json).
Parameters:
source-file: TsConfigSourceFilehost: ParseConfigHost - Instance of ParseConfigHost used to enumerate files in folder.base-path: string - A root directory to resolve relative path entries in the config
file to. e.g. outDirexisting-options: CompilerOptions | undefinedconfig-file-name: string | undefinedresolution-stack: Path[] | undefinedextra-file-extensions: readonly FileExtensionInfo[] | undefinedextended-config-cache: anyexisting-watch-options: WatchOptions | undefinedReturns: ParsedCommandLine
Parse the contents of a config file (tsconfig.json). **Parameters:** - `source-file`: `TsConfigSourceFile` - `host`: `ParseConfigHost` - Instance of ParseConfigHost used to enumerate files in folder. - `base-path`: `string` - A root directory to resolve relative path entries in the config file to. e.g. outDir - `existing-options`: `CompilerOptions | undefined` - `config-file-name`: `string | undefined` - `resolution-stack`: `Path[] | undefined` - `extra-file-extensions`: `readonly FileExtensionInfo[] | undefined` - `extended-config-cache`: `any` - `existing-watch-options`: `WatchOptions | undefined` **Returns:** `ParsedCommandLine`
(parse-json-text file-name source-text)Parse json text into SyntaxTree and return node and parse errors if any
Parameters:
file-name: stringsource-text: stringReturns: JsonSourceFile
Parse json text into SyntaxTree and return node and parse errors if any **Parameters:** - `file-name`: `string` - `source-text`: `string` **Returns:** `JsonSourceFile`
(parse-tree-node)(parse-tree-node node)(parse-tree-node node node-test)Gets the original parse tree node for a node.
Parameters:
node: T | undefined - The original node.node-test: ((node: Node) => node is T) | undefined - A callback used to ensure the correct type of parse tree node is returned.Returns: T | undefined - The original parse tree node if found; otherwise, undefined.
Gets the original parse tree node for a node. **Parameters:** - `node`: `T | undefined` - The original node. - `node-test`: `((node: Node) => node is T) | undefined` - A callback used to ensure the correct type of parse tree node is returned. **Returns:** `T | undefined` - The original parse tree node if found; otherwise, undefined.
(parse-tree-node? node)Gets a value indicating whether a node originated in the parse tree.
Parameters:
node: Node - The node to test.Returns: boolean
Gets a value indicating whether a node originated in the parse tree. **Parameters:** - `node`: `Node` - The node to test. **Returns:** `boolean`
(parsed-command-line-of-config-file config-file-name)(parsed-command-line-of-config-file config-file-name options-to-extend)(parsed-command-line-of-config-file config-file-name options-to-extend host)(parsed-command-line-of-config-file config-file-name
options-to-extend
host
extended-config-cache)(parsed-command-line-of-config-file config-file-name
options-to-extend
host
extended-config-cache
watch-options-to-extend)(parsed-command-line-of-config-file config-file-name
options-to-extend
host
extended-config-cache
watch-options-to-extend
extra-file-extensions)Reads the config file, reports errors if any and exits if the config file cannot be found
Parameters:
config-file-name: stringoptions-to-extend: CompilerOptions | undefinedhost: ParseConfigFileHostextended-config-cache: anywatch-options-to-extend: WatchOptions | undefinedextra-file-extensions: readonly FileExtensionInfo[] | undefinedReturns: ParsedCommandLine | undefined
Reads the config file, reports errors if any and exits if the config file cannot be found **Parameters:** - `config-file-name`: `string` - `options-to-extend`: `CompilerOptions | undefined` - `host`: `ParseConfigFileHost` - `extended-config-cache`: `any` - `watch-options-to-extend`: `WatchOptions | undefined` - `extra-file-extensions`: `readonly FileExtensionInfo[] | undefined` **Returns:** `ParsedCommandLine | undefined`
(part-of-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(partially-emitted-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(plus-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(position-of-line-and-character source-file line character)Parameters:
source-file: SourceFileLikeline: numbercharacter: numberReturns: number
**Parameters:** - `source-file`: `SourceFileLike` - `line`: `number` - `character`: `number` **Returns:** `number`
(postfix-unary-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(pre-emit-diagnostics program)(pre-emit-diagnostics program source-file)(pre-emit-diagnostics program source-file cancellation-token)Parameters:
program: Programsource-file: SourceFile | undefinedcancellation-token: CancellationToken | undefinedReturns: readonly Diagnostic[]
**Parameters:** - `program`: `Program` - `source-file`: `SourceFile | undefined` - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly Diagnostic[]`
(pre-process-file source-text)(pre-process-file source-text read-import-files?)(pre-process-file source-text read-import-files? detect-java-script-imports?)Parameters:
source-text: stringread-import-files?: boolean | undefineddetect-java-script-imports?: boolean | undefinedReturns: PreProcessedFileInfo
**Parameters:** - `source-text`: `string` - `read-import-files?`: `boolean | undefined` - `detect-java-script-imports?`: `boolean | undefined` **Returns:** `PreProcessedFileInfo`
(prefix-unary-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(private-identifier? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-access-chain? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-access-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-access-or-qualified-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-assignment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(property-signature? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(qualified-name? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(question-dot-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(question-or-exclamation-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(question-or-plus-or-minus-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(question-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(read-builder-program compiler-options host)Parameters:
compiler-options: CompilerOptionshost: ReadBuildProgramHostReturns: EmitAndSemanticDiagnosticsBuilderProgram | undefined
**Parameters:** - `compiler-options`: `CompilerOptions` - `host`: `ReadBuildProgramHost` **Returns:** `EmitAndSemanticDiagnosticsBuilderProgram | undefined`
(read-config-file file-name read-file)Read tsconfig.json file
Parameters:
file-name: string - The path to the config fileread-file: (path: string) => string | undefinedReturns: { config?: any; error?: Diagnostic | undefined; }
Read tsconfig.json file
**Parameters:**
- `file-name`: `string` - The path to the config file
- `read-file`: `(path: string) => string | undefined`
**Returns:** `{ config?: any; error?: Diagnostic | undefined; }`(read-json-config-file file-name read-file)Read tsconfig.json file
Parameters:
file-name: string - The path to the config fileread-file: (path: string) => string | undefinedReturns: TsConfigSourceFile
Read tsconfig.json file **Parameters:** - `file-name`: `string` - The path to the config file - `read-file`: `(path: string) => string | undefined` **Returns:** `TsConfigSourceFile`
(readonly-keyword-or-plus-or-minus-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(reduce-each-leading-comment-range text pos cb state initial)Parameters:
text: stringpos: numbercb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => Ustate: Tinitial: UReturns: U | undefined
**Parameters:** - `text`: `string` - `pos`: `number` - `cb`: `(pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U` - `state`: `T` - `initial`: `U` **Returns:** `U | undefined`
(reduce-each-trailing-comment-range text pos cb state initial)Parameters:
text: stringpos: numbercb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => Ustate: Tinitial: UReturns: U | undefined
**Parameters:** - `text`: `string` - `pos`: `number` - `cb`: `(pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U` - `state`: `T` - `initial`: `U` **Returns:** `U | undefined`
(regular-expression-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(remove-emit-helper? node helper)Removes an EmitHelper from a node.
Parameters:
node: Nodehelper: EmitHelperReturns: boolean
Removes an EmitHelper from a node. **Parameters:** - `node`: `Node` - `helper`: `EmitHelper` **Returns:** `boolean`
(resolve-module-name module-name containing-file compiler-options host)(resolve-module-name module-name containing-file compiler-options host cache)(resolve-module-name module-name
containing-file
compiler-options
host
cache
redirected-reference)(resolve-module-name module-name
containing-file
compiler-options
host
cache
redirected-reference
resolution-mode)Parameters:
module-name: stringcontaining-file: stringcompiler-options: CompilerOptionshost: ModuleResolutionHostcache: ModuleResolutionCache | undefinedredirected-reference: ResolvedProjectReference | undefinedresolution-mode: ResolutionModeReturns: ResolvedModuleWithFailedLookupLocations
**Parameters:** - `module-name`: `string` - `containing-file`: `string` - `compiler-options`: `CompilerOptions` - `host`: `ModuleResolutionHost` - `cache`: `ModuleResolutionCache | undefined` - `redirected-reference`: `ResolvedProjectReference | undefined` - `resolution-mode`: `ResolutionMode` **Returns:** `ResolvedModuleWithFailedLookupLocations`
(resolve-module-name-from-cache module-name containing-file cache)(resolve-module-name-from-cache module-name containing-file cache mode)Parameters:
module-name: stringcontaining-file: stringcache: ModuleResolutionCachemode: ResolutionModeReturns: ResolvedModuleWithFailedLookupLocations | undefined
**Parameters:** - `module-name`: `string` - `containing-file`: `string` - `cache`: `ModuleResolutionCache` - `mode`: `ResolutionMode` **Returns:** `ResolvedModuleWithFailedLookupLocations | undefined`
(resolve-project-reference-path ref)Returns the target config filename of a project reference. Note: The file might not exist.
Parameters:
ref: ProjectReferenceReturns: ResolvedConfigFileName
Returns the target config filename of a project reference. Note: The file might not exist. **Parameters:** - `ref`: `ProjectReference` **Returns:** `ResolvedConfigFileName`
(resolve-tripleslash-reference module-name containing-file)Parameters:
module-name: stringcontaining-file: stringReturns: string
**Parameters:** - `module-name`: `string` - `containing-file`: `string` **Returns:** `string`
(resolve-type-reference-directive type-reference-directive-name)(resolve-type-reference-directive type-reference-directive-name containing-file)(resolve-type-reference-directive type-reference-directive-name
containing-file
options)(resolve-type-reference-directive type-reference-directive-name
containing-file
options
host)(resolve-type-reference-directive type-reference-directive-name
containing-file
options
host
redirected-reference)(resolve-type-reference-directive type-reference-directive-name
containing-file
options
host
redirected-reference
cache)(resolve-type-reference-directive type-reference-directive-name
containing-file
options
host
redirected-reference
cache
resolution-mode)Parameters:
type-reference-directive-name: stringcontaining-file: string | undefined - - file that contains type reference directive, can be undefined if containing file is unknown.
This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
is assumed to be the same as root directory of the project.options: CompilerOptionshost: ModuleResolutionHostredirected-reference: ResolvedProjectReference | undefinedcache: TypeReferenceDirectiveResolutionCache | undefinedresolution-mode: ResolutionModeReturns: ResolvedTypeReferenceDirectiveWithFailedLookupLocations
**Parameters:** - `type-reference-directive-name`: `string` - `containing-file`: `string | undefined` - - file that contains type reference directive, can be undefined if containing file is unknown. This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups is assumed to be the same as root directory of the project. - `options`: `CompilerOptions` - `host`: `ModuleResolutionHost` - `redirected-reference`: `ResolvedProjectReference | undefined` - `cache`: `TypeReferenceDirectiveResolutionCache | undefined` - `resolution-mode`: `ResolutionMode` **Returns:** `ResolvedTypeReferenceDirectiveWithFailedLookupLocations`
(rest-parameter? node)Parameters:
node: ParameterDeclaration | JSDocParameterTagReturns: boolean
**Parameters:** - `node`: `ParameterDeclaration | JSDocParameterTag` **Returns:** `boolean`
(rest-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(return-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(satisfies-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(semicolon-class-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(services-version)The version of the language service API
Returns: "0.8"
The version of the language service API **Returns:** `"0.8"`
(set-accessor-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(set-accessor? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(set-comment-range node range)Sets a custom text range to use when emitting comments.
Parameters:
node: Trange: TextRangeReturns: T
Sets a custom text range to use when emitting comments. **Parameters:** - `node`: `T` - `range`: `TextRange` **Returns:** `T`
(set-constant-value node value)Sets the constant value to emit for an expression.
Parameters:
node: AccessExpressionvalue: string | numberReturns: AccessExpression
Sets the constant value to emit for an expression. **Parameters:** - `node`: `AccessExpression` - `value`: `string | number` **Returns:** `AccessExpression`
(set-emit-flags node emit-flags)Sets flags that control emit behavior of a node.
Parameters:
node: Temit-flags: EmitFlagsReturns: T
Sets flags that control emit behavior of a node. **Parameters:** - `node`: `T` - `emit-flags`: `EmitFlags` **Returns:** `T`
(set-original-node node)(set-original-node node original)Parameters:
node: Toriginal: Node | undefinedReturns: T
**Parameters:** - `node`: `T` - `original`: `Node | undefined` **Returns:** `T`
(set-source-map-range node)(set-source-map-range node range)Sets a custom text range to use when emitting source maps.
Parameters:
node: Trange: SourceMapRange | undefinedReturns: T
Sets a custom text range to use when emitting source maps. **Parameters:** - `node`: `T` - `range`: `SourceMapRange | undefined` **Returns:** `T`
(set-synthetic-leading-comments node)(set-synthetic-leading-comments node comments)Parameters:
node: Tcomments: SynthesizedComment[] | undefinedReturns: T
**Parameters:** - `node`: `T` - `comments`: `SynthesizedComment[] | undefined` **Returns:** `T`
(set-synthetic-trailing-comments node)(set-synthetic-trailing-comments node comments)Parameters:
node: Tcomments: SynthesizedComment[] | undefinedReturns: T
**Parameters:** - `node`: `T` - `comments`: `SynthesizedComment[] | undefined` **Returns:** `T`
(set-text-range range)(set-text-range range location)Parameters:
range: Tlocation: TextRange | undefinedReturns: T
**Parameters:** - `range`: `T` - `location`: `TextRange | undefined` **Returns:** `T`
(set-token-source-map-range node token)(set-token-source-map-range node token range)Sets the TextRange to use for source maps for a token of a node.
Parameters:
node: Ttoken: SyntaxKindrange: SourceMapRange | undefinedReturns: T
Sets the TextRange to use for source maps for a token of a node. **Parameters:** - `node`: `T` - `token`: `SyntaxKind` - `range`: `SourceMapRange | undefined` **Returns:** `T`
(shebang text)Optionally, get the shebang
Parameters:
text: stringReturns: string | undefined
Optionally, get the shebang **Parameters:** - `text`: `string` **Returns:** `string | undefined`
(shorthand-property-assignment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(skip-partially-emitted-expressions node)Parameters:
node: NodeReturns: Node
**Parameters:** - `node`: `Node` **Returns:** `Node`
(sort-and-deduplicate-diagnostics diagnostics)Parameters:
diagnostics: readonly T[]Returns: SortedReadonlyArray<T>
**Parameters:** - `diagnostics`: `readonly T[]` **Returns:** `SortedReadonlyArray<T>`
(source-file? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(source-map-range node)Gets a custom text range to use when emitting source maps.
Parameters:
node: NodeReturns: SourceMapRange
Gets a custom text range to use when emitting source maps. **Parameters:** - `node`: `Node` **Returns:** `SourceMapRange`
(spread-assignment? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(spread-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(string-literal-like? node)Parameters:
node: Node | FileReferenceReturns: boolean
**Parameters:** - `node`: `Node | FileReference` **Returns:** `boolean`
(string-literal-or-jsx-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(string-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(string-text-containing-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(supported-code-fixes)Returns: readonly string[]
**Returns:** `readonly string[]`
(switch-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(symbol-name symbol)Parameters:
symbol: SymbolReturns: string
**Parameters:** - `symbol`: `Symbol` **Returns:** `string`
(synthetic-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(synthetic-leading-comments node)Parameters:
node: NodeReturns: SynthesizedComment[] | undefined
**Parameters:** - `node`: `Node` **Returns:** `SynthesizedComment[] | undefined`
(synthetic-trailing-comments node)Parameters:
node: NodeReturns: SynthesizedComment[] | undefined
**Parameters:** - `node`: `Node` **Returns:** `SynthesizedComment[] | undefined`
(tagged-template-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-head? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-literal-token? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-literal-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-literal-type-span? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-literal? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-middle-or-template-tail? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-middle? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-span? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(template-tail? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(text-change-range-is-unchanged? range)Parameters:
range: TextChangeRangeReturns: boolean
**Parameters:** - `range`: `TextChangeRange` **Returns:** `boolean`
(text-change-range-new-span range)Parameters:
range: TextChangeRangeReturns: TextSpan
**Parameters:** - `range`: `TextChangeRange` **Returns:** `TextSpan`
(text-of-js-doc-comment)(text-of-js-doc-comment comment)Gets the text of a jsdoc comment, flattening links to their text.
Parameters:
comment: string | NodeArray<JSDocComment> | undefinedReturns: string | undefined
Gets the text of a jsdoc comment, flattening links to their text. **Parameters:** - `comment`: `string | NodeArray<JSDocComment> | undefined` **Returns:** `string | undefined`
(text-span-contains-position? span position)Parameters:
span: TextSpanposition: numberReturns: boolean
**Parameters:** - `span`: `TextSpan` - `position`: `number` **Returns:** `boolean`
(text-span-contains-text-span? span other)Parameters:
span: TextSpanother: TextSpanReturns: boolean
**Parameters:** - `span`: `TextSpan` - `other`: `TextSpan` **Returns:** `boolean`
(text-span-end span)Parameters:
span: TextSpanReturns: number
**Parameters:** - `span`: `TextSpan` **Returns:** `number`
(text-span-intersection span-1 span-2)Parameters:
span-1: TextSpanspan-2: TextSpanReturns: TextSpan | undefined
**Parameters:** - `span-1`: `TextSpan` - `span-2`: `TextSpan` **Returns:** `TextSpan | undefined`
(text-span-intersects-with-position? span position)Parameters:
span: TextSpanposition: numberReturns: boolean
**Parameters:** - `span`: `TextSpan` - `position`: `number` **Returns:** `boolean`
(text-span-intersects-with-text-span? span other)Parameters:
span: TextSpanother: TextSpanReturns: boolean
**Parameters:** - `span`: `TextSpan` - `other`: `TextSpan` **Returns:** `boolean`
(text-span-intersects-with? span start length)Parameters:
span: TextSpanstart: numberlength: numberReturns: boolean
**Parameters:** - `span`: `TextSpan` - `start`: `number` - `length`: `number` **Returns:** `boolean`
(text-span-is-empty? span)Parameters:
span: TextSpanReturns: boolean
**Parameters:** - `span`: `TextSpan` **Returns:** `boolean`
(text-span-overlap span-1 span-2)Parameters:
span-1: TextSpanspan-2: TextSpanReturns: TextSpan | undefined
**Parameters:** - `span-1`: `TextSpan` - `span-2`: `TextSpan` **Returns:** `TextSpan | undefined`
(text-span-overlaps-with? span other)Parameters:
span: TextSpanother: TextSpanReturns: boolean
**Parameters:** - `span`: `TextSpan` - `other`: `TextSpan` **Returns:** `boolean`
(this-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(throw-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(to-editor-settings options)Parameters:
options: EditorSettings | EditorOptionsReturns: EditorSettings
**Parameters:** - `options`: `EditorSettings | EditorOptions` **Returns:** `EditorSettings`
(token-kind? kind)True if kind 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:
kind: SyntaxKindReturns: boolean
True if kind 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:** - `kind`: `SyntaxKind` **Returns:** `boolean`
(token-source-map-range node token)Gets the TextRange to use for source maps for a token of a node.
Parameters:
node: Nodetoken: SyntaxKindReturns: SourceMapRange | undefined
Gets the TextRange to use for source maps for a token of a node. **Parameters:** - `node`: `Node` - `token`: `SyntaxKind` **Returns:** `SourceMapRange | undefined`
(token-to-string t)Parameters:
t: SyntaxKindReturns: string | undefined
**Parameters:** - `t`: `SyntaxKind` **Returns:** `string | undefined`
(token? n)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:
n: NodeReturns: 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:** - `n`: `Node` **Returns:** `boolean`
(trailing-comment-ranges text pos)Parameters:
text: stringpos: numberReturns: CommentRange[] | undefined
**Parameters:** - `text`: `string` - `pos`: `number` **Returns:** `CommentRange[] | undefined`
(transform source transformers)(transform source transformers compiler-options)Transform one or more nodes using the supplied transformers.
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.compiler-options: CompilerOptions | undefined - Optional compiler options.Returns: TransformationResult<T>
Transform one or more nodes using the supplied transformers. **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. - `compiler-options`: `CompilerOptions | undefined` - Optional compiler options. **Returns:** `TransformationResult<T>`
(transpile input)(transpile input compiler-options)(transpile input compiler-options file-name)(transpile input compiler-options file-name diagnostics)(transpile input compiler-options file-name diagnostics module-name)Parameters:
input: stringcompiler-options: CompilerOptions | undefinedfile-name: string | undefineddiagnostics: Diagnostic[] | undefinedmodule-name: string | undefinedReturns: string
**Parameters:** - `input`: `string` - `compiler-options`: `CompilerOptions | undefined` - `file-name`: `string | undefined` - `diagnostics`: `Diagnostic[] | undefined` - `module-name`: `string | undefined` **Returns:** `string`
(transpile-module input transpile-options)Parameters:
input: stringtranspile-options: TranspileOptionsReturns: TranspileOutput
**Parameters:** - `input`: `string` - `transpile-options`: `TranspileOptions` **Returns:** `TranspileOutput`
(try-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(ts-build-info-emit-output-file-path options)Parameters:
options: CompilerOptionsReturns: string | undefined
**Parameters:** - `options`: `CompilerOptions` **Returns:** `string | undefined`
(tuple-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-alias-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-assertion-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-element? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-literal-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-node? node)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:
node: NodeReturns: boolean
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:** - `node`: `Node` **Returns:** `boolean`
(type-of-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-only-export-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-only-import-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-only-import-or-export-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-operator-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-parameter-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-parameter-owner d)Parameters:
d: DeclarationReturns: Declaration | undefined
**Parameters:** - `d`: `Declaration` **Returns:** `Declaration | undefined`
(type-predicate-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-query-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(type-reference-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(unchanged-text-change-range)Returns: TextChangeRange
**Returns:** `TextChangeRange`
(unescape-leading-underscores identifier)Remove extra underscore from escaped identifier text content.
Parameters:
identifier: __String - The escaped identifier text.Returns: string - The unescaped identifier text.
Remove extra underscore from escaped identifier text content. **Parameters:** - `identifier`: `__String` - The escaped identifier text. **Returns:** `string` - The unescaped identifier text.
(union-type-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(unparsed-node? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(unparsed-prepend? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(unparsed-source? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(unparsed-text-like? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(update-language-service-source-file source-file script-snapshot version)(update-language-service-source-file source-file
script-snapshot
version
text-change-range)(update-language-service-source-file source-file
script-snapshot
version
text-change-range
aggressive-checks?)Parameters:
source-file: SourceFilescript-snapshot: IScriptSnapshotversion: stringtext-change-range: TextChangeRange | undefinedaggressive-checks?: boolean | undefinedReturns: SourceFile
**Parameters:** - `source-file`: `SourceFile` - `script-snapshot`: `IScriptSnapshot` - `version`: `string` - `text-change-range`: `TextChangeRange | undefined` - `aggressive-checks?`: `boolean | undefined` **Returns:** `SourceFile`
(update-source-file source-file new-text text-change-range)(update-source-file source-file new-text text-change-range aggressive-checks?)Parameters:
source-file: SourceFilenew-text: stringtext-change-range: TextChangeRangeaggressive-checks?: boolean | undefinedReturns: SourceFile
**Parameters:** - `source-file`: `SourceFile` - `new-text`: `string` - `text-change-range`: `TextChangeRange` - `aggressive-checks?`: `boolean | undefined` **Returns:** `SourceFile`
(validate-locale-and-set-language locale sys)(validate-locale-and-set-language locale sys errors)Checks to see if the locale is in the appropriate format, and if it is, attempts to set the appropriate language.
Parameters:
locale: stringsys: { getExecutingFilePath(): string; resolvePath(path: string): string; fileExists(fileName: string): boolean; readFile(fileName: string): string | undefined; }errors: Diagnostic[] | undefinedReturns: 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`: `{ getExecutingFilePath(): string; resolvePath(path: string): string; fileExists(fileName: string): boolean; readFile(fileName: string): string | undefined; }`
- `errors`: `Diagnostic[] | undefined`
**Returns:** `void`(variable-declaration-list? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(variable-declaration? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(variable-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(version)The version of the TypeScript compiler release
Returns: string
The version of the TypeScript compiler release **Returns:** `string`
(visit-comma-list-elements elements visitor)(visit-comma-list-elements elements visitor discard-visitor)Visits the elements of a {@link CommaListExpression }.
Parameters:
elements: NodeArray<Expression>visitor: Visitor<Node, Node | undefined> - The visitor to use when visiting expressions whose result will not be discarded at runtime.discard-visitor: Visitor<Node, Node | undefined> | undefined - The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor }.Returns: NodeArray<Expression>
Visits the elements of a {@link CommaListExpression }.
**Parameters:**
- `elements`: `NodeArray<Expression>`
- `visitor`: `Visitor<Node, Node | undefined>` - The visitor to use when visiting expressions whose result will not be discarded at runtime.
- `discard-visitor`: `Visitor<Node, Node | undefined> | undefined` - The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor }.
**Returns:** `NodeArray<Expression>`(visit-each-child)(visit-each-child node)(visit-each-child node visitor)(visit-each-child node visitor context)(visit-each-child node visitor context nodes-visitor)(visit-each-child node visitor context nodes-visitor token-visitor)Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
Parameters:
node: T | undefined - The Node whose children will be visited.visitor: Visitor<Node, Node | undefined> - The callback used to visit each child.context: TransformationContext | undefined - A lexical environment context for the visitor.nodes-visitor: { <TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number | undefined, count?: number | undefined): NodeArray<...> | (TInArray & undefined); <TIn extends Node, TInArray extends Node...token-visitor: Visitor<Node, Node | undefined> | undefinedReturns: T | undefined
Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
**Parameters:**
- `node`: `T | undefined` - The Node whose children will be visited.
- `visitor`: `Visitor<Node, Node | undefined>` - The callback used to visit each child.
- `context`: `TransformationContext | undefined` - A lexical environment context for the visitor.
- `nodes-visitor`: `{ <TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number | undefined, count?: number | undefined): NodeArray<...> | (TInArray & undefined); <TIn extends Node, TInArray extends Node...`
- `token-visitor`: `Visitor<Node, Node | undefined> | undefined`
**Returns:** `T | undefined`(visit-function-body)(visit-function-body node)(visit-function-body node visitor)(visit-function-body node visitor context)Resumes a suspended lexical environment and visits a function body, ending the lexical environment and merging hoisted declarations upon completion. Resumes a suspended lexical environment and visits a concise body, ending the lexical environment and merging hoisted declarations upon completion.
Parameters:
node: ConciseBodyvisitor: Visitor<Node, Node | undefined>context: TransformationContextReturns: ConciseBody
Resumes a suspended lexical environment and visits a function body, ending the lexical environment and merging hoisted declarations upon completion. Resumes a suspended lexical environment and visits a concise body, ending the lexical environment and merging hoisted declarations upon completion. **Parameters:** - `node`: `ConciseBody` - `visitor`: `Visitor<Node, Node | undefined>` - `context`: `TransformationContext` **Returns:** `ConciseBody`
(visit-iteration-body body visitor context)Visits an iteration body, adding any block-scoped variables required by the transformation.
Parameters:
body: Statementvisitor: Visitor<Node, Node | undefined>context: TransformationContextReturns: Statement
Visits an iteration body, adding any block-scoped variables required by the transformation. **Parameters:** - `body`: `Statement` - `visitor`: `Visitor<Node, Node | undefined>` - `context`: `TransformationContext` **Returns:** `Statement`
(visit-lexical-environment statements visitor context)(visit-lexical-environment statements visitor context start)(visit-lexical-environment statements visitor context start ensure-use-strict?)(visit-lexical-environment statements
visitor
context
start
ensure-use-strict?
nodes-visitor)Starts a new lexical environment and visits a statement list, ending the lexical environment and merging hoisted declarations upon completion.
Parameters:
statements: NodeArray<Statement>visitor: Visitor<Node, Node | undefined>context: TransformationContextstart: number | undefinedensure-use-strict?: boolean | undefinednodes-visitor: NodesVisitor | undefinedReturns: NodeArray<Statement>
Starts a new lexical environment and visits a statement list, ending the lexical environment and merging hoisted declarations upon completion. **Parameters:** - `statements`: `NodeArray<Statement>` - `visitor`: `Visitor<Node, Node | undefined>` - `context`: `TransformationContext` - `start`: `number | undefined` - `ensure-use-strict?`: `boolean | undefined` - `nodes-visitor`: `NodesVisitor | undefined` **Returns:** `NodeArray<Statement>`
(visit-node node visitor)(visit-node node visitor test)(visit-node node visitor test lift)Visits a Node using the supplied visitor, possibly returning a new Node in its place.
Node, a test
function must be provided, and that function must be a type predicate.Parameters:
node: TIn - The Node to visit.visitor: Visitor<NonNullable<TIn>, TVisited> - The callback used to visit the Node.test: ((node: Node) => boolean) | undefined - A callback to execute to verify the Node is valid.lift: ((node: readonly Node[]) => Node) | undefined - An optional callback to execute to lift a NodeArray into a valid Node.Returns: Node | (TIn & undefined) | (TVisited & undefined)
Visits a Node using the supplied visitor, possibly returning a new Node in its place. - If the input node is undefined, then the output is undefined. - If the visitor returns undefined, then the output is undefined. - If the output node is not undefined, then it will satisfy the test function. - In order to obtain a return type that is more specific than `Node`, a test function _must_ be provided, and that function must be a type predicate. **Parameters:** - `node`: `TIn` - The Node to visit. - `visitor`: `Visitor<NonNullable<TIn>, TVisited>` - The callback used to visit the Node. - `test`: `((node: Node) => boolean) | undefined` - A callback to execute to verify the Node is valid. - `lift`: `((node: readonly Node[]) => Node) | undefined` - An optional callback to execute to lift a NodeArray into a valid Node. **Returns:** `Node | (TIn & undefined) | (TVisited & undefined)`
(visit-nodes nodes visitor)(visit-nodes nodes visitor test)(visit-nodes nodes visitor test start)(visit-nodes nodes visitor test start count)Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
NodeArray<Node>, a test
function must be provided, and that function must be a type predicate.Parameters:
nodes: TInArray - The NodeArray to visit.visitor: Visitor<TIn, Node | undefined> - The callback used to visit a Node.test: ((node: Node) => boolean) | undefined - A node test to execute for each node.start: number | undefined - An optional value indicating the starting offset at which to start visiting.count: number | undefined - An optional value indicating the maximum number of nodes to visit.Returns: NodeArray<Node> | (TInArray & undefined)
Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. - If the input node array is undefined, the output is undefined. - If the visitor can return undefined, the node it visits in the array will be reused. - If the output node array is not undefined, then its contents will satisfy the test. - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test function _must_ be provided, and that function must be a type predicate. **Parameters:** - `nodes`: `TInArray` - The NodeArray to visit. - `visitor`: `Visitor<TIn, Node | undefined>` - The callback used to visit a Node. - `test`: `((node: Node) => boolean) | undefined` - A node test to execute for each node. - `start`: `number | undefined` - An optional value indicating the starting offset at which to start visiting. - `count`: `number | undefined` - An optional value indicating the maximum number of nodes to visit. **Returns:** `NodeArray<Node> | (TInArray & undefined)`
(visit-parameter-list)(visit-parameter-list nodes)(visit-parameter-list nodes visitor)(visit-parameter-list nodes visitor context)(visit-parameter-list nodes visitor context nodes-visitor)Starts a new lexical environment and visits a parameter list, suspending the lexical environment upon completion.
Parameters:
nodes: NodeArray<ParameterDeclaration> | undefinedvisitor: Visitor<Node, Node | undefined>context: TransformationContextnodes-visitor: NodesVisitor | undefinedReturns: NodeArray<ParameterDeclaration> | undefined
Starts a new lexical environment and visits a parameter list, suspending the lexical environment upon completion. **Parameters:** - `nodes`: `NodeArray<ParameterDeclaration> | undefined` - `visitor`: `Visitor<Node, Node | undefined>` - `context`: `TransformationContext` - `nodes-visitor`: `NodesVisitor | undefined` **Returns:** `NodeArray<ParameterDeclaration> | undefined`
(void-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(walk-up-binding-elements-and-patterns binding)Parameters:
binding: BindingElementReturns: VariableDeclaration | ParameterDeclaration
**Parameters:** - `binding`: `BindingElement` **Returns:** `VariableDeclaration | ParameterDeclaration`
(while-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(white-space-like? ch)Parameters:
ch: numberReturns: boolean
**Parameters:** - `ch`: `number` **Returns:** `boolean`
(white-space-single-line? ch)Does not include line breaks. For that, see isWhiteSpaceLike.
Parameters:
ch: numberReturns: boolean
Does not include line breaks. For that, see isWhiteSpaceLike. **Parameters:** - `ch`: `number` **Returns:** `boolean`
(with-statement? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
(yield-expression? node)Parameters:
node: NodeReturns: boolean
**Parameters:** - `node`: `Node` **Returns:** `boolean`
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |