我收到了关于Cannot find name 'Record'的这个错误--我需要为这个类安装一个包吗?
严重性代码描述文件项目行抑制状态错误TS2304 (TS)找不到名称'Record‘。C:\WebProjects\ITF\node_modules\orderedmap\types\index.d.ts C:\WebProjects\ITF\Web (tsconfig或jsconfig项目) 29活动

declare class OrderedMap<T = any> {
private constructor(content: Array<string | T>)
get(key: string): T | undefined
update(key: string, value: T, newKey?: string): OrderedMap<T>
remove(key: string): OrderedMap<T>
addToStart(key: string, value: T): OrderedMap<T>
addToEnd(key: string, value: T): OrderedMap<T>
addBefore(place: string, key: string, value: T): OrderedMap<T>
forEach(fn: (key: string, value: T) => any): void
prepend(map: MapLike<T>): OrderedMap<T>
append(map: MapLike<T>): OrderedMap<T>
subtract(map: MapLike<T>): OrderedMap<T>
readonly size: number
static from<T>(map: MapLike<T>): OrderedMap<T>
}
type MapLike<T = any> = Record<string, T> | OrderedMap<T>
export = OrderedMap发布于 2022-04-28 20:48:34
Record是在2.1中添加的实用程序类型
因此,通过检查您的版本,您可能会考虑更新。
https://stackoverflow.com/questions/72048295
复制相似问题