An open API service indexing awesome lists of open source software.

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

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`