Skip to content

Type Alias: TypedMap<T, Key, Value>

TypedMap<T, Key, Value> = Omit<Map<Key, Value>, "get" | "set"> & object

Defined in: core/dist/index.d.ts:1455

A type-safe extension of the built-in Map.

While a standard Map<K, V> returns a union V | undefined for any key, StrictMap<T> uses the property types of T to provide specific types for known keys when using .get().

Type Declaration

get()

get<K>(key): T[K] | undefined

Type Parameters

K

K extends string | number | symbol

Parameters

key

K

Returns

T[K] | undefined

set()

set<K>(key, value): Map<Key, Value>

Type Parameters

K

K extends string | number | symbol

Parameters

key

K

value

T[K]

Returns

Map<Key, Value>

Type Parameters

T

T extends object

The object structure providing the key-value types.

Key

Key extends keyof T = keyof T

Value

Value = T[Key]