Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental-utils): moved types eslint-plugin util to experimen…
…tal-utils package
- Loading branch information
1 parent
a2f1dfb
commit 5ece2d9
Showing
5 changed files
with
75 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'typescript'; | ||
|
||
declare module 'typescript' { | ||
interface TypeChecker { | ||
// internal TS APIs | ||
|
||
/** | ||
* @returns `true` if the given type is an array type: | ||
* - `Array<foo>` | ||
* - `ReadonlyArray<foo>` | ||
* - `foo[]` | ||
* - `readonly foo[]` | ||
*/ | ||
isArrayType(type: Type): type is TypeReference; | ||
/** | ||
* @returns `true` if the given type is a tuple type: | ||
* - `[foo]` | ||
* - `readonly [foo]` | ||
*/ | ||
isTupleType(type: Type): type is TupleTypeReference; | ||
/** | ||
* Return the type of the given property in the given type, or undefined if no such property exists | ||
*/ | ||
getTypeOfPropertyOfType(type: Type, propertyName: string): Type | undefined; | ||
} | ||
|
||
interface Type { | ||
/** | ||
* If the type is `any`, and this is set to "error", then TS was unable to resolve the type | ||
*/ | ||
intrinsicName?: string; | ||
} | ||
} |