Skip to content

PartialKeys

Category
Get Object Keys
Alias
OptionalKeys

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

Usage

ts
import type { PartialKeys } from '@utype/core'

type Prop = {
  name: string;
  age?: number;
  visible?: boolean;
}

// Expect: 'age' | 'visible'
type PartialKeysProp = PartialKeys<Prop>