1
私はタイスクリプトを学んでおり、それについては非常に新しいです。現時点では、私は少し早く理解できるように、いくつかのプロジェクトのコードを読もうとしています。オプションとは何ですか?typescriptの[x:string]は何ですか?
私はこれが非常に基本的なコンセプトだと確信しています。私はC#開発者ですから、私はいつも何らかのC#の方法でコードを理解しようとしています。
export type NLC = string; ---so NLC type is string
export type CRS = string; ---so CRS type is string
export class Location {
constructor(
public readonly nlc: NLC, ----we have a property nlc with type NLC (basically string)
public readonly crs: Option<CRS>, ---what is Option, is it an optional property?
public readonly clusters: ClusterMap, -- property with type ClusterMap
public readonly allStations: NLC[]
) { }
}
**////can someone tell me what property this ClusterMap has?**
export type ClusterMap = {
[nlc: string]: NLC; -- what is [nlc: string]?
}
多くのおかげ