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 typeKextendskeyof 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 }