TypeScript/tests/cases/fourslash/refactorConvertExport_ambientModule.ts
Andy 806a661be3
Add refactor to convert named to default export and back (#24878)
* Add refactor to convert named to default export and back

* Support ambient module

* Handle declaration kinds that can't be default-exported

* Update API (#24966)
2018-06-25 10:34:24 -07:00

26 lines
554 B
TypeScript

/// <reference path='fourslash.ts' />
// @Filename: /foo.ts
////declare module "foo" {
//// /*a*/export default function foo(): void;/*b*/
////}
// @Filename: /b.ts
////import foo from "foo";
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Convert export",
actionName: "Convert default export to named export",
actionDescription: "Convert default export to named export",
newContent: {
"/foo.ts":
`declare module "foo" {
export function foo(): void;
}`,
"/b.ts":
`import { foo } from "foo";`,
},
});