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

16 lines
412 B
TypeScript

/// <reference path='fourslash.ts' />
//// const a = 1;
//// type A = (v: string | number) => /*a*/typeof a/*b*/;
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Extract type",
actionName: "Extract to type alias",
actionDescription: "Extract to type alias",
newContent: `const a = 1;
type /*RENAME*/NewType = typeof a;
type A = (v: string | number) => NewType;`,
});