import '../assert_dev_env.js';
/**
 * Family-shared `BackendConfig` builders for cross-process test backends.
 *
 * Two consumer-facing factories — {@link make_default_ts_backend_config}
 * and {@link make_default_rust_backend_config} — own the common shape
 * for the JS-runtime (Deno/Node on V8) and Rust families respectively.
 * Per-backend factories in consumer projects compose a small
 * declaration against one of these and add consumer-specific env vars
 * via `extra_env`.
 *
 * Defaults baked in by family:
 *
 * - **TS** — `'memory://'` PGlite, 30s startup window, capabilities
 *   without trusted_proxy/login_rate_limit. The TS canonical path
 *   leaves these limiters null in test mode.
 * - **Rust** — caller-supplied real Postgres URL (PGlite isn't reachable
 *   from `tokio-postgres`), 120s startup window (cargo first-build cost),
 *   capabilities including trusted_proxy + login_rate_limit + the
 *   `FUZ_TESTING_RESET_DB_ON_STARTUP=true` self-wipe gate.
 *
 * Both builders default `port_env_var` to `'PORT'`. Consumers whose
 * binary reads a different name (e.g. zzz's `ZZZ_PORT`) override.
 *
 * Common across both families: `/api/rpc`, `/api/ws`, `/health`,
 * `/api/account/bootstrap`, `cookie_name: 'fuz_session'`, the standard
 * bootstrap block keyed off `default_test_*` constants. Builders call
 * `build_test_backend_paths(name)` internally when the optional `paths`
 * is omitted.
 *
 * @module
 */
import type { BackendBootstrapConfig, BackendConfig } from './backend_config.js';
import type { BackendCapabilities } from './capabilities.js';
import { type TestBackendPaths } from './build_test_backend_paths.js';
/**
 * Capabilities shared by TS-family backends — same canonical
 * implementation, same feature set. No trusted-proxy phase (the test
 * binary doesn't enable proxy parsing) and no per-account login rate
 * limit (the TS canonical path leaves the limiter null in test mode).
 */
export declare const ts_default_capabilities: BackendCapabilities;
/**
 * Capabilities for the Rust family. Adds `trusted_proxy: true` (the
 * Rust spine's client-IP middleware is always wired; the env-gate just
 * controls whether XFF is consulted vs the TCP peer IP) and
 * `login_rate_limit: true` (env-gated bucket on `/login` + `/password`).
 */
export declare const rust_default_capabilities: BackendCapabilities;
export interface MakeDefaultTsBackendConfigOptions {
    /** Diagnostic label; also used as the tmpdir prefix when `paths` is omitted. */
    readonly name: string;
    /** TCP port the binary listens on. */
    readonly port: number;
    /** argv passed to the spawn (first entry is the binary). */
    readonly start_command: ReadonlyArray<string>;
    /** Defaults to `'memory://'` (in-memory PGlite). */
    readonly database_url?: string;
    /** Merged on top of the generic env baseline; later keys win. */
    readonly extra_env?: Readonly<Record<string, string>>;
    /** Defaults to `ts_default_capabilities`. */
    readonly capabilities?: BackendCapabilities;
    /** Pre-computed paths; defaults to `build_test_backend_paths(name)`. */
    readonly paths?: TestBackendPaths;
    /** Override individual bootstrap fields (username/password/token). */
    readonly bootstrap_overrides?: Partial<BackendBootstrapConfig>;
    /**
     * Env-var name the binary reads for its port. Defaults to `'PORT'`.
     * Consumers whose binary reads a different name (e.g. `'ZZZ_PORT'`)
     * override.
     */
    readonly port_env_var?: string;
    /**
     * Session cookie name the binary's `create_session_config` uses.
     * Defaults to `'fuz_session'`. Must match the consumer's session config
     * — the harness threads the `_testing_reset`-returned keeper cookie into
     * its jar under this name, so a mismatch surfaces as 401s on the
     * `create_account` path (e.g. fuz_forge uses `'fuz_forge_session'`).
     */
    readonly cookie_name?: string;
}
/**
 * Shared builder for TS-family backends (Deno + Node). Owns the common
 * env baseline (NODE_ENV, HOST, PORT, in-memory PGlite, cookie keys,
 * bootstrap token path) so per-backend factories only declare what
 * genuinely differs.
 */
export declare const make_default_ts_backend_config: (opts: MakeDefaultTsBackendConfigOptions) => BackendConfig;
export interface MakeDefaultRustBackendConfigOptions {
    /** Diagnostic label; also used as the tmpdir prefix when `paths` is omitted. */
    readonly name: string;
    /** TCP port the binary listens on. */
    readonly port: number;
    /** argv passed to the spawn (first entry is the binary). */
    readonly start_command: ReadonlyArray<string>;
    /**
     * Required — Rust needs real Postgres (PGlite isn't reachable from
     * `tokio-postgres`). Consumers typically supply
     * `'postgres://localhost/{repo}_test_{name}'`.
     */
    readonly database_url: string;
    /** Merged on top of the generic env baseline; later keys win. */
    readonly extra_env?: Readonly<Record<string, string>>;
    /** Defaults to `rust_default_capabilities`. */
    readonly capabilities?: BackendCapabilities;
    /** Pre-computed paths; defaults to `build_test_backend_paths(name)`. */
    readonly paths?: TestBackendPaths;
    /** Override individual bootstrap fields (username/password/token). */
    readonly bootstrap_overrides?: Partial<BackendBootstrapConfig>;
    /**
     * Env-var name the binary reads for its port. Defaults to `'PORT'`.
     * Consumers whose binary reads a different name (e.g. `'ZZZ_PORT'`)
     * override.
     */
    readonly port_env_var?: string;
    /**
     * Initial value for `RUST_LOG`. Defaults to `'info'`. Consumers pass
     * their binary-specific module filter
     * (e.g. `'info,zzz_server=info,testing_zzz_server=info'`).
     */
    readonly rust_log?: string;
    /**
     * Session cookie name the binary uses. Defaults to `'fuz_session'`.
     * Must match the consumer's session config (see the TS builder's note).
     */
    readonly cookie_name?: string;
}
/**
 * Shared builder for Rust-family backends. Owns the common env baseline
 * (RUST_LOG, HOST, port, real Postgres, cookie keys, bootstrap token
 * path, the `FUZ_TESTING_RESET_DB_ON_STARTUP=true` self-wipe gate) plus
 * the 120s startup window for cargo's first-run build cost.
 */
export declare const make_default_rust_backend_config: (opts: MakeDefaultRustBackendConfigOptions) => BackendConfig;
//# sourceMappingURL=default_backend_configs.d.ts.map