Skip to content

RequiredKeys

Category
Get Object Keys

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

Usage

ts
import type { 
RequiredKeys
} from '@utype/core'
type
Props
= {
name
: string;
age
: number;
visible
?: boolean;
} // Expect: 'name' | 'age' type
RequiredKeysProps
=
RequiredKeys
<
Props
>