ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ • 2.73 kB
TypeScript
import { ClientState } from "./clientState.js";
import { CiphersuiteImpl } from "./crypto/ciphersuite.js";
import { GroupContext } from "./groupContext.js";
import { GroupInfo } from "./groupInfo.js";
import { KeyPackage, PrivateKeyPackage } from "./keyPackage.js";
import { MLSMessage } from "./message.js";
import { PrivateKeyPath } from "./privateKeyPath.js";
import { Proposal } from "./proposal.js";
import { PskIndex } from "./pskIndex.js";
import { RatchetTree } from "./ratchetTree.js";
import { LeafIndex, NodeIndex } from "./treemath.js";
import { UpdatePath } from "./updatePath.js";
import { Welcome } from "./welcome.js";
import { ClientConfig } from "./clientConfig.js";
import { Extension } from "./extension.js";
export interface MLSContext {
state: ClientState;
cipherSuite: CiphersuiteImpl;
pskIndex?: PskIndex;
}
export interface CreateCommitResult {
newState: ClientState;
welcome: Welcome | undefined;
commit: MLSMessage;
}
export interface CreateCommitOptions {
wireAsPublicMessage?: boolean;
extraProposals?: Proposal[];
ratchetTreeExtension?: boolean;
groupInfoExtensions?: Extension[];
authenticatedData?: Uint8Array;
}
export declare function createCommit(context: MLSContext, options?: CreateCommitOptions): Promise<CreateCommitResult>;
export declare function createGroupInfo(groupContext: GroupContext, confirmationTag: Uint8Array, state: ClientState, extensions: Extension[], cs: CiphersuiteImpl): Promise<GroupInfo>;
export declare function createGroupInfoWithRatchetTree(groupContext: GroupContext, confirmationTag: Uint8Array, state: ClientState, tree: RatchetTree, extensions: Extension[], cs: CiphersuiteImpl): Promise<GroupInfo>;
export declare function createGroupInfoWithExternalPub(state: ClientState, extensions: Extension[], cs: CiphersuiteImpl): Promise<GroupInfo>;
export declare function createGroupInfoWithExternalPubAndRatchetTree(state: ClientState, extensions: Extension[], cs: CiphersuiteImpl): Promise<GroupInfo>;
export declare function applyUpdatePathSecret(tree: RatchetTree, privatePath: PrivateKeyPath, senderLeafIndex: LeafIndex, gc: GroupContext, path: UpdatePath, excludeNodes: NodeIndex[], cs: CiphersuiteImpl): Promise<{
nodeIndex: NodeIndex;
pathSecret: Uint8Array;
}>;
export declare function joinGroupExternal(groupInfo: GroupInfo, keyPackage: KeyPackage, privateKeys: PrivateKeyPackage, resync: boolean, cs: CiphersuiteImpl, tree?: RatchetTree, clientConfig?: ClientConfig, authenticatedData?: Uint8Array): Promise<{
publicMessage: import("./publicMessage.js").PublicMessage;
newState: ClientState;
}>;
export declare function filterNewLeaves(resolution: NodeIndex[], excludeNodes: NodeIndex[]): NodeIndex[];