Generate types for TSImportType
This commit is contained in:
parent
4c2f8d9337
commit
28b70e5910
@ -939,6 +939,9 @@ export function assertTSModuleDeclaration(
|
||||
export function assertTSModuleBlock(node: Object, opts?: Object = {}): void {
|
||||
assert("TSModuleBlock", node, opts);
|
||||
}
|
||||
export function assertTSImportType(node: Object, opts?: Object = {}): void {
|
||||
assert("TSImportType", node, opts);
|
||||
}
|
||||
export function assertTSImportEqualsDeclaration(
|
||||
node: Object,
|
||||
opts?: Object = {},
|
||||
|
||||
@ -914,6 +914,11 @@ export function TSModuleBlock(...args: Array<any>): Object {
|
||||
}
|
||||
export { TSModuleBlock as tsModuleBlock };
|
||||
export { TSModuleBlock as tSModuleBlock };
|
||||
export function TSImportType(...args: Array<any>): Object {
|
||||
return builder("TSImportType", ...args);
|
||||
}
|
||||
export { TSImportType as tsImportType };
|
||||
export { TSImportType as tSImportType };
|
||||
export function TSImportEqualsDeclaration(...args: Array<any>): Object {
|
||||
return builder("TSImportEqualsDeclaration", ...args);
|
||||
}
|
||||
|
||||
@ -3031,6 +3031,20 @@ export function isTSModuleBlock(node: Object, opts?: Object): boolean {
|
||||
|
||||
return false;
|
||||
}
|
||||
export function isTSImportType(node: Object, opts?: Object): boolean {
|
||||
if (!node) return false;
|
||||
|
||||
const nodeType = node.type;
|
||||
if (nodeType === "TSImportType") {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
} else {
|
||||
return shallowEqual(node, opts);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
export function isTSImportEqualsDeclaration(
|
||||
node: Object,
|
||||
opts?: Object,
|
||||
@ -4254,7 +4268,8 @@ export function isTSType(node: Object, opts?: Object): boolean {
|
||||
"TSIndexedAccessType" === nodeType ||
|
||||
"TSMappedType" === nodeType ||
|
||||
"TSLiteralType" === nodeType ||
|
||||
"TSExpressionWithTypeArguments" === nodeType
|
||||
"TSExpressionWithTypeArguments" === nodeType ||
|
||||
"TSImportType" === nodeType
|
||||
) {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user