Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 421 Bytes

object-keys.md

File metadata and controls

24 lines (17 loc) · 421 Bytes
category
Get Object Keys

ObjectKeys

Get union type of keys that are object in object type T.

Usage

import type { ObjectKeys } from '@utype/core'

type Props = {
  name: string;
  breakfast: { foods: string[]; };
  dinner: { foods: string[]; };
}

// Expect: 'breakfast' | 'dinner' // [!code highlight]
type ObjectKeysProps = ObjectKeys<Props>