cesr
Version:
[](https://www.npmjs.com/package/cesr) [](https://github.com/lenkan/cesr-js/blob/main/LICENSE) [ • 702 B
TypeScript
import { Attachments, type AttachmentsInit } from "./attachments.ts";
import { VersionString } from "./version-string.ts";
export interface MessageBody {
v: string;
[key: string]: unknown;
}
export declare class Message<T extends MessageBody = MessageBody> {
#private;
readonly body: T;
constructor(body: T, attachments?: AttachmentsInit);
text(): string;
get raw(): Uint8Array;
get version(): VersionString;
get attachments(): Attachments;
set attachments(value: AttachmentsInit);
static parse(input: Uint8Array): Message | null;
static encode(init: MessageBody): Uint8Array;
static from<T extends MessageBody = MessageBody>(body: T): Message<T>;
}