export interface AuthMessage {
  type: 'auth';
  password: string;
  confirm_password?: string;
  change_to_password?: string;
  confirm_new_password?: string;
}

export interface AuthResponseMessage {
  type: 'auth_response';
  success: boolean;
  needs_confirmation?: boolean;
  password_changed?: boolean;
  message: string;
}

export interface SnapshotMessage {
  type: 'snapshot';
  store: string;
  seq: number;
  state: any;
}

export interface PatchMessage {
  type: 'patch';
  store: string;
  seq: number;
  patch: any[];
}

export interface HelloMessage {
  type: 'hello';
  seqs: Record<string, number>;
}

export type BackendMessage = SnapshotMessage | PatchMessage | AuthResponseMessage;
export type FrontendMessage = AuthMessage | HelloMessage | PatchMessage;
