/** MLS (RFC 9420) context wrapper. */ /** * Managed wrapper around an MLS context owned by the native library. * * Owns a single-member group plus a published ``KeyPackage`` that can be * used to invite this member into another group. Always call * {@link MlsContext.close} (or use `try/finally`) to release the native * handle. */ export declare class MlsContext { /** Native handle (i32). */ handle: number; /** Application-level identity. */ readonly identity: string; private constructor(); /** Create a fresh MLS context. */ static create(identity: string): MlsContext; /** Current group epoch. */ get epoch(): bigint; /** 16-byte group identifier. */ get groupId(): Buffer; /** Export this member's TLS-serialised KeyPackage. */ exportKeyPackage(): Buffer; /** * Invite the given KeyPackage into the local group; returns the * Welcome only. Use {@link MlsContext.inviteFull} to also obtain the * Commit message that must be broadcast to existing members * (RFC 9420 §11/§12.4). */ invite(keyPackage: Buffer): Buffer; /** * Invite the given KeyPackage and return BOTH the MLS Commit (broadcast * to existing members) and the Welcome (unicast to the new joiner). */ inviteFull(keyPackage: Buffer): { commit: Buffer; welcome: Buffer; }; /** * Remove the member at the given MLS LeafIndex; returns the Commit that * remaining members must apply via {@link MlsContext.processMessage}. */ removeMember(leafIndex: number): Buffer; /** * Apply a Commit (or staged Proposal) to the local MLS group. Returns * the kind of message that was processed. */ processMessage(message: Buffer): "commit" | "application" | "proposal" | "external"; /** * Merge any pending commit produced by {@link MlsContext.inviteFull} or * {@link MlsContext.removeMember}. Idempotent. */ finalizeCommit(): void; /** Discard any pending commit without applying it (used on ABORT). */ clearPendingCommit(): void; /** Replace the local group with the one described by the Welcome. */ acceptWelcome(welcome: Buffer): void; /** * Serialise the full MLS state into an opaque blob that * {@link MlsContext.restoreState} can reconstruct, so a consumer can * persist the context across restarts. The blob contains **private key * material** — store it encrypted at rest. */ exportState(): Buffer; /** * Reconstruct a context from a blob produced by {@link MlsContext.exportState}. * The restored context is at the same epoch / group state and can send and * receive again. `identity` is informational (the real identity is in the blob). */ static restoreState(state: Buffer, identity?: string): MlsContext; /** Release the native handle. Idempotent. */ close(): void; [Symbol.dispose](): void; } //# sourceMappingURL=mls.d.ts.map