@signalapp/mock-server
Version:
Mock Signal Server for writing tests
32 lines (31 loc) • 1.48 kB
TypeScript
import { GroupSecretParams, ProfileKey, ProfileKeyCredentialPresentation } from '@signalapp/libsignal-client/zkgroup';
import { signalservice as Proto } from '../../protos/compiled';
import { AciString, ServiceIdString } from '../types';
import { Group as GroupData } from '../data/group';
export type GroupOptions = Readonly<{
secretParams: GroupSecretParams;
groupState: Proto.Group.Params;
}>;
export type GroupMember = Readonly<{
presentation: ProfileKeyCredentialPresentation;
profileKey: ProfileKey;
aci: AciString;
}>;
export type GroupFromConfigOptions = Readonly<{
secretParams: GroupSecretParams;
title: string;
members: ReadonlyArray<GroupMember>;
}>;
export declare class Group extends GroupData {
readonly secretParams: GroupSecretParams;
readonly title: string;
constructor({ secretParams, groupState }: GroupOptions);
static fromConfig({ secretParams, title, members, }: GroupFromConfigOptions): Group;
get masterKey(): Buffer<ArrayBuffer>;
toContext(): Proto.GroupContextV2.Params;
encryptServiceId(serviceId: ServiceIdString): Buffer<ArrayBuffer>;
decryptServiceId(ciphertext: Uint8Array<ArrayBuffer>): ServiceIdString;
getMemberByServiceId(serviceId: ServiceIdString): Proto.Member.Params | undefined;
getPendingMemberByServiceId(serviceId: ServiceIdString): Proto.MemberPendingProfileKey.Params | undefined;
encryptBlob(proto: Proto.GroupAttributeBlob.Params): Buffer<ArrayBuffer>;
}