snapcap
ApiType aliases

PlaintextMessage

Type Alias: PlaintextMessage

type PlaintextMessage = {
  content: Uint8Array;
  contentType: number | undefined;
  isSender: boolean | undefined;
  raw: Record<string, unknown>;
};

Defined in: bundle/chat/standalone/session/types.ts:22

Plaintext message handed to the consumer's onPlaintext callback.

content is the decrypted bytes the WASM produced for t.content inside the messagingDelegate. For text DMs it's a UTF-8 string of the sent text. For media messages it's a small protobuf header pointing at the encrypted CDN blob.

Properties

PropertyTypeDescriptionDefined in
contentUint8ArrayDecrypted message bytes the WASM produced.bundle/chat/standalone/session/types.ts:24
contentTypenumber | undefinedSnap's contentType enum (2 = text, 3 = media, …).bundle/chat/standalone/session/types.ts:28
isSenderboolean | undefinedTrue iff WE are the sender (outbound); false for inbound from peer.bundle/chat/standalone/session/types.ts:26
rawRecord<string, unknown>Raw delegate object for advanced callers — keys vary by build.bundle/chat/standalone/session/types.ts:30

On this page