snapcap
ApiType aliases

MessagingEvents

Type Alias: MessagingEvents

type MessagingEvents = {
  message: (msg: PlaintextMessage) => void;
  read: (ev: {
     at: number;
     convId: string;
     messageId: string;
     userId: string;
  }) => void;
  typing: (ev: {
     convId: string;
     until: number;
     userId: string;
  }) => void;
  viewing: (ev: {
     convId: string;
     until: number;
     userId: string;
  }) => void;
};

Defined in: api/messaging/interface.ts:20

Event map for Messaging.on.

message is the only event currently wired end-to-end — it fires whenever the bundle's WASM produces a plaintext message via the messaging delegate. The presence events (typing, viewing, read) are declared so consumers can subscribe today; the inbound delegate slots that drive them are still being mapped — see TODO inside bringup.ts#bringUpSession.

Properties

PropertyTypeDescriptionDefined in
message(msg: PlaintextMessage) => voidA decrypted plaintext message arrived.api/messaging/interface.ts:22
read(ev: { at: number; convId: string; messageId: string; userId: string; }) => voidPeer marked messageId read at at (ms epoch).api/messaging/interface.ts:28
typing(ev: { convId: string; until: number; userId: string; }) => voidPeer started typing in convId until until (ms epoch).api/messaging/interface.ts:24
viewing(ev: { convId: string; until: number; userId: string; }) => voidPeer is viewing convId until until (ms epoch).api/messaging/interface.ts:26

On this page