Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers TypeScript

Teaches how to configure TypeScript for Cloudflare Workers by generating runtime types that match specific worker configurations, compatibility dates, and bindings using the wrangler types command.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers TypeScript

Teaches how to configure TypeScript for Cloudflare Workers by generating runtime types that match specific worker configurations, compatibility dates, and bindings using the wrangler types command.

When To Use

Use when you need to generate TypeScript definitions that accurately reflect your Worker's specific bindings, compatibility flags, and runtime environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-typescript-index-workflow-guide.mdA guide explaining how to use TypeScript with Cloudflare Workers, including migrating to wrangler-generated types.Questions about a guide explaining how to use TypeScript with Cloudflare Workers, including migrating to wrangler-generated types.
examples/workers-typescript-index-cloudflare-workers-typescript-wrangler-types-co.textA text representation of the npx wrangler types command used to generate TypeScript definitions for Cloudflare Workers.Exact payloads, commands, or snippets shown in A text representation of the npx wrangler types command used to generate TypeScript definitions for Cloudflare Workers.
examples/workers-typescript-index-cloudflare-workers-typescript-wrangler-types-co-2.textA text representation of the wrangler types command used to generate TypeScript definitions for Cloudflare Workers.Exact payloads, commands, or snippets shown in A text representation of the wrangler types command used to generate TypeScript definitions for Cloudflare Workers.
examples/workers-typescript-index-cloudflare-workers-typescript-wrangler-types-co-3.textA command-line instruction demonstrating how to use pnpm wrangler types to generate TypeScript definitions for Cloudflare Workers.Exact payloads, commands, or snippets shown in A command-line instruction demonstrating how to use pnpm wrangler types to generate TypeScript definitions for Cloudf...
examples/workers-typescript-index-cloudflare-workers-typescript-npm-uninstall-com.textThe npm command to uninstall the @cloudflare/workers-types package from a project.Exact payloads, commands, or snippets shown in The npm command to uninstall the @cloudflare/workers-types package from a project.
examples/workers-typescript-index-cloudflare-workers-typescript-types-removal-com.textA command to remove the @cloudflare/workers-types package using yarn.Exact payloads, commands, or snippets shown in A command to remove the @cloudflare/workers-types package using yarn.
examples/workers-typescript-index-cloudflare-workers-typescript-remove-types-comm.textA command to remove the @cloudflare/workers-types package using pnpm.Exact payloads, commands, or snippets shown in A command to remove the @cloudflare/workers-types package using pnpm.
examples/workers-typescript-index-cloudflare-workers-typescript-bun-remove-types-.textA command to remove the @cloudflare/workers-types package using the Bun package manager.Exact payloads, commands, or snippets shown in A command to remove the @cloudflare/workers-types package using the Bun package manager.
examples/workers-typescript-index-cloudflare-workers-typescript-tsconfig-configur.textA tsconfig.json configuration file demonstrating the compilerOptions required for a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A tsconfig.json configuration file demonstrating the compilerOptions required for a Cloudflare Workers TypeScript pro...
examples/workers-typescript-index-cloudflare-workers-typescript-npm-node-types-in.textThe command to install node type definitions for Cloudflare Workers using npm.Exact payloads, commands, or snippets shown in The command to install node type definitions for Cloudflare Workers using npm.
examples/workers-typescript-index-cloudflare-workers-typescript-node-types-instal.textA command to install Node.js type definitions for Cloudflare Workers using yarn.Exact payloads, commands, or snippets shown in A command to install Node.js type definitions for Cloudflare Workers using yarn.
examples/workers-typescript-index-cloudflare-workers-typescript-node-types-instal-2.textA command to install Node.js type definitions for Cloudflare Workers using pnpm.Exact payloads, commands, or snippets shown in A command to install Node.js type definitions for Cloudflare Workers using pnpm.
examples/workers-typescript-index-cloudflare-workers-typescript-node-types-instal-3.textA command to install Node.js type definitions using the Bun package manager for Cloudflare Workers TypeScript development.Exact payloads, commands, or snippets shown in A command to install Node.js type definitions using the Bun package manager for Cloudflare Workers TypeScript develop...
examples/workers-typescript-index-cloudflare-workers-typescript-tsconfig-configur-2.textA TypeScript configuration file demonstrating the compilerOptions and type definitions required for a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A TypeScript configuration file demonstrating the compilerOptions and type definitions required for a Cloudflare Work...
examples/workers-typescript-index-cloudflare-workers-typescript-package-json-scri.textA package.json configuration snippet showing scripts for development, building, type generation, and type checking in a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A package.json configuration snippet showing scripts for development, building, type generation, and type checking in...
examples/workers-typescript-index-cloudflare-workers-typescript-build-test-comman.textA list of npm commands used to generate types, build, and test a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A list of npm commands used to generate types, build, and test a Cloudflare Workers TypeScript project.
examples/workers-typescript-index-cloudflare-workers-typescript-build-test-comman-2.textA list of shell commands for generating types, building, and testing a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A list of shell commands for generating types, building, and testing a Cloudflare Workers TypeScript project.
examples/workers-typescript-index-cloudflare-workers-typescript-build-test-comman-3.textA list of shell commands for generating types, building, and testing a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A list of shell commands for generating types, building, and testing a Cloudflare Workers TypeScript project.
examples/workers-typescript-index-cloudflare-workers-typescript-type-checking-com.textA list of terminal commands for running type checking, building, and testing in a Cloudflare Workers TypeScript project.Exact payloads, commands, or snippets shown in A list of terminal commands for running type checking, building, and testing in a Cloudflare Workers TypeScript project.
examples/workers-typescript-index-cloudflare-workers-typescript-type-checking-com-2.textA list of yarn commands used to check types, build, and test Cloudflare Workers using TypeScript.Exact payloads, commands, or snippets shown in A list of yarn commands used to check types, build, and test Cloudflare Workers using TypeScript.
examples/workers-typescript-index-cloudflare-workers-typescript-type-checking-com-3.textA list of pnpm commands used to check types and build Cloudflare Workers projects using TypeScript.Exact payloads, commands, or snippets shown in A list of pnpm commands used to check types and build Cloudflare Workers projects using TypeScript.

What This Skill Covers

  • TypeScript is a first-class language on Cloudflare Workers. All APIs provided in Workers are fully typed, and type definitions are generated directly from wo...
  • Main sections: Generate types that match your Worker's configuration, Migrating from @cloudflare/workers-types to wrangler types, 1\. Uninstall @cloudflare/workers-types, 2\. Generate runtime types using Wrangler, 3\. Make sure your tsconfig.json includes the generated types.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/languages/typescript/index.md