import type { WriteOperation } from './index.js'; export interface ChangeEventBase { operation: WriteOperation; /** * document id, * value of the primary key. */ id: string; } export interface ChangeEventInsert extends ChangeEventBase { operation: 'INSERT'; doc: DocType; previous: null; } export interface ChangeEventUpdate extends ChangeEventBase { operation: 'UPDATE'; doc: DocType; previous: DocType; } export interface ChangeEventDelete extends ChangeEventBase { operation: 'DELETE'; doc: null; previous: DocType; } export type ChangeEvent = ChangeEventInsert | ChangeEventUpdate | ChangeEventDelete;