hotypes
Higher-order types for TypeScript in the real world.
Motivation
TypeScripts type system is Turing-complete.
This means that if you don't follow the real-world use cases to create higher-order types,
you will create a lot of useless new macros.
Some people, when confronted with a type problem, think "I know, I'll use advanced types." Now they have two type problems.
This means that higher-order types are difficult,
so we should not further complicate or mystify them.
The difference with justypes
hotypes are more like verbs or operators.
Install
npm install --save hotypes
yarn add hotypes
API
It is highly recommended to read test cases to make sure you understand what types exactly do.
- Equals
- FunctionKeys
- Head
- KeysByType
- KeysExcludeByType
- KeysExcludeExtendType
- KeysExtendType
- Last
- MapNullablePropsToOptionalNullable
- MapNullablePropsToOptional
- MapPropsByKeyToNonOptional
- MapPropsByKeyToOptional
- MapPropsByType
- MapPropsExtendType
- MapPropsToNonNullable
- NonNullableKeys
- NullableKeys
- OmitPropsByType
- OmitPropsExtendType
- OptionalKeys
- PickNonNever
- ReplacePropsByType
- ReplaceType
- ReturnTypeOfConstructor
- Tail
- WithDefault