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

16 lines
468 B
TypeScript

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