import type { BucketCachePurge } from "./durable-objects/bucket-cache-purge.js"; import type { DOQueueHandler } from "./durable-objects/queue.js"; import type { DOShardedTagCache } from "./durable-objects/sharded-tag-cache.js"; import type { PREFIX_ENV_NAME as KV_CACHE_PREFIX_ENV_NAME } from "./overrides/incremental-cache/kv-incremental-cache.js"; import type { PREFIX_ENV_NAME as R2_CACHE_PREFIX_ENV_NAME } from "./overrides/incremental-cache/r2-incremental-cache.js"; declare global { interface CloudflareEnv { ASSETS?: Fetcher; IMAGES?: ImagesBinding; NEXTJS_ENV?: string; WORKER_SELF_REFERENCE?: Service; NEXT_INC_CACHE_KV?: KVNamespace; [KV_CACHE_PREFIX_ENV_NAME]?: string; NEXT_INC_CACHE_R2_BUCKET?: R2Bucket; [R2_CACHE_PREFIX_ENV_NAME]?: string; NEXT_TAG_CACHE_D1?: D1Database; NEXT_TAG_CACHE_KV?: KVNamespace; NEXT_TAG_CACHE_DO_SHARDED?: DurableObjectNamespace; NEXT_TAG_CACHE_DO_SHARDED_DLQ?: Queue; NEXT_CACHE_DO_QUEUE?: DurableObjectNamespace; NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION?: string; NEXT_CACHE_DO_QUEUE_REVALIDATION_TIMEOUT_MS?: string; NEXT_CACHE_DO_QUEUE_RETRY_INTERVAL_MS?: string; NEXT_CACHE_DO_QUEUE_MAX_RETRIES?: string; NEXT_CACHE_DO_QUEUE_DISABLE_SQLITE?: string; NEXT_CACHE_DO_PURGE?: DurableObjectNamespace; NEXT_CACHE_DO_PURGE_BUFFER_TIME_IN_SECONDS?: string; CACHE_PURGE_ZONE_ID?: string; CACHE_PURGE_API_TOKEN?: string; CF_WORKER_NAME?: string; CF_PREVIEW_DOMAIN?: string; CF_WORKERS_SCRIPTS_API_TOKEN?: string; CF_ACCOUNT_ID?: string; R2_ACCESS_KEY_ID?: string; R2_SECRET_ACCESS_KEY?: string; } } export type CloudflareContext = IncomingRequestCfProperties, Context = ExecutionContext> = { /** * the worker's [bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/) */ env: CloudflareEnv; /** * the request's [cf properties](https://developers.cloudflare.com/workers/runtime-apis/request/#the-cf-property-requestinitcfproperties) */ cf: CfProperties | undefined; /** * the current [execution context](https://developers.cloudflare.com/workers/runtime-apis/context) */ ctx: Context; }; /** * Utility to get the current Cloudflare context * * @returns the cloudflare context */ export declare function getCloudflareContext = IncomingRequestCfProperties, Context = ExecutionContext>(options: { async: true; }): Promise>; export declare function getCloudflareContext = IncomingRequestCfProperties, Context = ExecutionContext>(options?: { async: false; }): CloudflareContext; /** * Options forwarded to `getPlatformProxy` from `wrangler`. * * Mirrors wrangler's `GetPlatformProxyOptions`. Importing it would pull wrangler's declarations into the published * `.d.ts`, and they do not type-check with `skipLibCheck: false` (#1408, cloudflare/workers-sdk#15940). * Import it again once the upstream issue is fixed. */ type GetPlatformProxyOptions = { /** Name of the wrangler environment to use */ environment?: string; /** Path to the wrangler configuration file, looked up from the current directory by default */ configPath?: string; /** @deprecated Ignored: Next.js loads the `.env*` files itself, so the adapter always passes `[]` to wrangler */ envFiles?: string[]; /** Whether and where to persist the bindings data, defaults to `.wrangler/state/v3` */ persist?: boolean | { path: string; }; /** Whether remote bindings are enabled, defaults to `true` */ remoteBindings?: boolean; }; /** * Performs some initial setup to integrate as best as possible the local Next.js dev server (run via `next dev`) * with the open-next Cloudflare adapter * * Note: this function should only be called inside the Next.js config file, and although async it doesn't need to be `await`ed * @param options options on how the function should operate and if/where to persist the platform data */ export declare function initOpenNextCloudflareForDev(options?: GetPlatformProxyOptions): Promise; export {};