@@ -906,6 +906,34 @@ export interface Node extends ReadonlyTextRange {
906
906
// see: https://github.com/microsoft/TypeScript/pull/51682
907
907
}
908
908
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
+
909
937
export interface JSDocContainer extends Node {
910
938
_jsdocContainerBrand : any ;
911
939
/** @internal */ jsDoc ?: JSDoc [ ] ; // JSDoc that directly precedes this node
@@ -1683,7 +1711,8 @@ export interface Identifier extends PrimaryExpression, Declaration, JSDocContain
1683
1711
isInJSDocNamespace ?: boolean ; // if the node is a member in a JSDoc namespace
1684
1712
/** @internal */ typeArguments ?: NodeArray < TypeNode | TypeParameterDeclaration > ; // Only defined on synthesized nodes. Though not syntactically valid, used in emitting diagnostics, quickinfo, and signature help.
1685
1713
/** @internal */ jsdocDotPos ?: number ; // Identifier occurs in JSDoc-style generic: Id.<T>
1686
- /**@internal */ hasExtendedUnicodeEscape ?: boolean ;
1714
+ /** @internal */ hasExtendedUnicodeEscape ?: boolean ;
1715
+ /** @internal */ readonly text : string ;
1687
1716
}
1688
1717
1689
1718
// Transient identifier node (marked by id === -1)
@@ -1780,6 +1809,7 @@ export interface PrivateIdentifier extends PrimaryExpression {
1780
1809
// avoids gotchas in transforms and utils
1781
1810
readonly escapedText : __String ;
1782
1811
/** @internal */ readonly autoGenerate : AutoGenerateInfo | undefined ; // Used for auto-generated identifiers.
1812
+ /** @internal */ readonly text : string ;
1783
1813
}
1784
1814
1785
1815
/** @internal */
@@ -4387,6 +4417,49 @@ export interface SourceFile extends Declaration, LocalsContainer {
4387
4417
/** @internal */ endFlowNode ?: FlowNode ;
4388
4418
}
4389
4419
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
+
4390
4463
/** @internal */
4391
4464
export interface ReadonlyPragmaContext {
4392
4465
languageVersion : ScriptTarget ;
0 commit comments