blob: 7985ccd986389dc8c96e12619c56351d3f66b9dc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# Bun TypeScript type definitions
<p align="center">
<a href="https://bun.sh"><img src="https://bun.sh/logo@2x.png" alt="Logo"></a>
</p>
These are the type definitions for Bun's JavaScript runtime APIs.
# Installation
Install the `bun-types` npm package:
```bash
# yarn/npm/pnpm work too, "bun-types" is an ordinary npm package
bun add bun-types
```
# Usage
Add this to your `tsconfig.json` or `jsconfig.json`:
```jsonc
{
"compilerOptions": {
"lib": ["esnext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
// "bun-types" is the important part
"types": ["bun-types"]
}
}
```
# Contributing
`bun-types` is generated via [./bundle.ts](./scripts/bundle.ts).
## Adding a new file
1. Add it to [./index.d.ts](./index.d.ts)
## How to generate types.d.ts
[`./bundle.ts`](./bundle.ts) merges the types in this folder into a single file.
To run it:
```bash
bun build
```
# Generated docs
**[📚 See here for docs](https://oven-sh.github.io/bun-types/)**
|