Type Alias Maybe<T, K>

Maybe<T, K>: K extends keyof T
    ? T
    : T & {
        [k in K]: undefined
    }

If the property exists, use it, otherwise treat it as a known undefined

Type Parameters

  • T
  • K extends symbol | number | string