[{id: FooOperation, display: string}]
定义
tuple
只有一个元素。
尝试:
export const FooMapping: Array<{id: FooOperation; display: string}> = [
{ id: FooOperation.Undefined, display: 'Nothing' },
{ id: FooOperation.A, display: "I'm A" },
{ id: FooOperation.B, display: "I'm B" }
];
或者想想类似的事情:
interface Foo {
id: FooOperation;
display: string;
}
export const FooMapping: Foo[] = [...];