Extracts keys from a record R that are not explicitly marked as optional using the ? modifier. It calculates this by taking all keys of R and excluding the optional keys identified by OptionalKeys<R>.
R
?
OptionalKeys<R>
The record type.
A union of keys that are required (not optional) in R.
type K = RequiredKeys<{ a?: 0; // optional b?: 0 | undefined; // optional c?: undefined; // optional d: 0; // required e: undefined; // required, value is undefined f: 0 | undefined; // required, value includes undefined}>; // 'd' | 'e' | 'f' Copy
type K = RequiredKeys<{ a?: 0; // optional b?: 0 | undefined; // optional c?: undefined; // optional d: 0; // required e: undefined; // required, value is undefined f: 0 | undefined; // required, value includes undefined}>; // 'd' | 'e' | 'f'
Extracts keys from a record
Rthat are not explicitly marked as optional using the?modifier. It calculates this by taking all keys ofRand excluding the optional keys identified byOptionalKeys<R>.