Skip to content

Commit a0e1fba

Browse files
committed
fixups
1 parent e20e73b commit a0e1fba

File tree

8 files changed

+15
-23
lines changed

8 files changed

+15
-23
lines changed

src/content/docs/ai-gateway/integrations/worker-binding-methods.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ binding = "AI"
2525

2626
This configuration sets up the AI binding accessible in your Worker code as `env.AI`.
2727

28-
<Render file="wrangler-typegen" />
28+
<Render file="wrangler-typegen" product="workers" />
2929

3030
## 2. Basic Usage with Workers AI + Gateway
3131

src/content/docs/browser-rendering/platform/playwright.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ binding = "MYBROWSER"
4242

4343
</WranglerConfig>
4444

45-
<Render file="wrangler-typegen" />
45+
<Render file="wrangler-typegen" product="workers" />
4646

4747
Install the npm package:
4848

src/content/docs/pages/framework-guides/deploy-a-qwik-site.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The following code block shows an example of accessing a KV namespace in QwikCit
6868
// ...
6969

7070
export const useGetServerTime = routeLoader$(({ platform }) => {
71-
// the type `KVNamespace` comes from types generated by running `wrangler types`
71+
// the type `KVNamespace` comes from runtime types generated by running `wrangler types`
7272
const { MY_KV } = (platform.env as { MY_KV: KVNamespace }));
7373

7474
return {

src/content/docs/vectorize/reference/client-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,4 @@ Refer to the [bindings documentation](/workers/wrangler/configuration/#vectorize
218218

219219
## TypeScript Types
220220

221-
<Render file="wrangler-typegen" />
221+
<Render file="wrangler-typegen" product="workers" />

src/content/docs/workers/runtime-apis/rpc/typescript.mdx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,17 @@ head:
88
content: Workers RPC — TypeScript
99
description: How TypeScript types for your Worker or Durable Object's RPC
1010
methods are generated and exposed to clients
11-
1211
---
1312

14-
The types generated by running [`wrangler types`](/workers/languages/typescript/#generate-types) provide the `Service` and `DurableObjectNamespace` types, each of which accepts a single type parameter for the server-side [`WorkerEntrypoint`](/workers/runtime-apis/bindings/service-bindings/rpc) or [`DurableObject`](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/#call-rpc-methods) types.
15-
16-
Using higher-order types, we automatically generate client-side stub types (e.g., forcing all methods to be async).
17-
18-
For example:
13+
The types generated by running [`wrangler types`](/workers/languages/typescript/#generate-types) provide the `Service` and `DurableObjectNamespace` types, each of which accepts a single type parameter for the [`WorkerEntrypoint`](/workers/runtime-apis/bindings/service-bindings/rpc) or [`DurableObject`](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/#call-rpc-methods) types.
1914

20-
```ts
21-
interface Env {
22-
SUM_SERVICE: Service<SumService>;
23-
COUNTER_OBJECT: DurableObjectNamespace<Counter>
24-
}
15+
Using higher-order types, we automatically generate client-side stub types (e.g., forcing all methods to be async). In the following example, `env.SUM_SERVICE.sum` will be typed as defined in the `SumService` WorkerEntrypoint.
2516

17+
```ts title="src/index.ts"
2618
export default {
27-
async fetch(req, env, ctx): Promise<Response> {
28-
const result = await env.SUM_SERVICE.sum(1, 2);
29-
return new Response(result.toString());
30-
}
19+
async fetch(req, env, ctx): Promise<Response> {
20+
const result = await env.SUM_SERVICE.sum(1, 2);
21+
return new Response(result.toString());
22+
},
3123
} satisfies ExportedHandler<Env>;
3224
```

src/content/docs/workers/vite-plugin/tutorial.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
description: Create a React SPA with an API Worker using the Vite plugin
77
---
88

9-
import { PackageManagers, WranglerConfig } from "~/components";
9+
import { PackageManagers, WranglerConfig, Render } from "~/components";
1010

1111
This tutorial takes you through the steps needed to adapt a Vite project to use the Cloudflare Vite plugin.
1212
Much of the content can also be applied to adapting existing Vite projects and to front-end frameworks other than React.

src/content/docs/workflows/build/workers-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ script_name = "billing-worker"
212212

213213
</WranglerConfig>
214214

215-
<Render file="wrangler-typegen" />
215+
<Render file="wrangler-typegen" product="workers" />
216216

217217
## Workflow
218218

src/content/docs/workflows/examples/send-invoices.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sidebar:
1212
description: Send invoice when shopping cart is checked out and paid for
1313
---
1414

15-
import { TabItem, Tabs, WranglerConfig } from "~/components";
15+
import { TabItem, Tabs, WranglerConfig, Render } from "~/components";
1616

1717
In this example, we implement a Workflow for an e-commerce website that is triggered every time a shopping cart is created.
1818

@@ -219,4 +219,4 @@ name = "SEND_EMAIL"
219219

220220
</WranglerConfig>
221221

222-
<Render file="wrangler-typegen" />
222+
<Render file="wrangler-typegen" product="workers" />

0 commit comments

Comments
 (0)