/**
 * Sync seam.
 *
 * Today the app is local-first: all data lives in Dexie and the "player view" is
 * driven on the same device by liveQuery, so there is nothing to sync. This
 * interface is the seam a future networked adapter (e.g. a WebSocket/CRDT
 * service) implements to mirror repository writes to other devices — without the
 * feature code needing to change.
 */
export type SyncStatus = 'local' | 'connecting' | 'connected' | 'error';

export interface SyncAdapter {
  readonly status: SyncStatus;
  /** begin syncing this campaign (no-op locally) */
  start(campaignId: string): Promise<void>;
  stop(): void;
}

/** Default adapter: single-device, backed entirely by Dexie liveQuery. */
export const localSync: SyncAdapter = {
  status: 'local',
  async start() {
    /* nothing to do — same-device sharing is automatic via liveQuery */
  },
  stop() {},
};
