Skip to content

Commit

Permalink
docs: add note about installing workers types (#11731)
Browse files Browse the repository at this point in the history
Co-authored-by: Chew Tee Ming <[email protected]>
  • Loading branch information
Rich-Harris and eltigerchino authored Jan 13, 2025
1 parent 043cdac commit c2ffdcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export async function POST({ request, platform }) {

> [!NOTE] SvelteKit's built-in `$env` module should be preferred for environment variables.
To include type declarations for your bindings, reference them in your `src/app.d.ts`:
To make these types available to your app, install `@cloudflare/workers-types` and reference them in your `src/app.d.ts`:

```ts
/// file: src/app.d.ts
import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types';
+++import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types';+++

declare global {
namespace App {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ export async function POST({ request, platform }) {

> [!NOTE] SvelteKit's built-in `$env` module should be preferred for environment variables.
To include type declarations for your bindings, reference them in your `src/app.d.ts`:
To make these types available to your app, install `@cloudflare/workers-types` and reference them in your `src/app.d.ts`:

```ts
/// file: src/app.d.ts
import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types';
+++import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types';+++

declare global {
namespace App {
Expand Down

0 comments on commit c2ffdcf

Please sign in to comment.