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.
Files changed (4) hide show
  1. package/README.md +6 -18
  2. package/package.json +7 -2
  3. package/tsconfig.json +1 -4
  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 `bun-types` npm package:
11
+ Install the `@types/bun` npm package:
12
12
 
13
13
  ```bash
14
- # yarn/npm/pnpm work too, "bun-types" is an ordinary npm package
15
- bun add -d bun-types
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
- # Usage
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.18",
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
  }
package/tsconfig.json CHANGED
@@ -17,9 +17,6 @@
17
17
  "composite": true,
18
18
  "allowSyntheticDefaultImports": true,
19
19
  "forceConsistentCasingInFileNames": true,
20
- "allowJs": true,
21
- "types": [
22
- "bun-types"
23
- ]
20
+ "allowJs": true
24
21
  }
25
22
  }