# @types/sharedworker

> Types for the global scope of Shared Workers

Latest version **0.0.230** (published 2026-09-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @types/sharedworker
pnpm add @types/sharedworker
yarn add @types/sharedworker
bun add @types/sharedworker
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.230 |
| Published | 2026-09-05 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 738 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/sharedworker
- Repository: https://github.com/microsoft/TypeScript-DOM-Lib-Generator
- Homepage: https://github.com/microsoft/TypeScript-DOM-Lib-Generator#readme
- Issues: https://github.com/microsoft/TypeScript-DOM-Lib-Generator/issues
- npm.io page: https://npm.io/package/@types/sharedworker

## Recent versions

- 0.0.230 (latest) — 2026-09-05
- 0.0.29 (ts3.1) — 2019-11-06
- 0.0.28 (ts2.8) — 2018-06-07
- 0.0.27 (ts2.7) — 2016-09-19
- 0.0.229 — 2026-07-19
- 0.0.228 — 2026-06-30
- 0.0.227 — 2026-06-29
- 0.0.226 — 2026-05-02
- 0.0.225 — 2026-04-30
- 0.0.224 — 2026-04-20
- 0.0.223 — 2026-03-19
- 0.0.222 — 2026-03-02
- 0.0.221 — 2026-02-23
- 0.0.220 — 2026-02-16
- 0.0.219 — 2026-02-15
- … 199 more at https://npm.io/package/@types/sharedworker/versions

## README

### `@types/sharedworker` - Types for the global scope of Web Workers

> The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts, such as several windows, iframes or even workers. They implement an interface different than dedicated workers and have a different global scope, `SharedWorkerGlobalScope`.

From [MDN Web Docs: SharedWorker API](https://developer.mozilla.org/docs/Web/API/SharedWorker)

This package contains type definitions which will set up the global environment for your TypeScript project to match the runtime environment of a Web Worker. The APIs inside `@types/sharedworker` are [generated from](https://github.com/microsoft/TypeScript-DOM-lib-generator/) the specifications for JavaScript.

## Installation 

To use `@types/sharedworker` you need to do two things:

1. Install the dependency: `npm install @types/sharedworker --save-dev`, `yarn add @types/sharedworker --dev` or `pnpm add @types/sharedworker --dev`.

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.

    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"]`
    1. **With "lib"**  - You should remove `"dom"`.

1. If you are using TypeScript 6.0+, set [`libReplacement`](https://www.typescriptlang.org/tsconfig/#libReplacement) to `true` in your `tsconfig.json`.

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+.

## SemVer

This project does not respect semantic versioning as almost every change could potentially break a project, though we try to minimize removing types.

`@types/sharedworker` follow the specifications, so when they mark a function/object/API/type as deprecated or removed - that is respected.

## Deploy Metadata

You can read what changed in version 0.0.230 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.230.

---
_Source: https://npm.io/package/@types/sharedworker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
