Type alias PartialRecord<K, T>

PartialRecord<K, T>: {
    [P in K]?: T
}

Partial record type with all keys optional

Type Parameters

  • K extends keyof any

  • T

Example

type T = PartialRecord<'a' | 'b', number>
// T = {a?: number, b?: number}