|
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
|
REFERENCES_R2_BUCKET?: { |
|
23
|
get(key: string): Promise<{ text(): Promise<string> } | null> |
|
24
|
} |
|
25
|
ASSETS?: { |
|
26
|
fetch(url: string | URL): Promise<Response> |
|
27
|
} |
|
28
|
} |