# Typescript Types A utility types library for Typescript. ### Types The types included in this library are categorized by their purpose. #### Test Types | Type | Description | | --------------------------------------- | --------------------------------------------------------------------------------------------------------- | | [`IsAny`][] | `true` if `T` is `any`, `false` otherwise (`null`, `undefined` also yield `false`) | | [`IsNever`][] | `true` if `T` is `never`, `false` otherwise (`null`, `undefined`, `any` also yield `false`) | | [`If`][] | Returns `TrueBranch` if `Test` is `true`, `FalseBranch` otherwise[^if_remark]. | | [`IsKeyOf`][] | `true` if `K` is a key of `T`, `false` otherwise. If `T` is `any`, any `K` but `never` will yield `true`. | | [`IsEmptyString`][] | `true` if `S` is the empty string `''`, `false` otherwise.[^is-empty-string_remark] | [^if_remark]: If `boolean` is passed as `Test` the return value is a union of both branches, i.e. `TrueBranch | FalseBranch`. [^is-empty-string_remark]: If `T` is `any` will yield `true`, as it is taken to be `any` string. [`IsAny`]: src/is-any.ts [`IsNever`]: src/is-never.ts [`If`]: src/if.ts #### Extraction Types | Type | Description | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`OptionalKeysOf`][] | 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[^optional-keys-of_remark]. | [^optional-keys-of_remark]: If `T` is `any`, it returns a union of string and number 'string | number'. [`OptionalKeysOf`]: src/optional-keys-of.ts #### Conversion Types | Type | Description | | --------------------------------- | ------------------------------------------------------------------ | | [`KeyPath`][] | Converts a `Separator` separated string into a tuple of its parts. | #### Combination Types | Type | Description | | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | [`Assign`][] | Return a type with the structure of `Shape` and value types from `Obj` or `Default` for missing optional keys in `Obj`. | [`Assign`]: src/assign.ts