1 /**
2 * The `@opennextjs/cloudflare/overrides/*` specifiers are defined through the
3 * package's `exports` map, which the `node` (node10) moduleResolution used by
4 * this app can't read. These shims point TypeScript at the physical files;
5 * the OpenNext build resolves the real specifiers through the exports map.
6 */
7 declare module "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache" {
8 export * from "@opennextjs/cloudflare/dist/api/overrides/incremental-cache/r2-incremental-cache"
9 export { default } from "@opennextjs/cloudflare/dist/api/overrides/incremental-cache/r2-incremental-cache"
10 }
11
12 declare module "@opennextjs/cloudflare/overrides/incremental-cache/regional-cache" {
13 export * from "@opennextjs/cloudflare/dist/api/overrides/incremental-cache/regional-cache"
14 }
15
16 /**
17 * Custom bindings from wrangler.jsonc, merged into the CloudflareEnv
18 * interface that `getCloudflareContext().env` is typed with. The R2 binding
19 * is typed structurally because `@cloudflare/workers-types` isn't installed.
20 */
21 interface CloudflareEnv {
22 SPECS_R2_BUCKET?: {
23 get(key: string): Promise<{ text(): Promise<string> } | null>
24 list(options?: {
25 prefix?: string
26 delimiter?: string
27 cursor?: string
28 limit?: number
29 }): Promise<{
30 objects: { key: string }[]
31 delimitedPrefixes: string[]
32 truncated: boolean
33 cursor?: string
34 }>
35 }
36 }