Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 530 Bytes

File metadata and controls

25 lines (15 loc) · 530 Bytes

Home > types-kit > MapEntry

MapEntry type

return the type of that map's entry.

Signature:

export type MapEntry<T extends ReadonlyMap<unknown, unknown>> =
  T extends ReadonlyMap<infer K, infer V> ? [K, V] : never

Example

type Foo = Map<number, string>

// Expect: [number, string]
type EntryType = MapEntry<Foo>