Skip to content

Commit 5163f0e

Browse files
leo-arjrf0110
authored andcommitted
Recommend libraries and update links to new typescript docs
1 parent b60a2e7 commit 5163f0e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Just supply an empty import in one of your source files to receive the workers t
1616
import {} from '@cloudflare/workers-types'
1717
```
1818

19-
Make sure that the `WebWorker` library is included in [`tsconfig`](https://www.typescriptlang.org/v2/en/tsconfig#lib). e.g.: `"lib": ["WebWorker"] // As well as "DOM", "ESNext", etc.`. `@cloudflare/workers-types` definitions are merged with `WebWorker`.
19+
Make sure that the `DOM`, `DOM.Iterable` and `WebWorker` [libraries][tsconfig-lib] are included in your [`tsconfig.json`]. e.g.:
20+
```json
21+
"lib": ["DOM", "DOM.Iterable", "WebWorker"] // As well as "ESNext", etc. as your project requires
22+
```
23+
`@cloudflare/workers-types` definitions are merged with `WebWorker` while `DOM` and `DOM.Iterable` are used in the [`Request`], [`Response`] and [`Headers`] interfaces.
2024

2125

2226
### Using a KV namespace
@@ -34,3 +38,10 @@ declare global {
3438
```
3539

3640
Now `myKVNamespace` is available to all of your source files.
41+
42+
43+
[tsconfig-lib]: https://www.typescriptlang.org/tsconfig#lib
44+
[`tsconfig.json`]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
45+
[`Request`]: https://developers.cloudflare.com/workers/reference/apis/request/
46+
[`Response`]: https://developers.cloudflare.com/workers/reference/apis/response/
47+
[`Headers`]: https://developer.mozilla.org/en-US/docs/Web/API/Headers

0 commit comments

Comments
 (0)