/**
 * stateSync config resolution + invariant validation (WS2 replicated-store
 * foundation, §10.2).
 *
 * Spec: docs/specs/multi-machine-replicated-store-foundation.md §10 (config
 * schema, validateStateSyncInvariants, rollout posture), §3.4 (the maxDriftMs
 * clamp), §8.2 (snapshot-cache ceilings).
 *
 * Mirrors `seamlessnessConfig.ts`: resolve the optional `multiMachine.stateSync`
 * knobs to concrete values, then enforce the cross-knob invariants. A violating
 * config is REJECTED with a clear message (StateSyncConfigError) rather than
 * silently coerced — the §10.2 contract: "a bad config is REJECTED, not silently
 * degraded". The per-store `enabled` flags are NOT validated here (they are the
 * dark-by-default on-switches, store by store); this module governs the
 * FOUNDATION-LEVEL knobs every store shares (the journal budget, the HLC drift
 * ceiling, the snapshot cache bounds).
 */
import { DEFAULT_MAX_DRIFT_MS, MIN_MAX_DRIFT_MS, MAX_MAX_DRIFT_MS } from './HybridLogicalClock.js';
import type { MultiMachineConfig } from './types.js';
/** Foundation-level stateSync defaults (§10.2). */
export declare const DEFAULT_AGGREGATE_JOURNAL_BUDGET_BYTES: number;
export declare const DEFAULT_MAX_CACHED_SNAPSHOTS = 16;
export declare const DEFAULT_MAX_CACHE_BYTES: number;
/**
 * The propagation allowance (§10.2): the invariant `maxDriftMs > flush interval +
 * propagation allowance` must hold so the drift bound can never be tighter than
 * the journal's own flush+replicate latency (which would quarantine our own
 * in-flight writes). With the 60s floor this always holds; the allowance is the
 * realistic worst-case mesh propagation lag we account for explicitly.
 */
export declare const DEFAULT_PROPAGATION_ALLOWANCE_MS: number;
/** Fully-resolved foundation-level stateSync knobs (every field concrete). */
export interface ResolvedStateSyncConfig {
    /** Aggregate journal byte budget across all replicated kinds (§10.2). */
    aggregateJournalBudgetBytes: number;
    /** The CLAMPED HLC bounded-drift ceiling the clock enforces (§3.4 / §10.2). */
    maxDriftMs: number;
    /** Snapshot-cache count ceiling (§8.2). */
    maxCachedSnapshots: number;
    /** Snapshot-cache byte ceiling (§8.2). */
    maxCacheBytes: number;
}
export declare class StateSyncConfigError extends Error {
    constructor(message: string);
}
/** The minimal shape this module reads from config — the per-store flags are a
 *  free-form map (a store's key → { enabled, dryRun }); the foundation knobs are
 *  optional siblings. Mirrors the spec §10 schema. */
export interface StateSyncRawConfig {
    aggregateJournalBudgetBytes?: number;
    maxDriftMs?: number;
    maxCachedSnapshots?: number;
    maxCacheBytes?: number;
    /** Per-store on-switches live as sibling keys; this module ignores their
     *  shape beyond the foundation knobs. Stores are typed loosely so a new
     *  store added later needs no change here. */
    [store: string]: unknown;
}
/** Read the stateSync block off a multiMachine config (may be absent). */
export declare function readStateSyncRaw(mm?: MultiMachineConfig): StateSyncRawConfig | undefined;
/**
 * Resolve the foundation-level stateSync knobs to concrete values. Does NOT
 * validate — call validateStateSyncInvariants() after (or use
 * assertStateSyncInvariants() for resolve+validate+throw in one step). The
 * maxDriftMs is CLAMPED here via the clock's clampMaxDriftMs so a resolved value
 * is always in-range; the §10.2 invariant additionally REJECTS an out-of-range
 * RAW value (so an operator sees an error, not a silent clamp) — see
 * validateStateSyncInvariants.
 */
export declare function resolveStateSyncConfig(mm?: MultiMachineConfig): ResolvedStateSyncConfig;
/**
 * Validate the foundation-level stateSync invariants (§10.2). Returns the list
 * of violations (empty = valid). Operates on the RAW config (not the resolved
 * one) for the maxDriftMs range check, so an out-of-range value is REJECTED
 * rather than silently clamped — the spec's "rejected, not silently coerced".
 *
 * Invariants (§10.2):
 *  1. aggregateJournalBudgetBytes > 0.
 *  2. maxDriftMs within [60_000, 900_000] (the §3.4 clamp) — out-of-range REJECTED.
 *  3. maxDriftMs > flush interval + propagation allowance (NOT the vacuous
 *     "> flush window") — so the bound can never be tighter than the journal's
 *     own flush+replicate latency.
 *  4. maxCachedSnapshots > 0 and maxCacheBytes > 0 (§8.2).
 */
export declare function validateStateSyncInvariants(mm?: MultiMachineConfig): string[];
/**
 * Resolve + validate in one step, throwing StateSyncConfigError on any invariant
 * violation. Use at server startup so a bad config is rejected loudly rather
 * than degrading silently (mirrors assertSeamlessnessInvariants).
 */
export declare function assertStateSyncInvariants(mm?: MultiMachineConfig): ResolvedStateSyncConfig;
/** Re-export the drift-clamp constants for callers/tests that assert the range. */
export { DEFAULT_MAX_DRIFT_MS, MIN_MAX_DRIFT_MS, MAX_MAX_DRIFT_MS };
//# sourceMappingURL=stateSyncConfig.d.ts.map