clean-jsdoc-theme TypeDoc APIv0.0.0

OptionalKeys

OptionalKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>

Source: common.ts:75

Makes specific properties of T optional

Type Parameters

  • T — The base type
  • K extends keyof T — Keys to make optional

Example

CODE
interface User {
  id: string
  name: string
  email: string
}

type CreateUserInput = OptionalKeys<User, 'id'>
// { id?: string; name: string; email: string }