import type { LogContext } from '@rocicorp/logger';
import * as v from '../../../shared/src/valita.ts';
import { Database } from '../../../zqlite/src/db.ts';
import type { ReplicaOptions } from '../config/zero-config.ts';
import { Notifier } from '../services/replicator/notifier.ts';
import type { ReplicaStateNotifier, Replicator } from '../services/replicator/replicator.ts';
import type { Worker } from '../types/processes.ts';
export declare const replicaFileModeSchema: v.Type<"backup" | "serving" | "serving-copy">;
export type ReplicaFileMode = v.Infer<typeof replicaFileModeSchema>;
export declare function replicaFileName(replicaFile: string, mode: ReplicaFileMode): string;
export declare function setupReplica(lc: LogContext, mode: ReplicaFileMode, replicaOptions: ReplicaOptions): Promise<Database>;
export declare function setUpMessageHandlers(lc: LogContext, replicator: Replicator, parent: Worker): void;
export declare function handleSubscriptionsFrom(lc: LogContext, subscriber: Worker, notifier: ReplicaStateNotifier): void;
/**
 * Creates a Notifier to relay notifications the notifier of another Worker.
 * This does not send the initial subscription message. Use {@link subscribeTo}
 * to initiate the subscription.
 */
export declare function createNotifierFrom(_lc: LogContext, source: Worker): Notifier;
export declare function subscribeTo(_lc: LogContext, source: Worker): void;
//# sourceMappingURL=replicator.d.ts.map