Definitions#

All code blocks below are TypeScript declarations copied from the server. They document validation, not JSON to send or code to paste into a chat. Clients can use any HTTP library without importing these declarations. check.object rejects unknown fields. Custom functions and refinements specify additional checks.

Imported definitions#

MAX_HISTORY_CONTEXT#

MAX_HISTORY_CONTEXT = 260

roomContext#

export function roomContext(room: string): string { return 'room/' + room; }

contextRoom#

export function contextRoom(context: string): string | null { return context.startsWith('room/') ? context.slice(5) : null; }

validHistoryContext#

export function validHistoryContext(context: string): boolean {
    const room = contextRoom(context);
    return context === 'shared' || context === 'control' || room !== null && opaqueIdentifier(room);
}

Related definitions: