Type alias EntriesToKeys<T>

EntriesToKeys<T>: T[number][0]

takes an array of 2-tuples (entries) of the form [key: string, value: any], and returns a union of the first element of each of the tuples (keys). it practically functions like the elements of Object.keys.

Type Parameters

  • T extends [string, any][]

Example

type MyKeys = EntriesToKeys<[["name", "john"], ["age", 30], ["title", string]]>
// type MyKeys === ("name" | "age" | "title")

Generated using TypeDoc