Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program
Deprecated, please use UpdateExpression
Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute.
Branded string for keeping track of when we've turned an ambiguous path specified like "./blah" to an absolute path to an actual tsconfig file, e.g. "/root/blah/tsconfig.json"
SymbolTable based on ES6 Map interface.
A function that transforms a node.
A function that is used to initialize and return a Transformer
callback, which in turn
will be used to transform one or more nodes.
A function that accepts and possibly transforms a node.
This represents a string whose leading underscore have been escaped by adding extra leading underscores. The shape of this brand is rather unique compared to others we've used. Instead of just an intersection of a string and an object, it is that union-ed with an intersection of void and an object. This makes it wholly incompatible with a normal string (which is good, it cannot be misused on assignment or on usage), while still being comparable with a normal string via === (also good) and castable from a string.
The version of the language service API
The version of the TypeScript compiler release
Adds an EmitHelper to a node.
Add EmitHelpers to a node.
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.
Convert the json syntax tree into the json value
Creates a builder thats just abstraction over program and can be used with watch
Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
The classifier is used for syntactic highlighting in editors via the TSServer
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
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.
The options for creating a 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.
A set of root files.
The compiler options which should be used.
The host interacts with the underlying file system.
Reuses an old program structure.
error during config file parsing
A 'Program' object.
Create the builder to manage semantic diagnostics and cache them
Create an external source map source file reference
Create the watch compiler host for either configFile or fileNames and its options
Creates the watch from the host for root files and compiler options
Creates the watch from the host for config file
Clears any EmitNode
entries from parse-tree nodes.
A source file.
Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like 'proto'
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.
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.
a given node to visit its children
a callback to be invoked for all child nodes
a callback to be invoked for embedded array
Gets all JSDoc tags of a specified kind
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.
Gets the constant value to emit for an expression representing an enum.
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.
Gets the effective type parameters. If the node was parsed in a
JavaScript file, gets the type parameters from the @template
tag from JSDoc.
Gets the EmitHelpers of a node.
Gets the JSDoc augments tag for the node if present
Gets the JSDoc class tag for the node if present
Gets the JSDoc deprecated tag for the node if present
Gets the JSDoc enum tag for the node if present
Gets the JSDoc implements tags for the node if present
Gets the JSDoc parameter tags for the node if present.
Gets the JSDoc private tag for the node if present
Gets the JSDoc protected tag for the node if present
Gets the JSDoc public tag for the node if present
Gets the JSDoc protected tag for the node if present
Gets the JSDoc return tag for the node if present
Gets the JSDoc template tag for the node if present
Gets the JSDoc this tag for the node if present
Gets the JSDoc type parameter tags for the node if present.
Gets the JSDoc type tag for the node if present and valid
Creates a shallow, memberwise clone of a node for mutation with its pos
, end
, and parent
set.
NOTE: It is unsafe to change any properties of a Node
that relate to its AST children, as those changes won't be
captured with respect to transformations.
Gets the original parse tree node for a node.
The original node.
The original parse tree node if found; otherwise, undefined.
Gets the original parse tree node for a node.
The original node.
A callback used to ensure the correct type of parse tree node is returned.
The original parse tree node if found; otherwise, undefined.
Reads the config file, reports errors if any and exits if the config file cannot be found
Optionally, get the shebang
Gets a custom text range to use when emitting source maps.
Gets the TextRange to use for source maps for a token of a node.
Return true if the node has JSDoc parameter tags.
True if has initializer node attached to it.
True if node is of a kind that may contain comment text.
Gets a value indicating whether a node originated in the parse tree.
The node to test.
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.
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.
Does not include line breaks. For that, see isWhiteSpaceLike.
Moves matching emit helpers from a source node to a target node.
Parse the text of the tsconfig.json file
The path to the config file
The text of the config file
Parse the contents of a config file (tsconfig.json).
The contents of the config file to parse
Instance of ParseConfigHost used to enumerate files in folder.
A root directory to resolve relative path entries in the config file to. e.g. outDir
Parse the contents of a config file (tsconfig.json).
Instance of ParseConfigHost used to enumerate files in folder.
A root directory to resolve relative path entries in the config file to. e.g. outDir
Parse json text into SyntaxTree and return node and parse errors if any
Read tsconfig.json file
The path to the config file
Read tsconfig.json file
The path to the config file
Removes an EmitHelper from a node.
Returns the target config filename of a project reference. Note: The file might not exist.
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.
Sets the constant value to emit for an expression.
Sets a custom text range to use when emitting source maps.
Sets the TextRange to use for source maps for a token of a node.
Transform one or more nodes using the supplied transformers.
A single Node
or an array of Node
objects.
An array of TransformerFactory
callbacks used to process the transformation.
Optional compiler options.
Remove extra underscore from escaped identifier text content.
The escaped identifier text.
The unescaped identifier text.
Checks to see if the locale is in the appropriate format, and if it is, attempts to set the appropriate language.
Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
The Node whose children will be visited.
The callback used to visit each child.
A lexical environment context for the visitor.
Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
The Node whose children will be visited.
The callback used to visit each child.
A lexical environment context for the visitor.
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 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.
Visits an iteration body, adding any block-scoped variables required by the transformation.
Starts a new lexical environment and visits a statement list, ending the lexical environment and merging hoisted declarations upon completion.
Visits a Node using the supplied visitor, possibly returning a new Node in its place.
The Node to visit.
The callback used to visit the Node.
A callback to execute to verify the Node is valid.
An optional callback to execute to lift a NodeArray into a valid Node.
Visits a Node using the supplied visitor, possibly returning a new Node in its place.
The Node to visit.
The callback used to visit the Node.
A callback to execute to verify the Node is valid.
An optional callback to execute to lift a NodeArray into a valid Node.
Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
The NodeArray to visit.
The callback used to visit a Node.
A node test to execute for each node.
An optional value indicating the starting offset at which to start visiting.
An optional value indicating the maximum number of nodes to visit.
Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
The NodeArray to visit.
The callback used to visit a Node.
A node test to execute for each node.
An optional value indicating the starting offset at which to start visiting.
An optional value indicating the maximum number of nodes to visit.
Starts a new lexical environment and visits a parameter list, suspending the lexical environment upon completion.
Generated using TypeDoc
Use
AssertsKeyword
instead.