Type Alias ConditionalProperty<K, C, O>

ConditionalProperty<K, C, O>: [C] extends [never]
    ? Record<K, never> | Partial<Record<K, Record<PropertyKey, never>>>
    : Record<K, O>

Return a type with required property K of type O if C is not never, otherwise return a type where K is optional or accepts an empty object.

Type Parameters

  • K extends PropertyKey

    The property key.

  • C

    The condition to check.

  • O extends object

    The type of the property.