You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/readmes/audioworklet.md
+1
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ To use `@types/audioworklet` you need to do two things:
18
18
19
19
That's all.
20
20
21
+
If you'd like to ensure that the DOM types are never accidentally included, you can use [@orta/types-noop]()https://www.npmjs.com/package/@orta/type-noops) in TypeScript 4.5+.
Copy file name to clipboardExpand all lines: deploy/readmes/serviceworker.md
+1
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ To use `@types/serviceworker` you need to do two things:
18
18
19
19
That's all.
20
20
21
+
If you'd like to ensure that the DOM types are never accidentally included, you can use [@orta/types-noop]()https://www.npmjs.com/package/@orta/type-noops) in TypeScript 4.5+.
Copy file name to clipboardExpand all lines: deploy/readmes/sharedworker.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,14 @@ This package contains type definitions which will set up the global environment
11
11
To use `@types/sharedworker` you need to do two things:
12
12
13
13
1. Install the dependency: `npm install @types/sharedworker --save-dev`, `yarn add @types/sharedworker --dev` or `pnpm add @types/sharedworker --dev`.
14
+
14
15
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not.
15
16
16
17
1.**Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]`
17
18
1.**With "lib"** - You should remove `"dom"`.
18
19
19
-
That's all.
20
20
21
+
If you'd like to ensure that the DOM types are never accidentally included, you can use [@orta/types-noop]()https://www.npmjs.com/package/@orta/type-noops) in TypeScript 4.5+.
Copy file name to clipboardExpand all lines: deploy/readmes/web.md
+18-1
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,20 @@ The APIs inside `@types/web` are [generated from](https://github.com/microsoft/T
8
8
9
9
## Installation
10
10
11
+
With TypeScript 4.5+ using [lib replacement](https://github.com/microsoft/TypeScript/pull/45771), you can swap the DOM lib with this dependency:
1. Install the dependency: `npm install @types/web --save-dev`, `yarn add @types/web --dev` or `pnpm add @types/web --dev`.
@@ -17,7 +31,10 @@ To use `@types/web` you need to do two things:
17
31
1.**Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]`
18
32
1.**With "lib"** - You should remove `"dom"`.
19
33
20
-
That's all.
34
+
Removing `"dom"` gives @types/web the chance to provide the same set of global declarations. However, It's possible that your dependencies pull in the TypeScript DOM library, in which case you can either try to make that not happen, or use TypeScript 4.5 to systematically replace the library.
Copy file name to clipboardExpand all lines: deploy/readmes/webworker.md
+22-4
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,34 @@ This package contains type definitions which will set up the global environment
8
8
9
9
## Installation
10
10
11
+
With TypeScript 4.5+ using [lib replacement](https://github.com/microsoft/TypeScript/pull/45771), you can swap the WebWorker lib with this dependency:
To use `@types/webworker` you need to do two things:
12
26
13
-
1. Install the dependency: `npm install @types/webworker --save-dev`, `yarn add @types/webworker --dev` or `pnpm add @types/webworker --dev`.
14
-
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not.
27
+
1. Install the dependency: `npm install @types/webworker --save-dev`, `yarn add @types/webworker --dev` or `pnpm add @types/webworker --save-dev`.
28
+
29
+
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig). There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not.
15
30
16
31
1.**Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]`
17
-
1.**With "lib"** - You should remove `"dom"`.
32
+
1.**With "lib"** - You should remove `"webworker"`.
18
33
19
-
That's all.
34
+
Removing `"webworker"` gives @types/webworker the chance to provide the same set of global declarations. However, It's possible that your dependencies pull in the TypeScript Web Worker library, in which case you can either try to make that not happen, or use TypeScript 4.5 to systematically replace the library.
35
+
36
+
</details>
20
37
38
+
If you'd like to ensure that the DOM types are never accidentally included, you can use [@orta/types-noop]()https://www.npmjs.com/package/@orta/type-noops) in TypeScript 4.5+.
0 commit comments