UNPKG

@signalapp/mock-server

Version:
32 lines (31 loc) 1.37 kB
/// <reference types="node" /> 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.IGroup; }>; 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; toContext(): Proto.IGroupContextV2; encryptServiceId(serviceId: ServiceIdString): Buffer; decryptServiceId(ciphertext: Uint8Array): ServiceIdString; getMemberByServiceId(serviceId: ServiceIdString): Proto.IMember | undefined; getPendingMemberByServiceId(serviceId: ServiceIdString): Proto.IMemberPendingProfileKey | undefined; }