@@ -1256,8 +1256,10 @@ namespace ts {
1256
1256
* Finds the rightmost token satisfying `token.end <= position`,
1257
1257
* excluding `JsxText` tokens containing only whitespace.
1258
1258
*/
1259
- export function findPrecedingToken ( position : number , sourceFile : SourceFile , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined {
1260
- const result = find ( startNode || sourceFile ) ;
1259
+ export function findPrecedingToken ( position : number , sourceFile : SourceFileLike , startNode : Node , excludeJsdoc ?: boolean ) : Node | undefined ;
1260
+ export function findPrecedingToken ( position : number , sourceFile : SourceFile , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined ;
1261
+ export function findPrecedingToken ( position : number , sourceFile : SourceFileLike , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined {
1262
+ const result = find ( ( startNode || sourceFile ) as Node ) ;
1261
1263
Debug . assert ( ! ( result && isWhiteSpaceOnlyJsxText ( result ) ) ) ;
1262
1264
return result ;
1263
1265
@@ -1322,7 +1324,7 @@ namespace ts {
1322
1324
return isToken ( n ) && ! isWhiteSpaceOnlyJsxText ( n ) ;
1323
1325
}
1324
1326
1325
- function findRightmostToken ( n : Node , sourceFile : SourceFile ) : Node | undefined {
1327
+ function findRightmostToken ( n : Node , sourceFile : SourceFileLike ) : Node | undefined {
1326
1328
if ( isNonWhitespaceToken ( n ) ) {
1327
1329
return n ;
1328
1330
}
@@ -1339,7 +1341,7 @@ namespace ts {
1339
1341
/**
1340
1342
* Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens.
1341
1343
*/
1342
- function findRightmostChildNodeWithTokens ( children : Node [ ] , exclusiveStartPosition : number , sourceFile : SourceFile , parentKind : SyntaxKind ) : Node | undefined {
1344
+ function findRightmostChildNodeWithTokens ( children : Node [ ] , exclusiveStartPosition : number , sourceFile : SourceFileLike , parentKind : SyntaxKind ) : Node | undefined {
1343
1345
for ( let i = exclusiveStartPosition - 1 ; i >= 0 ; i -- ) {
1344
1346
const child = children [ i ] ;
1345
1347
0 commit comments