![](/img/trans.png)
[英]Type “only refers to a type, but is being used as a value here” when exporting
[英]'MapEditServiceConfig' only refers to a type, but is being used as a value here
不知道為什么這個錯誤提示MapEditServiceConfig,說MapEditServiceConfig引用了一個類型,我們也理解為MapEditServiceConfig {},因為MapEditServiceConfig是一個接口,這個括號怎么說?
export interface MapEditServiceConfig extends AppCredentialsConfig {
readonly "moderation.authServiceId": string;
readonly "maphub.mc.endpoint": string;
}
export interface AppConfig
extends MapDataServiceConfig,
GeocoderConfig,
LoginServiceConfig,
ScbeServiceConfig,
MapJobServiceConfig,
TaskProviderServiceConfig,
YourXYZSpaceServiceConfig {
"map.defaultLocation":MapDataModels.MapLocation;
"app.imageBasePath": string;
},
MapEditServiceConfig {} // Getting the refers to a //type , but use as a value here
在AppConfig
擴展的接口列表中有以下部分:
{
"map.defaultLocation":MapDataModels.MapLocation;
"app.imageBasePath": string;
},
由編譯器解釋為AppConfig
接口的實際定義。
逗號是語法錯誤,編譯器需要聲明。
之后是一個新語句MapEditServiceConfig
,它由編譯器解釋為文字值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.