【发布时间】:2021-11-07 23:11:04
【问题描述】:
我正在尝试为一个对象创建一个类型,我在 javascript 中使用 console.log 记录了该类型。我访问了我的控制台来查看这个对象的内容,这就是我得到的
{
SomeAssets: [{id:"SomeArbitaryIdHere"}]
description: "SomeDescription here"
id: "SomeID"
SomeRef: "SomeProdRef"
}
我将如何创建这种类型,这是我尝试但不确定的方法
export type = myObjectType
{
someAssets: Asset;
description: string;
id: string;
someRef: string;
}
export type = Asset
{
someArray: string[];
}
这是正确的吗?
【问题讨论】:
标签: javascript json typescript