// // Copyright 2020-2022 Signal Messenger, LLC. // SPDX-License-Identifier: AGPL-3.0-only // // WARNING: this file was automatically generated type Uuid = Buffer; /// A Native.Timestamp may be measured in seconds or in milliseconds; /// what's important is that it's an integer less than Number.MAX_SAFE_INTEGER. type Timestamp = number; type LookupResponse = Map; interface LookupResponseEntry { readonly aci: string | undefined; readonly pni: string | undefined; } interface SealedSenderMultiRecipientMessageRecipient { deviceIds: number[]; registrationIds: number[]; rangeOffset: number; rangeLen: number; } interface SealedSenderMultiRecipientMessage { recipientMap: { [serviceId: string]: SealedSenderMultiRecipientMessageRecipient; }; excludedRecipients: string[]; offsetOfSharedData: number; } export abstract class IdentityKeyStore { _getIdentityKey(): Promise; _getLocalRegistrationId(): Promise; _saveIdentity(name: ProtocolAddress, key: PublicKey): Promise; _isTrustedIdentity( name: ProtocolAddress, key: PublicKey, sending: boolean ): Promise; _getIdentity(name: ProtocolAddress): Promise; } export abstract class SessionStore { _saveSession(addr: ProtocolAddress, record: SessionRecord): Promise; _getSession(addr: ProtocolAddress): Promise; } export abstract class PreKeyStore { _savePreKey(preKeyId: number, record: PreKeyRecord): Promise; _getPreKey(preKeyId: number): Promise; _removePreKey(preKeyId: number): Promise; } export abstract class SignedPreKeyStore { _saveSignedPreKey( signedPreKeyId: number, record: SignedPreKeyRecord ): Promise; _getSignedPreKey(signedPreKeyId: number): Promise; } export abstract class KyberPreKeyStore { _saveKyberPreKey( kyberPreKeyId: number, record: KyberPreKeyRecord ): Promise; _getKyberPreKey(kyberPreKeyId: number): Promise; _markKyberPreKeyUsed(kyberPreKeyId: number): Promise; } export abstract class SenderKeyStore { _saveSenderKey( sender: ProtocolAddress, distributionId: Uuid, record: SenderKeyRecord ): Promise; _getSenderKey( sender: ProtocolAddress, distributionId: Uuid ): Promise; } export abstract class InputStream { _read(amount: number): Promise; _skip(amount: number): Promise; } export abstract class SyncInputStream extends Buffer {} interface Wrapper { readonly _nativeHandle: T; } // eslint-disable-next-line @typescript-eslint/no-unused-vars type Serialized = Buffer; export function registerErrors(errorsModule: Record): void; export const enum LogLevel { Error = 1, Warn, Info, Debug, Trace } export function Aes256GcmSiv_Decrypt(aesGcmSiv: Wrapper, ctext: Buffer, nonce: Buffer, associatedData: Buffer): Buffer; export function Aes256GcmSiv_Encrypt(aesGcmSivObj: Wrapper, ptext: Buffer, nonce: Buffer, associatedData: Buffer): Buffer; export function Aes256GcmSiv_New(key: Buffer): Aes256GcmSiv; export function AuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function AuthCredentialPresentation_GetPniCiphertext(presentationBytes: Buffer): Buffer | null; export function AuthCredentialPresentation_GetRedemptionTime(presentationBytes: Buffer): Timestamp; export function AuthCredentialPresentation_GetUuidCiphertext(presentationBytes: Buffer): Serialized; export function AuthCredentialResponse_CheckValidContents(buffer: Buffer): void; export function AuthCredentialWithPniResponse_CheckValidContents(buffer: Buffer): void; export function AuthCredentialWithPni_CheckValidContents(buffer: Buffer): void; export function AuthCredential_CheckValidContents(buffer: Buffer): void; export function BackupAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function BackupAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer): void; export function BackupAuthCredentialRequestContext_CheckValidContents(contextBytes: Buffer): void; export function BackupAuthCredentialRequestContext_GetRequest(contextBytes: Buffer): Buffer; export function BackupAuthCredentialRequestContext_New(backupKey: Buffer, uuid: Uuid): Buffer; export function BackupAuthCredentialRequestContext_ReceiveResponse(contextBytes: Buffer, responseBytes: Buffer, paramsBytes: Buffer, expectedReceiptLevel: Buffer): Buffer; export function BackupAuthCredentialRequest_CheckValidContents(requestBytes: Buffer): void; export function BackupAuthCredentialRequest_IssueDeterministic(requestBytes: Buffer, redemptionTime: Timestamp, receiptLevel: Buffer, paramsBytes: Buffer, randomness: Buffer): Buffer; export function BackupAuthCredentialResponse_CheckValidContents(responseBytes: Buffer): void; export function BackupAuthCredential_CheckValidContents(paramsBytes: Buffer): void; export function BackupAuthCredential_GetBackupId(credentialBytes: Buffer): Buffer; export function BackupAuthCredential_PresentDeterministic(credentialBytes: Buffer, serverParamsBytes: Buffer, randomness: Buffer): Buffer; export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Buffer): Serialized; export function CallLinkAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void; export function CallLinkAuthCredentialResponse_CheckValidContents(responseBytes: Buffer): void; export function CallLinkAuthCredentialResponse_IssueDeterministic(userId: Buffer, redemptionTime: Timestamp, paramsBytes: Buffer, randomness: Buffer): Buffer; export function CallLinkAuthCredentialResponse_Receive(responseBytes: Buffer, userId: Buffer, redemptionTime: Timestamp, paramsBytes: Buffer): Buffer; export function CallLinkAuthCredential_CheckValidContents(credentialBytes: Buffer): void; export function CallLinkAuthCredential_PresentDeterministic(credentialBytes: Buffer, userId: Buffer, redemptionTime: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer, randomness: Buffer): Buffer; export function CallLinkPublicParams_CheckValidContents(paramsBytes: Buffer): void; export function CallLinkSecretParams_CheckValidContents(paramsBytes: Buffer): void; export function CallLinkSecretParams_DecryptUserId(paramsBytes: Buffer, userId: Serialized): Buffer; export function CallLinkSecretParams_DeriveFromRootKey(rootKey: Buffer): Buffer; export function CallLinkSecretParams_GetPublicParams(paramsBytes: Buffer): Buffer; export function Cds2ClientState_New(mrenclave: Buffer, attestationMsg: Buffer, currentTimestamp: Timestamp): SgxClientState; export function CdsiLookup_complete(asyncRuntime: Wrapper, lookup: Wrapper): Promise; export function CdsiLookup_new(asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string, request: Wrapper, timeoutMillis: number): Promise; export function CdsiLookup_token(lookup: Wrapper): Buffer; export function CiphertextMessage_FromPlaintextContent(m: Wrapper): CiphertextMessage; export function CiphertextMessage_Serialize(obj: Wrapper): Buffer; export function CiphertextMessage_Type(msg: Wrapper): number; export function ConnectionManager_new(environment: number): ConnectionManager; export function CreateCallLinkCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function CreateCallLinkCredentialPresentation_Verify(presentationBytes: Buffer, roomId: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void; export function CreateCallLinkCredentialRequestContext_CheckValidContents(contextBytes: Buffer): void; export function CreateCallLinkCredentialRequestContext_GetRequest(contextBytes: Buffer): Buffer; export function CreateCallLinkCredentialRequestContext_NewDeterministic(roomId: Buffer, randomness: Buffer): Buffer; export function CreateCallLinkCredentialRequestContext_ReceiveResponse(contextBytes: Buffer, responseBytes: Buffer, userId: Buffer, paramsBytes: Buffer): Buffer; export function CreateCallLinkCredentialRequest_CheckValidContents(requestBytes: Buffer): void; export function CreateCallLinkCredentialRequest_IssueDeterministic(requestBytes: Buffer, userId: Buffer, timestamp: Timestamp, paramsBytes: Buffer, randomness: Buffer): Buffer; export function CreateCallLinkCredentialResponse_CheckValidContents(responseBytes: Buffer): void; export function CreateCallLinkCredential_CheckValidContents(paramsBytes: Buffer): void; export function CreateCallLinkCredential_PresentDeterministic(credentialBytes: Buffer, roomId: Buffer, userId: Buffer, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer, randomness: Buffer): Buffer; export function DecryptionErrorMessage_Deserialize(data: Buffer): DecryptionErrorMessage; export function DecryptionErrorMessage_ExtractFromSerializedContent(bytes: Buffer): DecryptionErrorMessage; export function DecryptionErrorMessage_ForOriginalMessage(originalBytes: Buffer, originalType: number, originalTimestamp: Timestamp, originalSenderDeviceId: number): DecryptionErrorMessage; export function DecryptionErrorMessage_GetDeviceId(obj: Wrapper): number; export function DecryptionErrorMessage_GetRatchetKey(m: Wrapper): PublicKey | null; export function DecryptionErrorMessage_GetTimestamp(obj: Wrapper): Timestamp; export function DecryptionErrorMessage_Serialize(obj: Wrapper): Buffer; export function ExpiringProfileKeyCredentialResponse_CheckValidContents(buffer: Buffer): void; export function ExpiringProfileKeyCredential_CheckValidContents(buffer: Buffer): void; export function ExpiringProfileKeyCredential_GetExpirationTime(credential: Serialized): Timestamp; export function Fingerprint_DisplayString(obj: Wrapper): string; export function Fingerprint_New(iterations: number, version: number, localIdentifier: Buffer, localKey: Wrapper, remoteIdentifier: Buffer, remoteKey: Wrapper): Fingerprint; export function Fingerprint_ScannableEncoding(obj: Wrapper): Buffer; export function GenericServerPublicParams_CheckValidContents(paramsBytes: Buffer): void; export function GenericServerSecretParams_CheckValidContents(paramsBytes: Buffer): void; export function GenericServerSecretParams_GenerateDeterministic(randomness: Buffer): Buffer; export function GenericServerSecretParams_GetPublicParams(paramsBytes: Buffer): Buffer; export function GroupCipher_DecryptMessage(sender: Wrapper, message: Buffer, store: SenderKeyStore): Promise; export function GroupCipher_EncryptMessage(sender: Wrapper, distributionId: Uuid, message: Buffer, store: SenderKeyStore): Promise; export function GroupMasterKey_CheckValidContents(buffer: Buffer): void; export function GroupPublicParams_CheckValidContents(buffer: Buffer): void; export function GroupPublicParams_GetGroupIdentifier(groupPublicParams: Serialized): Buffer; export function GroupSecretParams_CheckValidContents(buffer: Buffer): void; export function GroupSecretParams_DecryptBlobWithPadding(params: Serialized, ciphertext: Buffer): Buffer; export function GroupSecretParams_DecryptProfileKey(params: Serialized, profileKey: Serialized, userId: Buffer): Serialized; export function GroupSecretParams_DecryptServiceId(params: Serialized, ciphertext: Serialized): Buffer; export function GroupSecretParams_DeriveFromMasterKey(masterKey: Serialized): Serialized; export function GroupSecretParams_EncryptBlobWithPaddingDeterministic(params: Serialized, randomness: Buffer, plaintext: Buffer, paddingLen: number): Buffer; export function GroupSecretParams_EncryptProfileKey(params: Serialized, profileKey: Serialized, userId: Buffer): Serialized; export function GroupSecretParams_EncryptServiceId(params: Serialized, serviceId: Buffer): Serialized; export function GroupSecretParams_GenerateDeterministic(randomness: Buffer): Serialized; export function GroupSecretParams_GetMasterKey(params: Serialized): Serialized; export function GroupSecretParams_GetPublicParams(params: Serialized): Serialized; export function GroupSendCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function GroupSendCredentialPresentation_Verify(presentationBytes: Buffer, groupMembers: Buffer, now: Timestamp, serverParams: Serialized): void; export function GroupSendCredentialResponse_CheckValidContents(responseBytes: Buffer): void; export function GroupSendCredentialResponse_DefaultExpirationBasedOnCurrentTime(): Timestamp; export function GroupSendCredentialResponse_IssueDeterministic(concatenatedGroupMemberCiphertexts: Buffer, requester: Serialized, expiration: Timestamp, serverParams: Serialized, randomness: Buffer): Buffer; export function GroupSendCredentialResponse_Receive(responseBytes: Buffer, groupMembers: Buffer, localAci: Buffer, now: Timestamp, serverParams: Serialized, groupParams: Serialized): Buffer; export function GroupSendCredentialResponse_ReceiveWithCiphertexts(responseBytes: Buffer, concatenatedGroupMemberCiphertexts: Buffer, requester: Serialized, now: Timestamp, serverParams: Serialized, groupParams: Serialized): Buffer; export function GroupSendCredential_CheckValidContents(paramsBytes: Buffer): void; export function GroupSendCredential_PresentDeterministic(credentialBytes: Buffer, serverParams: Serialized, randomness: Buffer): Buffer; export function HKDF_DeriveSecrets(outputLength: number, ikm: Buffer, label: Buffer | null, salt: Buffer | null): Buffer; export function HsmEnclaveClient_CompleteHandshake(cli: Wrapper, handshakeReceived: Buffer): void; export function HsmEnclaveClient_EstablishedRecv(cli: Wrapper, receivedCiphertext: Buffer): Buffer; export function HsmEnclaveClient_EstablishedSend(cli: Wrapper, plaintextToSend: Buffer): Buffer; export function HsmEnclaveClient_InitialRequest(obj: Wrapper): Buffer; export function HsmEnclaveClient_New(trustedPublicKey: Buffer, trustedCodeHashes: Buffer): HsmEnclaveClient; export function IdentityKeyPair_Deserialize(buffer: Buffer): {publicKey:PublicKey,privateKey:PrivateKey}; export function IdentityKeyPair_Serialize(publicKey: Wrapper, privateKey: Wrapper): Buffer; export function IdentityKeyPair_SignAlternateIdentity(publicKey: Wrapper, privateKey: Wrapper, otherIdentity: Wrapper): Buffer; export function IdentityKey_VerifyAlternateIdentity(publicKey: Wrapper, otherIdentity: Wrapper, signature: Buffer): boolean; export function IncrementalMac_CalculateChunkSize(dataSize: number): number; export function IncrementalMac_Finalize(mac: Wrapper): Buffer; export function IncrementalMac_Initialize(key: Buffer, chunkSize: number): IncrementalMac; export function IncrementalMac_Update(mac: Wrapper, bytes: Buffer, offset: number, length: number): Buffer; export function KyberKeyPair_Generate(): KyberKeyPair; export function KyberKeyPair_GetPublicKey(keyPair: Wrapper): KyberPublicKey; export function KyberKeyPair_GetSecretKey(keyPair: Wrapper): KyberSecretKey; export function KyberPreKeyRecord_Deserialize(data: Buffer): KyberPreKeyRecord; export function KyberPreKeyRecord_GetId(obj: Wrapper): number; export function KyberPreKeyRecord_GetKeyPair(obj: Wrapper): KyberKeyPair; export function KyberPreKeyRecord_GetPublicKey(obj: Wrapper): KyberPublicKey; export function KyberPreKeyRecord_GetSecretKey(obj: Wrapper): KyberSecretKey; export function KyberPreKeyRecord_GetSignature(obj: Wrapper): Buffer; export function KyberPreKeyRecord_GetTimestamp(obj: Wrapper): Timestamp; export function KyberPreKeyRecord_New(id: number, timestamp: Timestamp, keyPair: Wrapper, signature: Buffer): KyberPreKeyRecord; export function KyberPreKeyRecord_Serialize(obj: Wrapper): Buffer; export function KyberPublicKey_Deserialize(data: Buffer): KyberPublicKey; export function KyberPublicKey_Equals(lhs: Wrapper, rhs: Wrapper): boolean; export function KyberPublicKey_Serialize(obj: Wrapper): Buffer; export function KyberSecretKey_Deserialize(data: Buffer): KyberSecretKey; export function KyberSecretKey_Serialize(obj: Wrapper): Buffer; export function LookupRequest_addAciAndAccessKey(request: Wrapper, aci: Buffer, accessKey: Buffer): void; export function LookupRequest_addE164(request: Wrapper, e164: string): void; export function LookupRequest_addPreviousE164(request: Wrapper, e164: string): void; export function LookupRequest_new(): LookupRequest; export function LookupRequest_setReturnAcisWithoutUaks(request: Wrapper, returnAcisWithoutUaks: boolean): void; export function LookupRequest_setToken(request: Wrapper, token: Buffer): void; export function Mp4Sanitizer_Sanitize(input: InputStream, len: Buffer): Promise; export function PlaintextContent_Deserialize(data: Buffer): PlaintextContent; export function PlaintextContent_FromDecryptionErrorMessage(m: Wrapper): PlaintextContent; export function PlaintextContent_GetBody(obj: Wrapper): Buffer; export function PlaintextContent_Serialize(obj: Wrapper): Buffer; export function PreKeyBundle_GetDeviceId(obj: Wrapper): number; export function PreKeyBundle_GetIdentityKey(p: Wrapper): PublicKey; export function PreKeyBundle_GetKyberPreKeyId(obj: Wrapper): number | null; export function PreKeyBundle_GetKyberPreKeyPublic(bundle: Wrapper): KyberPublicKey | null; export function PreKeyBundle_GetKyberPreKeySignature(bundle: Wrapper): Buffer; export function PreKeyBundle_GetPreKeyId(obj: Wrapper): number | null; export function PreKeyBundle_GetPreKeyPublic(obj: Wrapper): PublicKey | null; export function PreKeyBundle_GetRegistrationId(obj: Wrapper): number; export function PreKeyBundle_GetSignedPreKeyId(obj: Wrapper): number; export function PreKeyBundle_GetSignedPreKeyPublic(obj: Wrapper): PublicKey; export function PreKeyBundle_GetSignedPreKeySignature(obj: Wrapper): Buffer; export function PreKeyBundle_New(registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper | null, signedPrekeyId: number, signedPrekey: Wrapper, signedPrekeySignature: Buffer, identityKey: Wrapper, kyberPrekeyId: number | null, kyberPrekey: Wrapper | null, kyberPrekeySignature: Buffer): PreKeyBundle; export function PreKeyRecord_Deserialize(data: Buffer): PreKeyRecord; export function PreKeyRecord_GetId(obj: Wrapper): number; export function PreKeyRecord_GetPrivateKey(obj: Wrapper): PrivateKey; export function PreKeyRecord_GetPublicKey(obj: Wrapper): PublicKey; export function PreKeyRecord_New(id: number, pubKey: Wrapper, privKey: Wrapper): PreKeyRecord; export function PreKeyRecord_Serialize(obj: Wrapper): Buffer; export function PreKeySignalMessage_Deserialize(data: Buffer): PreKeySignalMessage; export function PreKeySignalMessage_GetPreKeyId(obj: Wrapper): number | null; export function PreKeySignalMessage_GetRegistrationId(obj: Wrapper): number; export function PreKeySignalMessage_GetSignedPreKeyId(obj: Wrapper): number; export function PreKeySignalMessage_GetVersion(obj: Wrapper): number; export function PreKeySignalMessage_New(messageVersion: number, registrationId: number, preKeyId: number | null, signedPreKeyId: number, baseKey: Wrapper, identityKey: Wrapper, signalMessage: Wrapper): PreKeySignalMessage; export function PreKeySignalMessage_Serialize(obj: Wrapper): Buffer; export function PrivateKey_Agree(privateKey: Wrapper, publicKey: Wrapper): Buffer; export function PrivateKey_Deserialize(data: Buffer): PrivateKey; export function PrivateKey_Generate(): PrivateKey; export function PrivateKey_GetPublicKey(k: Wrapper): PublicKey; export function PrivateKey_Serialize(obj: Wrapper): Buffer; export function PrivateKey_Sign(key: Wrapper, message: Buffer): Buffer; export function ProfileKeyCiphertext_CheckValidContents(buffer: Buffer): void; export function ProfileKeyCommitment_CheckValidContents(buffer: Buffer): void; export function ProfileKeyCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void; export function ProfileKeyCredentialPresentation_GetProfileKeyCiphertext(presentationBytes: Buffer): Serialized; export function ProfileKeyCredentialPresentation_GetUuidCiphertext(presentationBytes: Buffer): Serialized; export function ProfileKeyCredentialRequestContext_CheckValidContents(buffer: Buffer): void; export function ProfileKeyCredentialRequestContext_GetRequest(context: Serialized): Serialized; export function ProfileKeyCredentialRequest_CheckValidContents(buffer: Buffer): void; export function ProfileKey_CheckValidContents(buffer: Buffer): void; export function ProfileKey_DeriveAccessKey(profileKey: Serialized): Buffer; export function ProfileKey_GetCommitment(profileKey: Serialized, userId: Buffer): Serialized; export function ProfileKey_GetProfileKeyVersion(profileKey: Serialized, userId: Buffer): Buffer; export function ProtocolAddress_DeviceId(obj: Wrapper): number; export function ProtocolAddress_Name(obj: Wrapper): string; export function ProtocolAddress_New(name: string, deviceId: number): ProtocolAddress; export function PublicKey_Compare(key1: Wrapper, key2: Wrapper): number; export function PublicKey_Deserialize(data: Buffer): PublicKey; export function PublicKey_Equals(lhs: Wrapper, rhs: Wrapper): boolean; export function PublicKey_GetPublicKeyBytes(obj: Wrapper): Buffer; export function PublicKey_Serialize(obj: Wrapper): Buffer; export function PublicKey_Verify(key: Wrapper, message: Buffer, signature: Buffer): boolean; export function ReceiptCredentialPresentation_CheckValidContents(buffer: Buffer): void; export function ReceiptCredentialPresentation_GetReceiptExpirationTime(presentation: Serialized): Timestamp; export function ReceiptCredentialPresentation_GetReceiptLevel(presentation: Serialized): Buffer; export function ReceiptCredentialPresentation_GetReceiptSerial(presentation: Serialized): Buffer; export function ReceiptCredentialRequestContext_CheckValidContents(buffer: Buffer): void; export function ReceiptCredentialRequestContext_GetRequest(requestContext: Serialized): Serialized; export function ReceiptCredentialRequest_CheckValidContents(buffer: Buffer): void; export function ReceiptCredentialResponse_CheckValidContents(buffer: Buffer): void; export function ReceiptCredential_CheckValidContents(buffer: Buffer): void; export function ReceiptCredential_GetReceiptExpirationTime(receiptCredential: Serialized): Timestamp; export function ReceiptCredential_GetReceiptLevel(receiptCredential: Serialized): Buffer; export function SanitizedMetadata_GetDataLen(sanitized: Wrapper): Buffer; export function SanitizedMetadata_GetDataOffset(sanitized: Wrapper): Buffer; export function SanitizedMetadata_GetMetadata(sanitized: Wrapper): Buffer; export function ScannableFingerprint_Compare(fprint1: Buffer, fprint2: Buffer): boolean; export function SealedSenderDecryptionResult_GetDeviceId(obj: Wrapper): number; export function SealedSenderDecryptionResult_GetSenderE164(obj: Wrapper): string | null; export function SealedSenderDecryptionResult_GetSenderUuid(obj: Wrapper): string; export function SealedSenderDecryptionResult_Message(obj: Wrapper): Buffer; export function SealedSenderMultiRecipientMessage_Parse(buffer: Buffer): SealedSenderMultiRecipientMessage; export function SealedSender_DecryptMessage(message: Buffer, trustRoot: Wrapper, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise; export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: IdentityKeyStore): Promise; export function SealedSender_Encrypt(destination: Wrapper, content: Wrapper, identityKeyStore: IdentityKeyStore): Promise; export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper[], recipientSessions: Wrapper[], excludedRecipients: Buffer, content: Wrapper, identityKeyStore: IdentityKeyStore): Promise; export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Buffer): Buffer; export function SenderCertificate_Deserialize(data: Buffer): SenderCertificate; export function SenderCertificate_GetCertificate(obj: Wrapper): Buffer; export function SenderCertificate_GetDeviceId(obj: Wrapper): number; export function SenderCertificate_GetExpiration(obj: Wrapper): Timestamp; export function SenderCertificate_GetKey(obj: Wrapper): PublicKey; export function SenderCertificate_GetSenderE164(obj: Wrapper): string | null; export function SenderCertificate_GetSenderUuid(obj: Wrapper): string; export function SenderCertificate_GetSerialized(obj: Wrapper): Buffer; export function SenderCertificate_GetServerCertificate(cert: Wrapper): ServerCertificate; export function SenderCertificate_GetSignature(obj: Wrapper): Buffer; export function SenderCertificate_New(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper, expiration: Timestamp, signerCert: Wrapper, signerKey: Wrapper): SenderCertificate; export function SenderCertificate_Validate(cert: Wrapper, key: Wrapper, time: Timestamp): boolean; export function SenderKeyDistributionMessage_Create(sender: Wrapper, distributionId: Uuid, store: SenderKeyStore): Promise; export function SenderKeyDistributionMessage_Deserialize(data: Buffer): SenderKeyDistributionMessage; export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper): number; export function SenderKeyDistributionMessage_GetChainKey(obj: Wrapper): Buffer; export function SenderKeyDistributionMessage_GetDistributionId(obj: Wrapper): Uuid; export function SenderKeyDistributionMessage_GetIteration(obj: Wrapper): number; export function SenderKeyDistributionMessage_New(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Buffer, pk: Wrapper): SenderKeyDistributionMessage; export function SenderKeyDistributionMessage_Process(sender: Wrapper, senderKeyDistributionMessage: Wrapper, store: SenderKeyStore): Promise; export function SenderKeyDistributionMessage_Serialize(obj: Wrapper): Buffer; export function SenderKeyMessage_Deserialize(data: Buffer): SenderKeyMessage; export function SenderKeyMessage_GetChainId(obj: Wrapper): number; export function SenderKeyMessage_GetCipherText(obj: Wrapper): Buffer; export function SenderKeyMessage_GetDistributionId(obj: Wrapper): Uuid; export function SenderKeyMessage_GetIteration(obj: Wrapper): number; export function SenderKeyMessage_New(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Buffer, pk: Wrapper): SenderKeyMessage; export function SenderKeyMessage_Serialize(obj: Wrapper): Buffer; export function SenderKeyMessage_VerifySignature(skm: Wrapper, pubkey: Wrapper): boolean; export function SenderKeyRecord_Deserialize(data: Buffer): SenderKeyRecord; export function SenderKeyRecord_Serialize(obj: Wrapper): Buffer; export function ServerCertificate_Deserialize(data: Buffer): ServerCertificate; export function ServerCertificate_GetCertificate(obj: Wrapper): Buffer; export function ServerCertificate_GetKey(obj: Wrapper): PublicKey; export function ServerCertificate_GetKeyId(obj: Wrapper): number; export function ServerCertificate_GetSerialized(obj: Wrapper): Buffer; export function ServerCertificate_GetSignature(obj: Wrapper): Buffer; export function ServerCertificate_New(keyId: number, serverKey: Wrapper, trustRoot: Wrapper): ServerCertificate; export function ServerPublicParams_CheckValidContents(buffer: Buffer): void; export function ServerPublicParams_CreateAuthCredentialPresentationDeterministic(serverPublicParams: Serialized, randomness: Buffer, groupSecretParams: Serialized, authCredential: Serialized): Buffer; export function ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic(serverPublicParams: Serialized, randomness: Buffer, groupSecretParams: Serialized, authCredential: Serialized): Buffer; export function ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic(serverPublicParams: Serialized, randomness: Buffer, groupSecretParams: Serialized, profileKeyCredential: Serialized): Buffer; export function ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic(serverPublicParams: Serialized, randomness: Buffer, userId: Buffer, profileKey: Serialized): Serialized; export function ServerPublicParams_CreateReceiptCredentialPresentationDeterministic(serverPublicParams: Serialized, randomness: Buffer, receiptCredential: Serialized): Serialized; export function ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic(serverPublicParams: Serialized, randomness: Buffer, receiptSerial: Buffer): Serialized; export function ServerPublicParams_ReceiveAuthCredential(params: Serialized, aci: Buffer, redemptionTime: number, response: Serialized): Serialized; export function ServerPublicParams_ReceiveAuthCredentialWithPniAsAci(params: Serialized, aci: Buffer, pni: Buffer, redemptionTime: Timestamp, response: Serialized): Serialized; export function ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId(params: Serialized, aci: Buffer, pni: Buffer, redemptionTime: Timestamp, response: Serialized): Serialized; export function ServerPublicParams_ReceiveExpiringProfileKeyCredential(serverPublicParams: Serialized, requestContext: Serialized, response: Serialized, currentTimeInSeconds: Timestamp): Serialized; export function ServerPublicParams_ReceiveReceiptCredential(serverPublicParams: Serialized, requestContext: Serialized, response: Serialized): Serialized; export function ServerPublicParams_VerifySignature(serverPublicParams: Serialized, message: Buffer, notarySignature: Buffer): void; export function ServerSecretParams_CheckValidContents(buffer: Buffer): void; export function ServerSecretParams_GenerateDeterministic(randomness: Buffer): Serialized; export function ServerSecretParams_GetPublicParams(params: Serialized): Serialized; export function ServerSecretParams_IssueAuthCredentialDeterministic(serverSecretParams: Serialized, randomness: Buffer, aci: Buffer, redemptionTime: number): Serialized; export function ServerSecretParams_IssueAuthCredentialWithPniAsAciDeterministic(serverSecretParams: Serialized, randomness: Buffer, aci: Buffer, pni: Buffer, redemptionTime: Timestamp): Serialized; export function ServerSecretParams_IssueAuthCredentialWithPniAsServiceIdDeterministic(serverSecretParams: Serialized, randomness: Buffer, aci: Buffer, pni: Buffer, redemptionTime: Timestamp): Serialized; export function ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic(serverSecretParams: Serialized, randomness: Buffer, request: Serialized, userId: Buffer, commitment: Serialized, expirationInSeconds: Timestamp): Serialized; export function ServerSecretParams_IssueReceiptCredentialDeterministic(serverSecretParams: Serialized, randomness: Buffer, request: Serialized, receiptExpirationTime: Timestamp, receiptLevel: Buffer): Serialized; export function ServerSecretParams_SignDeterministic(params: Serialized, randomness: Buffer, message: Buffer): Buffer; export function ServerSecretParams_VerifyAuthCredentialPresentation(serverSecretParams: Serialized, groupPublicParams: Serialized, presentationBytes: Buffer, currentTimeInSeconds: Timestamp): void; export function ServerSecretParams_VerifyProfileKeyCredentialPresentation(serverSecretParams: Serialized, groupPublicParams: Serialized, presentationBytes: Buffer, currentTimeInSeconds: Timestamp): void; export function ServerSecretParams_VerifyReceiptCredentialPresentation(serverSecretParams: Serialized, presentation: Serialized): void; export function ServiceId_ParseFromServiceIdBinary(input: Buffer): Buffer; export function ServiceId_ParseFromServiceIdString(input: string): Buffer; export function ServiceId_ServiceIdBinary(value: Buffer): Buffer; export function ServiceId_ServiceIdLog(value: Buffer): string; export function ServiceId_ServiceIdString(value: Buffer): string; export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp): Promise; export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise; export function SessionCipher_DecryptSignalMessage(message: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise; export function SessionCipher_EncryptMessage(ptext: Buffer, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp): Promise; export function SessionRecord_ArchiveCurrentState(sessionRecord: Wrapper): void; export function SessionRecord_CurrentRatchetKeyMatches(s: Wrapper, key: Wrapper): boolean; export function SessionRecord_Deserialize(data: Buffer): SessionRecord; export function SessionRecord_GetLocalRegistrationId(obj: Wrapper): number; export function SessionRecord_GetRemoteRegistrationId(obj: Wrapper): number; export function SessionRecord_HasUsableSenderChain(s: Wrapper, now: Timestamp): boolean; export function SessionRecord_Serialize(obj: Wrapper): Buffer; export function SgxClientState_CompleteHandshake(cli: Wrapper, handshakeReceived: Buffer): void; export function SgxClientState_EstablishedRecv(cli: Wrapper, receivedCiphertext: Buffer): Buffer; export function SgxClientState_EstablishedSend(cli: Wrapper, plaintextToSend: Buffer): Buffer; export function SgxClientState_InitialRequest(obj: Wrapper): Buffer; export function SignalMedia_CheckAvailable(): void; export function SignalMessage_Deserialize(data: Buffer): SignalMessage; export function SignalMessage_GetBody(obj: Wrapper): Buffer; export function SignalMessage_GetCounter(obj: Wrapper): number; export function SignalMessage_GetMessageVersion(obj: Wrapper): number; export function SignalMessage_GetSerialized(obj: Wrapper): Buffer; export function SignalMessage_New(messageVersion: number, macKey: Buffer, senderRatchetKey: Wrapper, counter: number, previousCounter: number, ciphertext: Buffer, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper): SignalMessage; export function SignalMessage_VerifyMac(msg: Wrapper, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper, macKey: Buffer): boolean; export function SignedPreKeyRecord_Deserialize(data: Buffer): SignedPreKeyRecord; export function SignedPreKeyRecord_GetId(obj: Wrapper): number; export function SignedPreKeyRecord_GetPrivateKey(obj: Wrapper): PrivateKey; export function SignedPreKeyRecord_GetPublicKey(obj: Wrapper): PublicKey; export function SignedPreKeyRecord_GetSignature(obj: Wrapper): Buffer; export function SignedPreKeyRecord_GetTimestamp(obj: Wrapper): Timestamp; export function SignedPreKeyRecord_New(id: number, timestamp: Timestamp, pubKey: Wrapper, privKey: Wrapper, signature: Buffer): SignedPreKeyRecord; export function SignedPreKeyRecord_Serialize(obj: Wrapper): Buffer; export function TESTING_CdsiLookupResponseConvert(): LookupResponse; export function TESTING_ErrorOnBorrowAsync(_input: null): Promise; export function TESTING_ErrorOnBorrowIo(asyncRuntime: Wrapper, _input: null): Promise; export function TESTING_ErrorOnBorrowSync(_input: null): void; export function TESTING_ErrorOnReturnAsync(_needsCleanup: null): Promise; export function TESTING_ErrorOnReturnIo(asyncRuntime: Wrapper, _needsCleanup: null): Promise; export function TESTING_ErrorOnReturnSync(_needsCleanup: null): null; export function TESTING_FutureFailure(asyncRuntime: Wrapper, _input: number): Promise; export function TESTING_FutureProducesOtherPointerType(asyncRuntime: Wrapper, input: string): Promise; export function TESTING_FutureProducesPointerType(asyncRuntime: Wrapper, input: number): Promise; export function TESTING_FutureSuccess(asyncRuntime: Wrapper, input: number): Promise; export function TESTING_NonSuspendingBackgroundThreadRuntime_New(): NonSuspendingBackgroundThreadRuntime; export function TESTING_OtherTestingHandleType_getValue(handle: Wrapper): string; export function TESTING_PanicInBodyAsync(_input: null): Promise; export function TESTING_PanicInBodyIo(asyncRuntime: Wrapper, _input: null): Promise; export function TESTING_PanicInBodySync(_input: null): void; export function TESTING_PanicOnBorrowAsync(_input: null): Promise; export function TESTING_PanicOnBorrowIo(asyncRuntime: Wrapper, _input: null): Promise; export function TESTING_PanicOnBorrowSync(_input: null): void; export function TESTING_PanicOnLoadAsync(_needsCleanup: null, _input: null): Promise; export function TESTING_PanicOnLoadIo(asyncRuntime: Wrapper, _needsCleanup: null, _input: null): Promise; export function TESTING_PanicOnLoadSync(_needsCleanup: null, _input: null): void; export function TESTING_PanicOnReturnAsync(_needsCleanup: null): Promise; export function TESTING_PanicOnReturnIo(asyncRuntime: Wrapper, _needsCleanup: null): Promise; export function TESTING_PanicOnReturnSync(_needsCleanup: null): null; export function TESTING_TestingHandleType_getValue(handle: Wrapper): number; export function TokioAsyncContext_new(): TokioAsyncContext; export function UnidentifiedSenderMessageContent_Deserialize(data: Buffer): UnidentifiedSenderMessageContent; export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper): number; export function UnidentifiedSenderMessageContent_GetContents(obj: Wrapper): Buffer; export function UnidentifiedSenderMessageContent_GetGroupId(obj: Wrapper): Buffer | null; export function UnidentifiedSenderMessageContent_GetMsgType(m: Wrapper): number; export function UnidentifiedSenderMessageContent_GetSenderCert(m: Wrapper): SenderCertificate; export function UnidentifiedSenderMessageContent_New(message: Wrapper, sender: Wrapper, contentHint: number, groupId: Buffer | null): UnidentifiedSenderMessageContent; export function UnidentifiedSenderMessageContent_Serialize(obj: Wrapper): Buffer; export function UsernameLink_Create(username: string, entropy: Buffer | null): Buffer; export function UsernameLink_DecryptUsername(entropy: Buffer, encryptedUsername: Buffer): string; export function Username_CandidatesFrom(nickname: string, minLen: number, maxLen: number): string; export function Username_Hash(username: string): Buffer; export function Username_HashFromParts(nickname: string, discriminator: string, minLen: number, maxLen: number): Buffer; export function Username_Proof(username: string, randomness: Buffer): Buffer; export function Username_Verify(proof: Buffer, hash: Buffer): void; export function UuidCiphertext_CheckValidContents(buffer: Buffer): void; export function ValidatingMac_Finalize(mac: Wrapper): number; export function ValidatingMac_Initialize(key: Buffer, chunkSize: number, digests: Buffer): ValidatingMac; export function ValidatingMac_Update(mac: Wrapper, bytes: Buffer, offset: number, length: number): number; export function WebpSanitizer_Sanitize(input: SyncInputStream): void; export function initLogger(maxLevel: LogLevel, callback: (level: LogLevel, target: string, file: string | null, line: number | null, message: string) => void): void interface Aes256GcmSiv { readonly __type: unique symbol; } interface AuthCredential { readonly __type: unique symbol; } interface AuthCredentialResponse { readonly __type: unique symbol; } interface AuthCredentialWithPni { readonly __type: unique symbol; } interface AuthCredentialWithPniResponse { readonly __type: unique symbol; } interface CdsiLookup { readonly __type: unique symbol; } interface CiphertextMessage { readonly __type: unique symbol; } interface ConnectionManager { readonly __type: unique symbol; } interface DecryptionErrorMessage { readonly __type: unique symbol; } interface ExpiringProfileKeyCredential { readonly __type: unique symbol; } interface ExpiringProfileKeyCredentialResponse { readonly __type: unique symbol; } interface Fingerprint { readonly __type: unique symbol; } interface GroupMasterKey { readonly __type: unique symbol; } interface GroupPublicParams { readonly __type: unique symbol; } interface GroupSecretParams { readonly __type: unique symbol; } interface HsmEnclaveClient { readonly __type: unique symbol; } interface IncrementalMac { readonly __type: unique symbol; } interface KyberKeyPair { readonly __type: unique symbol; } interface KyberPreKeyRecord { readonly __type: unique symbol; } interface KyberPublicKey { readonly __type: unique symbol; } interface KyberSecretKey { readonly __type: unique symbol; } interface LookupRequest { readonly __type: unique symbol; } interface NonSuspendingBackgroundThreadRuntime { readonly __type: unique symbol; } interface OtherTestingHandleType { readonly __type: unique symbol; } interface PlaintextContent { readonly __type: unique symbol; } interface PreKeyBundle { readonly __type: unique symbol; } interface PreKeyRecord { readonly __type: unique symbol; } interface PreKeySignalMessage { readonly __type: unique symbol; } interface PrivateKey { readonly __type: unique symbol; } interface ProfileKey { readonly __type: unique symbol; } interface ProfileKeyCiphertext { readonly __type: unique symbol; } interface ProfileKeyCommitment { readonly __type: unique symbol; } interface ProfileKeyCredentialRequest { readonly __type: unique symbol; } interface ProfileKeyCredentialRequestContext { readonly __type: unique symbol; } interface ProtocolAddress { readonly __type: unique symbol; } interface PublicKey { readonly __type: unique symbol; } interface ReceiptCredential { readonly __type: unique symbol; } interface ReceiptCredentialPresentation { readonly __type: unique symbol; } interface ReceiptCredentialRequest { readonly __type: unique symbol; } interface ReceiptCredentialRequestContext { readonly __type: unique symbol; } interface ReceiptCredentialResponse { readonly __type: unique symbol; } interface SanitizedMetadata { readonly __type: unique symbol; } interface SealedSenderDecryptionResult { readonly __type: unique symbol; } interface SenderCertificate { readonly __type: unique symbol; } interface SenderKeyDistributionMessage { readonly __type: unique symbol; } interface SenderKeyMessage { readonly __type: unique symbol; } interface SenderKeyRecord { readonly __type: unique symbol; } interface ServerCertificate { readonly __type: unique symbol; } interface ServerPublicParams { readonly __type: unique symbol; } interface ServerSecretParams { readonly __type: unique symbol; } interface SessionRecord { readonly __type: unique symbol; } interface SgxClientState { readonly __type: unique symbol; } interface SignalMessage { readonly __type: unique symbol; } interface SignedPreKeyRecord { readonly __type: unique symbol; } interface TestingHandleType { readonly __type: unique symbol; } interface TokioAsyncContext { readonly __type: unique symbol; } interface UnidentifiedSenderMessageContent { readonly __type: unique symbol; } interface UuidCiphertext { readonly __type: unique symbol; } interface ValidatingMac { readonly __type: unique symbol; }