Type alias PartialRequired<T, Required>

PartialRequired<T, Required>: {
    [key in keyof T]?: T[key]
} & {
    [key in Required]: T[key]
}

If a key is in both objects passed to this type, it will be required in the resulting type.

Type Parameters

  • T

  • Required extends keyof T

Example

// Will equal { foo: string }
PartialRequired<{ foo: string, bar: number }, { foo: string}>

Generated using TypeDoc