import type { LogContext } from '@rocicorp/logger';
import postgres from 'postgres';
import type { JSONObject } from '../../../../../shared/src/bigint-json.ts';
import type { Database } from '../../../../../zqlite/src/db.ts';
import type { PublishedTableSpec } from '../../../db/specs.ts';
import type { ShardConfig } from '../../../types/shards.ts';
export type InitialSyncOptions = {
    tableCopyWorkers: number;
    profileCopy?: boolean | undefined;
    textCopy?: boolean | undefined;
    replicationSlotFailover?: boolean | undefined;
};
/** Server context to store with the initial sync metadata for debugging. */
export type ServerContext = JSONObject;
export declare function initialSync(lc: LogContext, shard: ShardConfig, tx: Database, upstreamURI: string, syncOptions: InitialSyncOptions, context: ServerContext): Promise<void>;
type ReplicationSlot = {
    slot_name: string;
    consistent_point: string;
    snapshot_name: string;
    output_plugin: string;
};
export declare function createReplicationSlot(lc: LogContext, session: postgres.Sql, slotName: string, failover?: boolean): Promise<ReplicationSlot>;
export declare const INSERT_BATCH_SIZE = 50;
export type DownloadStatements = {
    select: string;
    getTotalRows: string;
    getTotalBytes: string;
};
export declare function makeDownloadStatements(table: PublishedTableSpec, cols: string[]): DownloadStatements;
export {};
//# sourceMappingURL=initial-sync.d.ts.map