import { LeaderElection } from '../leader/index.js'; import { L as LockManager } from '../LockManager-BeW6JDFT.js'; import '../types-CYIf5CLM.js'; import '../types-BZGet48R.js'; interface MeshCleanupTaskOptions { readonly intervalMs: number; readonly initialDelayMs?: number; readonly jitterMs?: number; readonly maxRuntimeMs?: number; readonly leader?: boolean | string; readonly lockKey?: string; readonly run: (context: MeshCleanupTaskContext) => Promise | void; } interface MeshCleanupTaskContext { readonly task: string; readonly signal: AbortSignal; readonly startedAt: Date; } type MeshCleanupTaskStatus = 'idle' | 'running' | 'succeeded' | 'failed' | 'skipped' | 'stopped'; interface MeshCleanupTaskSnapshot { readonly name: string; readonly status: MeshCleanupTaskStatus; readonly intervalMs: number; readonly lastRunAt?: string; readonly nextRunAt?: string; readonly lastDurationMs?: number; readonly lastError?: string; readonly runs: number; readonly failures: number; } declare class CleanupScheduler { private readonly deps; private readonly tasks; private stopped; constructor(deps?: { readonly locks?: LockManager; readonly leader?: LeaderElection; }); task(name: string, options: MeshCleanupTaskOptions): this; start(): void; stop(): Promise; snapshots(): readonly MeshCleanupTaskSnapshot[]; private schedule; private runTask; private runProtected; } declare function sleepForCleanup(ms: number, signal?: AbortSignal): Promise; export { CleanupScheduler, type MeshCleanupTaskContext, type MeshCleanupTaskOptions, type MeshCleanupTaskSnapshot, type MeshCleanupTaskStatus, sleepForCleanup };