https://github.com/alloc/types
Common types for TypeScript
https://github.com/alloc/types
typescript
Last synced: 2 months ago
JSON representation
Common types for TypeScript
- Host: GitHub
- URL: https://github.com/alloc/types
- Owner: alloc
- License: mit
- Created: 2019-12-02T19:23:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-11T20:09:29.000Z (about 3 years ago)
- Last Synced: 2025-03-24T21:02:31.228Z (11 months ago)
- Topics: typescript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @alloc/types
Common types for TypeScript
```ts
import { Lookup } from '@alloc/types'
import { ElementType } from '@alloc/types/react'
```
### Basic
- `Solve` for solving generic types
- `Remap` to simplify `&` out of an object type
- `Pick` the same as built-in `Pick` but wrapped with `Solve`
- `Overwrite` for merging two object types (where `U` takes precedence)
- `MergeUnknown` for merging two object types (where `T` takes precedence)
- `MergeDefaults` for making `T` properties optional if they exist in `U`
### React
- `ElementType
` as a workaround for [#34237](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34237)
- `ComponentPropsWithRef` which uses `ElementType`