import { promiseVoid } from "../../../../shared/src/resolved-promises.js";
import { Database } from "../../../../zqlite/src/db.js";
import { IncrementalSyncer } from "./incremental-sync.js";
export class ReplicatorService {
    id;
    #lc;
    #incrementalSyncer;
    constructor(lc, taskID, id, mode, changeStreamer, replica, publishReplicationStatus) {
        this.id = id;
        this.#lc = lc
            .withContext('component', 'replicator')
            .withContext('serviceID', this.id);
        this.#incrementalSyncer = new IncrementalSyncer(taskID, `${taskID}/${id}`, changeStreamer, replica, mode, publishReplicationStatus);
    }
    status() {
        return Promise.resolve({ status: 'ok' });
    }
    run() {
        return this.#incrementalSyncer.run(this.#lc);
    }
    subscribe() {
        return this.#incrementalSyncer.subscribe();
    }
    stop() {
        this.#incrementalSyncer.stop(this.#lc);
        return promiseVoid;
    }
}
//# sourceMappingURL=replicator.js.map