bun-types 0.1.4 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/package.json +2 -2
- package/types.d.ts +20247 -17862
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Bun TypeScript type definitions
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://bun.sh"><img src="https://bun.sh/logo@2x.png" alt="Logo"></a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
These are the type definitions for Bun's JavaScript runtime APIs.
|
|
8
|
+
|
|
9
|
+
# Installation
|
|
10
|
+
|
|
11
|
+
Install the `bun-types` npm package:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# yarn/npm/pnpm work too, "bun-types" is an ordinary npm package
|
|
15
|
+
bun add bun-types
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
# Usage
|
|
19
|
+
|
|
20
|
+
Add this to your `tsconfig.json` or `jsconfig.json`:
|
|
21
|
+
|
|
22
|
+
```jsonc
|
|
23
|
+
{
|
|
24
|
+
"compilerOptions": {
|
|
25
|
+
"lib": ["ESNext"],
|
|
26
|
+
"module": "esnext",
|
|
27
|
+
"target": "esnext",
|
|
28
|
+
// "bun-types" is the important part
|
|
29
|
+
"types": ["bun-types"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
# Contributing
|
|
35
|
+
|
|
36
|
+
`bun-types` is generated via [./bundle.ts](./scripts/bundle.ts).
|
|
37
|
+
|
|
38
|
+
## Adding a new file
|
|
39
|
+
|
|
40
|
+
1. Add it to [./index.d.ts](./index.d.ts)
|
|
41
|
+
|
|
42
|
+
## How to generate types.d.ts
|
|
43
|
+
|
|
44
|
+
[`./bundle.ts`](./bundle.ts) merges the types in this folder into a single file.
|
|
45
|
+
|
|
46
|
+
To run it:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bun generate:package
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
# Generated docs
|
|
53
|
+
|
|
54
|
+
**[📚 See here for docs](https://oven-sh.github.io/bun-types/)**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Type definitions for bun.js",
|
|
5
5
|
"types": "types.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
"bun.js",
|
|
13
13
|
"types"
|
|
14
14
|
],
|
|
15
|
-
"repository": "https://github.com/oven-sh/bun",
|
|
15
|
+
"repository": "https://github.com/oven-sh/bun-types",
|
|
16
16
|
"homepage": "https://bun.sh"
|
|
17
17
|
}
|