🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@cloudflare/workers-types

Package Overview
Dependencies
Maintainers
5
Versions
464
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudflare/workers-types - npm Package Compare versions

Comparing version
4.20260702.1
to
5.20260703.1
+1
-1
package.json

@@ -10,3 +10,3 @@ {

"license": "MIT OR Apache-2.0",
"version": "4.20260702.1"
"version": "5.20260703.1"
}

@@ -37,59 +37,4 @@ # Cloudflare Workers Types

![Entrypoints for compatibility dates](./npm/workers-types/entrypoints.svg)
The Cloudflare Workers runtime manages backwards compatibility through the use of [Compatibility Dates](https://developers.cloudflare.com/workers/platform/compatibility-dates/). The `@cloudflare/workers-types` package provides a typing environment that corresponds to the latest version of the Cloudflare Workers runtime. The `@cloudflare/workers-types/experimental` entrypoint is also available for APIs guarded by experimental compatibility flags. Instead of using `@cloudflare/workers-types` directly, we recommend following the [Typescript language documentation](https://developers.cloudflare.com/workers/languages/typescript/) for Cloudflare Workers to generate a runtime typing environment that corresponds exactly to your compatibility date and flags.
The Cloudflare Workers runtime manages backwards compatibility through the use of [Compatibility Dates](https://developers.cloudflare.com/workers/platform/compatibility-dates/). Using different compatibility dates affects the runtime types available to your Worker, and so it's important you specify the correct entrypoint to the `workers-types` package to match your compatibility date (which is usually set in your `wrangler.toml` configuration file). `workers-types` currently exposes the following entrypoints to choose from:
- `@cloudflare/workers-types`
The default entrypoint exposes the runtime types for a compatibility date before `2021-11-03`.
- `@cloudflare/workers-types/2021-11-03`
This entrypoint exposes the runtime types for a compatibility date between `2021-11-03` and `2022-01-31`.
- `@cloudflare/workers-types/2022-01-31`
This entrypoint exposes the runtime types for a compatibility date between `2022-01-31` and `2022-03-21`.
- `@cloudflare/workers-types/2022-03-21`
This entrypoint exposes the runtime types for a compatibility date between `2022-03-21` and `2022-08-04`.
- `@cloudflare/workers-types/2022-08-04`
This entrypoint exposes the runtime types for a compatibility date between `2022-08-04` and `2022-10-31`.
- `@cloudflare/workers-types/2022-10-31`
This entrypoint exposes the runtime types for a compatibility date between `2022-10-31` and `2022-11-30`.
- `@cloudflare/workers-types/2022-11-30`
This entrypoint exposes the runtime types for a compatibility date between `2022-11-30` and `2023-03-01`.
- `@cloudflare/workers-types/2023-03-01`
This entrypoint exposes the runtime types for a compatibility date between `2023-03-01` and `2023-07-01`.
- `@cloudflare/workers-types/2023-07-01`
This entrypoint exposes the runtime types for a compatibility date after `2023-07-01`.
- `@cloudflare/workers-types/experimental`
This entrypoint exposes the runtime types for the latest compatibility date. The types exposed by this entrypoint will change over time to always reflect the latest version of the Workers runtime.
To use one of these entrypoints, you need to specify them in your `tsconfig.json`. For example, this is a sample `tsconfig.json` for using the `2022-08-04` entrypoint.
```json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"types": ["@cloudflare/workers-types/2022-08-04"]
}
}
```
### Importable Types

@@ -100,3 +45,3 @@

```ts
import type { Request as WorkerRequest, ExecutionContext } from "@cloudflare/workers-types/experimental"
import type { Request as WorkerRequest, ExecutionContext } from "@cloudflare/workers-types"

@@ -137,2 +82,1 @@ export default {

Wrangler can also generate this for you automatically from your `wrangler.toml` configuration file, using the `wrangler types` command.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 540 280" width="540px" height="280px" xmlns="http://www.w3.org/2000/svg">
<rect width="540" height="280" style="fill: rgb(255, 255, 255);"/>
<g transform="matrix(1, 0, 0, 1, 61.018997, -319.418854)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(238, 238, 238);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;" x="135.709" y="369.298">@cloudflare/workers-types</text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.018997, -289.418793)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(221, 221, 221);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 85, 220); font-weight: 700;">2021-11-03</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.018997, -259.418793)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(238, 238, 238);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 54, 130); font-weight: 700;">2022-01-31</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.018997, -229.418869)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(221, 221, 221);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 85, 220); font-weight: 700;">2022-03-21</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.018997, -199.418839)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(238, 238, 238);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 54, 130); font-weight: 700;">2022-08-04</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.018997, -169.418839)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(221, 221, 221);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 85, 220); font-weight: 700;">2022-10-31</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.017925, -139.418854)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(238, 238, 238);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;"><tspan x="135.709" y="369.298">@cloudflare/workers-types/</tspan><tspan style="fill: rgb(0, 54, 130); font-weight: 700;">2022-11-30</tspan></text>
</g>
<g transform="matrix(1, 0, 0, 1, 61.017925, -109.418816)">
<rect x="128.981" y="349.42" width="340" height="30" style="fill: rgb(221, 221, 221);"/>
<text style="font-family: monospace; font-size: 14px; white-space: pre;" x="135.709" y="369.298">@cloudflare/workers-types/experimental</text>
</g>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="60" x2="190" y2="60"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="90" x2="190" y2="90"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="120" x2="190" y2="120"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="150" x2="190" y2="150"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="180" x2="190" y2="180"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="160" y1="210" x2="190" y2="210"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0);" x1="175" y1="60" x2="175" y2="240"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0); stroke-dasharray: 2px;" x1="175" y1="30" x2="175" y2="60"/>
<line style="fill: rgb(216, 216, 216); stroke: rgb(0, 0, 0); stroke-dasharray: 2px;" x1="175" y1="240" x2="175" y2="270"/>
<text style="fill: rgb(51, 51, 51); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: middle; white-space: pre;" transform="matrix(1, 0, 0, 1, 307.347992, -77.253761)"><tspan x="52.652" y="98.052">types Entrypoint</tspan></text>
<text style="fill: rgb(51, 51, 51); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="157.185" y="20.798">compatibility_date</text>
<text style="fill: rgb(0, 85, 220); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="64.798">2021-11-03</text>
<text style="fill: rgb(0, 54, 130); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="94.798">2022-01-31</text>
<text style="fill: rgb(0, 85, 220); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="124.798">2022-03-21</text>
<text style="fill: rgb(0, 54, 130); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="154.798">2022-08-04</text>
<text style="fill: rgb(0, 85, 220); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="184.798">2022-10-31</text>
<text style="fill: rgb(0, 54, 130); font-family: monospace; font-size: 14px; font-weight: 700; text-anchor: end; white-space: pre;" x="153.994" y="214.798">2022-11-30</text>
</svg>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display