diff --git a/baselines/ts3.4/test.d.ts b/baselines/ts3.4/test.d.ts index 670c981..cd39cf9 100644 --- a/baselines/ts3.4/test.d.ts +++ b/baselines/ts3.4/test.d.ts @@ -27,6 +27,9 @@ export class G { export class H extends G { private "H.#private"; } +export interface I extends Pick> { + version: number; +} declare function guardIsString(val: any): val is string; declare function assertIsString(val: any, msg?: string): void; declare function assert(val: any, msg?: string): void; diff --git a/index.js b/index.js index 797a426..98dc0bf 100644 --- a/index.js +++ b/index.js @@ -136,8 +136,11 @@ function doTransform(checker, k) { return ts.createExportDeclaration(n.decorators, n.modifiers, n.exportClause, n.moduleSpecifier); } else if (ts.isImportClause(n) && n.isTypeOnly) { return ts.createImportClause(n.name, n.namedBindings); - } else if (ts.isTypeReferenceNode(n) && ts.isIdentifier(n.typeName) && n.typeName.escapedText === "Omit") { - const symbol = checker.getSymbolAtLocation(n.typeName); + } else if ( + (ts.isTypeReferenceNode(n) && ts.isIdentifier(n.typeName) && n.typeName.escapedText === "Omit") || + (ts.isExpressionWithTypeArguments(n) && ts.isIdentifier(n.expression) && n.expression.escapedText === "Omit") + ) { + const symbol = checker.getSymbolAtLocation(ts.isTypeReferenceNode(n) ? n.typeName : n.expression); const typeArguments = n.typeArguments; if ( diff --git a/test/test.d.ts b/test/test.d.ts index a88245a..0b57aa1 100644 --- a/test/test.d.ts +++ b/test/test.d.ts @@ -32,6 +32,9 @@ export class G { export class H extends G { #private } +export interface I extends Omit { + version: number; +} declare function guardIsString(val: any): val is string; declare function assertIsString(val: any, msg?: string): asserts val is string; declare function assert(val: any, msg?: string): asserts val;