import type { ListItem } from './shopping-list' /** Discriminator of the events a list's SSE stream can emit. */ export type ListEventType = | 'item.created' | 'item.updated' | 'invitation.created' | 'member.added' | 'list.updated' /** * Server-Sent Events pushed to the members viewing a list * (`GET /lists/:listId/events`). `type` is the SSE `event:` name and the whole * object is the JSON `data:` payload. */ export type ListEvent = | { type: 'item.created' | 'item.updated'; listId: string; item: ListItem } | { type: 'invitation.created'; listId: string; email: string } | { type: 'member.added'; listId: string; userId: string } | { type: 'list.updated'; listId: string; name: string }