RequiredNonOptional<T>:T extends object ? { [P in keyof T]-?: NonOptional<T[P]> } : T
Converts a type T that may have optional properties into a type T with only required
properties (e.g. undefined values are not allowed). Explicit nulls in value unions
will still be possible. This is similar to the Required builtin mapped type, but also
subtracts undefined from value union types as well as the optional property declaration.
Converts a type
T
that may have optional properties into a typeT
with only required properties (e.g.undefined
values are not allowed). Explicitnull
s in value unions will still be possible. This is similar to theRequired
builtin mapped type, but also subtractsundefined
from value union types as well as the optional property declaration.