feat(typescript-types): Add OptionalKeysOf<T>
This commit is contained in:
@@ -14,8 +14,16 @@ The types included in this library are categorized by their purpose.
|
||||
| [`IsNever<T>`][] | `true` if `T` is `never`, `false` otherwise (`null`, `undefined`, `any` also yield `false`) |
|
||||
| [`If<Test, TrueBranch, FalseBranch>`][] | Returns `TrueBranch` if `Test` is `true`, `FalseBranch` otherwise[^if_remark]. |
|
||||
|
||||
[^if_remark]: Note the special behavior, if `boolean` is passed as `Test` the return value is a union of both branches, i.e. `TrueBranch | FalseBranch`.
|
||||
[^if_remark]: If `boolean` is passed as `Test` the return value is a union of both branches, i.e. `TrueBranch | FalseBranch`.
|
||||
|
||||
[`IsAny<T>`]: src/is-any.ts
|
||||
[`IsNever<T>`]: src/is-never.ts
|
||||
[`If<Test, TrueBranch, FalseBranch>`]: src/if.ts
|
||||
|
||||
#### Extraction Types
|
||||
|
||||
| Type | Description |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [`OptionalKeysOf<T>`][] | A union of all keys of `T` that are marked as optional. If `T` is a union, a union of the optional keys of all union members of `T` is returned. |
|
||||
|
||||
[`OptionalKeysOf<T>`]: src/optional-keys-of.ts
|
||||
|
||||
Reference in New Issue
Block a user