18 lines
338 B
TypeScript
18 lines
338 B
TypeScript
|
/// <reference path='fourslash.ts' />
|
||
|
|
||
|
//// type K = "foo" | "bar";
|
||
|
//// interface SomeType {
|
||
|
//// a: string;
|
||
|
//// [prop: K]: any;
|
||
|
//// }
|
||
|
|
||
|
verify.codeFix({
|
||
|
description: `Convert 'SomeType' to mapped object type`,
|
||
|
newFileContent: `type K = "foo" | "bar";
|
||
|
type SomeType = {
|
||
|
[prop in K]: any;
|
||
|
} & {
|
||
|
a: string;
|
||
|
};`
|
||
|
})
|