import type { BuildOptions } from "@opennextjs/aws/build/helper.js"; import type { OpenNextConfig } from "@opennextjs/aws/types/open-next.js"; import type { Unstable_Config as WranglerConfig } from "wrangler"; import type yargs from "yargs"; import { type WorkerEnvVar } from "./utils/helpers.js"; import type { WranglerTarget } from "./utils/run-wrangler.js"; export declare const MAX_REQUEST_RETRIES = 15; export declare const BASE_RETRY_DELAY_MS = 250; export declare const MAX_RETRY_DELAY_MS = 10000; export declare const BACKOFF_FACTOR: number; export declare function populateCache(buildOpts: BuildOptions, config: OpenNextConfig, wranglerConfig: WranglerConfig, populateCacheOptions: PopulateCacheOptions, envVars: WorkerEnvVar): Promise; export type CacheAsset = { isFetch: boolean; fullPath: string; key: string; buildId: string; }; export declare function getCacheAssets(opts: BuildOptions): CacheAsset[]; export type PopulateCacheOptions = { /** * Whether to populate the local or remote cache. */ target: WranglerTarget; /** * Wrangler environment to use. */ environment?: string; /** * Path to the Wrangler config file. */ wranglerConfigPath?: string; /** * Number of concurrent requests when populating the cache. * For KV this is the chunk size passed to `wrangler kv bulk put`. * For R2 this is the number of concurrent requests to the local worker or rclone transfers. * * @default 25 */ cacheChunkSize?: number; /** * Whether to use `rclone` instead of the worker-based R2 cache population path. */ useRclone?: boolean; /** * Instructs Wrangler to use the preview namespace or ID defined in the Wrangler config for the remote target. */ shouldUsePreviewId: boolean; }; export declare function loadRclone(importRclone?: () => Promise<{ default: typeof import("rclone.js"); }>): Promise<((...args: Array) => import("child_process").ChildProcess) & Record<"test" | "checksum" | "link" | "tree" | "version" | "config" | "copy" | "delete" | "about" | "authorize" | "backend" | "cat" | "check" | "cleanup" | "config create" | "config delete" | "config disconnect" | "config dump" | "config edit" | "config file" | "config password" | "config providers" | "config reconnect" | "config show" | "config update" | "config userinfo" | "copyto" | "copyurl" | "cryptcheck" | "cryptdecode" | "dedupe" | "deletefile" | "genautocomplete" | "genautocomplete bash" | "genautocomplete fish" | "genautocomplete zsh" | "gendocs" | "hashsum" | "help" | "listremotes" | "ls" | "lsd" | "lsf" | "lsjson" | "lsl" | "md5sum" | "mkdir" | "mount" | "move" | "moveto" | "ncdu" | "obscure" | "purge" | "rc" | "rcat" | "rcd" | "rmdir" | "rmdirs" | "selfupdate" | "serve" | "serve dlna" | "serve ftp" | "serve http" | "serve restic" | "serve sftp" | "serve webdav" | "settier" | "sha1sum" | "size" | "sync" | "touch", (...args: Array) => import("child_process").ChildProcess> & { promises: ((...args: Array) => Promise>) & Record<"test" | "checksum" | "link" | "tree" | "version" | "config" | "copy" | "delete" | "about" | "authorize" | "backend" | "cat" | "check" | "cleanup" | "config create" | "config delete" | "config disconnect" | "config dump" | "config edit" | "config file" | "config password" | "config providers" | "config reconnect" | "config show" | "config update" | "config userinfo" | "copyto" | "copyurl" | "cryptcheck" | "cryptdecode" | "dedupe" | "deletefile" | "genautocomplete" | "genautocomplete bash" | "genautocomplete fish" | "genautocomplete zsh" | "gendocs" | "hashsum" | "help" | "listremotes" | "ls" | "lsd" | "lsf" | "lsjson" | "lsl" | "md5sum" | "mkdir" | "mount" | "move" | "moveto" | "ncdu" | "obscure" | "purge" | "rc" | "rcat" | "rcd" | "rmdir" | "rmdirs" | "selfupdate" | "serve" | "serve dlna" | "serve ftp" | "serve http" | "serve restic" | "serve sftp" | "serve webdav" | "settier" | "sha1sum" | "size" | "sync" | "touch", (...args: Array) => Promise>>; }>; /** * Add the `populateCache` command to yargs configuration, with nested commands for `local` and `remote`. * * Consumes 2 positional parameters. */ export declare function addPopulateCacheCommand(y: T): yargs.Argv<{}>; export declare function withPopulateCacheOptions(args: T): yargs.Argv<{ config: string | undefined; } & { configPath: string | undefined; } & { env: string | undefined; } & { cacheChunkSize: number | undefined; } & { rclone: boolean; }>;