mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Correct return type for getLocFromIndex
This commit is contained in:
@@ -62,7 +62,9 @@ sourceCode.getNodeByRangeIndex(0);
|
||||
|
||||
sourceCode.isSpaceBetweenTokens(TOKEN, TOKEN);
|
||||
|
||||
sourceCode.getLocFromIndex(0);
|
||||
const loc = sourceCode.getLocFromIndex(0);
|
||||
loc.line; // $ExpectType number
|
||||
loc.column; // $ExpectType number
|
||||
|
||||
sourceCode.getIndexFromLoc({ line: 0, column: 0 });
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -136,7 +136,7 @@ export class SourceCode {
|
||||
|
||||
isSpaceBetweenTokens(first: AST.Token, second: AST.Token): boolean;
|
||||
|
||||
getLocFromIndex(index: number): ESTree.SourceLocation;
|
||||
getLocFromIndex(index: number): ESTree.Position;
|
||||
|
||||
getIndexFromLoc(location: ESTree.Position): number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user