TypeScript/tests/cases/fourslash/refactorExtractType28.ts
2019-06-06 10:39:22 -07:00

14 lines
399 B
TypeScript

/// <reference path='fourslash.ts' />
//// type Item<T> = /*a*/T/*b*/ extends (infer P)[] ? P : never;
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Extract type",
actionName: "Extract to type alias",
actionDescription: "Extract to type alias",
newContent: `type /*RENAME*/NewType<T> = T;
type Item<T> = NewType<T> extends (infer P)[] ? P : never;`,
});