bun-types 1.0.18 → 1.0.19
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 +6 -18
- package/package.json +7 -2
- package/tsconfig.json +1 -4
- package/types.d.ts +9908 -40816
package/README.md
CHANGED
|
@@ -8,31 +8,19 @@ These are the type definitions for Bun's JavaScript runtime APIs.
|
|
|
8
8
|
|
|
9
9
|
# Installation
|
|
10
10
|
|
|
11
|
-
Install the
|
|
11
|
+
Install the `@types/bun` npm package:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
# yarn/npm/pnpm work too
|
|
15
|
-
bun
|
|
14
|
+
# yarn/npm/pnpm work too
|
|
15
|
+
# @types/bun is an ordinary npm package
|
|
16
|
+
bun add -D @types/bun
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Add this to your `tsconfig.json` or `jsconfig.json`:
|
|
21
|
-
|
|
22
|
-
```jsonc-diff
|
|
23
|
-
{
|
|
24
|
-
"compilerOptions": {
|
|
25
|
-
+ "types": ["bun-types"]
|
|
26
|
-
// other options...
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// other options...
|
|
30
|
-
}
|
|
31
|
-
```
|
|
19
|
+
That's it! VS Code and TypeScript automatically load `@types/*` packages into your project, so the `Bun` global and all `bun:*` modules should be available immediately.
|
|
32
20
|
|
|
33
21
|
# Contributing
|
|
34
22
|
|
|
35
|
-
`bun-types` is generated via [./scripts/bundle.ts](./scripts/bundle.ts).
|
|
23
|
+
The `@types/bun` package is a shim that loads `bun-types`. The `bun-types` package lives in the Bun repo under `packages/bun-types`. It is generated via [./scripts/bundle.ts](./scripts/bundle.ts).
|
|
36
24
|
|
|
37
25
|
To add a new file, add it under `packages/bun-types`. Then add a [triple-slash directive](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) pointing to it inside [./index.d.ts](./index.d.ts).
|
|
38
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Type definitions for Bun, an incredibly fast JavaScript runtime",
|
|
6
6
|
"types": "types.d.ts",
|
|
@@ -16,5 +16,10 @@
|
|
|
16
16
|
"types"
|
|
17
17
|
],
|
|
18
18
|
"repository": "https://github.com/oven-sh/bun",
|
|
19
|
-
"homepage": "https://bun.sh"
|
|
19
|
+
"homepage": "https://bun.sh",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@types/node": "*",
|
|
22
|
+
"@types/ws": "*",
|
|
23
|
+
"undici-types": "^5.26.4"
|
|
24
|
+
}
|
|
20
25
|
}
|