# @alloc/types

> Common types for TypeScript

Latest version **2.3.0** (published 2022-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alloc/types
pnpm add @alloc/types
yarn add @alloc/types
bun add @alloc/types
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2022-11-11 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aleclarson |

## Links

- npm: https://www.npmjs.com/package/@alloc/types
- npm.io page: https://npm.io/package/@alloc/types

## Recent versions

- 2.3.0 (latest) — 2022-11-11
- 2.2.3 — 2022-11-11
- 2.2.2 — 2022-09-09
- 2.2.1 — 2022-09-04
- 2.2.0 — 2022-08-11
- 2.1.0 — 2021-04-05
- 2.0.0 — 2021-03-21
- 1.3.0 — 2020-06-22
- 1.2.6 — 2020-05-31
- 1.2.5 — 2020-05-06
- 1.2.4 — 2020-05-02
- 1.2.3 — 2020-03-25
- 1.2.2 — 2020-03-24
- 1.2.1 — 2020-03-24
- 1.2.0 — 2020-03-23
- … 2 more at https://npm.io/package/@alloc/types/versions

## README

# @alloc/types

Common types for TypeScript

```ts
import { Lookup } from '@alloc/types'
import { ElementType } from '@alloc/types/react'
```

### Basic

- `Solve<T>` for solving generic types

- `Remap<T>` to simplify `&` out of an object type

- `Pick<T, K>` the same as built-in `Pick` but wrapped with `Solve`

- `Overwrite<T, U>` for merging two object types (where `U` takes precedence)

- `MergeUnknown<T, U>` for merging two object types (where `T` takes precedence)

- `MergeDefaults<T, U>` for making `T` properties optional if they exist in `U`

### React

- `ElementType<P>` as a workaround for [#34237](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34237)

- `ComponentPropsWithRef<T>` which uses `ElementType`

---
_Source: https://npm.io/package/@alloc/types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
