@@ -906,6 +906,34 @@ export interface Node extends ReadonlyTextRange {
906906 // see: https://github.com/microsoft/TypeScript/pull/51682
907907}
908908
909+ /** @internal */
910+ export interface Node {
911+ getSourceFile ( ) : SourceFile ;
912+ getChildCount ( sourceFile ?: SourceFile ) : number ;
913+ getChildAt ( index : number , sourceFile ?: SourceFile ) : Node ;
914+ getChildren ( sourceFile ?: SourceFile ) : Node [ ] ;
915+ /** @internal */
916+ getChildren ( sourceFile ?: SourceFileLike ) : Node [ ] ; // eslint-disable-line @typescript-eslint/unified-signatures
917+ getStart ( sourceFile ?: SourceFile , includeJsDocComment ?: boolean ) : number ;
918+ /** @internal */
919+ getStart ( sourceFile ?: SourceFileLike , includeJsDocComment ?: boolean ) : number ; // eslint-disable-line @typescript-eslint/unified-signatures
920+ getFullStart ( ) : number ;
921+ getEnd ( ) : number ;
922+ getWidth ( sourceFile ?: SourceFileLike ) : number ;
923+ getFullWidth ( ) : number ;
924+ getLeadingTriviaWidth ( sourceFile ?: SourceFile ) : number ;
925+ getFullText ( sourceFile ?: SourceFile ) : string ;
926+ getText ( sourceFile ?: SourceFile ) : string ;
927+ getFirstToken ( sourceFile ?: SourceFile ) : Node | undefined ;
928+ /** @internal */
929+ getFirstToken ( sourceFile ?: SourceFileLike ) : Node | undefined ; // eslint-disable-line @typescript-eslint/unified-signatures
930+ getLastToken ( sourceFile ?: SourceFile ) : Node | undefined ;
931+ /** @internal */
932+ getLastToken ( sourceFile ?: SourceFileLike ) : Node | undefined ; // eslint-disable-line @typescript-eslint/unified-signatures
933+ // See ts.forEachChild for documentation.
934+ forEachChild < T > ( cbNode : ( node : Node ) => T | undefined , cbNodeArray ?: ( nodes : NodeArray < Node > ) => T | undefined ) : T | undefined ;
935+ }
936+
909937export interface JSDocContainer extends Node {
910938 _jsdocContainerBrand : any ;
911939 /** @internal */ jsDoc ?: JSDoc [ ] ; // JSDoc that directly precedes this node
@@ -1683,7 +1711,8 @@ export interface Identifier extends PrimaryExpression, Declaration, JSDocContain
16831711 isInJSDocNamespace ?: boolean ; // if the node is a member in a JSDoc namespace
16841712 /** @internal */ typeArguments ?: NodeArray < TypeNode | TypeParameterDeclaration > ; // Only defined on synthesized nodes. Though not syntactically valid, used in emitting diagnostics, quickinfo, and signature help.
16851713 /** @internal */ jsdocDotPos ?: number ; // Identifier occurs in JSDoc-style generic: Id.<T>
1686- /**@internal */ hasExtendedUnicodeEscape ?: boolean ;
1714+ /** @internal */ hasExtendedUnicodeEscape ?: boolean ;
1715+ /** @internal */ readonly text : string ;
16871716}
16881717
16891718// Transient identifier node (marked by id === -1)
@@ -1780,6 +1809,7 @@ export interface PrivateIdentifier extends PrimaryExpression {
17801809 // avoids gotchas in transforms and utils
17811810 readonly escapedText : __String ;
17821811 /** @internal */ readonly autoGenerate : AutoGenerateInfo | undefined ; // Used for auto-generated identifiers.
1812+ /** @internal */ readonly text : string ;
17831813}
17841814
17851815/** @internal */
@@ -4387,6 +4417,49 @@ export interface SourceFile extends Declaration, LocalsContainer {
43874417 /** @internal */ endFlowNode ?: FlowNode ;
43884418}
43894419
4420+ /** @internal */
4421+ export interface SourceFile {
4422+ /** @internal */ version : string ;
4423+ /** @internal */ scriptSnapshot : IScriptSnapshot | undefined ;
4424+ /** @internal */ nameTable : UnderscoreEscapedMap < number > | undefined ;
4425+
4426+ /** @internal */ getNamedDeclarations ( ) : Map < string , readonly Declaration [ ] > ;
4427+
4428+ getLineAndCharacterOfPosition ( pos : number ) : LineAndCharacter ;
4429+ getLineEndOfPosition ( pos : number ) : number ;
4430+ getLineStarts ( ) : readonly number [ ] ;
4431+ getPositionOfLineAndCharacter ( line : number , character : number ) : number ;
4432+ update ( newText : string , textChangeRange : TextChangeRange ) : SourceFile ;
4433+
4434+ /** @internal */ sourceMapper ?: DocumentPositionMapper ;
4435+ }
4436+
4437+ /**
4438+ * Represents an immutable snapshot of a script at a specified time.Once acquired, the
4439+ * snapshot is observably immutable. i.e. the same calls with the same parameters will return
4440+ * the same values.
4441+ */
4442+ // eslint-disable-next-line @typescript-eslint/naming-convention
4443+ export interface IScriptSnapshot {
4444+ /** Gets a portion of the script snapshot specified by [start, end). */
4445+ getText ( start : number , end : number ) : string ;
4446+
4447+ /** Gets the length of this script snapshot. */
4448+ getLength ( ) : number ;
4449+
4450+ /**
4451+ * Gets the TextChangeRange that describe how the text changed between this text and
4452+ * an older version. This information is used by the incremental parser to determine
4453+ * what sections of the script need to be re-parsed. 'undefined' can be returned if the
4454+ * change range cannot be determined. However, in that case, incremental parsing will
4455+ * not happen and the entire document will be re - parsed.
4456+ */
4457+ getChangeRange ( oldSnapshot : IScriptSnapshot ) : TextChangeRange | undefined ;
4458+
4459+ /** Releases all resources held by this script snapshot */
4460+ dispose ?( ) : void ;
4461+ }
4462+
43904463/** @internal */
43914464export interface ReadonlyPragmaContext {
43924465 languageVersion : ScriptTarget ;
0 commit comments