cloudflare-workers-types-esm
TypeScript icon, indicating that this package has built-in type declarations

3.18.0 • Public • Published

Cloudflare Workers Types (ESM)

your automatic band-aid for using @cloudflare/workers-types to ship Cloudflare Workers utilities and frameworks

@cloudflare/workers-types current version cloudflare-workers-types-esm current version

Quality Tests Build

If you're like me, you might think to yourself, "hey I could totally make this library that others and I can re-use when building Cloudflare Workers", and you get all the way to the end, go to test it, and see everybody's favorite TypeScript error:

This happens because the @cloudflare/workers-types package doesn't export its type definitions; which is why you need to reference them in your project's tsconfig.json file as global types.

Issue #195 has been opened to fix this, but because there is no timeline for completion and no ability to submit a PR (the type definitions are automatically generated), I created this package as a stopgap.

Installation

# NPM
npm install cloudflare-workers-types-esm
# Yarn
yarn add cloudflare-workers-types-esm
# PNPM
pnpm install cloudflare-workers-types-esm

Usage

Import (or export) the types as needed

import { KVNamespace } from "cloudflare-workers-types-esm";

export type MySpecialSnowflake = KVNamespace<string>;

Updates

cloudflare-workers-types-esm is automagically kept in sync with @cloudflare/workers-types with a GitHub Action workflow that runs hourly. When Cloudflare releases a new version of their type definitions, cloudflare-workers-types-esm will be updated to match it within an hour or so. That way, you don't have to wait on some unreliable maintainer to do stuff for you 👀

License

This package is subject to the license of the original @cloudflare/workers-types package

Readme

Keywords

none

Package Sidebar

Install

npm i cloudflare-workers-types-esm

Weekly Downloads

0

Version

3.18.0

License

BSD-3-Clause

Unpacked Size

89.8 kB

Total Files

4

Last publish

Collaborators

  • checktheroads