21 lines
598 B
Markdown
21 lines
598 B
Markdown
# Node Web Globals
|
|
|
|
These types are copied (literally) from the web-globals folder of `@types/node` to provide types that are compatible with both web and node for developing libraries that are compatible with both web and node.
|
|
|
|
# Usage
|
|
|
|
To prevent tsc from importing the default `Dom` library, add the `compilerOptions` key `lib` with value `ESNext` (or whatever version you're targeting, such as `ES2022`).
|
|
|
|
<details><summary>tsconfig.json</summary>
|
|
|
|
```json
|
|
{
|
|
"compilerOptions":{
|
|
"module":"esnext",
|
|
"moduleResolution":"node",
|
|
"lib":["ESNext"]
|
|
}
|
|
}
|
|
```
|
|
|
|
</details> |