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
TypeScript is a first-class language on Cloudflare Workers. Cloudflare publishes type definitions to [GitHub](https://github.com/cloudflare/workers-types) and [npm](https://www.npmjs.com/package/@cloudflare/workers-types) (`npm install -D @cloudflare/workers-types`). All APIs provided in Workers are fully typed, and type definitions are generated directly from [workerd](https://github.com/cloudflare/workerd), the open-source Workers runtime.
16
16
17
-
### Generate types that match your Worker's configuration (experimental)
17
+
<h3id="type-gen">Generate types that match your Worker's configuration</h3>
18
18
19
19
Cloudflare continuously improves [workerd](https://github.com/cloudflare/workerd), the open-source Workers runtime.
20
20
Changes in workerd can introduce JavaScript API changes, thus changing the respective TypeScript types. For example, the [`urlsearchparams_delete_has_value_arg`](/workers/configuration/compatibility-flags/#urlsearchparams-delete-and-has-value-argument) compatibility flag adds optional arguments to some methods, in order to support new additions to the WHATWG URL standard API.
See [the full list of available flags](/workers/wrangler/commands/#types) for more details.
46
46
47
-
#### Migrating from `@cloudflare/workers-types` to `wrangler types --experimental-include-runtime`
47
+
<h4id="migrating">
48
+
Migrating from `@cloudflare/workers-types` to `wrangler types`
49
+
</h4>
48
50
49
51
The `@cloudflare/workers-types` package provides runtime types for each distinct [compatibility date](https://github.com/cloudflare/workerd/tree/main/npm/workers-types#compatibility-dates), which is specified by the user in their `tsconfig.json`. But this package is superseded by the `wrangler types --experimental-include-runtime` command.
50
52
@@ -162,3 +164,4 @@ For more information, refer to [this GitHub issue](https://github.com/cloudflare
0 commit comments