Not addressing the question mark syntax, my inquiry pertains to the usage of -?
in scenarios such as the following:
type Required<T> =
T extends object
? { [P in keyof T]-?: NonNullable<T[P]>; } // <---------- "-?" here
: T;
Referenced from a 2018 GitHub comment, this particular syntax seems absent from TypeScript's guide on advanced types and utility types.
The usage of -?
displayed above successfully compiles in TypeScript 3.8 and serves as the opposite of ?
, essentially requiring the key. Is it similar to Required
? If not, what is the specific name for this syntax and where can one find further information about it?