1.2.0 • Published 3 years ago
@wedgekit/types v1.2.0
@wedgekit/types
A set of utility types for use in TypeScript development
Types
- Empty - Sets all properties in a type to be non-permissible. Unlikely to be used outside of
OptionalInGroup. - MakeOptional<T, K> - Makes all listed property keys (K) into optional types while leaving the rest of the type (T)
unaffected. This can be thought of as a selective version of
Partial, or as a variation onOmitthat makes the listed keys optional instead of removing them. - Optional - An alternative way to denote
T | undefinedfor function return types. - OptionalInGroup - Require properties in groups with an all-or-nothing strategy. Example usage: a property
iconColoris useless wheniconNameis not defined, so both props could be wrapped in anOptionalInGroup. - UnwrapPromise - Unwraps the type of the contents of a promise.