interface ChatCursor

Passed by routes/chat.ts to page through the history, from the message the client already has at one end. Messages are ordered by createdAt, then by id, so a page boundary between two messages sent in the same millisecond skips neither.

Properties

createdAt: string

An ISO timestamp, compared as a string with created_at.

optional
id: string

Without it, the cursor takes in every message at createdAt: they are all older for getRecentChatMessages and all newer for getChatMessagesAfter.

Usage

import { type ChatCursor } from "api/services/chat-service.ts";