我试图做一个打字稿接口,为cryptocompare coinlist API创建界面(https://www.cryptocompare.com/api/data/coinlist/)typescipt:为cryptocompare coinlist API
我已经尝试过目前这样的:
interface CoinListResponse {
Response: string,
Message: string,
BaseImageUrl: string,
BaseLinkUrl: string,
Type: number,
Data: Array<Coin>
}
现在,这部分作品但Data: Array<Coin>
存在问题,因为Data
不是数组而是对象。你可以在这里看到documenation:https://www.cryptocompare.com/api/#-api-data-coinlist-
这是硬币接口:
export interface Coin {
Id: number,
Url: string,
Name: string,
CoinName: string,
FullName: string,
Algorithm: string,
ProofType: string,
SortOrder: number
}
这可能吗?
非常感谢。
但..数据是否有你正在返回'可观察'因为你是有原因的不处理数组? –
@SurajRao我想用作数组 – DazDylz