From 85686caa01465eacba6fddcdc19a22d2d62d8c7f Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Wed, 15 Oct 2025 17:50:37 -0700 Subject: [PATCH] node: Combine Native.js and .d.ts into Native.ts This allows the file to be checked by tsc, which would have caught some of the missing type aliases sooner (now added to Native.ts.in). Strictly speaking the behavior is slightly different: we have returned to exporting many items individually instead of collecting them on a single object. Co-authored-by: Alex Bakon --- node/.prettierignore | 2 +- node/Native.d.ts | 817 ------- node/Native.js | 9 - node/eslint.config.js | 1 + node/package.json | 4 +- node/ts/AccountKeys.ts | 2 +- node/ts/Address.ts | 2 +- node/ts/EcKeys.ts | 2 +- node/ts/Errors.ts | 2 +- node/ts/MessageBackup.ts | 2 +- node/ts/Minidump.ts | 2 +- node/ts/Mp4Sanitizer.ts | 2 +- node/ts/Native.ts | 1916 +++++++++++++++++ node/ts/SealedSenderMultiRecipientMessage.ts | 2 +- node/ts/WebpSanitizer.ts | 2 +- node/ts/incremental_mac.ts | 2 +- node/ts/index.ts | 2 +- node/ts/internal.ts | 2 +- node/ts/io.ts | 2 +- node/ts/net.ts | 2 +- node/ts/net/CDSI.ts | 2 +- node/ts/net/Chat.ts | 20 +- node/ts/net/KeyTransparency.ts | 2 +- node/ts/net/Registration.ts | 2 +- node/ts/net/SvrB.ts | 2 +- node/ts/net/chat/UnauthMessagesService.ts | 2 +- node/ts/net/chat/UnauthUsernamesService.ts | 2 +- node/ts/node-gyp-build.d.ts | 3 + node/ts/test/BridgingTest.ts | 2 +- node/ts/test/FutureTest.ts | 2 +- node/ts/test/IoTest.ts | 2 +- node/ts/test/KeyTransparencyTest.ts | 2 +- node/ts/test/NativeTest.ts | 2 +- node/ts/test/NetTest.ts | 6 +- node/ts/test/RegistrationTest.ts | 2 +- node/ts/test/SvrBTest.ts | 2 +- node/ts/test/chat/ServiceTestUtils.ts | 2 +- .../ts/test/chat/UnauthMessagesServiceTest.ts | 2 +- .../test/chat/UnauthUsernamesServiceTest.ts | 2 +- node/ts/usernames.ts | 2 +- node/ts/zkgroup/GenericServerPublicParams.ts | 2 +- node/ts/zkgroup/GenericServerSecretParams.ts | 2 +- node/ts/zkgroup/ServerPublicParams.ts | 2 +- node/ts/zkgroup/ServerSecretParams.ts | 2 +- .../auth/AuthCredentialPresentation.ts | 2 +- node/ts/zkgroup/auth/AuthCredentialWithPni.ts | 2 +- .../auth/AuthCredentialWithPniResponse.ts | 2 +- .../ts/zkgroup/auth/ClientZkAuthOperations.ts | 2 +- .../ts/zkgroup/auth/ServerZkAuthOperations.ts | 2 +- .../zkgroup/backups/BackupAuthCredential.ts | 2 +- .../BackupAuthCredentialPresentation.ts | 2 +- .../backups/BackupAuthCredentialRequest.ts | 2 +- .../BackupAuthCredentialRequestContext.ts | 2 +- .../backups/BackupAuthCredentialResponse.ts | 2 +- .../calllinks/CallLinkAuthCredential.ts | 2 +- .../CallLinkAuthCredentialPresentation.ts | 2 +- .../CallLinkAuthCredentialResponse.ts | 2 +- .../zkgroup/calllinks/CallLinkPublicParams.ts | 2 +- .../zkgroup/calllinks/CallLinkSecretParams.ts | 2 +- .../calllinks/CreateCallLinkCredential.ts | 2 +- .../CreateCallLinkCredentialPresentation.ts | 2 +- .../CreateCallLinkCredentialRequest.ts | 2 +- .../CreateCallLinkCredentialRequestContext.ts | 2 +- .../CreateCallLinkCredentialResponse.ts | 2 +- node/ts/zkgroup/groups/ClientZkGroupCipher.ts | 2 +- node/ts/zkgroup/groups/GroupPublicParams.ts | 2 +- node/ts/zkgroup/groups/GroupSecretParams.ts | 2 +- .../ts/zkgroup/groups/ProfileKeyCiphertext.ts | 2 +- node/ts/zkgroup/groups/UuidCiphertext.ts | 2 +- .../groupsend/GroupSendDerivedKeyPair.ts | 2 +- .../zkgroup/groupsend/GroupSendEndorsement.ts | 2 +- .../GroupSendEndorsementsResponse.ts | 2 +- .../zkgroup/groupsend/GroupSendFullToken.ts | 2 +- node/ts/zkgroup/groupsend/GroupSendToken.ts | 2 +- node/ts/zkgroup/internal/ByteArray.ts | 2 +- .../profiles/ClientZkProfileOperations.ts | 2 +- .../profiles/ExpiringProfileKeyCredential.ts | 2 +- .../ExpiringProfileKeyCredentialResponse.ts | 2 +- node/ts/zkgroup/profiles/ProfileKey.ts | 2 +- .../zkgroup/profiles/ProfileKeyCommitment.ts | 2 +- .../ProfileKeyCredentialPresentation.ts | 2 +- .../profiles/ProfileKeyCredentialRequest.ts | 2 +- .../ProfileKeyCredentialRequestContext.ts | 2 +- .../profiles/ServerZkProfileOperations.ts | 2 +- .../receipts/ClientZkReceiptOperations.ts | 2 +- node/ts/zkgroup/receipts/ReceiptCredential.ts | 2 +- .../receipts/ReceiptCredentialPresentation.ts | 2 +- .../receipts/ReceiptCredentialRequest.ts | 2 +- .../ReceiptCredentialRequestContext.ts | 2 +- .../receipts/ReceiptCredentialResponse.ts | 2 +- .../receipts/ServerZkReceiptOperations.ts | 2 +- rust/bridge/README.md | 2 +- .../node/bin/{Native.d.ts.in => Native.ts.in} | 78 +- rust/bridge/node/bin/gen_ts_decl.py | 23 +- 94 files changed, 2084 insertions(+), 961 deletions(-) delete mode 100644 node/Native.d.ts delete mode 100644 node/Native.js create mode 100644 node/ts/Native.ts create mode 100644 node/ts/node-gyp-build.d.ts rename rust/bridge/node/bin/{Native.d.ts.in => Native.ts.in} (69%) diff --git a/node/.prettierignore b/node/.prettierignore index bf6d4bc46..377b2c9a3 100644 --- a/node/.prettierignore +++ b/node/.prettierignore @@ -1,4 +1,4 @@ build/** dist/** -Native.d.ts +ts/Native.ts ts/test/canonical-backup.expected.json \ No newline at end of file diff --git a/node/Native.d.ts b/node/Native.d.ts deleted file mode 100644 index 6e1441bf8..000000000 --- a/node/Native.d.ts +++ /dev/null @@ -1,817 +0,0 @@ -// -// Copyright 2020 Signal Messenger, LLC. -// SPDX-License-Identifier: AGPL-3.0-only -// - -// WARNING: this file was automatically generated - -type Uuid = Uint8Array; - -/// 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; - -// Rust code produces or consumes values that conform to these interface -// definitions. They must be kept in sync to prevent bridging errors. - -type LookupResponse = { - entries: Map; - debugPermitsUsed: number; -}; - -type LookupResponseEntry = { - readonly aci: string | undefined; - readonly pni: string | undefined; -}; - -type ChatResponse = { - status: number; - message: string | undefined; - headers: ReadonlyArray<[string, string]>; - body: Uint8Array | undefined; -}; - -type ChatServiceDebugInfo = { - ipType: number; - durationMillis: number; - connectionInfo: string; -}; - -type ResponseAndDebugInfo = { - response: ChatResponse; - debugInfo: ChatServiceDebugInfo; -}; - -type SealedSenderMultiRecipientMessageRecipient = { - deviceIds: number[]; - registrationIds: number[]; - rangeOffset: number; - rangeLen: number; -}; - -type SealedSenderMultiRecipientMessage = { - recipientMap: { - [serviceId: string]: SealedSenderMultiRecipientMessageRecipient; - }; - excludedRecipients: string[]; - offsetOfSharedData: number; -}; - -enum IdentityChange { - // This must be kept in sync with the Rust enum of the same name. - NewOrUnchanged = 0, - ReplacedExisting = 1, -} - -type IdentityKeyStore = { - _getIdentityKey: () => Promise; - _getLocalRegistrationId: () => Promise; - _saveIdentity: ( - name: ProtocolAddress, - key: PublicKey - ) => Promise; - _isTrustedIdentity: ( - name: ProtocolAddress, - key: PublicKey, - sending: boolean - ) => Promise; - _getIdentity: (name: ProtocolAddress) => Promise; -}; - -type SessionStore = { - _saveSession: (addr: ProtocolAddress, record: SessionRecord) => Promise; - _getSession: (addr: ProtocolAddress) => Promise; -}; - -type PreKeyStore = { - _savePreKey: (preKeyId: number, record: PreKeyRecord) => Promise; - _getPreKey: (preKeyId: number) => Promise; - _removePreKey: (preKeyId: number) => Promise; -}; - -type SignedPreKeyStore = { - _saveSignedPreKey: ( - signedPreKeyId: number, - record: SignedPreKeyRecord - ) => Promise; - _getSignedPreKey: (signedPreKeyId: number) => Promise; -}; - -type KyberPreKeyStore = { - _saveKyberPreKey: ( - kyberPreKeyId: number, - record: KyberPreKeyRecord - ) => Promise; - _getKyberPreKey: (kyberPreKeyId: number) => Promise; - _markKyberPreKeyUsed: ( - kyberPreKeyId: number, - signedPreKeyId: number, - baseKey: PublicKey - ) => Promise; -}; - -type SenderKeyStore = { - _saveSenderKey: ( - sender: ProtocolAddress, - distributionId: Uuid, - record: SenderKeyRecord - ) => Promise; - _getSenderKey: ( - sender: ProtocolAddress, - distributionId: Uuid - ) => Promise; -}; - -type InputStream = { - _read: (amount: number) => Promise; - _skip: (amount: number) => Promise; -}; - -type SyncInputStream = Uint8Array; - -type ChatListener = { - _incoming_message: ( - envelope: Uint8Array, - timestamp: number, - ack: ServerMessageAck - ) => void; - _queue_empty: () => void; - _received_alerts: (alerts: string[]) => void; - _connection_interrupted: ( - // A LibSignalError or null, but not naming the type to avoid circular import dependencies. - reason: Error | null - ) => void; -}; - -type ChallengeOption = 'pushChallenge' | 'captcha'; - -type RegistrationPushTokenType = 'apn' | 'fcm'; - -type RegistrationCreateSessionRequest = { - number: string; - push_token?: string; - push_token_type?: RegistrationPushTokenType; - mcc?: string; - mnc?: string; -}; - -type RegisterResponseBadge = { - id: string; - visible: boolean; - expirationSeconds: number; -}; - -type CheckSvr2CredentialsResponse = Map< - string, - 'match' | 'no-match' | 'invalid' ->; - -type SignedPublicPreKey = { - keyId: number; - publicKey: Uint8Array; - signature: Uint8Array; -}; - -type Wrapper = Readonly<{ - _nativeHandle: T; -}>; - -type MessageBackupValidationOutcome = { - errorMessage: string | null; - unknownFieldMessages: Array; -}; - -type AccountEntropyPool = string; - -type CancellablePromise = Promise & { - _cancellationToken: bigint; -}; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -type Serialized = Uint8Array; - -export function registerErrors(errorsModule: Record): void; - -export const enum LogLevel { Error = 1, Warn, Info, Debug, Trace } -export function AccountEntropyPool_DeriveBackupKey(accountEntropy: AccountEntropyPool): Uint8Array; -export function AccountEntropyPool_DeriveSvrKey(accountEntropy: AccountEntropyPool): Uint8Array; -export function AccountEntropyPool_Generate(): string; -export function AccountEntropyPool_IsValid(accountEntropy: string): boolean; -export function Aes256GcmSiv_Decrypt(aesGcmSiv: Wrapper, ctext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array): Uint8Array; -export function Aes256GcmSiv_Encrypt(aesGcmSivObj: Wrapper, ptext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array): Uint8Array; -export function Aes256GcmSiv_New(key: Uint8Array): Aes256GcmSiv; -export function AuthCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void; -export function AuthCredentialPresentation_GetPniCiphertext(presentationBytes: Uint8Array): Serialized; -export function AuthCredentialPresentation_GetRedemptionTime(presentationBytes: Uint8Array): Timestamp; -export function AuthCredentialPresentation_GetUuidCiphertext(presentationBytes: Uint8Array): Serialized; -export function AuthCredentialWithPniResponse_CheckValidContents(bytes: Uint8Array): void; -export function AuthCredentialWithPni_CheckValidContents(bytes: Uint8Array): void; -export function AuthenticatedChatConnection_connect(asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string, receiveStories: boolean, languages: string[]): CancellablePromise; -export function AuthenticatedChatConnection_disconnect(asyncRuntime: Wrapper, chat: Wrapper): CancellablePromise; -export function AuthenticatedChatConnection_info(chat: Wrapper): ChatConnectionInfo; -export function AuthenticatedChatConnection_init_listener(chat: Wrapper, listener: ChatListener): void; -export function AuthenticatedChatConnection_preconnect(asyncRuntime: Wrapper, connectionManager: Wrapper): CancellablePromise; -export function AuthenticatedChatConnection_send(asyncRuntime: Wrapper, chat: Wrapper, httpRequest: Wrapper, timeoutMillis: number): CancellablePromise; -export function BackupAuthCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void; -export function BackupAuthCredentialPresentation_GetBackupId(presentationBytes: Uint8Array): Uint8Array; -export function BackupAuthCredentialPresentation_GetBackupLevel(presentationBytes: Uint8Array): number; -export function BackupAuthCredentialPresentation_GetType(presentationBytes: Uint8Array): number; -export function BackupAuthCredentialPresentation_Verify(presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array): void; -export function BackupAuthCredentialRequestContext_CheckValidContents(contextBytes: Uint8Array): void; -export function BackupAuthCredentialRequestContext_GetRequest(contextBytes: Uint8Array): Uint8Array; -export function BackupAuthCredentialRequestContext_New(backupKey: Uint8Array, uuid: Uuid): Uint8Array; -export function BackupAuthCredentialRequestContext_ReceiveResponse(contextBytes: Uint8Array, responseBytes: Uint8Array, expectedRedemptionTime: Timestamp, paramsBytes: Uint8Array): Uint8Array; -export function BackupAuthCredentialRequest_CheckValidContents(requestBytes: Uint8Array): void; -export function BackupAuthCredentialRequest_IssueDeterministic(requestBytes: Uint8Array, redemptionTime: Timestamp, backupLevel: number, credentialType: number, paramsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function BackupAuthCredentialResponse_CheckValidContents(responseBytes: Uint8Array): void; -export function BackupAuthCredential_CheckValidContents(paramsBytes: Uint8Array): void; -export function BackupAuthCredential_GetBackupId(credentialBytes: Uint8Array): Uint8Array; -export function BackupAuthCredential_GetBackupLevel(credentialBytes: Uint8Array): number; -export function BackupAuthCredential_GetType(credentialBytes: Uint8Array): number; -export function BackupAuthCredential_PresentDeterministic(credentialBytes: Uint8Array, serverParamsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function BackupJsonExporter_ExportFrames(exporter: Wrapper, frames: Uint8Array): string; -export function BackupJsonExporter_Finish(exporter: Wrapper): string; -export function BackupJsonExporter_GetInitialChunk(exporter: Wrapper): string; -export function BackupJsonExporter_New(backupInfo: Uint8Array, shouldValidate: boolean): BackupJsonExporter; -export function BackupKey_DeriveBackupId(backupKey: Uint8Array, aci: Uint8Array): Uint8Array; -export function BackupKey_DeriveEcKey(backupKey: Uint8Array, aci: Uint8Array): PrivateKey; -export function BackupKey_DeriveLocalBackupMetadataKey(backupKey: Uint8Array): Uint8Array; -export function BackupKey_DeriveMediaEncryptionKey(backupKey: Uint8Array, mediaId: Uint8Array): Uint8Array; -export function BackupKey_DeriveMediaId(backupKey: Uint8Array, mediaName: string): Uint8Array; -export function BackupKey_DeriveThumbnailTransitEncryptionKey(backupKey: Uint8Array, mediaId: Uint8Array): Uint8Array; -export function BackupRestoreResponse_GetForwardSecrecyToken(response: Wrapper): Uint8Array; -export function BackupRestoreResponse_GetNextBackupSecretData(response: Wrapper): Uint8Array; -export function BackupStoreResponse_GetForwardSecrecyToken(response: Wrapper): Uint8Array; -export function BackupStoreResponse_GetNextBackupSecretData(response: Wrapper): Uint8Array; -export function BackupStoreResponse_GetOpaqueMetadata(response: Wrapper): Uint8Array; -export function BridgedStringMap_insert(map: Wrapper, key: string, value: string): void; -export function BridgedStringMap_new(initialCapacity: number): BridgedStringMap; -export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void; -export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Uint8Array): Serialized; -export function CallLinkAuthCredentialPresentation_Verify(presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array): void; -export function CallLinkAuthCredentialResponse_CheckValidContents(responseBytes: Uint8Array): void; -export function CallLinkAuthCredentialResponse_IssueDeterministic(userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function CallLinkAuthCredentialResponse_Receive(responseBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array): Uint8Array; -export function CallLinkAuthCredential_CheckValidContents(credentialBytes: Uint8Array): void; -export function CallLinkAuthCredential_PresentDeterministic(credentialBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function CallLinkPublicParams_CheckValidContents(paramsBytes: Uint8Array): void; -export function CallLinkSecretParams_CheckValidContents(paramsBytes: Uint8Array): void; -export function CallLinkSecretParams_DecryptUserId(paramsBytes: Uint8Array, userId: Serialized): Uint8Array; -export function CallLinkSecretParams_DeriveFromRootKey(rootKey: Uint8Array): Uint8Array; -export function CallLinkSecretParams_EncryptUserId(paramsBytes: Uint8Array, userId: Uint8Array): Serialized; -export function CallLinkSecretParams_GetPublicParams(paramsBytes: Uint8Array): Uint8Array; -export function Cds2ClientState_New(mrenclave: Uint8Array, attestationMsg: Uint8Array, currentTimestamp: Timestamp): SgxClientState; -export function CdsiLookup_complete(asyncRuntime: Wrapper, lookup: Wrapper): CancellablePromise; -export function CdsiLookup_new(asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string, request: Wrapper): CancellablePromise; -export function CdsiLookup_token(lookup: Wrapper): Uint8Array; -export function ChatConnectionInfo_description(connectionInfo: Wrapper): string; -export function ChatConnectionInfo_ip_version(connectionInfo: Wrapper): number; -export function ChatConnectionInfo_local_port(connectionInfo: Wrapper): number; -export function CiphertextMessage_FromPlaintextContent(m: Wrapper): CiphertextMessage; -export function CiphertextMessage_Serialize(obj: Wrapper): Uint8Array; -export function CiphertextMessage_Type(msg: Wrapper): number; -export function ComparableBackup_GetComparableString(backup: Wrapper): string; -export function ComparableBackup_GetUnknownFields(backup: Wrapper): string[]; -export function ComparableBackup_ReadUnencrypted(stream: InputStream, len: bigint, purpose: number): Promise; -export function ConnectionManager_clear_proxy(connectionManager: Wrapper): void; -export function ConnectionManager_new(environment: number, userAgent: string, remoteConfig: Wrapper, buildVariant: number): ConnectionManager; -export function ConnectionManager_on_network_change(connectionManager: Wrapper): void; -export function ConnectionManager_set_censorship_circumvention_enabled(connectionManager: Wrapper, enabled: boolean): void; -export function ConnectionManager_set_invalid_proxy(connectionManager: Wrapper): void; -export function ConnectionManager_set_ipv6_enabled(connectionManager: Wrapper, ipv6Enabled: boolean): void; -export function ConnectionManager_set_proxy(connectionManager: Wrapper, proxy: Wrapper): void; -export function ConnectionManager_set_remote_config(connectionManager: Wrapper, remoteConfig: Wrapper, buildVariant: number): void; -export function ConnectionProxyConfig_new(scheme: string, host: string, port: number, username: string | null, password: string | null): ConnectionProxyConfig; -export function CreateCallLinkCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void; -export function CreateCallLinkCredentialPresentation_Verify(presentationBytes: Uint8Array, roomId: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array): void; -export function CreateCallLinkCredentialRequestContext_CheckValidContents(contextBytes: Uint8Array): void; -export function CreateCallLinkCredentialRequestContext_GetRequest(contextBytes: Uint8Array): Uint8Array; -export function CreateCallLinkCredentialRequestContext_NewDeterministic(roomId: Uint8Array, randomness: Uint8Array): Uint8Array; -export function CreateCallLinkCredentialRequestContext_ReceiveResponse(contextBytes: Uint8Array, responseBytes: Uint8Array, userId: Uint8Array, paramsBytes: Uint8Array): Uint8Array; -export function CreateCallLinkCredentialRequest_CheckValidContents(requestBytes: Uint8Array): void; -export function CreateCallLinkCredentialRequest_IssueDeterministic(requestBytes: Uint8Array, userId: Uint8Array, timestamp: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function CreateCallLinkCredentialResponse_CheckValidContents(responseBytes: Uint8Array): void; -export function CreateCallLinkCredential_CheckValidContents(paramsBytes: Uint8Array): void; -export function CreateCallLinkCredential_PresentDeterministic(credentialBytes: Uint8Array, roomId: Uint8Array, userId: Uint8Array, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array): Uint8Array; -export function DecryptionErrorMessage_Deserialize(data: Uint8Array): DecryptionErrorMessage; -export function DecryptionErrorMessage_ExtractFromSerializedContent(bytes: Uint8Array): DecryptionErrorMessage; -export function DecryptionErrorMessage_ForOriginalMessage(originalBytes: Uint8Array, 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): Uint8Array; -export function ExpiringProfileKeyCredentialResponse_CheckValidContents(buffer: Uint8Array): void; -export function ExpiringProfileKeyCredential_CheckValidContents(buffer: Uint8Array): void; -export function ExpiringProfileKeyCredential_GetExpirationTime(credential: Serialized): Timestamp; -export function Fingerprint_DisplayString(obj: Wrapper): string; -export function Fingerprint_New(iterations: number, version: number, localIdentifier: Uint8Array, localKey: Wrapper, remoteIdentifier: Uint8Array, remoteKey: Wrapper): Fingerprint; -export function Fingerprint_ScannableEncoding(obj: Wrapper): Uint8Array; -export function GenericServerPublicParams_CheckValidContents(paramsBytes: Uint8Array): void; -export function GenericServerSecretParams_CheckValidContents(paramsBytes: Uint8Array): void; -export function GenericServerSecretParams_GenerateDeterministic(randomness: Uint8Array): Uint8Array; -export function GenericServerSecretParams_GetPublicParams(paramsBytes: Uint8Array): Uint8Array; -export function GroupCipher_DecryptMessage(sender: Wrapper, message: Uint8Array, store: SenderKeyStore): Promise; -export function GroupCipher_EncryptMessage(sender: Wrapper, distributionId: Uuid, message: Uint8Array, store: SenderKeyStore): Promise; -export function GroupMasterKey_CheckValidContents(buffer: Uint8Array): void; -export function GroupPublicParams_CheckValidContents(buffer: Uint8Array): void; -export function GroupPublicParams_GetGroupIdentifier(groupPublicParams: Serialized): Uint8Array; -export function GroupSecretParams_CheckValidContents(buffer: Uint8Array): void; -export function GroupSecretParams_DecryptBlobWithPadding(params: Serialized, ciphertext: Uint8Array): Uint8Array; -export function GroupSecretParams_DecryptProfileKey(params: Serialized, profileKey: Serialized, userId: Uint8Array): Serialized; -export function GroupSecretParams_DecryptServiceId(params: Serialized, ciphertext: Serialized): Uint8Array; -export function GroupSecretParams_DeriveFromMasterKey(masterKey: Serialized): Serialized; -export function GroupSecretParams_EncryptBlobWithPaddingDeterministic(params: Serialized, randomness: Uint8Array, plaintext: Uint8Array, paddingLen: number): Uint8Array; -export function GroupSecretParams_EncryptProfileKey(params: Serialized, profileKey: Serialized, userId: Uint8Array): Serialized; -export function GroupSecretParams_EncryptServiceId(params: Serialized, serviceId: Uint8Array): Serialized; -export function GroupSecretParams_GenerateDeterministic(randomness: Uint8Array): Serialized; -export function GroupSecretParams_GetMasterKey(params: Serialized): Serialized; -export function GroupSecretParams_GetPublicParams(params: Serialized): Serialized; -export function GroupSendDerivedKeyPair_CheckValidContents(bytes: Uint8Array): void; -export function GroupSendDerivedKeyPair_ForExpiration(expiration: Timestamp, serverParams: Wrapper): Uint8Array; -export function GroupSendEndorsement_CallLinkParams_ToToken(endorsement: Uint8Array, callLinkSecretParamsSerialized: Uint8Array): Uint8Array; -export function GroupSendEndorsement_CheckValidContents(bytes: Uint8Array): void; -export function GroupSendEndorsement_Combine(endorsements: Uint8Array[]): Uint8Array; -export function GroupSendEndorsement_Remove(endorsement: Uint8Array, toRemove: Uint8Array): Uint8Array; -export function GroupSendEndorsement_ToToken(endorsement: Uint8Array, groupParams: Serialized): Uint8Array; -export function GroupSendEndorsementsResponse_CheckValidContents(bytes: Uint8Array): void; -export function GroupSendEndorsementsResponse_GetExpiration(responseBytes: Uint8Array): Timestamp; -export function GroupSendEndorsementsResponse_IssueDeterministic(concatenatedGroupMemberCiphertexts: Uint8Array, keyPair: Uint8Array, randomness: Uint8Array): Uint8Array; -export function GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts(responseBytes: Uint8Array, concatenatedGroupMemberCiphertexts: Uint8Array, localUserCiphertext: Uint8Array, now: Timestamp, serverParams: Wrapper): Uint8Array[]; -export function GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds(responseBytes: Uint8Array, groupMembers: Uint8Array, localUser: Uint8Array, now: Timestamp, groupParams: Serialized, serverParams: Wrapper): Uint8Array[]; -export function GroupSendFullToken_CheckValidContents(bytes: Uint8Array): void; -export function GroupSendFullToken_GetExpiration(token: Uint8Array): Timestamp; -export function GroupSendFullToken_Verify(token: Uint8Array, userIds: Uint8Array, now: Timestamp, keyPair: Uint8Array): void; -export function GroupSendToken_CheckValidContents(bytes: Uint8Array): void; -export function GroupSendToken_ToFullToken(token: Uint8Array, expiration: Timestamp): Uint8Array; -export function HKDF_DeriveSecrets(outputLength: number, ikm: Uint8Array, label: Uint8Array | null, salt: Uint8Array | null): Uint8Array; -export function HsmEnclaveClient_CompleteHandshake(cli: Wrapper, handshakeReceived: Uint8Array): void; -export function HsmEnclaveClient_EstablishedRecv(cli: Wrapper, receivedCiphertext: Uint8Array): Uint8Array; -export function HsmEnclaveClient_EstablishedSend(cli: Wrapper, plaintextToSend: Uint8Array): Uint8Array; -export function HsmEnclaveClient_InitialRequest(obj: Wrapper): Uint8Array; -export function HsmEnclaveClient_New(trustedPublicKey: Uint8Array, trustedCodeHashes: Uint8Array): HsmEnclaveClient; -export function HttpRequest_add_header(request: Wrapper, name: string, value: string): void; -export function HttpRequest_new(method: string, path: string, bodyAsSlice: Uint8Array | null): HttpRequest; -export function IdentityKeyPair_Deserialize(input: Uint8Array): [PublicKey, PrivateKey]; -export function IdentityKeyPair_Serialize(publicKey: Wrapper, privateKey: Wrapper): Uint8Array; -export function IdentityKeyPair_SignAlternateIdentity(publicKey: Wrapper, privateKey: Wrapper, otherIdentity: Wrapper): Uint8Array; -export function IdentityKey_VerifyAlternateIdentity(publicKey: Wrapper, otherIdentity: Wrapper, signature: Uint8Array): boolean; -export function IncrementalMac_CalculateChunkSize(dataSize: number): number; -export function IncrementalMac_Finalize(mac: Wrapper): Uint8Array; -export function IncrementalMac_Initialize(key: Uint8Array, chunkSize: number): IncrementalMac; -export function IncrementalMac_Update(mac: Wrapper, bytes: Uint8Array, offset: number, length: number): Uint8Array; -export function KeyTransparency_AciSearchKey(aci: Uint8Array): Uint8Array; -export function KeyTransparency_Distinguished(asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, lastDistinguishedTreeHead: Uint8Array | null): CancellablePromise; -export function KeyTransparency_E164SearchKey(e164: string): Uint8Array; -export function KeyTransparency_Monitor(asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, aci: Uint8Array, aciIdentityKey: Wrapper, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array, isSelfMonitor: boolean): CancellablePromise; -export function KeyTransparency_Search(asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, aci: Uint8Array, aciIdentityKey: Wrapper, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array): CancellablePromise; -export function KeyTransparency_UsernameHashSearchKey(hash: Uint8Array): Uint8Array; -export function KyberKeyPair_Generate(): KyberKeyPair; -export function KyberKeyPair_GetPublicKey(keyPair: Wrapper): KyberPublicKey; -export function KyberKeyPair_GetSecretKey(keyPair: Wrapper): KyberSecretKey; -export function KyberPreKeyRecord_Deserialize(data: Uint8Array): 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): Uint8Array; -export function KyberPreKeyRecord_GetTimestamp(obj: Wrapper): Timestamp; -export function KyberPreKeyRecord_New(id: number, timestamp: Timestamp, keyPair: Wrapper, signature: Uint8Array): KyberPreKeyRecord; -export function KyberPreKeyRecord_Serialize(obj: Wrapper): Uint8Array; -export function KyberPublicKey_Deserialize(data: Uint8Array): KyberPublicKey; -export function KyberPublicKey_Equals(lhs: Wrapper, rhs: Wrapper): boolean; -export function KyberPublicKey_Serialize(obj: Wrapper): Uint8Array; -export function KyberSecretKey_Deserialize(data: Uint8Array): KyberSecretKey; -export function KyberSecretKey_Serialize(obj: Wrapper): Uint8Array; -export function LookupRequest_addAciAndAccessKey(request: Wrapper, aci: Uint8Array, accessKey: Uint8Array): 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_setToken(request: Wrapper, token: Uint8Array): void; -export function MessageBackupKey_FromAccountEntropyPool(accountEntropy: AccountEntropyPool, aci: Uint8Array, forwardSecrecyToken: Uint8Array | null): MessageBackupKey; -export function MessageBackupKey_FromBackupKeyAndBackupId(backupKey: Uint8Array, backupId: Uint8Array, forwardSecrecyToken: Uint8Array | null): MessageBackupKey; -export function MessageBackupKey_GetAesKey(key: Wrapper): Uint8Array; -export function MessageBackupKey_GetHmacKey(key: Wrapper): Uint8Array; -export function MessageBackupValidator_Validate(key: Wrapper, firstStream: InputStream, secondStream: InputStream, len: bigint, purpose: number): Promise; -export function MinidumpToJSONString(buffer: Uint8Array): string; -export function Mp4Sanitizer_Sanitize(input: InputStream, len: bigint): Promise; -export function OnlineBackupValidator_AddFrame(backup: Wrapper, frame: Uint8Array): void; -export function OnlineBackupValidator_Finalize(backup: Wrapper): void; -export function OnlineBackupValidator_New(backupInfoFrame: Uint8Array, purpose: number): OnlineBackupValidator; -export function PlaintextContent_Deserialize(data: Uint8Array): PlaintextContent; -export function PlaintextContent_FromDecryptionErrorMessage(m: Wrapper): PlaintextContent; -export function PlaintextContent_GetBody(obj: Wrapper): Uint8Array; -export function PlaintextContent_Serialize(obj: Wrapper): Uint8Array; -export function PreKeyBundle_GetDeviceId(obj: Wrapper): number; -export function PreKeyBundle_GetIdentityKey(p: Wrapper): PublicKey; -export function PreKeyBundle_GetKyberPreKeyId(obj: Wrapper): number; -export function PreKeyBundle_GetKyberPreKeyPublic(bundle: Wrapper): KyberPublicKey; -export function PreKeyBundle_GetKyberPreKeySignature(obj: Wrapper): Uint8Array; -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): Uint8Array; -export function PreKeyBundle_New(registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper | null, signedPrekeyId: number, signedPrekey: Wrapper, signedPrekeySignature: Uint8Array, identityKey: Wrapper, kyberPrekeyId: number, kyberPrekey: Wrapper, kyberPrekeySignature: Uint8Array): PreKeyBundle; -export function PreKeyRecord_Deserialize(data: Uint8Array): 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): Uint8Array; -export function PreKeySignalMessage_Deserialize(data: Uint8Array): 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): Uint8Array; -export function PrivateKey_Agree(privateKey: Wrapper, publicKey: Wrapper): Uint8Array; -export function PrivateKey_Deserialize(data: Uint8Array): PrivateKey; -export function PrivateKey_Generate(): PrivateKey; -export function PrivateKey_GetPublicKey(k: Wrapper): PublicKey; -export function PrivateKey_HpkeOpen(sk: Wrapper, ciphertext: Uint8Array, info: Uint8Array, associatedData: Uint8Array): Uint8Array; -export function PrivateKey_Serialize(obj: Wrapper): Uint8Array; -export function PrivateKey_Sign(key: Wrapper, message: Uint8Array): Uint8Array; -export function ProfileKeyCiphertext_CheckValidContents(buffer: Uint8Array): void; -export function ProfileKeyCommitment_CheckValidContents(buffer: Uint8Array): void; -export function ProfileKeyCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void; -export function ProfileKeyCredentialPresentation_GetProfileKeyCiphertext(presentationBytes: Uint8Array): Serialized; -export function ProfileKeyCredentialPresentation_GetUuidCiphertext(presentationBytes: Uint8Array): Serialized; -export function ProfileKeyCredentialRequestContext_CheckValidContents(buffer: Uint8Array): void; -export function ProfileKeyCredentialRequestContext_GetRequest(context: Serialized): Serialized; -export function ProfileKeyCredentialRequest_CheckValidContents(buffer: Uint8Array): void; -export function ProfileKey_CheckValidContents(buffer: Uint8Array): void; -export function ProfileKey_DeriveAccessKey(profileKey: Serialized): Uint8Array; -export function ProfileKey_GetCommitment(profileKey: Serialized, userId: Uint8Array): Serialized; -export function ProfileKey_GetProfileKeyVersion(profileKey: Serialized, userId: Uint8Array): Uint8Array; -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: Uint8Array): PublicKey; -export function PublicKey_Equals(lhs: Wrapper, rhs: Wrapper): boolean; -export function PublicKey_GetPublicKeyBytes(obj: Wrapper): Uint8Array; -export function PublicKey_HpkeSeal(pk: Wrapper, plaintext: Uint8Array, info: Uint8Array, associatedData: Uint8Array): Uint8Array; -export function PublicKey_Serialize(obj: Wrapper): Uint8Array; -export function PublicKey_Verify(key: Wrapper, message: Uint8Array, signature: Uint8Array): boolean; -export function ReceiptCredentialPresentation_CheckValidContents(buffer: Uint8Array): void; -export function ReceiptCredentialPresentation_GetReceiptExpirationTime(presentation: Serialized): Timestamp; -export function ReceiptCredentialPresentation_GetReceiptLevel(presentation: Serialized): bigint; -export function ReceiptCredentialPresentation_GetReceiptSerial(presentation: Serialized): Uint8Array; -export function ReceiptCredentialRequestContext_CheckValidContents(buffer: Uint8Array): void; -export function ReceiptCredentialRequestContext_GetRequest(requestContext: Serialized): Serialized; -export function ReceiptCredentialRequest_CheckValidContents(buffer: Uint8Array): void; -export function ReceiptCredentialResponse_CheckValidContents(buffer: Uint8Array): void; -export function ReceiptCredential_CheckValidContents(buffer: Uint8Array): void; -export function ReceiptCredential_GetReceiptExpirationTime(receiptCredential: Serialized): Timestamp; -export function ReceiptCredential_GetReceiptLevel(receiptCredential: Serialized): bigint; -export function RegisterAccountRequest_Create(): RegisterAccountRequest; -export function RegisterAccountRequest_SetAccountPassword(registerAccount: Wrapper, accountPassword: string): void; -export function RegisterAccountRequest_SetIdentityPqLastResortPreKey(registerAccount: Wrapper, identityType: number, pqLastResortPreKey: SignedPublicPreKey): void; -export function RegisterAccountRequest_SetIdentityPublicKey(registerAccount: Wrapper, identityType: number, identityKey: Wrapper): void; -export function RegisterAccountRequest_SetIdentitySignedPreKey(registerAccount: Wrapper, identityType: number, signedPreKey: SignedPublicPreKey): void; -export function RegisterAccountRequest_SetSkipDeviceTransfer(registerAccount: Wrapper): void; -export function RegisterAccountResponse_GetEntitlementBackupExpirationSeconds(response: Wrapper): bigint | null; -export function RegisterAccountResponse_GetEntitlementBackupLevel(response: Wrapper): bigint | null; -export function RegisterAccountResponse_GetEntitlementBadges(response: Wrapper): RegisterResponseBadge[]; -export function RegisterAccountResponse_GetIdentity(response: Wrapper, identityType: number): Uint8Array; -export function RegisterAccountResponse_GetNumber(response: Wrapper): string; -export function RegisterAccountResponse_GetReregistration(response: Wrapper): boolean; -export function RegisterAccountResponse_GetStorageCapable(response: Wrapper): boolean; -export function RegisterAccountResponse_GetUsernameHash(response: Wrapper): Uint8Array | null; -export function RegisterAccountResponse_GetUsernameLinkHandle(response: Wrapper): Uuid | null; -export function RegistrationAccountAttributes_Create(recoveryPassword: Uint8Array, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Uint8Array, unrestrictedUnidentifiedAccess: boolean, capabilities: string[], discoverableByPhoneNumber: boolean): RegistrationAccountAttributes; -export function RegistrationService_CheckSvr2Credentials(asyncRuntime: Wrapper, service: Wrapper, svrTokens: string[]): CancellablePromise; -export function RegistrationService_CreateSession(asyncRuntime: Wrapper, createSession: RegistrationCreateSessionRequest, connectChat: ConnectChatBridge): CancellablePromise; -export function RegistrationService_RegisterAccount(asyncRuntime: Wrapper, service: Wrapper, registerAccount: Wrapper, accountAttributes: Wrapper): CancellablePromise; -export function RegistrationService_RegistrationSession(service: Wrapper): RegistrationSession; -export function RegistrationService_RequestVerificationCode(asyncRuntime: Wrapper, service: Wrapper, transport: string, client: string, languages: string[]): CancellablePromise; -export function RegistrationService_ReregisterAccount(asyncRuntime: Wrapper, connectChat: ConnectChatBridge, number: string, registerAccount: Wrapper, accountAttributes: Wrapper): CancellablePromise; -export function RegistrationService_ResumeSession(asyncRuntime: Wrapper, sessionId: string, number: string, connectChat: ConnectChatBridge): CancellablePromise; -export function RegistrationService_SessionId(service: Wrapper): string; -export function RegistrationService_SubmitCaptcha(asyncRuntime: Wrapper, service: Wrapper, captchaValue: string): CancellablePromise; -export function RegistrationService_SubmitVerificationCode(asyncRuntime: Wrapper, service: Wrapper, code: string): CancellablePromise; -export function RegistrationSession_GetAllowedToRequestCode(session: Wrapper): boolean; -export function RegistrationSession_GetNextCallSeconds(session: Wrapper): number | null; -export function RegistrationSession_GetNextSmsSeconds(session: Wrapper): number | null; -export function RegistrationSession_GetNextVerificationAttemptSeconds(session: Wrapper): number | null; -export function RegistrationSession_GetRequestedInformation(session: Wrapper): ChallengeOption[]; -export function RegistrationSession_GetVerified(session: Wrapper): boolean; -export function SanitizedMetadata_GetDataLen(sanitized: Wrapper): bigint; -export function SanitizedMetadata_GetDataOffset(sanitized: Wrapper): bigint; -export function SanitizedMetadata_GetMetadata(sanitized: Wrapper): Uint8Array; -export function ScannableFingerprint_Compare(fprint1: Uint8Array, fprint2: Uint8Array): 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): Uint8Array; -export function SealedSenderMultiRecipientMessage_Parse(buffer: Uint8Array): SealedSenderMultiRecipientMessage; -export function SealedSender_DecryptMessage(message: Uint8Array, 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: Uint8Array, identityStore: IdentityKeyStore): Promise; -export function SealedSender_Encrypt(destination: Wrapper, content: Wrapper, identityKeyStore: IdentityKeyStore): Promise; -export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper[], recipientSessions: Wrapper[], excludedRecipients: Uint8Array, content: Wrapper, identityKeyStore: IdentityKeyStore): Promise; -export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Uint8Array): Uint8Array; -export function SecureValueRecoveryForBackups_CreateNewBackupChain(environment: number, backupKey: Uint8Array): Uint8Array; -export function SecureValueRecoveryForBackups_RemoveBackup(asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string): CancellablePromise; -export function SecureValueRecoveryForBackups_RestoreBackupFromServer(asyncRuntime: Wrapper, backupKey: Uint8Array, metadata: Uint8Array, connectionManager: Wrapper, username: string, password: string): CancellablePromise; -export function SecureValueRecoveryForBackups_StoreBackup(asyncRuntime: Wrapper, backupKey: Uint8Array, previousSecretData: Uint8Array, connectionManager: Wrapper, username: string, password: string): CancellablePromise; -export function SenderCertificate_Deserialize(data: Uint8Array): SenderCertificate; -export function SenderCertificate_GetCertificate(obj: Wrapper): Uint8Array; -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): Uint8Array; -export function SenderCertificate_GetServerCertificate(cert: Wrapper): ServerCertificate; -export function SenderCertificate_GetSignature(obj: Wrapper): Uint8Array; -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, trustRoots: Wrapper[], time: Timestamp): boolean; -export function SenderKeyDistributionMessage_Create(sender: Wrapper, distributionId: Uuid, store: SenderKeyStore): Promise; -export function SenderKeyDistributionMessage_Deserialize(data: Uint8Array): SenderKeyDistributionMessage; -export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper): number; -export function SenderKeyDistributionMessage_GetChainKey(obj: Wrapper): Uint8Array; -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: Uint8Array, pk: Wrapper): SenderKeyDistributionMessage; -export function SenderKeyDistributionMessage_Process(sender: Wrapper, senderKeyDistributionMessage: Wrapper, store: SenderKeyStore): Promise; -export function SenderKeyDistributionMessage_Serialize(obj: Wrapper): Uint8Array; -export function SenderKeyMessage_Deserialize(data: Uint8Array): SenderKeyMessage; -export function SenderKeyMessage_GetChainId(obj: Wrapper): number; -export function SenderKeyMessage_GetCipherText(obj: Wrapper): Uint8Array; -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: Uint8Array, pk: Wrapper): SenderKeyMessage; -export function SenderKeyMessage_Serialize(obj: Wrapper): Uint8Array; -export function SenderKeyMessage_VerifySignature(skm: Wrapper, pubkey: Wrapper): boolean; -export function SenderKeyRecord_Deserialize(data: Uint8Array): SenderKeyRecord; -export function SenderKeyRecord_Serialize(obj: Wrapper): Uint8Array; -export function ServerCertificate_Deserialize(data: Uint8Array): ServerCertificate; -export function ServerCertificate_GetCertificate(obj: Wrapper): Uint8Array; -export function ServerCertificate_GetKey(obj: Wrapper): PublicKey; -export function ServerCertificate_GetKeyId(obj: Wrapper): number; -export function ServerCertificate_GetSerialized(obj: Wrapper): Uint8Array; -export function ServerCertificate_GetSignature(obj: Wrapper): Uint8Array; -export function ServerCertificate_New(keyId: number, serverKey: Wrapper, trustRoot: Wrapper): ServerCertificate; -export function ServerMessageAck_SendStatus(ack: Wrapper, status: number): void; -export function ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic(serverPublicParams: Wrapper, randomness: Uint8Array, groupSecretParams: Serialized, authCredentialWithPniBytes: Uint8Array): Uint8Array; -export function ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic(serverPublicParams: Wrapper, randomness: Uint8Array, groupSecretParams: Serialized, profileKeyCredential: Serialized): Uint8Array; -export function ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic(serverPublicParams: Wrapper, randomness: Uint8Array, userId: Uint8Array, profileKey: Serialized): Serialized; -export function ServerPublicParams_CreateReceiptCredentialPresentationDeterministic(serverPublicParams: Wrapper, randomness: Uint8Array, receiptCredential: Serialized): Serialized; -export function ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic(serverPublicParams: Wrapper, randomness: Uint8Array, receiptSerial: Uint8Array): Serialized; -export function ServerPublicParams_Deserialize(buffer: Uint8Array): ServerPublicParams; -export function ServerPublicParams_GetEndorsementPublicKey(params: Wrapper): Uint8Array; -export function ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId(params: Wrapper, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp, authCredentialWithPniResponseBytes: Uint8Array): Uint8Array; -export function ServerPublicParams_ReceiveExpiringProfileKeyCredential(serverPublicParams: Wrapper, requestContext: Serialized, response: Serialized, currentTimeInSeconds: Timestamp): Serialized; -export function ServerPublicParams_ReceiveReceiptCredential(serverPublicParams: Wrapper, requestContext: Serialized, response: Serialized): Serialized; -export function ServerPublicParams_Serialize(handle: Wrapper): Uint8Array; -export function ServerPublicParams_VerifySignature(serverPublicParams: Wrapper, message: Uint8Array, notarySignature: Uint8Array): void; -export function ServerSecretParams_Deserialize(buffer: Uint8Array): ServerSecretParams; -export function ServerSecretParams_GenerateDeterministic(randomness: Uint8Array): ServerSecretParams; -export function ServerSecretParams_GetPublicParams(params: Wrapper): ServerPublicParams; -export function ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic(serverSecretParams: Wrapper, randomness: Uint8Array, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp): Uint8Array; -export function ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic(serverSecretParams: Wrapper, randomness: Uint8Array, request: Serialized, userId: Uint8Array, commitment: Serialized, expirationInSeconds: Timestamp): Serialized; -export function ServerSecretParams_IssueReceiptCredentialDeterministic(serverSecretParams: Wrapper, randomness: Uint8Array, request: Serialized, receiptExpirationTime: Timestamp, receiptLevel: bigint): Serialized; -export function ServerSecretParams_Serialize(handle: Wrapper): Uint8Array; -export function ServerSecretParams_SignDeterministic(params: Wrapper, randomness: Uint8Array, message: Uint8Array): Uint8Array; -export function ServerSecretParams_VerifyAuthCredentialPresentation(serverSecretParams: Wrapper, groupPublicParams: Serialized, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp): void; -export function ServerSecretParams_VerifyProfileKeyCredentialPresentation(serverSecretParams: Wrapper, groupPublicParams: Serialized, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp): void; -export function ServerSecretParams_VerifyReceiptCredentialPresentation(serverSecretParams: Wrapper, presentation: Serialized): void; -export function ServiceId_ParseFromServiceIdBinary(input: Uint8Array): Uint8Array; -export function ServiceId_ParseFromServiceIdString(input: string): Uint8Array; -export function ServiceId_ServiceIdBinary(value: Uint8Array): Uint8Array; -export function ServiceId_ServiceIdLog(value: Uint8Array): string; -export function ServiceId_ServiceIdString(value: Uint8Array): 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: Uint8Array, 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: Uint8Array): 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): Uint8Array; -export function SgxClientState_CompleteHandshake(cli: Wrapper, handshakeReceived: Uint8Array): void; -export function SgxClientState_EstablishedRecv(cli: Wrapper, receivedCiphertext: Uint8Array): Uint8Array; -export function SgxClientState_EstablishedSend(cli: Wrapper, plaintextToSend: Uint8Array): Uint8Array; -export function SgxClientState_InitialRequest(obj: Wrapper): Uint8Array; -export function SignalMedia_CheckAvailable(): void; -export function SignalMessage_Deserialize(data: Uint8Array): SignalMessage; -export function SignalMessage_GetBody(obj: Wrapper): Uint8Array; -export function SignalMessage_GetCounter(obj: Wrapper): number; -export function SignalMessage_GetMessageVersion(obj: Wrapper): number; -export function SignalMessage_GetPqRatchet(msg: Wrapper): Uint8Array; -export function SignalMessage_GetSerialized(obj: Wrapper): Uint8Array; -export function SignalMessage_New(messageVersion: number, macKey: Uint8Array, senderRatchetKey: Wrapper, counter: number, previousCounter: number, ciphertext: Uint8Array, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper, pqRatchet: Uint8Array): SignalMessage; -export function SignalMessage_VerifyMac(msg: Wrapper, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper, macKey: Uint8Array): boolean; -export function SignedPreKeyRecord_Deserialize(data: Uint8Array): 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): Uint8Array; -export function SignedPreKeyRecord_GetTimestamp(obj: Wrapper): Timestamp; -export function SignedPreKeyRecord_New(id: number, timestamp: Timestamp, pubKey: Wrapper, privKey: Wrapper, signature: Uint8Array): SignedPreKeyRecord; -export function SignedPreKeyRecord_Serialize(obj: Wrapper): Uint8Array; -export function TESTING_BridgedStringMap_dump_to_json(map: Wrapper): string; -export function TESTING_CdsiLookupErrorConvert(errorDescription: string): void; -export function TESTING_CdsiLookupResponseConvert(asyncRuntime: Wrapper): CancellablePromise; -export function TESTING_ChatConnectErrorConvert(errorDescription: string): void; -export function TESTING_ChatRequestGetBody(request: Wrapper): Uint8Array; -export function TESTING_ChatRequestGetHeaderNames(request: Wrapper): string[]; -export function TESTING_ChatRequestGetHeaderValue(request: Wrapper, headerName: string): string; -export function TESTING_ChatRequestGetMethod(request: Wrapper): string; -export function TESTING_ChatRequestGetPath(request: Wrapper): string; -export function TESTING_ChatResponseConvert(bodyPresent: boolean): ChatResponse; -export function TESTING_ChatSendErrorConvert(errorDescription: string): void; -export function TESTING_ConnectionManager_isUsingProxy(manager: Wrapper): number; -export function TESTING_ConnectionManager_newLocalOverride(userAgent: string, chatPort: number, cdsiPort: number, svr2Port: number, svrBPort: number, rootCertificateDer: Uint8Array): ConnectionManager; -export function TESTING_ConvertOptionalUuid(present: boolean): Uuid | null; -export function TESTING_CreateOTP(username: string, secret: Uint8Array): string; -export function TESTING_CreateOTPFromBase64(username: string, secret: string): string; -export function TESTING_ErrorOnBorrowAsync(_input: null): Promise; -export function TESTING_ErrorOnBorrowIo(asyncRuntime: Wrapper, _input: null): CancellablePromise; -export function TESTING_ErrorOnBorrowSync(_input: null): void; -export function TESTING_ErrorOnReturnAsync(_needsCleanup: null): Promise; -export function TESTING_ErrorOnReturnIo(asyncRuntime: Wrapper, _needsCleanup: null): CancellablePromise; -export function TESTING_ErrorOnReturnSync(_needsCleanup: null): null; -export function TESTING_FakeChatConnection_Create(tokio: Wrapper, listener: ChatListener, alertsJoinedByNewlines: string): FakeChatConnection; -export function TESTING_FakeChatConnection_TakeAuthenticatedChat(chat: Wrapper): AuthenticatedChatConnection; -export function TESTING_FakeChatConnection_TakeRemote(chat: Wrapper): FakeChatRemoteEnd; -export function TESTING_FakeChatConnection_TakeUnauthenticatedChat(chat: Wrapper): UnauthenticatedChatConnection; -export function TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted(chat: Wrapper): void; -export function TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest(asyncRuntime: Wrapper, chat: Wrapper): CancellablePromise<[HttpRequest, bigint] | null>; -export function TESTING_FakeChatRemoteEnd_SendRawServerRequest(chat: Wrapper, bytes: Uint8Array): void; -export function TESTING_FakeChatRemoteEnd_SendRawServerResponse(chat: Wrapper, bytes: Uint8Array): void; -export function TESTING_FakeChatRemoteEnd_SendServerResponse(chat: Wrapper, response: Wrapper): void; -export function TESTING_FakeChatResponse_Create(id: bigint, status: number, message: string, headers: string[], body: Uint8Array | null): FakeChatResponse; -export function TESTING_FakeChatServer_Create(): FakeChatServer; -export function TESTING_FakeChatServer_GetNextRemote(asyncRuntime: Wrapper, server: Wrapper): CancellablePromise; -export function TESTING_FakeRegistrationSession_CreateSession(asyncRuntime: Wrapper, createSession: RegistrationCreateSessionRequest, chat: Wrapper): CancellablePromise; -export function TESTING_FutureCancellationCounter_Create(initialValue: number): TestingFutureCancellationCounter; -export function TESTING_FutureCancellationCounter_WaitForCount(asyncRuntime: Wrapper, count: Wrapper, target: number): CancellablePromise; -export function TESTING_FutureFailure(asyncRuntime: Wrapper, _input: number): CancellablePromise; -export function TESTING_FutureIncrementOnCancel(asyncRuntime: Wrapper, _guard: TestingFutureCancellationGuard): CancellablePromise; -export function TESTING_FutureProducesOtherPointerType(asyncRuntime: Wrapper, input: string): CancellablePromise; -export function TESTING_FutureProducesPointerType(asyncRuntime: Wrapper, input: number): CancellablePromise; -export function TESTING_FutureSuccess(asyncRuntime: Wrapper, input: number): CancellablePromise; -export function TESTING_InputStreamReadIntoZeroLengthSlice(capsAlphabetInput: InputStream): Promise; -export function TESTING_JoinStringArray(array: string[], joinWith: string): string; -export function TESTING_KeyTransChatSendError(): void; -export function TESTING_KeyTransFatalVerificationFailure(): void; -export function TESTING_KeyTransNonFatalVerificationFailure(): void; -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): CancellablePromise; -export function TESTING_PanicInBodySync(_input: null): void; -export function TESTING_PanicOnBorrowAsync(_input: null): Promise; -export function TESTING_PanicOnBorrowIo(asyncRuntime: Wrapper, _input: null): CancellablePromise; -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): CancellablePromise; -export function TESTING_PanicOnLoadSync(_needsCleanup: null, _input: null): void; -export function TESTING_PanicOnReturnAsync(_needsCleanup: null): Promise; -export function TESTING_PanicOnReturnIo(asyncRuntime: Wrapper, _needsCleanup: null): CancellablePromise; -export function TESTING_PanicOnReturnSync(_needsCleanup: null): null; -export function TESTING_ProcessBytestringArray(input: Uint8Array[]): Uint8Array[]; -export function TESTING_RegisterAccountResponse_CreateTestValue(): RegisterAccountResponse; -export function TESTING_RegistrationService_CheckSvr2CredentialsErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_CheckSvr2CredentialsResponseConvert(): CheckSvr2CredentialsResponse; -export function TESTING_RegistrationService_CreateSessionErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_RegisterAccountErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_RequestVerificationCodeErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_ResumeSessionErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_SubmitVerificationErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationService_UpdateSessionErrorConvert(errorDescription: string): void; -export function TESTING_RegistrationSessionInfoConvert(): RegistrationSession; -export function TESTING_ReturnPair(): [number, string]; -export function TESTING_ReturnStringArray(): string[]; -export function TESTING_RoundTripI32(input: number): number; -export function TESTING_RoundTripU16(input: number): number; -export function TESTING_RoundTripU32(input: number): number; -export function TESTING_RoundTripU64(input: bigint): bigint; -export function TESTING_RoundTripU8(input: number): number; -export function TESTING_ServerMessageAck_Create(): ServerMessageAck; -export function TESTING_SignedPublicPreKey_CheckBridgesCorrectly(sourcePublicKey: Wrapper, signedPreKey: SignedPublicPreKey): void; -export function TESTING_TestingHandleType_getValue(handle: Wrapper): number; -export function TESTING_TokioAsyncContext_FutureSuccessBytes(asyncRuntime: Wrapper, count: number): CancellablePromise; -export function TESTING_TokioAsyncContext_NewSingleThreaded(): TokioAsyncContext; -export function TESTING_TokioAsyncFuture(asyncRuntime: Wrapper, input: number): CancellablePromise; -export function TestingSemaphore_AddPermits(semaphore: Wrapper, permits: number): void; -export function TestingSemaphore_New(initial: number): TestingSemaphore; -export function TestingValueHolder_Get(holder: Wrapper): number; -export function TestingValueHolder_New(value: number): TestingValueHolder; -export function TokioAsyncContext_cancel(context: Wrapper, rawCancellationId: bigint): void; -export function TokioAsyncContext_new(): TokioAsyncContext; -export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper, connectionManager: Wrapper, languages: string[]): CancellablePromise; -export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper, chat: Wrapper): CancellablePromise; -export function UnauthenticatedChatConnection_info(chat: Wrapper): ChatConnectionInfo; -export function UnauthenticatedChatConnection_init_listener(chat: Wrapper, listener: ChatListener): void; -export function UnauthenticatedChatConnection_look_up_username_hash(asyncRuntime: Wrapper, chat: Wrapper, hash: Uint8Array): CancellablePromise; -export function UnauthenticatedChatConnection_send(asyncRuntime: Wrapper, chat: Wrapper, httpRequest: Wrapper, timeoutMillis: number): CancellablePromise; -export function UnauthenticatedChatConnection_send_multi_recipient_message(asyncRuntime: Wrapper, chat: Wrapper, payload: Uint8Array, timestamp: Timestamp, auth: Uint8Array|null, onlineOnly: boolean, isUrgent: boolean): CancellablePromise; -export function UnidentifiedSenderMessageContent_Deserialize(data: Uint8Array): UnidentifiedSenderMessageContent; -export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper): number; -export function UnidentifiedSenderMessageContent_GetContents(obj: Wrapper): Uint8Array; -export function UnidentifiedSenderMessageContent_GetGroupId(obj: Wrapper): Uint8Array | 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: Uint8Array | null): UnidentifiedSenderMessageContent; -export function UnidentifiedSenderMessageContent_Serialize(obj: Wrapper): Uint8Array; -export function UsernameLink_Create(username: string, entropy: Uint8Array | null): Uint8Array; -export function UsernameLink_DecryptUsername(entropy: Uint8Array, encryptedUsername: Uint8Array): string; -export function Username_CandidatesFrom(nickname: string, minLen: number, maxLen: number): string[]; -export function Username_Hash(username: string): Uint8Array; -export function Username_HashFromParts(nickname: string, discriminator: string, minLen: number, maxLen: number): Uint8Array; -export function Username_Proof(username: string, randomness: Uint8Array): Uint8Array; -export function Username_Verify(proof: Uint8Array, hash: Uint8Array): void; -export function UuidCiphertext_CheckValidContents(buffer: Uint8Array): void; -export function ValidatingMac_Finalize(mac: Wrapper): number; -export function ValidatingMac_Initialize(key: Uint8Array, chunkSize: number, digests: Uint8Array): ValidatingMac | null; -export function ValidatingMac_Update(mac: Wrapper, bytes: Uint8Array, 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 -export function test_only_fn_returns_123(): number; -interface Aes256GcmSiv { readonly __type: unique symbol; } -interface AuthenticatedChatConnection { readonly __type: unique symbol; } -interface BackupJsonExporter { readonly __type: unique symbol; } -interface BackupRestoreResponse { readonly __type: unique symbol; } -interface BackupStoreResponse { readonly __type: unique symbol; } -interface BridgedStringMap { readonly __type: unique symbol; } -interface CdsiLookup { readonly __type: unique symbol; } -interface ChatConnectionInfo { readonly __type: unique symbol; } -interface CiphertextMessage { readonly __type: unique symbol; } -interface ComparableBackup { readonly __type: unique symbol; } -interface ConnectionManager { readonly __type: unique symbol; } -interface ConnectionProxyConfig { readonly __type: unique symbol; } -interface DecryptionErrorMessage { readonly __type: unique symbol; } -interface ExpiringProfileKeyCredential { readonly __type: unique symbol; } -interface ExpiringProfileKeyCredentialResponse { readonly __type: unique symbol; } -interface FakeChatConnection { readonly __type: unique symbol; } -interface FakeChatRemoteEnd { readonly __type: unique symbol; } -interface FakeChatResponse { readonly __type: unique symbol; } -interface FakeChatServer { 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 HttpRequest { 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 MessageBackupKey { readonly __type: unique symbol; } -interface NonSuspendingBackgroundThreadRuntime { readonly __type: unique symbol; } -interface OnlineBackupValidator { 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 RegisterAccountRequest { readonly __type: unique symbol; } -interface RegisterAccountResponse { readonly __type: unique symbol; } -interface RegistrationAccountAttributes { readonly __type: unique symbol; } -interface RegistrationService { readonly __type: unique symbol; } -interface RegistrationSession { 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 ServerMessageAck { 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 TestingFutureCancellationCounter { readonly __type: unique symbol; } -interface TestingHandleType { readonly __type: unique symbol; } -interface TestingSemaphore { readonly __type: unique symbol; } -interface TestingValueHolder { readonly __type: unique symbol; } -interface TokioAsyncContext { readonly __type: unique symbol; } -interface UnauthenticatedChatConnection { readonly __type: unique symbol; } -interface UnidentifiedSenderMessageContent { readonly __type: unique symbol; } -interface UuidCiphertext { readonly __type: unique symbol; } -interface ValidatingMac { readonly __type: unique symbol; } diff --git a/node/Native.js b/node/Native.js deleted file mode 100644 index f361fa46b..000000000 --- a/node/Native.js +++ /dev/null @@ -1,9 +0,0 @@ -// -// Copyright 2021 Signal Messenger, LLC. -// SPDX-License-Identifier: AGPL-3.0-only -// - -import load from 'node-gyp-build'; - -const Native = load(import.meta.dirname); -export default Native; diff --git a/node/eslint.config.js b/node/eslint.config.js index 200ab2947..92c582d56 100644 --- a/node/eslint.config.js +++ b/node/eslint.config.js @@ -164,6 +164,7 @@ const config = defineConfig( '**/Native.js', '**/zkgroup.js', '**/zkgroup.d.ts', + 'ts/node-gyp-build.d.ts', ], }, ]); diff --git a/node/package.json b/node/package.json index 4c16ecdb1..9a6341017 100644 --- a/node/package.json +++ b/node/package.json @@ -23,8 +23,8 @@ "build": "python3 build_node_bridge.py", "build-with-debug-level-logs": "python3 build_node_bridge.py --debug-level-logs", "clean": "rimraf dist build prebuilds", - "format": "p() { prettier ${@:- --write} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.d.ts.in; }; p", - "format-check": "p() { prettier ${@:- --check} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.d.ts.in; }; p", + "format": "p() { prettier ${@:- --write} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.ts.in; }; p", + "format-check": "p() { prettier ${@:- --check} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.ts.in; }; p", "install": "echo Use \\`npm run build\\` to build the native library if needed", "lint": "eslint .", "prepack": "cp ../acknowledgments/acknowledgments-desktop.md dist/acknowledgments.md", diff --git a/node/ts/AccountKeys.ts b/node/ts/AccountKeys.ts index 219b0d490..f5ed1ed77 100644 --- a/node/ts/AccountKeys.ts +++ b/node/ts/AccountKeys.ts @@ -12,7 +12,7 @@ */ import * as crypto from 'node:crypto'; -import Native from '../Native.js'; +import * as Native from './Native.js'; import ByteArray from './zkgroup/internal/ByteArray.js'; import { Aci } from './Address.js'; import { PrivateKey } from './EcKeys.js'; diff --git a/node/ts/Address.ts b/node/ts/Address.ts index b83d2108a..085b4e883 100644 --- a/node/ts/Address.ts +++ b/node/ts/Address.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../Native.js'; +import * as Native from './Native.js'; import * as uuid from 'uuid'; import { Buffer } from 'node:buffer'; diff --git a/node/ts/EcKeys.ts b/node/ts/EcKeys.ts index 4eedb865e..c41ce0b2c 100644 --- a/node/ts/EcKeys.ts +++ b/node/ts/EcKeys.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../Native.js'; +import * as Native from './Native.js'; export class PublicKey { readonly _nativeHandle: Native.PublicKey; diff --git a/node/ts/Errors.ts b/node/ts/Errors.ts index 1512caa10..7a9665d90 100644 --- a/node/ts/Errors.ts +++ b/node/ts/Errors.ts @@ -4,7 +4,7 @@ // import { ProtocolAddress, ServiceId } from './Address.js'; -import Native from '../Native.js'; +import * as Native from './Native.js'; export enum ErrorCode { Generic, diff --git a/node/ts/MessageBackup.ts b/node/ts/MessageBackup.ts index 63db68a21..dd6d68ffc 100644 --- a/node/ts/MessageBackup.ts +++ b/node/ts/MessageBackup.ts @@ -9,7 +9,7 @@ * @module MessageBackup */ -import Native from '../Native.js'; +import * as Native from './Native.js'; import { BackupForwardSecrecyToken, BackupKey } from './AccountKeys.js'; import { Aci } from './Address.js'; import { InputStream } from './io.js'; diff --git a/node/ts/Minidump.ts b/node/ts/Minidump.ts index 323942d28..89c693557 100644 --- a/node/ts/Minidump.ts +++ b/node/ts/Minidump.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../Native.js'; +import * as Native from './Native.js'; export function toJSONString(buffer: Uint8Array): string { return Native.MinidumpToJSONString(buffer); diff --git a/node/ts/Mp4Sanitizer.ts b/node/ts/Mp4Sanitizer.ts index 5b77e7f38..29e3d01ed 100644 --- a/node/ts/Mp4Sanitizer.ts +++ b/node/ts/Mp4Sanitizer.ts @@ -31,7 +31,7 @@ * @module Mp4Sanitizer */ -import Native from '../Native.js'; +import * as Native from './Native.js'; import { IoError, InvalidMediaInputError, diff --git a/node/ts/Native.ts b/node/ts/Native.ts new file mode 100644 index 000000000..e0ea01c88 --- /dev/null +++ b/node/ts/Native.ts @@ -0,0 +1,1916 @@ +// +// Copyright 2020 Signal Messenger, LLC. +// SPDX-License-Identifier: AGPL-3.0-only +// + +// WARNING: this file was automatically generated + +export type Uuid = Uint8Array; + +/// 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. +export type Timestamp = number; + +// Rust code produces or consumes values that conform to these interface +// definitions. They must be kept in sync to prevent bridging errors. + +export type LookupResponse = { + entries: Map; + debugPermitsUsed: number; +}; + +export type LookupResponseEntry = { + readonly aci: string | undefined; + readonly pni: string | undefined; +}; + +export type ChatResponse = { + status: number; + message: string | undefined; + headers: ReadonlyArray<[string, string]>; + body: Uint8Array | undefined; +}; + +export type ChatServiceDebugInfo = { + ipType: number; + durationMillis: number; + connectionInfo: string; +}; + +export type ResponseAndDebugInfo = { + response: ChatResponse; + debugInfo: ChatServiceDebugInfo; +}; + +export type SealedSenderMultiRecipientMessageRecipient = { + deviceIds: number[]; + registrationIds: number[]; + rangeOffset: number; + rangeLen: number; +}; + +export type SealedSenderMultiRecipientMessage = { + recipientMap: { + [serviceId: string]: SealedSenderMultiRecipientMessageRecipient; + }; + excludedRecipients: string[]; + offsetOfSharedData: number; +}; + +export enum IdentityChange { + // This must be kept in sync with the Rust enum of the same name. + NewOrUnchanged = 0, + ReplacedExisting = 1, +} + +export type IdentityKeyStore = { + _getIdentityKey: () => Promise; + _getLocalRegistrationId: () => Promise; + _saveIdentity: ( + name: ProtocolAddress, + key: PublicKey + ) => Promise; + _isTrustedIdentity: ( + name: ProtocolAddress, + key: PublicKey, + sending: boolean + ) => Promise; + _getIdentity: (name: ProtocolAddress) => Promise; +}; + +export type SessionStore = { + _saveSession: (addr: ProtocolAddress, record: SessionRecord) => Promise; + _getSession: (addr: ProtocolAddress) => Promise; +}; + +export type PreKeyStore = { + _savePreKey: (preKeyId: number, record: PreKeyRecord) => Promise; + _getPreKey: (preKeyId: number) => Promise; + _removePreKey: (preKeyId: number) => Promise; +}; + +export type SignedPreKeyStore = { + _saveSignedPreKey: ( + signedPreKeyId: number, + record: SignedPreKeyRecord + ) => Promise; + _getSignedPreKey: (signedPreKeyId: number) => Promise; +}; + +export type KyberPreKeyStore = { + _saveKyberPreKey: ( + kyberPreKeyId: number, + record: KyberPreKeyRecord + ) => Promise; + _getKyberPreKey: (kyberPreKeyId: number) => Promise; + _markKyberPreKeyUsed: ( + kyberPreKeyId: number, + signedPreKeyId: number, + baseKey: PublicKey + ) => Promise; +}; + +export type SenderKeyStore = { + _saveSenderKey: ( + sender: ProtocolAddress, + distributionId: Uuid, + record: SenderKeyRecord + ) => Promise; + _getSenderKey: ( + sender: ProtocolAddress, + distributionId: Uuid + ) => Promise; +}; + +export type InputStream = { + _read: (amount: number) => Promise; + _skip: (amount: number) => Promise; +}; + +export type SyncInputStream = Uint8Array; + +export type ChatListener = { + _incoming_message: ( + envelope: Uint8Array, + timestamp: number, + ack: ServerMessageAck + ) => void; + _queue_empty: () => void; + _received_alerts: (alerts: string[]) => void; + _connection_interrupted: ( + // A LibSignalError or null, but not naming the type to avoid circular import dependencies. + reason: Error | null + ) => void; +}; + +export type ChallengeOption = 'pushChallenge' | 'captcha'; + +export type RegistrationPushTokenType = 'apn' | 'fcm'; + +export type RegistrationCreateSessionRequest = { + number: string; + push_token?: string; + push_token_type?: RegistrationPushTokenType; + mcc?: string; + mnc?: string; +}; + +export type RegisterResponseBadge = { + id: string; + visible: boolean; + expirationSeconds: number; +}; + +export type CheckSvr2CredentialsResponse = Map< + string, + 'match' | 'no-match' | 'invalid' +>; + +export type SignedPublicPreKey = { + keyId: number; + publicKey: Uint8Array; + signature: Uint8Array; +}; + +export type Wrapper = Readonly<{ + _nativeHandle: T; +}>; + +export type MessageBackupValidationOutcome = { + errorMessage: string | null; + unknownFieldMessages: Array; +}; + +export type AccountEntropyPool = string; + +export type CancellablePromise = Promise & { + _cancellationToken: bigint; +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export type Serialized = Uint8Array; + +type ConnectChatBridge = Wrapper; +type TestingFutureCancellationGuard = Wrapper; + +import load from 'node-gyp-build'; + +type NativeFunctions = { + registerErrors: (errorsModule: Record) => void; + initLogger: (maxLevel: LogLevel, callback: (level: LogLevel, target: string, file: string | null, line: number | null, message: string) => void) => void + SealedSenderMultiRecipientMessage_Parse: (buffer: Uint8Array) => SealedSenderMultiRecipientMessage; + MinidumpToJSONString: (buffer: Uint8Array) => string; + Aes256GcmSiv_New: (key: Uint8Array) => Aes256GcmSiv; + Aes256GcmSiv_Encrypt: (aesGcmSivObj: Wrapper, ptext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array) => Uint8Array; + Aes256GcmSiv_Decrypt: (aesGcmSiv: Wrapper, ctext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array) => Uint8Array; + PublicKey_HpkeSeal: (pk: Wrapper, plaintext: Uint8Array, info: Uint8Array, associatedData: Uint8Array) => Uint8Array; + PrivateKey_HpkeOpen: (sk: Wrapper, ciphertext: Uint8Array, info: Uint8Array, associatedData: Uint8Array) => Uint8Array; + HKDF_DeriveSecrets: (outputLength: number, ikm: Uint8Array, label: Uint8Array | null, salt: Uint8Array | null) => Uint8Array; + ServiceId_ServiceIdBinary: (value: Uint8Array) => Uint8Array; + ServiceId_ServiceIdString: (value: Uint8Array) => string; + ServiceId_ServiceIdLog: (value: Uint8Array) => string; + ServiceId_ParseFromServiceIdBinary: (input: Uint8Array) => Uint8Array; + ServiceId_ParseFromServiceIdString: (input: string) => Uint8Array; + ProtocolAddress_New: (name: string, deviceId: number) => ProtocolAddress; + PublicKey_Deserialize: (data: Uint8Array) => PublicKey; + PublicKey_Serialize: (obj: Wrapper) => Uint8Array; + PublicKey_GetPublicKeyBytes: (obj: Wrapper) => Uint8Array; + ProtocolAddress_DeviceId: (obj: Wrapper) => number; + ProtocolAddress_Name: (obj: Wrapper) => string; + PublicKey_Equals: (lhs: Wrapper, rhs: Wrapper) => boolean; + PublicKey_Compare: (key1: Wrapper, key2: Wrapper) => number; + PublicKey_Verify: (key: Wrapper, message: Uint8Array, signature: Uint8Array) => boolean; + PrivateKey_Deserialize: (data: Uint8Array) => PrivateKey; + PrivateKey_Serialize: (obj: Wrapper) => Uint8Array; + PrivateKey_Generate: () => PrivateKey; + PrivateKey_GetPublicKey: (k: Wrapper) => PublicKey; + PrivateKey_Sign: (key: Wrapper, message: Uint8Array) => Uint8Array; + PrivateKey_Agree: (privateKey: Wrapper, publicKey: Wrapper) => Uint8Array; + KyberPublicKey_Serialize: (obj: Wrapper) => Uint8Array; + KyberPublicKey_Deserialize: (data: Uint8Array) => KyberPublicKey; + KyberSecretKey_Serialize: (obj: Wrapper) => Uint8Array; + KyberSecretKey_Deserialize: (data: Uint8Array) => KyberSecretKey; + KyberPublicKey_Equals: (lhs: Wrapper, rhs: Wrapper) => boolean; + KyberKeyPair_Generate: () => KyberKeyPair; + KyberKeyPair_GetPublicKey: (keyPair: Wrapper) => KyberPublicKey; + KyberKeyPair_GetSecretKey: (keyPair: Wrapper) => KyberSecretKey; + IdentityKeyPair_Serialize: (publicKey: Wrapper, privateKey: Wrapper) => Uint8Array; + IdentityKeyPair_Deserialize: (input: Uint8Array) => [PublicKey, PrivateKey]; + IdentityKeyPair_SignAlternateIdentity: (publicKey: Wrapper, privateKey: Wrapper, otherIdentity: Wrapper) => Uint8Array; + IdentityKey_VerifyAlternateIdentity: (publicKey: Wrapper, otherIdentity: Wrapper, signature: Uint8Array) => boolean; + Fingerprint_New: (iterations: number, version: number, localIdentifier: Uint8Array, localKey: Wrapper, remoteIdentifier: Uint8Array, remoteKey: Wrapper) => Fingerprint; + Fingerprint_ScannableEncoding: (obj: Wrapper) => Uint8Array; + Fingerprint_DisplayString: (obj: Wrapper) => string; + ScannableFingerprint_Compare: (fprint1: Uint8Array, fprint2: Uint8Array) => boolean; + SignalMessage_Deserialize: (data: Uint8Array) => SignalMessage; + SignalMessage_GetBody: (obj: Wrapper) => Uint8Array; + SignalMessage_GetSerialized: (obj: Wrapper) => Uint8Array; + SignalMessage_GetCounter: (obj: Wrapper) => number; + SignalMessage_GetMessageVersion: (obj: Wrapper) => number; + SignalMessage_GetPqRatchet: (msg: Wrapper) => Uint8Array; + SignalMessage_New: (messageVersion: number, macKey: Uint8Array, senderRatchetKey: Wrapper, counter: number, previousCounter: number, ciphertext: Uint8Array, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper, pqRatchet: Uint8Array) => SignalMessage; + SignalMessage_VerifyMac: (msg: Wrapper, senderIdentityKey: Wrapper, receiverIdentityKey: Wrapper, macKey: Uint8Array) => boolean; + PreKeySignalMessage_New: (messageVersion: number, registrationId: number, preKeyId: number | null, signedPreKeyId: number, baseKey: Wrapper, identityKey: Wrapper, signalMessage: Wrapper) => PreKeySignalMessage; + PreKeySignalMessage_Deserialize: (data: Uint8Array) => PreKeySignalMessage; + PreKeySignalMessage_Serialize: (obj: Wrapper) => Uint8Array; + PreKeySignalMessage_GetRegistrationId: (obj: Wrapper) => number; + PreKeySignalMessage_GetSignedPreKeyId: (obj: Wrapper) => number; + PreKeySignalMessage_GetPreKeyId: (obj: Wrapper) => number | null; + PreKeySignalMessage_GetVersion: (obj: Wrapper) => number; + SenderKeyMessage_Deserialize: (data: Uint8Array) => SenderKeyMessage; + SenderKeyMessage_GetCipherText: (obj: Wrapper) => Uint8Array; + SenderKeyMessage_Serialize: (obj: Wrapper) => Uint8Array; + SenderKeyMessage_GetDistributionId: (obj: Wrapper) => Uuid; + SenderKeyMessage_GetChainId: (obj: Wrapper) => number; + SenderKeyMessage_GetIteration: (obj: Wrapper) => number; + SenderKeyMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Uint8Array, pk: Wrapper) => SenderKeyMessage; + SenderKeyMessage_VerifySignature: (skm: Wrapper, pubkey: Wrapper) => boolean; + SenderKeyDistributionMessage_Deserialize: (data: Uint8Array) => SenderKeyDistributionMessage; + SenderKeyDistributionMessage_GetChainKey: (obj: Wrapper) => Uint8Array; + SenderKeyDistributionMessage_Serialize: (obj: Wrapper) => Uint8Array; + SenderKeyDistributionMessage_GetDistributionId: (obj: Wrapper) => Uuid; + SenderKeyDistributionMessage_GetChainId: (obj: Wrapper) => number; + SenderKeyDistributionMessage_GetIteration: (obj: Wrapper) => number; + SenderKeyDistributionMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Uint8Array, pk: Wrapper) => SenderKeyDistributionMessage; + DecryptionErrorMessage_Deserialize: (data: Uint8Array) => DecryptionErrorMessage; + DecryptionErrorMessage_GetTimestamp: (obj: Wrapper) => Timestamp; + DecryptionErrorMessage_GetDeviceId: (obj: Wrapper) => number; + DecryptionErrorMessage_Serialize: (obj: Wrapper) => Uint8Array; + DecryptionErrorMessage_GetRatchetKey: (m: Wrapper) => PublicKey | null; + DecryptionErrorMessage_ForOriginalMessage: (originalBytes: Uint8Array, originalType: number, originalTimestamp: Timestamp, originalSenderDeviceId: number) => DecryptionErrorMessage; + DecryptionErrorMessage_ExtractFromSerializedContent: (bytes: Uint8Array) => DecryptionErrorMessage; + PlaintextContent_Deserialize: (data: Uint8Array) => PlaintextContent; + PlaintextContent_Serialize: (obj: Wrapper) => Uint8Array; + PlaintextContent_GetBody: (obj: Wrapper) => Uint8Array; + PlaintextContent_FromDecryptionErrorMessage: (m: Wrapper) => PlaintextContent; + PreKeyBundle_New: (registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper | null, signedPrekeyId: number, signedPrekey: Wrapper, signedPrekeySignature: Uint8Array, identityKey: Wrapper, kyberPrekeyId: number, kyberPrekey: Wrapper, kyberPrekeySignature: Uint8Array) => PreKeyBundle; + PreKeyBundle_GetIdentityKey: (p: Wrapper) => PublicKey; + PreKeyBundle_GetSignedPreKeySignature: (obj: Wrapper) => Uint8Array; + PreKeyBundle_GetKyberPreKeySignature: (obj: Wrapper) => Uint8Array; + PreKeyBundle_GetRegistrationId: (obj: Wrapper) => number; + PreKeyBundle_GetDeviceId: (obj: Wrapper) => number; + PreKeyBundle_GetSignedPreKeyId: (obj: Wrapper) => number; + PreKeyBundle_GetKyberPreKeyId: (obj: Wrapper) => number; + PreKeyBundle_GetPreKeyId: (obj: Wrapper) => number | null; + PreKeyBundle_GetPreKeyPublic: (obj: Wrapper) => PublicKey | null; + PreKeyBundle_GetSignedPreKeyPublic: (obj: Wrapper) => PublicKey; + PreKeyBundle_GetKyberPreKeyPublic: (bundle: Wrapper) => KyberPublicKey; + SignedPreKeyRecord_Deserialize: (data: Uint8Array) => SignedPreKeyRecord; + SignedPreKeyRecord_GetSignature: (obj: Wrapper) => Uint8Array; + SignedPreKeyRecord_Serialize: (obj: Wrapper) => Uint8Array; + SignedPreKeyRecord_GetId: (obj: Wrapper) => number; + SignedPreKeyRecord_GetTimestamp: (obj: Wrapper) => Timestamp; + SignedPreKeyRecord_GetPublicKey: (obj: Wrapper) => PublicKey; + SignedPreKeyRecord_GetPrivateKey: (obj: Wrapper) => PrivateKey; + KyberPreKeyRecord_Deserialize: (data: Uint8Array) => KyberPreKeyRecord; + KyberPreKeyRecord_GetSignature: (obj: Wrapper) => Uint8Array; + KyberPreKeyRecord_Serialize: (obj: Wrapper) => Uint8Array; + KyberPreKeyRecord_GetId: (obj: Wrapper) => number; + KyberPreKeyRecord_GetTimestamp: (obj: Wrapper) => Timestamp; + KyberPreKeyRecord_GetPublicKey: (obj: Wrapper) => KyberPublicKey; + KyberPreKeyRecord_GetSecretKey: (obj: Wrapper) => KyberSecretKey; + KyberPreKeyRecord_GetKeyPair: (obj: Wrapper) => KyberKeyPair; + SignedPreKeyRecord_New: (id: number, timestamp: Timestamp, pubKey: Wrapper, privKey: Wrapper, signature: Uint8Array) => SignedPreKeyRecord; + KyberPreKeyRecord_New: (id: number, timestamp: Timestamp, keyPair: Wrapper, signature: Uint8Array) => KyberPreKeyRecord; + PreKeyRecord_Deserialize: (data: Uint8Array) => PreKeyRecord; + PreKeyRecord_Serialize: (obj: Wrapper) => Uint8Array; + PreKeyRecord_GetId: (obj: Wrapper) => number; + PreKeyRecord_GetPublicKey: (obj: Wrapper) => PublicKey; + PreKeyRecord_GetPrivateKey: (obj: Wrapper) => PrivateKey; + PreKeyRecord_New: (id: number, pubKey: Wrapper, privKey: Wrapper) => PreKeyRecord; + SenderKeyRecord_Deserialize: (data: Uint8Array) => SenderKeyRecord; + SenderKeyRecord_Serialize: (obj: Wrapper) => Uint8Array; + ServerCertificate_Deserialize: (data: Uint8Array) => ServerCertificate; + ServerCertificate_GetSerialized: (obj: Wrapper) => Uint8Array; + ServerCertificate_GetCertificate: (obj: Wrapper) => Uint8Array; + ServerCertificate_GetSignature: (obj: Wrapper) => Uint8Array; + ServerCertificate_GetKeyId: (obj: Wrapper) => number; + ServerCertificate_GetKey: (obj: Wrapper) => PublicKey; + ServerCertificate_New: (keyId: number, serverKey: Wrapper, trustRoot: Wrapper) => ServerCertificate; + SenderCertificate_Deserialize: (data: Uint8Array) => SenderCertificate; + SenderCertificate_GetSerialized: (obj: Wrapper) => Uint8Array; + SenderCertificate_GetCertificate: (obj: Wrapper) => Uint8Array; + SenderCertificate_GetSignature: (obj: Wrapper) => Uint8Array; + SenderCertificate_GetSenderUuid: (obj: Wrapper) => string; + SenderCertificate_GetSenderE164: (obj: Wrapper) => string | null; + SenderCertificate_GetExpiration: (obj: Wrapper) => Timestamp; + SenderCertificate_GetDeviceId: (obj: Wrapper) => number; + SenderCertificate_GetKey: (obj: Wrapper) => PublicKey; + SenderCertificate_Validate: (cert: Wrapper, trustRoots: Wrapper[], time: Timestamp) => boolean; + SenderCertificate_GetServerCertificate: (cert: Wrapper) => ServerCertificate; + SenderCertificate_New: (senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper, expiration: Timestamp, signerCert: Wrapper, signerKey: Wrapper) => SenderCertificate; + UnidentifiedSenderMessageContent_Deserialize: (data: Uint8Array) => UnidentifiedSenderMessageContent; + UnidentifiedSenderMessageContent_Serialize: (obj: Wrapper) => Uint8Array; + UnidentifiedSenderMessageContent_GetContents: (obj: Wrapper) => Uint8Array; + UnidentifiedSenderMessageContent_GetGroupId: (obj: Wrapper) => Uint8Array | null; + UnidentifiedSenderMessageContent_GetSenderCert: (m: Wrapper) => SenderCertificate; + UnidentifiedSenderMessageContent_GetMsgType: (m: Wrapper) => number; + UnidentifiedSenderMessageContent_GetContentHint: (m: Wrapper) => number; + UnidentifiedSenderMessageContent_New: (message: Wrapper, sender: Wrapper, contentHint: number, groupId: Uint8Array | null) => UnidentifiedSenderMessageContent; + CiphertextMessage_Type: (msg: Wrapper) => number; + CiphertextMessage_Serialize: (obj: Wrapper) => Uint8Array; + CiphertextMessage_FromPlaintextContent: (m: Wrapper) => CiphertextMessage; + SessionRecord_ArchiveCurrentState: (sessionRecord: Wrapper) => void; + SessionRecord_HasUsableSenderChain: (s: Wrapper, now: Timestamp) => boolean; + SessionRecord_CurrentRatchetKeyMatches: (s: Wrapper, key: Wrapper) => boolean; + SessionRecord_Deserialize: (data: Uint8Array) => SessionRecord; + SessionRecord_Serialize: (obj: Wrapper) => Uint8Array; + SessionRecord_GetLocalRegistrationId: (obj: Wrapper) => number; + SessionRecord_GetRemoteRegistrationId: (obj: Wrapper) => number; + SealedSenderDecryptionResult_GetSenderUuid: (obj: Wrapper) => string; + SealedSenderDecryptionResult_GetSenderE164: (obj: Wrapper) => string | null; + SealedSenderDecryptionResult_GetDeviceId: (obj: Wrapper) => number; + SealedSenderDecryptionResult_Message: (obj: Wrapper) => Uint8Array; + SessionBuilder_ProcessPreKeyBundle: (bundle: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp) => Promise; + SessionCipher_EncryptMessage: (ptext: Uint8Array, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp) => Promise; + SessionCipher_DecryptSignalMessage: (message: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore) => Promise; + SessionCipher_DecryptPreKeySignalMessage: (message: Wrapper, protocolAddress: Wrapper, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise; + SealedSender_Encrypt: (destination: Wrapper, content: Wrapper, identityKeyStore: IdentityKeyStore) => Promise; + SealedSender_MultiRecipientEncrypt: (recipients: Wrapper[], recipientSessions: Wrapper[], excludedRecipients: Uint8Array, content: Wrapper, identityKeyStore: IdentityKeyStore) => Promise; + SealedSender_MultiRecipientMessageForSingleRecipient: (encodedMultiRecipientMessage: Uint8Array) => Uint8Array; + SealedSender_DecryptToUsmc: (ctext: Uint8Array, identityStore: IdentityKeyStore) => Promise; + SealedSender_DecryptMessage: (message: Uint8Array, trustRoot: Wrapper, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise; + SenderKeyDistributionMessage_Create: (sender: Wrapper, distributionId: Uuid, store: SenderKeyStore) => Promise; + SenderKeyDistributionMessage_Process: (sender: Wrapper, senderKeyDistributionMessage: Wrapper, store: SenderKeyStore) => Promise; + GroupCipher_EncryptMessage: (sender: Wrapper, distributionId: Uuid, message: Uint8Array, store: SenderKeyStore) => Promise; + GroupCipher_DecryptMessage: (sender: Wrapper, message: Uint8Array, store: SenderKeyStore) => Promise; + Cds2ClientState_New: (mrenclave: Uint8Array, attestationMsg: Uint8Array, currentTimestamp: Timestamp) => SgxClientState; + HsmEnclaveClient_New: (trustedPublicKey: Uint8Array, trustedCodeHashes: Uint8Array) => HsmEnclaveClient; + HsmEnclaveClient_CompleteHandshake: (cli: Wrapper, handshakeReceived: Uint8Array) => void; + HsmEnclaveClient_EstablishedSend: (cli: Wrapper, plaintextToSend: Uint8Array) => Uint8Array; + HsmEnclaveClient_EstablishedRecv: (cli: Wrapper, receivedCiphertext: Uint8Array) => Uint8Array; + HsmEnclaveClient_InitialRequest: (obj: Wrapper) => Uint8Array; + SgxClientState_InitialRequest: (obj: Wrapper) => Uint8Array; + SgxClientState_CompleteHandshake: (cli: Wrapper, handshakeReceived: Uint8Array) => void; + SgxClientState_EstablishedSend: (cli: Wrapper, plaintextToSend: Uint8Array) => Uint8Array; + SgxClientState_EstablishedRecv: (cli: Wrapper, receivedCiphertext: Uint8Array) => Uint8Array; + ExpiringProfileKeyCredential_CheckValidContents: (buffer: Uint8Array) => void; + ExpiringProfileKeyCredentialResponse_CheckValidContents: (buffer: Uint8Array) => void; + GroupMasterKey_CheckValidContents: (buffer: Uint8Array) => void; + GroupPublicParams_CheckValidContents: (buffer: Uint8Array) => void; + GroupSecretParams_CheckValidContents: (buffer: Uint8Array) => void; + ProfileKey_CheckValidContents: (buffer: Uint8Array) => void; + ProfileKeyCiphertext_CheckValidContents: (buffer: Uint8Array) => void; + ProfileKeyCommitment_CheckValidContents: (buffer: Uint8Array) => void; + ProfileKeyCredentialRequest_CheckValidContents: (buffer: Uint8Array) => void; + ProfileKeyCredentialRequestContext_CheckValidContents: (buffer: Uint8Array) => void; + ReceiptCredential_CheckValidContents: (buffer: Uint8Array) => void; + ReceiptCredentialPresentation_CheckValidContents: (buffer: Uint8Array) => void; + ReceiptCredentialRequest_CheckValidContents: (buffer: Uint8Array) => void; + ReceiptCredentialRequestContext_CheckValidContents: (buffer: Uint8Array) => void; + ReceiptCredentialResponse_CheckValidContents: (buffer: Uint8Array) => void; + UuidCiphertext_CheckValidContents: (buffer: Uint8Array) => void; + ServerPublicParams_Deserialize: (buffer: Uint8Array) => ServerPublicParams; + ServerPublicParams_Serialize: (handle: Wrapper) => Uint8Array; + ServerSecretParams_Deserialize: (buffer: Uint8Array) => ServerSecretParams; + ServerSecretParams_Serialize: (handle: Wrapper) => Uint8Array; + ProfileKey_GetCommitment: (profileKey: Serialized, userId: Uint8Array) => Serialized; + ProfileKey_GetProfileKeyVersion: (profileKey: Serialized, userId: Uint8Array) => Uint8Array; + ProfileKey_DeriveAccessKey: (profileKey: Serialized) => Uint8Array; + GroupSecretParams_GenerateDeterministic: (randomness: Uint8Array) => Serialized; + GroupSecretParams_DeriveFromMasterKey: (masterKey: Serialized) => Serialized; + GroupSecretParams_GetMasterKey: (params: Serialized) => Serialized; + GroupSecretParams_GetPublicParams: (params: Serialized) => Serialized; + GroupSecretParams_EncryptServiceId: (params: Serialized, serviceId: Uint8Array) => Serialized; + GroupSecretParams_DecryptServiceId: (params: Serialized, ciphertext: Serialized) => Uint8Array; + GroupSecretParams_EncryptProfileKey: (params: Serialized, profileKey: Serialized, userId: Uint8Array) => Serialized; + GroupSecretParams_DecryptProfileKey: (params: Serialized, profileKey: Serialized, userId: Uint8Array) => Serialized; + GroupSecretParams_EncryptBlobWithPaddingDeterministic: (params: Serialized, randomness: Uint8Array, plaintext: Uint8Array, paddingLen: number) => Uint8Array; + GroupSecretParams_DecryptBlobWithPadding: (params: Serialized, ciphertext: Uint8Array) => Uint8Array; + ServerSecretParams_GenerateDeterministic: (randomness: Uint8Array) => ServerSecretParams; + ServerSecretParams_GetPublicParams: (params: Wrapper) => ServerPublicParams; + ServerSecretParams_SignDeterministic: (params: Wrapper, randomness: Uint8Array, message: Uint8Array) => Uint8Array; + ServerPublicParams_GetEndorsementPublicKey: (params: Wrapper) => Uint8Array; + ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId: (params: Wrapper, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp, authCredentialWithPniResponseBytes: Uint8Array) => Uint8Array; + ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic: (serverPublicParams: Wrapper, randomness: Uint8Array, groupSecretParams: Serialized, authCredentialWithPniBytes: Uint8Array) => Uint8Array; + ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic: (serverPublicParams: Wrapper, randomness: Uint8Array, userId: Uint8Array, profileKey: Serialized) => Serialized; + ServerPublicParams_ReceiveExpiringProfileKeyCredential: (serverPublicParams: Wrapper, requestContext: Serialized, response: Serialized, currentTimeInSeconds: Timestamp) => Serialized; + ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic: (serverPublicParams: Wrapper, randomness: Uint8Array, groupSecretParams: Serialized, profileKeyCredential: Serialized) => Uint8Array; + ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic: (serverPublicParams: Wrapper, randomness: Uint8Array, receiptSerial: Uint8Array) => Serialized; + ServerPublicParams_ReceiveReceiptCredential: (serverPublicParams: Wrapper, requestContext: Serialized, response: Serialized) => Serialized; + ServerPublicParams_CreateReceiptCredentialPresentationDeterministic: (serverPublicParams: Wrapper, randomness: Uint8Array, receiptCredential: Serialized) => Serialized; + ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic: (serverSecretParams: Wrapper, randomness: Uint8Array, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp) => Uint8Array; + AuthCredentialWithPni_CheckValidContents: (bytes: Uint8Array) => void; + AuthCredentialWithPniResponse_CheckValidContents: (bytes: Uint8Array) => void; + ServerSecretParams_VerifyAuthCredentialPresentation: (serverSecretParams: Wrapper, groupPublicParams: Serialized, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp) => void; + ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic: (serverSecretParams: Wrapper, randomness: Uint8Array, request: Serialized, userId: Uint8Array, commitment: Serialized, expirationInSeconds: Timestamp) => Serialized; + ServerSecretParams_VerifyProfileKeyCredentialPresentation: (serverSecretParams: Wrapper, groupPublicParams: Serialized, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp) => void; + ServerSecretParams_IssueReceiptCredentialDeterministic: (serverSecretParams: Wrapper, randomness: Uint8Array, request: Serialized, receiptExpirationTime: Timestamp, receiptLevel: bigint) => Serialized; + ServerSecretParams_VerifyReceiptCredentialPresentation: (serverSecretParams: Wrapper, presentation: Serialized) => void; + GroupPublicParams_GetGroupIdentifier: (groupPublicParams: Serialized) => Uint8Array; + ServerPublicParams_VerifySignature: (serverPublicParams: Wrapper, message: Uint8Array, notarySignature: Uint8Array) => void; + AuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void; + AuthCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array) => Serialized; + AuthCredentialPresentation_GetPniCiphertext: (presentationBytes: Uint8Array) => Serialized; + AuthCredentialPresentation_GetRedemptionTime: (presentationBytes: Uint8Array) => Timestamp; + ProfileKeyCredentialRequestContext_GetRequest: (context: Serialized) => Serialized; + ExpiringProfileKeyCredential_GetExpirationTime: (credential: Serialized) => Timestamp; + ProfileKeyCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void; + ProfileKeyCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array) => Serialized; + ProfileKeyCredentialPresentation_GetProfileKeyCiphertext: (presentationBytes: Uint8Array) => Serialized; + ReceiptCredentialRequestContext_GetRequest: (requestContext: Serialized) => Serialized; + ReceiptCredential_GetReceiptExpirationTime: (receiptCredential: Serialized) => Timestamp; + ReceiptCredential_GetReceiptLevel: (receiptCredential: Serialized) => bigint; + ReceiptCredentialPresentation_GetReceiptExpirationTime: (presentation: Serialized) => Timestamp; + ReceiptCredentialPresentation_GetReceiptLevel: (presentation: Serialized) => bigint; + ReceiptCredentialPresentation_GetReceiptSerial: (presentation: Serialized) => Uint8Array; + GenericServerSecretParams_CheckValidContents: (paramsBytes: Uint8Array) => void; + GenericServerSecretParams_GenerateDeterministic: (randomness: Uint8Array) => Uint8Array; + GenericServerSecretParams_GetPublicParams: (paramsBytes: Uint8Array) => Uint8Array; + GenericServerPublicParams_CheckValidContents: (paramsBytes: Uint8Array) => void; + CallLinkSecretParams_CheckValidContents: (paramsBytes: Uint8Array) => void; + CallLinkSecretParams_DeriveFromRootKey: (rootKey: Uint8Array) => Uint8Array; + CallLinkSecretParams_GetPublicParams: (paramsBytes: Uint8Array) => Uint8Array; + CallLinkSecretParams_DecryptUserId: (paramsBytes: Uint8Array, userId: Serialized) => Uint8Array; + CallLinkSecretParams_EncryptUserId: (paramsBytes: Uint8Array, userId: Uint8Array) => Serialized; + CallLinkPublicParams_CheckValidContents: (paramsBytes: Uint8Array) => void; + CreateCallLinkCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array) => void; + CreateCallLinkCredentialRequestContext_NewDeterministic: (roomId: Uint8Array, randomness: Uint8Array) => Uint8Array; + CreateCallLinkCredentialRequestContext_GetRequest: (contextBytes: Uint8Array) => Uint8Array; + CreateCallLinkCredentialRequest_CheckValidContents: (requestBytes: Uint8Array) => void; + CreateCallLinkCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array, userId: Uint8Array, timestamp: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + CreateCallLinkCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void; + CreateCallLinkCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array, responseBytes: Uint8Array, userId: Uint8Array, paramsBytes: Uint8Array) => Uint8Array; + CreateCallLinkCredential_CheckValidContents: (paramsBytes: Uint8Array) => void; + CreateCallLinkCredential_PresentDeterministic: (credentialBytes: Uint8Array, roomId: Uint8Array, userId: Uint8Array, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + CreateCallLinkCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void; + CreateCallLinkCredentialPresentation_Verify: (presentationBytes: Uint8Array, roomId: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array) => void; + CallLinkAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void; + CallLinkAuthCredentialResponse_IssueDeterministic: (userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + CallLinkAuthCredentialResponse_Receive: (responseBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array) => Uint8Array; + CallLinkAuthCredential_CheckValidContents: (credentialBytes: Uint8Array) => void; + CallLinkAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + CallLinkAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void; + CallLinkAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array) => void; + CallLinkAuthCredentialPresentation_GetUserId: (presentationBytes: Uint8Array) => Serialized; + BackupAuthCredentialRequestContext_New: (backupKey: Uint8Array, uuid: Uuid) => Uint8Array; + BackupAuthCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array) => void; + BackupAuthCredentialRequestContext_GetRequest: (contextBytes: Uint8Array) => Uint8Array; + BackupAuthCredentialRequest_CheckValidContents: (requestBytes: Uint8Array) => void; + BackupAuthCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array, redemptionTime: Timestamp, backupLevel: number, credentialType: number, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + BackupAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void; + BackupAuthCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array, responseBytes: Uint8Array, expectedRedemptionTime: Timestamp, paramsBytes: Uint8Array) => Uint8Array; + BackupAuthCredential_CheckValidContents: (paramsBytes: Uint8Array) => void; + BackupAuthCredential_GetBackupId: (credentialBytes: Uint8Array) => Uint8Array; + BackupAuthCredential_GetBackupLevel: (credentialBytes: Uint8Array) => number; + BackupAuthCredential_GetType: (credentialBytes: Uint8Array) => number; + BackupAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array, serverParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array; + BackupAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void; + BackupAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array) => void; + BackupAuthCredentialPresentation_GetBackupId: (presentationBytes: Uint8Array) => Uint8Array; + BackupAuthCredentialPresentation_GetBackupLevel: (presentationBytes: Uint8Array) => number; + BackupAuthCredentialPresentation_GetType: (presentationBytes: Uint8Array) => number; + GroupSendDerivedKeyPair_CheckValidContents: (bytes: Uint8Array) => void; + GroupSendDerivedKeyPair_ForExpiration: (expiration: Timestamp, serverParams: Wrapper) => Uint8Array; + GroupSendEndorsementsResponse_CheckValidContents: (bytes: Uint8Array) => void; + GroupSendEndorsementsResponse_IssueDeterministic: (concatenatedGroupMemberCiphertexts: Uint8Array, keyPair: Uint8Array, randomness: Uint8Array) => Uint8Array; + GroupSendEndorsementsResponse_GetExpiration: (responseBytes: Uint8Array) => Timestamp; + GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds: (responseBytes: Uint8Array, groupMembers: Uint8Array, localUser: Uint8Array, now: Timestamp, groupParams: Serialized, serverParams: Wrapper) => Uint8Array[]; + GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts: (responseBytes: Uint8Array, concatenatedGroupMemberCiphertexts: Uint8Array, localUserCiphertext: Uint8Array, now: Timestamp, serverParams: Wrapper) => Uint8Array[]; + GroupSendEndorsement_CheckValidContents: (bytes: Uint8Array) => void; + GroupSendEndorsement_Combine: (endorsements: Uint8Array[]) => Uint8Array; + GroupSendEndorsement_Remove: (endorsement: Uint8Array, toRemove: Uint8Array) => Uint8Array; + GroupSendEndorsement_ToToken: (endorsement: Uint8Array, groupParams: Serialized) => Uint8Array; + GroupSendEndorsement_CallLinkParams_ToToken: (endorsement: Uint8Array, callLinkSecretParamsSerialized: Uint8Array) => Uint8Array; + GroupSendToken_CheckValidContents: (bytes: Uint8Array) => void; + GroupSendToken_ToFullToken: (token: Uint8Array, expiration: Timestamp) => Uint8Array; + GroupSendFullToken_CheckValidContents: (bytes: Uint8Array) => void; + GroupSendFullToken_GetExpiration: (token: Uint8Array) => Timestamp; + GroupSendFullToken_Verify: (token: Uint8Array, userIds: Uint8Array, now: Timestamp, keyPair: Uint8Array) => void; + LookupRequest_new: () => LookupRequest; + LookupRequest_addE164: (request: Wrapper, e164: string) => void; + LookupRequest_addPreviousE164: (request: Wrapper, e164: string) => void; + LookupRequest_setToken: (request: Wrapper, token: Uint8Array) => void; + LookupRequest_addAciAndAccessKey: (request: Wrapper, aci: Uint8Array, accessKey: Uint8Array) => void; + CdsiLookup_new: (asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string, request: Wrapper) => CancellablePromise; + CdsiLookup_token: (lookup: Wrapper) => Uint8Array; + CdsiLookup_complete: (asyncRuntime: Wrapper, lookup: Wrapper) => CancellablePromise; + HttpRequest_new: (method: string, path: string, bodyAsSlice: Uint8Array | null) => HttpRequest; + HttpRequest_add_header: (request: Wrapper, name: string, value: string) => void; + ChatConnectionInfo_local_port: (connectionInfo: Wrapper) => number; + ChatConnectionInfo_ip_version: (connectionInfo: Wrapper) => number; + ChatConnectionInfo_description: (connectionInfo: Wrapper) => string; + UnauthenticatedChatConnection_connect: (asyncRuntime: Wrapper, connectionManager: Wrapper, languages: string[]) => CancellablePromise; + UnauthenticatedChatConnection_init_listener: (chat: Wrapper, listener: ChatListener) => void; + UnauthenticatedChatConnection_send: (asyncRuntime: Wrapper, chat: Wrapper, httpRequest: Wrapper, timeoutMillis: number) => CancellablePromise; + UnauthenticatedChatConnection_disconnect: (asyncRuntime: Wrapper, chat: Wrapper) => CancellablePromise; + UnauthenticatedChatConnection_info: (chat: Wrapper) => ChatConnectionInfo; + UnauthenticatedChatConnection_look_up_username_hash: (asyncRuntime: Wrapper, chat: Wrapper, hash: Uint8Array) => CancellablePromise; + UnauthenticatedChatConnection_send_multi_recipient_message: (asyncRuntime: Wrapper, chat: Wrapper, payload: Uint8Array, timestamp: Timestamp, auth: Uint8Array|null, onlineOnly: boolean, isUrgent: boolean) => CancellablePromise; + AuthenticatedChatConnection_preconnect: (asyncRuntime: Wrapper, connectionManager: Wrapper) => CancellablePromise; + AuthenticatedChatConnection_connect: (asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string, receiveStories: boolean, languages: string[]) => CancellablePromise; + AuthenticatedChatConnection_init_listener: (chat: Wrapper, listener: ChatListener) => void; + AuthenticatedChatConnection_send: (asyncRuntime: Wrapper, chat: Wrapper, httpRequest: Wrapper, timeoutMillis: number) => CancellablePromise; + AuthenticatedChatConnection_disconnect: (asyncRuntime: Wrapper, chat: Wrapper) => CancellablePromise; + AuthenticatedChatConnection_info: (chat: Wrapper) => ChatConnectionInfo; + ServerMessageAck_SendStatus: (ack: Wrapper, status: number) => void; + KeyTransparency_AciSearchKey: (aci: Uint8Array) => Uint8Array; + KeyTransparency_E164SearchKey: (e164: string) => Uint8Array; + KeyTransparency_UsernameHashSearchKey: (hash: Uint8Array) => Uint8Array; + KeyTransparency_Search: (asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, aci: Uint8Array, aciIdentityKey: Wrapper, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array) => CancellablePromise; + KeyTransparency_Monitor: (asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, aci: Uint8Array, aciIdentityKey: Wrapper, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array, isSelfMonitor: boolean) => CancellablePromise; + KeyTransparency_Distinguished: (asyncRuntime: Wrapper, environment: number, chatConnection: Wrapper, lastDistinguishedTreeHead: Uint8Array | null) => CancellablePromise; + RegistrationService_CreateSession: (asyncRuntime: Wrapper, createSession: RegistrationCreateSessionRequest, connectChat: ConnectChatBridge) => CancellablePromise; + RegistrationService_ResumeSession: (asyncRuntime: Wrapper, sessionId: string, number: string, connectChat: ConnectChatBridge) => CancellablePromise; + RegistrationService_RequestVerificationCode: (asyncRuntime: Wrapper, service: Wrapper, transport: string, client: string, languages: string[]) => CancellablePromise; + RegistrationService_SubmitVerificationCode: (asyncRuntime: Wrapper, service: Wrapper, code: string) => CancellablePromise; + RegistrationService_SubmitCaptcha: (asyncRuntime: Wrapper, service: Wrapper, captchaValue: string) => CancellablePromise; + RegistrationService_CheckSvr2Credentials: (asyncRuntime: Wrapper, service: Wrapper, svrTokens: string[]) => CancellablePromise; + RegistrationService_RegisterAccount: (asyncRuntime: Wrapper, service: Wrapper, registerAccount: Wrapper, accountAttributes: Wrapper) => CancellablePromise; + RegistrationService_ReregisterAccount: (asyncRuntime: Wrapper, connectChat: ConnectChatBridge, number: string, registerAccount: Wrapper, accountAttributes: Wrapper) => CancellablePromise; + RegistrationService_SessionId: (service: Wrapper) => string; + RegistrationService_RegistrationSession: (service: Wrapper) => RegistrationSession; + RegistrationSession_GetAllowedToRequestCode: (session: Wrapper) => boolean; + RegistrationSession_GetVerified: (session: Wrapper) => boolean; + RegistrationSession_GetNextCallSeconds: (session: Wrapper) => number | null; + RegistrationSession_GetNextSmsSeconds: (session: Wrapper) => number | null; + RegistrationSession_GetNextVerificationAttemptSeconds: (session: Wrapper) => number | null; + RegistrationSession_GetRequestedInformation: (session: Wrapper) => ChallengeOption[]; + RegisterAccountRequest_Create: () => RegisterAccountRequest; + RegisterAccountRequest_SetSkipDeviceTransfer: (registerAccount: Wrapper) => void; + RegisterAccountRequest_SetAccountPassword: (registerAccount: Wrapper, accountPassword: string) => void; + RegisterAccountRequest_SetIdentityPublicKey: (registerAccount: Wrapper, identityType: number, identityKey: Wrapper) => void; + RegisterAccountRequest_SetIdentitySignedPreKey: (registerAccount: Wrapper, identityType: number, signedPreKey: SignedPublicPreKey) => void; + RegisterAccountRequest_SetIdentityPqLastResortPreKey: (registerAccount: Wrapper, identityType: number, pqLastResortPreKey: SignedPublicPreKey) => void; + RegistrationAccountAttributes_Create: (recoveryPassword: Uint8Array, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Uint8Array, unrestrictedUnidentifiedAccess: boolean, capabilities: string[], discoverableByPhoneNumber: boolean) => RegistrationAccountAttributes; + RegisterAccountResponse_GetIdentity: (response: Wrapper, identityType: number) => Uint8Array; + RegisterAccountResponse_GetNumber: (response: Wrapper) => string; + RegisterAccountResponse_GetUsernameHash: (response: Wrapper) => Uint8Array | null; + RegisterAccountResponse_GetUsernameLinkHandle: (response: Wrapper) => Uuid | null; + RegisterAccountResponse_GetStorageCapable: (response: Wrapper) => boolean; + RegisterAccountResponse_GetReregistration: (response: Wrapper) => boolean; + RegisterAccountResponse_GetEntitlementBadges: (response: Wrapper) => RegisterResponseBadge[]; + RegisterAccountResponse_GetEntitlementBackupLevel: (response: Wrapper) => bigint | null; + RegisterAccountResponse_GetEntitlementBackupExpirationSeconds: (response: Wrapper) => bigint | null; + SecureValueRecoveryForBackups_CreateNewBackupChain: (environment: number, backupKey: Uint8Array) => Uint8Array; + SecureValueRecoveryForBackups_StoreBackup: (asyncRuntime: Wrapper, backupKey: Uint8Array, previousSecretData: Uint8Array, connectionManager: Wrapper, username: string, password: string) => CancellablePromise; + SecureValueRecoveryForBackups_RestoreBackupFromServer: (asyncRuntime: Wrapper, backupKey: Uint8Array, metadata: Uint8Array, connectionManager: Wrapper, username: string, password: string) => CancellablePromise; + SecureValueRecoveryForBackups_RemoveBackup: (asyncRuntime: Wrapper, connectionManager: Wrapper, username: string, password: string) => CancellablePromise; + BackupStoreResponse_GetForwardSecrecyToken: (response: Wrapper) => Uint8Array; + BackupStoreResponse_GetOpaqueMetadata: (response: Wrapper) => Uint8Array; + BackupStoreResponse_GetNextBackupSecretData: (response: Wrapper) => Uint8Array; + BackupRestoreResponse_GetForwardSecrecyToken: (response: Wrapper) => Uint8Array; + BackupRestoreResponse_GetNextBackupSecretData: (response: Wrapper) => Uint8Array; + TokioAsyncContext_new: () => TokioAsyncContext; + TokioAsyncContext_cancel: (context: Wrapper, rawCancellationId: bigint) => void; + ConnectionProxyConfig_new: (scheme: string, host: string, port: number, username: string | null, password: string | null) => ConnectionProxyConfig; + ConnectionManager_new: (environment: number, userAgent: string, remoteConfig: Wrapper, buildVariant: number) => ConnectionManager; + ConnectionManager_set_proxy: (connectionManager: Wrapper, proxy: Wrapper) => void; + ConnectionManager_set_invalid_proxy: (connectionManager: Wrapper) => void; + ConnectionManager_clear_proxy: (connectionManager: Wrapper) => void; + ConnectionManager_set_ipv6_enabled: (connectionManager: Wrapper, ipv6Enabled: boolean) => void; + ConnectionManager_set_censorship_circumvention_enabled: (connectionManager: Wrapper, enabled: boolean) => void; + ConnectionManager_set_remote_config: (connectionManager: Wrapper, remoteConfig: Wrapper, buildVariant: number) => void; + ConnectionManager_on_network_change: (connectionManager: Wrapper) => void; + AccountEntropyPool_Generate: () => string; + AccountEntropyPool_IsValid: (accountEntropy: string) => boolean; + AccountEntropyPool_DeriveSvrKey: (accountEntropy: AccountEntropyPool) => Uint8Array; + AccountEntropyPool_DeriveBackupKey: (accountEntropy: AccountEntropyPool) => Uint8Array; + BackupKey_DeriveBackupId: (backupKey: Uint8Array, aci: Uint8Array) => Uint8Array; + BackupKey_DeriveEcKey: (backupKey: Uint8Array, aci: Uint8Array) => PrivateKey; + BackupKey_DeriveLocalBackupMetadataKey: (backupKey: Uint8Array) => Uint8Array; + BackupKey_DeriveMediaId: (backupKey: Uint8Array, mediaName: string) => Uint8Array; + BackupKey_DeriveMediaEncryptionKey: (backupKey: Uint8Array, mediaId: Uint8Array) => Uint8Array; + BackupKey_DeriveThumbnailTransitEncryptionKey: (backupKey: Uint8Array, mediaId: Uint8Array) => Uint8Array; + IncrementalMac_CalculateChunkSize: (dataSize: number) => number; + IncrementalMac_Initialize: (key: Uint8Array, chunkSize: number) => IncrementalMac; + IncrementalMac_Update: (mac: Wrapper, bytes: Uint8Array, offset: number, length: number) => Uint8Array; + IncrementalMac_Finalize: (mac: Wrapper) => Uint8Array; + ValidatingMac_Initialize: (key: Uint8Array, chunkSize: number, digests: Uint8Array) => ValidatingMac | null; + ValidatingMac_Update: (mac: Wrapper, bytes: Uint8Array, offset: number, length: number) => number; + ValidatingMac_Finalize: (mac: Wrapper) => number; + MessageBackupKey_FromAccountEntropyPool: (accountEntropy: AccountEntropyPool, aci: Uint8Array, forwardSecrecyToken: Uint8Array | null) => MessageBackupKey; + MessageBackupKey_FromBackupKeyAndBackupId: (backupKey: Uint8Array, backupId: Uint8Array, forwardSecrecyToken: Uint8Array | null) => MessageBackupKey; + MessageBackupKey_GetHmacKey: (key: Wrapper) => Uint8Array; + MessageBackupKey_GetAesKey: (key: Wrapper) => Uint8Array; + MessageBackupValidator_Validate: (key: Wrapper, firstStream: InputStream, secondStream: InputStream, len: bigint, purpose: number) => Promise; + OnlineBackupValidator_New: (backupInfoFrame: Uint8Array, purpose: number) => OnlineBackupValidator; + OnlineBackupValidator_AddFrame: (backup: Wrapper, frame: Uint8Array) => void; + OnlineBackupValidator_Finalize: (backup: Wrapper) => void; + BackupJsonExporter_New: (backupInfo: Uint8Array, shouldValidate: boolean) => BackupJsonExporter; + BackupJsonExporter_GetInitialChunk: (exporter: Wrapper) => string; + BackupJsonExporter_ExportFrames: (exporter: Wrapper, frames: Uint8Array) => string; + BackupJsonExporter_Finish: (exporter: Wrapper) => string; + Username_Hash: (username: string) => Uint8Array; + Username_Proof: (username: string, randomness: Uint8Array) => Uint8Array; + Username_Verify: (proof: Uint8Array, hash: Uint8Array) => void; + Username_CandidatesFrom: (nickname: string, minLen: number, maxLen: number) => string[]; + Username_HashFromParts: (nickname: string, discriminator: string, minLen: number, maxLen: number) => Uint8Array; + UsernameLink_Create: (username: string, entropy: Uint8Array | null) => Uint8Array; + UsernameLink_DecryptUsername: (entropy: Uint8Array, encryptedUsername: Uint8Array) => string; + SignalMedia_CheckAvailable: () => void; + Mp4Sanitizer_Sanitize: (input: InputStream, len: bigint) => Promise; + WebpSanitizer_Sanitize: (input: SyncInputStream) => void; + SanitizedMetadata_GetMetadata: (sanitized: Wrapper) => Uint8Array; + SanitizedMetadata_GetDataOffset: (sanitized: Wrapper) => bigint; + SanitizedMetadata_GetDataLen: (sanitized: Wrapper) => bigint; + BridgedStringMap_new: (initialCapacity: number) => BridgedStringMap; + BridgedStringMap_insert: (map: Wrapper, key: string, value: string) => void; + TESTING_NonSuspendingBackgroundThreadRuntime_New: () => NonSuspendingBackgroundThreadRuntime; + TESTING_FutureSuccess: (asyncRuntime: Wrapper, input: number) => CancellablePromise; + TESTING_TokioAsyncContext_FutureSuccessBytes: (asyncRuntime: Wrapper, count: number) => CancellablePromise; + TESTING_FutureFailure: (asyncRuntime: Wrapper, _input: number) => CancellablePromise; + TESTING_FutureCancellationCounter_Create: (initialValue: number) => TestingFutureCancellationCounter; + TESTING_FutureCancellationCounter_WaitForCount: (asyncRuntime: Wrapper, count: Wrapper, target: number) => CancellablePromise; + TESTING_FutureIncrementOnCancel: (asyncRuntime: Wrapper, _guard: TestingFutureCancellationGuard) => CancellablePromise; + TESTING_TokioAsyncFuture: (asyncRuntime: Wrapper, input: number) => CancellablePromise; + TESTING_TestingHandleType_getValue: (handle: Wrapper) => number; + TESTING_FutureProducesPointerType: (asyncRuntime: Wrapper, input: number) => CancellablePromise; + TESTING_OtherTestingHandleType_getValue: (handle: Wrapper) => string; + TESTING_FutureProducesOtherPointerType: (asyncRuntime: Wrapper, input: string) => CancellablePromise; + TESTING_PanicOnBorrowSync: (_input: null) => void; + TESTING_PanicOnBorrowAsync: (_input: null) => Promise; + TESTING_PanicOnBorrowIo: (asyncRuntime: Wrapper, _input: null) => CancellablePromise; + TESTING_ErrorOnBorrowSync: (_input: null) => void; + TESTING_ErrorOnBorrowAsync: (_input: null) => Promise; + TESTING_ErrorOnBorrowIo: (asyncRuntime: Wrapper, _input: null) => CancellablePromise; + TESTING_PanicOnLoadSync: (_needsCleanup: null, _input: null) => void; + TESTING_PanicOnLoadAsync: (_needsCleanup: null, _input: null) => Promise; + TESTING_PanicOnLoadIo: (asyncRuntime: Wrapper, _needsCleanup: null, _input: null) => CancellablePromise; + TESTING_PanicInBodySync: (_input: null) => void; + TESTING_PanicInBodyAsync: (_input: null) => Promise; + TESTING_PanicInBodyIo: (asyncRuntime: Wrapper, _input: null) => CancellablePromise; + TESTING_PanicOnReturnSync: (_needsCleanup: null) => null; + TESTING_PanicOnReturnAsync: (_needsCleanup: null) => Promise; + TESTING_PanicOnReturnIo: (asyncRuntime: Wrapper, _needsCleanup: null) => CancellablePromise; + TESTING_ErrorOnReturnSync: (_needsCleanup: null) => null; + TESTING_ErrorOnReturnAsync: (_needsCleanup: null) => Promise; + TESTING_ErrorOnReturnIo: (asyncRuntime: Wrapper, _needsCleanup: null) => CancellablePromise; + TESTING_ReturnStringArray: () => string[]; + TESTING_JoinStringArray: (array: string[], joinWith: string) => string; + TESTING_ProcessBytestringArray: (input: Uint8Array[]) => Uint8Array[]; + TESTING_RoundTripU8: (input: number) => number; + TESTING_RoundTripU16: (input: number) => number; + TESTING_RoundTripU32: (input: number) => number; + TESTING_RoundTripI32: (input: number) => number; + TESTING_RoundTripU64: (input: bigint) => bigint; + TESTING_ConvertOptionalUuid: (present: boolean) => Uuid | null; + TESTING_InputStreamReadIntoZeroLengthSlice: (capsAlphabetInput: InputStream) => Promise; + ComparableBackup_ReadUnencrypted: (stream: InputStream, len: bigint, purpose: number) => Promise; + ComparableBackup_GetComparableString: (backup: Wrapper) => string; + ComparableBackup_GetUnknownFields: (backup: Wrapper) => string[]; + TESTING_FakeChatServer_Create: () => FakeChatServer; + TESTING_FakeChatServer_GetNextRemote: (asyncRuntime: Wrapper, server: Wrapper) => CancellablePromise; + TESTING_FakeChatConnection_Create: (tokio: Wrapper, listener: ChatListener, alertsJoinedByNewlines: string) => FakeChatConnection; + TESTING_FakeChatConnection_TakeAuthenticatedChat: (chat: Wrapper) => AuthenticatedChatConnection; + TESTING_FakeChatConnection_TakeUnauthenticatedChat: (chat: Wrapper) => UnauthenticatedChatConnection; + TESTING_FakeChatConnection_TakeRemote: (chat: Wrapper) => FakeChatRemoteEnd; + TESTING_FakeChatRemoteEnd_SendRawServerRequest: (chat: Wrapper, bytes: Uint8Array) => void; + TESTING_FakeChatRemoteEnd_SendRawServerResponse: (chat: Wrapper, bytes: Uint8Array) => void; + TESTING_FakeChatRemoteEnd_SendServerResponse: (chat: Wrapper, response: Wrapper) => void; + TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted: (chat: Wrapper) => void; + TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest: (asyncRuntime: Wrapper, chat: Wrapper) => CancellablePromise<[HttpRequest, bigint] | null>; + TESTING_ChatResponseConvert: (bodyPresent: boolean) => ChatResponse; + TESTING_ChatRequestGetMethod: (request: Wrapper) => string; + TESTING_ChatRequestGetPath: (request: Wrapper) => string; + TESTING_ChatRequestGetHeaderNames: (request: Wrapper) => string[]; + TESTING_ChatRequestGetHeaderValue: (request: Wrapper, headerName: string) => string; + TESTING_ChatRequestGetBody: (request: Wrapper) => Uint8Array; + TESTING_FakeChatResponse_Create: (id: bigint, status: number, message: string, headers: string[], body: Uint8Array | null) => FakeChatResponse; + TESTING_ChatConnectErrorConvert: (errorDescription: string) => void; + TESTING_ChatSendErrorConvert: (errorDescription: string) => void; + TESTING_KeyTransFatalVerificationFailure: () => void; + TESTING_KeyTransNonFatalVerificationFailure: () => void; + TESTING_KeyTransChatSendError: () => void; + TESTING_RegistrationSessionInfoConvert: () => RegistrationSession; + TESTING_RegistrationService_CheckSvr2CredentialsResponseConvert: () => CheckSvr2CredentialsResponse; + TESTING_FakeRegistrationSession_CreateSession: (asyncRuntime: Wrapper, createSession: RegistrationCreateSessionRequest, chat: Wrapper) => CancellablePromise; + TESTING_RegisterAccountResponse_CreateTestValue: () => RegisterAccountResponse; + TESTING_RegistrationService_CreateSessionErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_ResumeSessionErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_UpdateSessionErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_RequestVerificationCodeErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_SubmitVerificationErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_CheckSvr2CredentialsErrorConvert: (errorDescription: string) => void; + TESTING_RegistrationService_RegisterAccountErrorConvert: (errorDescription: string) => void; + TESTING_CdsiLookupResponseConvert: (asyncRuntime: Wrapper) => CancellablePromise; + TESTING_CdsiLookupErrorConvert: (errorDescription: string) => void; + TESTING_ServerMessageAck_Create: () => ServerMessageAck; + TESTING_ConnectionManager_newLocalOverride: (userAgent: string, chatPort: number, cdsiPort: number, svr2Port: number, svrBPort: number, rootCertificateDer: Uint8Array) => ConnectionManager; + TESTING_ConnectionManager_isUsingProxy: (manager: Wrapper) => number; + TESTING_CreateOTP: (username: string, secret: Uint8Array) => string; + TESTING_CreateOTPFromBase64: (username: string, secret: string) => string; + TESTING_SignedPublicPreKey_CheckBridgesCorrectly: (sourcePublicKey: Wrapper, signedPreKey: SignedPublicPreKey) => void; + TestingSemaphore_New: (initial: number) => TestingSemaphore; + TestingSemaphore_AddPermits: (semaphore: Wrapper, permits: number) => void; + TestingValueHolder_New: (value: number) => TestingValueHolder; + TestingValueHolder_Get: (holder: Wrapper) => number; + TESTING_ReturnPair: () => [number, string]; + test_only_fn_returns_123: () => number; + TESTING_BridgedStringMap_dump_to_json: (map: Wrapper) => string; + TESTING_TokioAsyncContext_NewSingleThreaded: () => TokioAsyncContext; +}; + +const { registerErrors, + initLogger, + SealedSenderMultiRecipientMessage_Parse, + MinidumpToJSONString, + Aes256GcmSiv_New, + Aes256GcmSiv_Encrypt, + Aes256GcmSiv_Decrypt, + PublicKey_HpkeSeal, + PrivateKey_HpkeOpen, + HKDF_DeriveSecrets, + ServiceId_ServiceIdBinary, + ServiceId_ServiceIdString, + ServiceId_ServiceIdLog, + ServiceId_ParseFromServiceIdBinary, + ServiceId_ParseFromServiceIdString, + ProtocolAddress_New, + PublicKey_Deserialize, + PublicKey_Serialize, + PublicKey_GetPublicKeyBytes, + ProtocolAddress_DeviceId, + ProtocolAddress_Name, + PublicKey_Equals, + PublicKey_Compare, + PublicKey_Verify, + PrivateKey_Deserialize, + PrivateKey_Serialize, + PrivateKey_Generate, + PrivateKey_GetPublicKey, + PrivateKey_Sign, + PrivateKey_Agree, + KyberPublicKey_Serialize, + KyberPublicKey_Deserialize, + KyberSecretKey_Serialize, + KyberSecretKey_Deserialize, + KyberPublicKey_Equals, + KyberKeyPair_Generate, + KyberKeyPair_GetPublicKey, + KyberKeyPair_GetSecretKey, + IdentityKeyPair_Serialize, + IdentityKeyPair_Deserialize, + IdentityKeyPair_SignAlternateIdentity, + IdentityKey_VerifyAlternateIdentity, + Fingerprint_New, + Fingerprint_ScannableEncoding, + Fingerprint_DisplayString, + ScannableFingerprint_Compare, + SignalMessage_Deserialize, + SignalMessage_GetBody, + SignalMessage_GetSerialized, + SignalMessage_GetCounter, + SignalMessage_GetMessageVersion, + SignalMessage_GetPqRatchet, + SignalMessage_New, + SignalMessage_VerifyMac, + PreKeySignalMessage_New, + PreKeySignalMessage_Deserialize, + PreKeySignalMessage_Serialize, + PreKeySignalMessage_GetRegistrationId, + PreKeySignalMessage_GetSignedPreKeyId, + PreKeySignalMessage_GetPreKeyId, + PreKeySignalMessage_GetVersion, + SenderKeyMessage_Deserialize, + SenderKeyMessage_GetCipherText, + SenderKeyMessage_Serialize, + SenderKeyMessage_GetDistributionId, + SenderKeyMessage_GetChainId, + SenderKeyMessage_GetIteration, + SenderKeyMessage_New, + SenderKeyMessage_VerifySignature, + SenderKeyDistributionMessage_Deserialize, + SenderKeyDistributionMessage_GetChainKey, + SenderKeyDistributionMessage_Serialize, + SenderKeyDistributionMessage_GetDistributionId, + SenderKeyDistributionMessage_GetChainId, + SenderKeyDistributionMessage_GetIteration, + SenderKeyDistributionMessage_New, + DecryptionErrorMessage_Deserialize, + DecryptionErrorMessage_GetTimestamp, + DecryptionErrorMessage_GetDeviceId, + DecryptionErrorMessage_Serialize, + DecryptionErrorMessage_GetRatchetKey, + DecryptionErrorMessage_ForOriginalMessage, + DecryptionErrorMessage_ExtractFromSerializedContent, + PlaintextContent_Deserialize, + PlaintextContent_Serialize, + PlaintextContent_GetBody, + PlaintextContent_FromDecryptionErrorMessage, + PreKeyBundle_New, + PreKeyBundle_GetIdentityKey, + PreKeyBundle_GetSignedPreKeySignature, + PreKeyBundle_GetKyberPreKeySignature, + PreKeyBundle_GetRegistrationId, + PreKeyBundle_GetDeviceId, + PreKeyBundle_GetSignedPreKeyId, + PreKeyBundle_GetKyberPreKeyId, + PreKeyBundle_GetPreKeyId, + PreKeyBundle_GetPreKeyPublic, + PreKeyBundle_GetSignedPreKeyPublic, + PreKeyBundle_GetKyberPreKeyPublic, + SignedPreKeyRecord_Deserialize, + SignedPreKeyRecord_GetSignature, + SignedPreKeyRecord_Serialize, + SignedPreKeyRecord_GetId, + SignedPreKeyRecord_GetTimestamp, + SignedPreKeyRecord_GetPublicKey, + SignedPreKeyRecord_GetPrivateKey, + KyberPreKeyRecord_Deserialize, + KyberPreKeyRecord_GetSignature, + KyberPreKeyRecord_Serialize, + KyberPreKeyRecord_GetId, + KyberPreKeyRecord_GetTimestamp, + KyberPreKeyRecord_GetPublicKey, + KyberPreKeyRecord_GetSecretKey, + KyberPreKeyRecord_GetKeyPair, + SignedPreKeyRecord_New, + KyberPreKeyRecord_New, + PreKeyRecord_Deserialize, + PreKeyRecord_Serialize, + PreKeyRecord_GetId, + PreKeyRecord_GetPublicKey, + PreKeyRecord_GetPrivateKey, + PreKeyRecord_New, + SenderKeyRecord_Deserialize, + SenderKeyRecord_Serialize, + ServerCertificate_Deserialize, + ServerCertificate_GetSerialized, + ServerCertificate_GetCertificate, + ServerCertificate_GetSignature, + ServerCertificate_GetKeyId, + ServerCertificate_GetKey, + ServerCertificate_New, + SenderCertificate_Deserialize, + SenderCertificate_GetSerialized, + SenderCertificate_GetCertificate, + SenderCertificate_GetSignature, + SenderCertificate_GetSenderUuid, + SenderCertificate_GetSenderE164, + SenderCertificate_GetExpiration, + SenderCertificate_GetDeviceId, + SenderCertificate_GetKey, + SenderCertificate_Validate, + SenderCertificate_GetServerCertificate, + SenderCertificate_New, + UnidentifiedSenderMessageContent_Deserialize, + UnidentifiedSenderMessageContent_Serialize, + UnidentifiedSenderMessageContent_GetContents, + UnidentifiedSenderMessageContent_GetGroupId, + UnidentifiedSenderMessageContent_GetSenderCert, + UnidentifiedSenderMessageContent_GetMsgType, + UnidentifiedSenderMessageContent_GetContentHint, + UnidentifiedSenderMessageContent_New, + CiphertextMessage_Type, + CiphertextMessage_Serialize, + CiphertextMessage_FromPlaintextContent, + SessionRecord_ArchiveCurrentState, + SessionRecord_HasUsableSenderChain, + SessionRecord_CurrentRatchetKeyMatches, + SessionRecord_Deserialize, + SessionRecord_Serialize, + SessionRecord_GetLocalRegistrationId, + SessionRecord_GetRemoteRegistrationId, + SealedSenderDecryptionResult_GetSenderUuid, + SealedSenderDecryptionResult_GetSenderE164, + SealedSenderDecryptionResult_GetDeviceId, + SealedSenderDecryptionResult_Message, + SessionBuilder_ProcessPreKeyBundle, + SessionCipher_EncryptMessage, + SessionCipher_DecryptSignalMessage, + SessionCipher_DecryptPreKeySignalMessage, + SealedSender_Encrypt, + SealedSender_MultiRecipientEncrypt, + SealedSender_MultiRecipientMessageForSingleRecipient, + SealedSender_DecryptToUsmc, + SealedSender_DecryptMessage, + SenderKeyDistributionMessage_Create, + SenderKeyDistributionMessage_Process, + GroupCipher_EncryptMessage, + GroupCipher_DecryptMessage, + Cds2ClientState_New, + HsmEnclaveClient_New, + HsmEnclaveClient_CompleteHandshake, + HsmEnclaveClient_EstablishedSend, + HsmEnclaveClient_EstablishedRecv, + HsmEnclaveClient_InitialRequest, + SgxClientState_InitialRequest, + SgxClientState_CompleteHandshake, + SgxClientState_EstablishedSend, + SgxClientState_EstablishedRecv, + ExpiringProfileKeyCredential_CheckValidContents, + ExpiringProfileKeyCredentialResponse_CheckValidContents, + GroupMasterKey_CheckValidContents, + GroupPublicParams_CheckValidContents, + GroupSecretParams_CheckValidContents, + ProfileKey_CheckValidContents, + ProfileKeyCiphertext_CheckValidContents, + ProfileKeyCommitment_CheckValidContents, + ProfileKeyCredentialRequest_CheckValidContents, + ProfileKeyCredentialRequestContext_CheckValidContents, + ReceiptCredential_CheckValidContents, + ReceiptCredentialPresentation_CheckValidContents, + ReceiptCredentialRequest_CheckValidContents, + ReceiptCredentialRequestContext_CheckValidContents, + ReceiptCredentialResponse_CheckValidContents, + UuidCiphertext_CheckValidContents, + ServerPublicParams_Deserialize, + ServerPublicParams_Serialize, + ServerSecretParams_Deserialize, + ServerSecretParams_Serialize, + ProfileKey_GetCommitment, + ProfileKey_GetProfileKeyVersion, + ProfileKey_DeriveAccessKey, + GroupSecretParams_GenerateDeterministic, + GroupSecretParams_DeriveFromMasterKey, + GroupSecretParams_GetMasterKey, + GroupSecretParams_GetPublicParams, + GroupSecretParams_EncryptServiceId, + GroupSecretParams_DecryptServiceId, + GroupSecretParams_EncryptProfileKey, + GroupSecretParams_DecryptProfileKey, + GroupSecretParams_EncryptBlobWithPaddingDeterministic, + GroupSecretParams_DecryptBlobWithPadding, + ServerSecretParams_GenerateDeterministic, + ServerSecretParams_GetPublicParams, + ServerSecretParams_SignDeterministic, + ServerPublicParams_GetEndorsementPublicKey, + ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId, + ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic, + ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic, + ServerPublicParams_ReceiveExpiringProfileKeyCredential, + ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic, + ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic, + ServerPublicParams_ReceiveReceiptCredential, + ServerPublicParams_CreateReceiptCredentialPresentationDeterministic, + ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic, + AuthCredentialWithPni_CheckValidContents, + AuthCredentialWithPniResponse_CheckValidContents, + ServerSecretParams_VerifyAuthCredentialPresentation, + ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic, + ServerSecretParams_VerifyProfileKeyCredentialPresentation, + ServerSecretParams_IssueReceiptCredentialDeterministic, + ServerSecretParams_VerifyReceiptCredentialPresentation, + GroupPublicParams_GetGroupIdentifier, + ServerPublicParams_VerifySignature, + AuthCredentialPresentation_CheckValidContents, + AuthCredentialPresentation_GetUuidCiphertext, + AuthCredentialPresentation_GetPniCiphertext, + AuthCredentialPresentation_GetRedemptionTime, + ProfileKeyCredentialRequestContext_GetRequest, + ExpiringProfileKeyCredential_GetExpirationTime, + ProfileKeyCredentialPresentation_CheckValidContents, + ProfileKeyCredentialPresentation_GetUuidCiphertext, + ProfileKeyCredentialPresentation_GetProfileKeyCiphertext, + ReceiptCredentialRequestContext_GetRequest, + ReceiptCredential_GetReceiptExpirationTime, + ReceiptCredential_GetReceiptLevel, + ReceiptCredentialPresentation_GetReceiptExpirationTime, + ReceiptCredentialPresentation_GetReceiptLevel, + ReceiptCredentialPresentation_GetReceiptSerial, + GenericServerSecretParams_CheckValidContents, + GenericServerSecretParams_GenerateDeterministic, + GenericServerSecretParams_GetPublicParams, + GenericServerPublicParams_CheckValidContents, + CallLinkSecretParams_CheckValidContents, + CallLinkSecretParams_DeriveFromRootKey, + CallLinkSecretParams_GetPublicParams, + CallLinkSecretParams_DecryptUserId, + CallLinkSecretParams_EncryptUserId, + CallLinkPublicParams_CheckValidContents, + CreateCallLinkCredentialRequestContext_CheckValidContents, + CreateCallLinkCredentialRequestContext_NewDeterministic, + CreateCallLinkCredentialRequestContext_GetRequest, + CreateCallLinkCredentialRequest_CheckValidContents, + CreateCallLinkCredentialRequest_IssueDeterministic, + CreateCallLinkCredentialResponse_CheckValidContents, + CreateCallLinkCredentialRequestContext_ReceiveResponse, + CreateCallLinkCredential_CheckValidContents, + CreateCallLinkCredential_PresentDeterministic, + CreateCallLinkCredentialPresentation_CheckValidContents, + CreateCallLinkCredentialPresentation_Verify, + CallLinkAuthCredentialResponse_CheckValidContents, + CallLinkAuthCredentialResponse_IssueDeterministic, + CallLinkAuthCredentialResponse_Receive, + CallLinkAuthCredential_CheckValidContents, + CallLinkAuthCredential_PresentDeterministic, + CallLinkAuthCredentialPresentation_CheckValidContents, + CallLinkAuthCredentialPresentation_Verify, + CallLinkAuthCredentialPresentation_GetUserId, + BackupAuthCredentialRequestContext_New, + BackupAuthCredentialRequestContext_CheckValidContents, + BackupAuthCredentialRequestContext_GetRequest, + BackupAuthCredentialRequest_CheckValidContents, + BackupAuthCredentialRequest_IssueDeterministic, + BackupAuthCredentialResponse_CheckValidContents, + BackupAuthCredentialRequestContext_ReceiveResponse, + BackupAuthCredential_CheckValidContents, + BackupAuthCredential_GetBackupId, + BackupAuthCredential_GetBackupLevel, + BackupAuthCredential_GetType, + BackupAuthCredential_PresentDeterministic, + BackupAuthCredentialPresentation_CheckValidContents, + BackupAuthCredentialPresentation_Verify, + BackupAuthCredentialPresentation_GetBackupId, + BackupAuthCredentialPresentation_GetBackupLevel, + BackupAuthCredentialPresentation_GetType, + GroupSendDerivedKeyPair_CheckValidContents, + GroupSendDerivedKeyPair_ForExpiration, + GroupSendEndorsementsResponse_CheckValidContents, + GroupSendEndorsementsResponse_IssueDeterministic, + GroupSendEndorsementsResponse_GetExpiration, + GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds, + GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts, + GroupSendEndorsement_CheckValidContents, + GroupSendEndorsement_Combine, + GroupSendEndorsement_Remove, + GroupSendEndorsement_ToToken, + GroupSendEndorsement_CallLinkParams_ToToken, + GroupSendToken_CheckValidContents, + GroupSendToken_ToFullToken, + GroupSendFullToken_CheckValidContents, + GroupSendFullToken_GetExpiration, + GroupSendFullToken_Verify, + LookupRequest_new, + LookupRequest_addE164, + LookupRequest_addPreviousE164, + LookupRequest_setToken, + LookupRequest_addAciAndAccessKey, + CdsiLookup_new, + CdsiLookup_token, + CdsiLookup_complete, + HttpRequest_new, + HttpRequest_add_header, + ChatConnectionInfo_local_port, + ChatConnectionInfo_ip_version, + ChatConnectionInfo_description, + UnauthenticatedChatConnection_connect, + UnauthenticatedChatConnection_init_listener, + UnauthenticatedChatConnection_send, + UnauthenticatedChatConnection_disconnect, + UnauthenticatedChatConnection_info, + UnauthenticatedChatConnection_look_up_username_hash, + UnauthenticatedChatConnection_send_multi_recipient_message, + AuthenticatedChatConnection_preconnect, + AuthenticatedChatConnection_connect, + AuthenticatedChatConnection_init_listener, + AuthenticatedChatConnection_send, + AuthenticatedChatConnection_disconnect, + AuthenticatedChatConnection_info, + ServerMessageAck_SendStatus, + KeyTransparency_AciSearchKey, + KeyTransparency_E164SearchKey, + KeyTransparency_UsernameHashSearchKey, + KeyTransparency_Search, + KeyTransparency_Monitor, + KeyTransparency_Distinguished, + RegistrationService_CreateSession, + RegistrationService_ResumeSession, + RegistrationService_RequestVerificationCode, + RegistrationService_SubmitVerificationCode, + RegistrationService_SubmitCaptcha, + RegistrationService_CheckSvr2Credentials, + RegistrationService_RegisterAccount, + RegistrationService_ReregisterAccount, + RegistrationService_SessionId, + RegistrationService_RegistrationSession, + RegistrationSession_GetAllowedToRequestCode, + RegistrationSession_GetVerified, + RegistrationSession_GetNextCallSeconds, + RegistrationSession_GetNextSmsSeconds, + RegistrationSession_GetNextVerificationAttemptSeconds, + RegistrationSession_GetRequestedInformation, + RegisterAccountRequest_Create, + RegisterAccountRequest_SetSkipDeviceTransfer, + RegisterAccountRequest_SetAccountPassword, + RegisterAccountRequest_SetIdentityPublicKey, + RegisterAccountRequest_SetIdentitySignedPreKey, + RegisterAccountRequest_SetIdentityPqLastResortPreKey, + RegistrationAccountAttributes_Create, + RegisterAccountResponse_GetIdentity, + RegisterAccountResponse_GetNumber, + RegisterAccountResponse_GetUsernameHash, + RegisterAccountResponse_GetUsernameLinkHandle, + RegisterAccountResponse_GetStorageCapable, + RegisterAccountResponse_GetReregistration, + RegisterAccountResponse_GetEntitlementBadges, + RegisterAccountResponse_GetEntitlementBackupLevel, + RegisterAccountResponse_GetEntitlementBackupExpirationSeconds, + SecureValueRecoveryForBackups_CreateNewBackupChain, + SecureValueRecoveryForBackups_StoreBackup, + SecureValueRecoveryForBackups_RestoreBackupFromServer, + SecureValueRecoveryForBackups_RemoveBackup, + BackupStoreResponse_GetForwardSecrecyToken, + BackupStoreResponse_GetOpaqueMetadata, + BackupStoreResponse_GetNextBackupSecretData, + BackupRestoreResponse_GetForwardSecrecyToken, + BackupRestoreResponse_GetNextBackupSecretData, + TokioAsyncContext_new, + TokioAsyncContext_cancel, + ConnectionProxyConfig_new, + ConnectionManager_new, + ConnectionManager_set_proxy, + ConnectionManager_set_invalid_proxy, + ConnectionManager_clear_proxy, + ConnectionManager_set_ipv6_enabled, + ConnectionManager_set_censorship_circumvention_enabled, + ConnectionManager_set_remote_config, + ConnectionManager_on_network_change, + AccountEntropyPool_Generate, + AccountEntropyPool_IsValid, + AccountEntropyPool_DeriveSvrKey, + AccountEntropyPool_DeriveBackupKey, + BackupKey_DeriveBackupId, + BackupKey_DeriveEcKey, + BackupKey_DeriveLocalBackupMetadataKey, + BackupKey_DeriveMediaId, + BackupKey_DeriveMediaEncryptionKey, + BackupKey_DeriveThumbnailTransitEncryptionKey, + IncrementalMac_CalculateChunkSize, + IncrementalMac_Initialize, + IncrementalMac_Update, + IncrementalMac_Finalize, + ValidatingMac_Initialize, + ValidatingMac_Update, + ValidatingMac_Finalize, + MessageBackupKey_FromAccountEntropyPool, + MessageBackupKey_FromBackupKeyAndBackupId, + MessageBackupKey_GetHmacKey, + MessageBackupKey_GetAesKey, + MessageBackupValidator_Validate, + OnlineBackupValidator_New, + OnlineBackupValidator_AddFrame, + OnlineBackupValidator_Finalize, + BackupJsonExporter_New, + BackupJsonExporter_GetInitialChunk, + BackupJsonExporter_ExportFrames, + BackupJsonExporter_Finish, + Username_Hash, + Username_Proof, + Username_Verify, + Username_CandidatesFrom, + Username_HashFromParts, + UsernameLink_Create, + UsernameLink_DecryptUsername, + SignalMedia_CheckAvailable, + Mp4Sanitizer_Sanitize, + WebpSanitizer_Sanitize, + SanitizedMetadata_GetMetadata, + SanitizedMetadata_GetDataOffset, + SanitizedMetadata_GetDataLen, + BridgedStringMap_new, + BridgedStringMap_insert, + TESTING_NonSuspendingBackgroundThreadRuntime_New, + TESTING_FutureSuccess, + TESTING_TokioAsyncContext_FutureSuccessBytes, + TESTING_FutureFailure, + TESTING_FutureCancellationCounter_Create, + TESTING_FutureCancellationCounter_WaitForCount, + TESTING_FutureIncrementOnCancel, + TESTING_TokioAsyncFuture, + TESTING_TestingHandleType_getValue, + TESTING_FutureProducesPointerType, + TESTING_OtherTestingHandleType_getValue, + TESTING_FutureProducesOtherPointerType, + TESTING_PanicOnBorrowSync, + TESTING_PanicOnBorrowAsync, + TESTING_PanicOnBorrowIo, + TESTING_ErrorOnBorrowSync, + TESTING_ErrorOnBorrowAsync, + TESTING_ErrorOnBorrowIo, + TESTING_PanicOnLoadSync, + TESTING_PanicOnLoadAsync, + TESTING_PanicOnLoadIo, + TESTING_PanicInBodySync, + TESTING_PanicInBodyAsync, + TESTING_PanicInBodyIo, + TESTING_PanicOnReturnSync, + TESTING_PanicOnReturnAsync, + TESTING_PanicOnReturnIo, + TESTING_ErrorOnReturnSync, + TESTING_ErrorOnReturnAsync, + TESTING_ErrorOnReturnIo, + TESTING_ReturnStringArray, + TESTING_JoinStringArray, + TESTING_ProcessBytestringArray, + TESTING_RoundTripU8, + TESTING_RoundTripU16, + TESTING_RoundTripU32, + TESTING_RoundTripI32, + TESTING_RoundTripU64, + TESTING_ConvertOptionalUuid, + TESTING_InputStreamReadIntoZeroLengthSlice, + ComparableBackup_ReadUnencrypted, + ComparableBackup_GetComparableString, + ComparableBackup_GetUnknownFields, + TESTING_FakeChatServer_Create, + TESTING_FakeChatServer_GetNextRemote, + TESTING_FakeChatConnection_Create, + TESTING_FakeChatConnection_TakeAuthenticatedChat, + TESTING_FakeChatConnection_TakeUnauthenticatedChat, + TESTING_FakeChatConnection_TakeRemote, + TESTING_FakeChatRemoteEnd_SendRawServerRequest, + TESTING_FakeChatRemoteEnd_SendRawServerResponse, + TESTING_FakeChatRemoteEnd_SendServerResponse, + TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted, + TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest, + TESTING_ChatResponseConvert, + TESTING_ChatRequestGetMethod, + TESTING_ChatRequestGetPath, + TESTING_ChatRequestGetHeaderNames, + TESTING_ChatRequestGetHeaderValue, + TESTING_ChatRequestGetBody, + TESTING_FakeChatResponse_Create, + TESTING_ChatConnectErrorConvert, + TESTING_ChatSendErrorConvert, + TESTING_KeyTransFatalVerificationFailure, + TESTING_KeyTransNonFatalVerificationFailure, + TESTING_KeyTransChatSendError, + TESTING_RegistrationSessionInfoConvert, + TESTING_RegistrationService_CheckSvr2CredentialsResponseConvert, + TESTING_FakeRegistrationSession_CreateSession, + TESTING_RegisterAccountResponse_CreateTestValue, + TESTING_RegistrationService_CreateSessionErrorConvert, + TESTING_RegistrationService_ResumeSessionErrorConvert, + TESTING_RegistrationService_UpdateSessionErrorConvert, + TESTING_RegistrationService_RequestVerificationCodeErrorConvert, + TESTING_RegistrationService_SubmitVerificationErrorConvert, + TESTING_RegistrationService_CheckSvr2CredentialsErrorConvert, + TESTING_RegistrationService_RegisterAccountErrorConvert, + TESTING_CdsiLookupResponseConvert, + TESTING_CdsiLookupErrorConvert, + TESTING_ServerMessageAck_Create, + TESTING_ConnectionManager_newLocalOverride, + TESTING_ConnectionManager_isUsingProxy, + TESTING_CreateOTP, + TESTING_CreateOTPFromBase64, + TESTING_SignedPublicPreKey_CheckBridgesCorrectly, + TestingSemaphore_New, + TestingSemaphore_AddPermits, + TestingValueHolder_New, + TestingValueHolder_Get, + TESTING_ReturnPair, + test_only_fn_returns_123, + TESTING_BridgedStringMap_dump_to_json, + TESTING_TokioAsyncContext_NewSingleThreaded, + } = load( + `${import.meta.dirname}/../` +) as NativeFunctions; + +export { registerErrors, + initLogger, + SealedSenderMultiRecipientMessage_Parse, + MinidumpToJSONString, + Aes256GcmSiv_New, + Aes256GcmSiv_Encrypt, + Aes256GcmSiv_Decrypt, + PublicKey_HpkeSeal, + PrivateKey_HpkeOpen, + HKDF_DeriveSecrets, + ServiceId_ServiceIdBinary, + ServiceId_ServiceIdString, + ServiceId_ServiceIdLog, + ServiceId_ParseFromServiceIdBinary, + ServiceId_ParseFromServiceIdString, + ProtocolAddress_New, + PublicKey_Deserialize, + PublicKey_Serialize, + PublicKey_GetPublicKeyBytes, + ProtocolAddress_DeviceId, + ProtocolAddress_Name, + PublicKey_Equals, + PublicKey_Compare, + PublicKey_Verify, + PrivateKey_Deserialize, + PrivateKey_Serialize, + PrivateKey_Generate, + PrivateKey_GetPublicKey, + PrivateKey_Sign, + PrivateKey_Agree, + KyberPublicKey_Serialize, + KyberPublicKey_Deserialize, + KyberSecretKey_Serialize, + KyberSecretKey_Deserialize, + KyberPublicKey_Equals, + KyberKeyPair_Generate, + KyberKeyPair_GetPublicKey, + KyberKeyPair_GetSecretKey, + IdentityKeyPair_Serialize, + IdentityKeyPair_Deserialize, + IdentityKeyPair_SignAlternateIdentity, + IdentityKey_VerifyAlternateIdentity, + Fingerprint_New, + Fingerprint_ScannableEncoding, + Fingerprint_DisplayString, + ScannableFingerprint_Compare, + SignalMessage_Deserialize, + SignalMessage_GetBody, + SignalMessage_GetSerialized, + SignalMessage_GetCounter, + SignalMessage_GetMessageVersion, + SignalMessage_GetPqRatchet, + SignalMessage_New, + SignalMessage_VerifyMac, + PreKeySignalMessage_New, + PreKeySignalMessage_Deserialize, + PreKeySignalMessage_Serialize, + PreKeySignalMessage_GetRegistrationId, + PreKeySignalMessage_GetSignedPreKeyId, + PreKeySignalMessage_GetPreKeyId, + PreKeySignalMessage_GetVersion, + SenderKeyMessage_Deserialize, + SenderKeyMessage_GetCipherText, + SenderKeyMessage_Serialize, + SenderKeyMessage_GetDistributionId, + SenderKeyMessage_GetChainId, + SenderKeyMessage_GetIteration, + SenderKeyMessage_New, + SenderKeyMessage_VerifySignature, + SenderKeyDistributionMessage_Deserialize, + SenderKeyDistributionMessage_GetChainKey, + SenderKeyDistributionMessage_Serialize, + SenderKeyDistributionMessage_GetDistributionId, + SenderKeyDistributionMessage_GetChainId, + SenderKeyDistributionMessage_GetIteration, + SenderKeyDistributionMessage_New, + DecryptionErrorMessage_Deserialize, + DecryptionErrorMessage_GetTimestamp, + DecryptionErrorMessage_GetDeviceId, + DecryptionErrorMessage_Serialize, + DecryptionErrorMessage_GetRatchetKey, + DecryptionErrorMessage_ForOriginalMessage, + DecryptionErrorMessage_ExtractFromSerializedContent, + PlaintextContent_Deserialize, + PlaintextContent_Serialize, + PlaintextContent_GetBody, + PlaintextContent_FromDecryptionErrorMessage, + PreKeyBundle_New, + PreKeyBundle_GetIdentityKey, + PreKeyBundle_GetSignedPreKeySignature, + PreKeyBundle_GetKyberPreKeySignature, + PreKeyBundle_GetRegistrationId, + PreKeyBundle_GetDeviceId, + PreKeyBundle_GetSignedPreKeyId, + PreKeyBundle_GetKyberPreKeyId, + PreKeyBundle_GetPreKeyId, + PreKeyBundle_GetPreKeyPublic, + PreKeyBundle_GetSignedPreKeyPublic, + PreKeyBundle_GetKyberPreKeyPublic, + SignedPreKeyRecord_Deserialize, + SignedPreKeyRecord_GetSignature, + SignedPreKeyRecord_Serialize, + SignedPreKeyRecord_GetId, + SignedPreKeyRecord_GetTimestamp, + SignedPreKeyRecord_GetPublicKey, + SignedPreKeyRecord_GetPrivateKey, + KyberPreKeyRecord_Deserialize, + KyberPreKeyRecord_GetSignature, + KyberPreKeyRecord_Serialize, + KyberPreKeyRecord_GetId, + KyberPreKeyRecord_GetTimestamp, + KyberPreKeyRecord_GetPublicKey, + KyberPreKeyRecord_GetSecretKey, + KyberPreKeyRecord_GetKeyPair, + SignedPreKeyRecord_New, + KyberPreKeyRecord_New, + PreKeyRecord_Deserialize, + PreKeyRecord_Serialize, + PreKeyRecord_GetId, + PreKeyRecord_GetPublicKey, + PreKeyRecord_GetPrivateKey, + PreKeyRecord_New, + SenderKeyRecord_Deserialize, + SenderKeyRecord_Serialize, + ServerCertificate_Deserialize, + ServerCertificate_GetSerialized, + ServerCertificate_GetCertificate, + ServerCertificate_GetSignature, + ServerCertificate_GetKeyId, + ServerCertificate_GetKey, + ServerCertificate_New, + SenderCertificate_Deserialize, + SenderCertificate_GetSerialized, + SenderCertificate_GetCertificate, + SenderCertificate_GetSignature, + SenderCertificate_GetSenderUuid, + SenderCertificate_GetSenderE164, + SenderCertificate_GetExpiration, + SenderCertificate_GetDeviceId, + SenderCertificate_GetKey, + SenderCertificate_Validate, + SenderCertificate_GetServerCertificate, + SenderCertificate_New, + UnidentifiedSenderMessageContent_Deserialize, + UnidentifiedSenderMessageContent_Serialize, + UnidentifiedSenderMessageContent_GetContents, + UnidentifiedSenderMessageContent_GetGroupId, + UnidentifiedSenderMessageContent_GetSenderCert, + UnidentifiedSenderMessageContent_GetMsgType, + UnidentifiedSenderMessageContent_GetContentHint, + UnidentifiedSenderMessageContent_New, + CiphertextMessage_Type, + CiphertextMessage_Serialize, + CiphertextMessage_FromPlaintextContent, + SessionRecord_ArchiveCurrentState, + SessionRecord_HasUsableSenderChain, + SessionRecord_CurrentRatchetKeyMatches, + SessionRecord_Deserialize, + SessionRecord_Serialize, + SessionRecord_GetLocalRegistrationId, + SessionRecord_GetRemoteRegistrationId, + SealedSenderDecryptionResult_GetSenderUuid, + SealedSenderDecryptionResult_GetSenderE164, + SealedSenderDecryptionResult_GetDeviceId, + SealedSenderDecryptionResult_Message, + SessionBuilder_ProcessPreKeyBundle, + SessionCipher_EncryptMessage, + SessionCipher_DecryptSignalMessage, + SessionCipher_DecryptPreKeySignalMessage, + SealedSender_Encrypt, + SealedSender_MultiRecipientEncrypt, + SealedSender_MultiRecipientMessageForSingleRecipient, + SealedSender_DecryptToUsmc, + SealedSender_DecryptMessage, + SenderKeyDistributionMessage_Create, + SenderKeyDistributionMessage_Process, + GroupCipher_EncryptMessage, + GroupCipher_DecryptMessage, + Cds2ClientState_New, + HsmEnclaveClient_New, + HsmEnclaveClient_CompleteHandshake, + HsmEnclaveClient_EstablishedSend, + HsmEnclaveClient_EstablishedRecv, + HsmEnclaveClient_InitialRequest, + SgxClientState_InitialRequest, + SgxClientState_CompleteHandshake, + SgxClientState_EstablishedSend, + SgxClientState_EstablishedRecv, + ExpiringProfileKeyCredential_CheckValidContents, + ExpiringProfileKeyCredentialResponse_CheckValidContents, + GroupMasterKey_CheckValidContents, + GroupPublicParams_CheckValidContents, + GroupSecretParams_CheckValidContents, + ProfileKey_CheckValidContents, + ProfileKeyCiphertext_CheckValidContents, + ProfileKeyCommitment_CheckValidContents, + ProfileKeyCredentialRequest_CheckValidContents, + ProfileKeyCredentialRequestContext_CheckValidContents, + ReceiptCredential_CheckValidContents, + ReceiptCredentialPresentation_CheckValidContents, + ReceiptCredentialRequest_CheckValidContents, + ReceiptCredentialRequestContext_CheckValidContents, + ReceiptCredentialResponse_CheckValidContents, + UuidCiphertext_CheckValidContents, + ServerPublicParams_Deserialize, + ServerPublicParams_Serialize, + ServerSecretParams_Deserialize, + ServerSecretParams_Serialize, + ProfileKey_GetCommitment, + ProfileKey_GetProfileKeyVersion, + ProfileKey_DeriveAccessKey, + GroupSecretParams_GenerateDeterministic, + GroupSecretParams_DeriveFromMasterKey, + GroupSecretParams_GetMasterKey, + GroupSecretParams_GetPublicParams, + GroupSecretParams_EncryptServiceId, + GroupSecretParams_DecryptServiceId, + GroupSecretParams_EncryptProfileKey, + GroupSecretParams_DecryptProfileKey, + GroupSecretParams_EncryptBlobWithPaddingDeterministic, + GroupSecretParams_DecryptBlobWithPadding, + ServerSecretParams_GenerateDeterministic, + ServerSecretParams_GetPublicParams, + ServerSecretParams_SignDeterministic, + ServerPublicParams_GetEndorsementPublicKey, + ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId, + ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic, + ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic, + ServerPublicParams_ReceiveExpiringProfileKeyCredential, + ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic, + ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic, + ServerPublicParams_ReceiveReceiptCredential, + ServerPublicParams_CreateReceiptCredentialPresentationDeterministic, + ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic, + AuthCredentialWithPni_CheckValidContents, + AuthCredentialWithPniResponse_CheckValidContents, + ServerSecretParams_VerifyAuthCredentialPresentation, + ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic, + ServerSecretParams_VerifyProfileKeyCredentialPresentation, + ServerSecretParams_IssueReceiptCredentialDeterministic, + ServerSecretParams_VerifyReceiptCredentialPresentation, + GroupPublicParams_GetGroupIdentifier, + ServerPublicParams_VerifySignature, + AuthCredentialPresentation_CheckValidContents, + AuthCredentialPresentation_GetUuidCiphertext, + AuthCredentialPresentation_GetPniCiphertext, + AuthCredentialPresentation_GetRedemptionTime, + ProfileKeyCredentialRequestContext_GetRequest, + ExpiringProfileKeyCredential_GetExpirationTime, + ProfileKeyCredentialPresentation_CheckValidContents, + ProfileKeyCredentialPresentation_GetUuidCiphertext, + ProfileKeyCredentialPresentation_GetProfileKeyCiphertext, + ReceiptCredentialRequestContext_GetRequest, + ReceiptCredential_GetReceiptExpirationTime, + ReceiptCredential_GetReceiptLevel, + ReceiptCredentialPresentation_GetReceiptExpirationTime, + ReceiptCredentialPresentation_GetReceiptLevel, + ReceiptCredentialPresentation_GetReceiptSerial, + GenericServerSecretParams_CheckValidContents, + GenericServerSecretParams_GenerateDeterministic, + GenericServerSecretParams_GetPublicParams, + GenericServerPublicParams_CheckValidContents, + CallLinkSecretParams_CheckValidContents, + CallLinkSecretParams_DeriveFromRootKey, + CallLinkSecretParams_GetPublicParams, + CallLinkSecretParams_DecryptUserId, + CallLinkSecretParams_EncryptUserId, + CallLinkPublicParams_CheckValidContents, + CreateCallLinkCredentialRequestContext_CheckValidContents, + CreateCallLinkCredentialRequestContext_NewDeterministic, + CreateCallLinkCredentialRequestContext_GetRequest, + CreateCallLinkCredentialRequest_CheckValidContents, + CreateCallLinkCredentialRequest_IssueDeterministic, + CreateCallLinkCredentialResponse_CheckValidContents, + CreateCallLinkCredentialRequestContext_ReceiveResponse, + CreateCallLinkCredential_CheckValidContents, + CreateCallLinkCredential_PresentDeterministic, + CreateCallLinkCredentialPresentation_CheckValidContents, + CreateCallLinkCredentialPresentation_Verify, + CallLinkAuthCredentialResponse_CheckValidContents, + CallLinkAuthCredentialResponse_IssueDeterministic, + CallLinkAuthCredentialResponse_Receive, + CallLinkAuthCredential_CheckValidContents, + CallLinkAuthCredential_PresentDeterministic, + CallLinkAuthCredentialPresentation_CheckValidContents, + CallLinkAuthCredentialPresentation_Verify, + CallLinkAuthCredentialPresentation_GetUserId, + BackupAuthCredentialRequestContext_New, + BackupAuthCredentialRequestContext_CheckValidContents, + BackupAuthCredentialRequestContext_GetRequest, + BackupAuthCredentialRequest_CheckValidContents, + BackupAuthCredentialRequest_IssueDeterministic, + BackupAuthCredentialResponse_CheckValidContents, + BackupAuthCredentialRequestContext_ReceiveResponse, + BackupAuthCredential_CheckValidContents, + BackupAuthCredential_GetBackupId, + BackupAuthCredential_GetBackupLevel, + BackupAuthCredential_GetType, + BackupAuthCredential_PresentDeterministic, + BackupAuthCredentialPresentation_CheckValidContents, + BackupAuthCredentialPresentation_Verify, + BackupAuthCredentialPresentation_GetBackupId, + BackupAuthCredentialPresentation_GetBackupLevel, + BackupAuthCredentialPresentation_GetType, + GroupSendDerivedKeyPair_CheckValidContents, + GroupSendDerivedKeyPair_ForExpiration, + GroupSendEndorsementsResponse_CheckValidContents, + GroupSendEndorsementsResponse_IssueDeterministic, + GroupSendEndorsementsResponse_GetExpiration, + GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds, + GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts, + GroupSendEndorsement_CheckValidContents, + GroupSendEndorsement_Combine, + GroupSendEndorsement_Remove, + GroupSendEndorsement_ToToken, + GroupSendEndorsement_CallLinkParams_ToToken, + GroupSendToken_CheckValidContents, + GroupSendToken_ToFullToken, + GroupSendFullToken_CheckValidContents, + GroupSendFullToken_GetExpiration, + GroupSendFullToken_Verify, + LookupRequest_new, + LookupRequest_addE164, + LookupRequest_addPreviousE164, + LookupRequest_setToken, + LookupRequest_addAciAndAccessKey, + CdsiLookup_new, + CdsiLookup_token, + CdsiLookup_complete, + HttpRequest_new, + HttpRequest_add_header, + ChatConnectionInfo_local_port, + ChatConnectionInfo_ip_version, + ChatConnectionInfo_description, + UnauthenticatedChatConnection_connect, + UnauthenticatedChatConnection_init_listener, + UnauthenticatedChatConnection_send, + UnauthenticatedChatConnection_disconnect, + UnauthenticatedChatConnection_info, + UnauthenticatedChatConnection_look_up_username_hash, + UnauthenticatedChatConnection_send_multi_recipient_message, + AuthenticatedChatConnection_preconnect, + AuthenticatedChatConnection_connect, + AuthenticatedChatConnection_init_listener, + AuthenticatedChatConnection_send, + AuthenticatedChatConnection_disconnect, + AuthenticatedChatConnection_info, + ServerMessageAck_SendStatus, + KeyTransparency_AciSearchKey, + KeyTransparency_E164SearchKey, + KeyTransparency_UsernameHashSearchKey, + KeyTransparency_Search, + KeyTransparency_Monitor, + KeyTransparency_Distinguished, + RegistrationService_CreateSession, + RegistrationService_ResumeSession, + RegistrationService_RequestVerificationCode, + RegistrationService_SubmitVerificationCode, + RegistrationService_SubmitCaptcha, + RegistrationService_CheckSvr2Credentials, + RegistrationService_RegisterAccount, + RegistrationService_ReregisterAccount, + RegistrationService_SessionId, + RegistrationService_RegistrationSession, + RegistrationSession_GetAllowedToRequestCode, + RegistrationSession_GetVerified, + RegistrationSession_GetNextCallSeconds, + RegistrationSession_GetNextSmsSeconds, + RegistrationSession_GetNextVerificationAttemptSeconds, + RegistrationSession_GetRequestedInformation, + RegisterAccountRequest_Create, + RegisterAccountRequest_SetSkipDeviceTransfer, + RegisterAccountRequest_SetAccountPassword, + RegisterAccountRequest_SetIdentityPublicKey, + RegisterAccountRequest_SetIdentitySignedPreKey, + RegisterAccountRequest_SetIdentityPqLastResortPreKey, + RegistrationAccountAttributes_Create, + RegisterAccountResponse_GetIdentity, + RegisterAccountResponse_GetNumber, + RegisterAccountResponse_GetUsernameHash, + RegisterAccountResponse_GetUsernameLinkHandle, + RegisterAccountResponse_GetStorageCapable, + RegisterAccountResponse_GetReregistration, + RegisterAccountResponse_GetEntitlementBadges, + RegisterAccountResponse_GetEntitlementBackupLevel, + RegisterAccountResponse_GetEntitlementBackupExpirationSeconds, + SecureValueRecoveryForBackups_CreateNewBackupChain, + SecureValueRecoveryForBackups_StoreBackup, + SecureValueRecoveryForBackups_RestoreBackupFromServer, + SecureValueRecoveryForBackups_RemoveBackup, + BackupStoreResponse_GetForwardSecrecyToken, + BackupStoreResponse_GetOpaqueMetadata, + BackupStoreResponse_GetNextBackupSecretData, + BackupRestoreResponse_GetForwardSecrecyToken, + BackupRestoreResponse_GetNextBackupSecretData, + TokioAsyncContext_new, + TokioAsyncContext_cancel, + ConnectionProxyConfig_new, + ConnectionManager_new, + ConnectionManager_set_proxy, + ConnectionManager_set_invalid_proxy, + ConnectionManager_clear_proxy, + ConnectionManager_set_ipv6_enabled, + ConnectionManager_set_censorship_circumvention_enabled, + ConnectionManager_set_remote_config, + ConnectionManager_on_network_change, + AccountEntropyPool_Generate, + AccountEntropyPool_IsValid, + AccountEntropyPool_DeriveSvrKey, + AccountEntropyPool_DeriveBackupKey, + BackupKey_DeriveBackupId, + BackupKey_DeriveEcKey, + BackupKey_DeriveLocalBackupMetadataKey, + BackupKey_DeriveMediaId, + BackupKey_DeriveMediaEncryptionKey, + BackupKey_DeriveThumbnailTransitEncryptionKey, + IncrementalMac_CalculateChunkSize, + IncrementalMac_Initialize, + IncrementalMac_Update, + IncrementalMac_Finalize, + ValidatingMac_Initialize, + ValidatingMac_Update, + ValidatingMac_Finalize, + MessageBackupKey_FromAccountEntropyPool, + MessageBackupKey_FromBackupKeyAndBackupId, + MessageBackupKey_GetHmacKey, + MessageBackupKey_GetAesKey, + MessageBackupValidator_Validate, + OnlineBackupValidator_New, + OnlineBackupValidator_AddFrame, + OnlineBackupValidator_Finalize, + BackupJsonExporter_New, + BackupJsonExporter_GetInitialChunk, + BackupJsonExporter_ExportFrames, + BackupJsonExporter_Finish, + Username_Hash, + Username_Proof, + Username_Verify, + Username_CandidatesFrom, + Username_HashFromParts, + UsernameLink_Create, + UsernameLink_DecryptUsername, + SignalMedia_CheckAvailable, + Mp4Sanitizer_Sanitize, + WebpSanitizer_Sanitize, + SanitizedMetadata_GetMetadata, + SanitizedMetadata_GetDataOffset, + SanitizedMetadata_GetDataLen, + BridgedStringMap_new, + BridgedStringMap_insert, + TESTING_NonSuspendingBackgroundThreadRuntime_New, + TESTING_FutureSuccess, + TESTING_TokioAsyncContext_FutureSuccessBytes, + TESTING_FutureFailure, + TESTING_FutureCancellationCounter_Create, + TESTING_FutureCancellationCounter_WaitForCount, + TESTING_FutureIncrementOnCancel, + TESTING_TokioAsyncFuture, + TESTING_TestingHandleType_getValue, + TESTING_FutureProducesPointerType, + TESTING_OtherTestingHandleType_getValue, + TESTING_FutureProducesOtherPointerType, + TESTING_PanicOnBorrowSync, + TESTING_PanicOnBorrowAsync, + TESTING_PanicOnBorrowIo, + TESTING_ErrorOnBorrowSync, + TESTING_ErrorOnBorrowAsync, + TESTING_ErrorOnBorrowIo, + TESTING_PanicOnLoadSync, + TESTING_PanicOnLoadAsync, + TESTING_PanicOnLoadIo, + TESTING_PanicInBodySync, + TESTING_PanicInBodyAsync, + TESTING_PanicInBodyIo, + TESTING_PanicOnReturnSync, + TESTING_PanicOnReturnAsync, + TESTING_PanicOnReturnIo, + TESTING_ErrorOnReturnSync, + TESTING_ErrorOnReturnAsync, + TESTING_ErrorOnReturnIo, + TESTING_ReturnStringArray, + TESTING_JoinStringArray, + TESTING_ProcessBytestringArray, + TESTING_RoundTripU8, + TESTING_RoundTripU16, + TESTING_RoundTripU32, + TESTING_RoundTripI32, + TESTING_RoundTripU64, + TESTING_ConvertOptionalUuid, + TESTING_InputStreamReadIntoZeroLengthSlice, + ComparableBackup_ReadUnencrypted, + ComparableBackup_GetComparableString, + ComparableBackup_GetUnknownFields, + TESTING_FakeChatServer_Create, + TESTING_FakeChatServer_GetNextRemote, + TESTING_FakeChatConnection_Create, + TESTING_FakeChatConnection_TakeAuthenticatedChat, + TESTING_FakeChatConnection_TakeUnauthenticatedChat, + TESTING_FakeChatConnection_TakeRemote, + TESTING_FakeChatRemoteEnd_SendRawServerRequest, + TESTING_FakeChatRemoteEnd_SendRawServerResponse, + TESTING_FakeChatRemoteEnd_SendServerResponse, + TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted, + TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest, + TESTING_ChatResponseConvert, + TESTING_ChatRequestGetMethod, + TESTING_ChatRequestGetPath, + TESTING_ChatRequestGetHeaderNames, + TESTING_ChatRequestGetHeaderValue, + TESTING_ChatRequestGetBody, + TESTING_FakeChatResponse_Create, + TESTING_ChatConnectErrorConvert, + TESTING_ChatSendErrorConvert, + TESTING_KeyTransFatalVerificationFailure, + TESTING_KeyTransNonFatalVerificationFailure, + TESTING_KeyTransChatSendError, + TESTING_RegistrationSessionInfoConvert, + TESTING_RegistrationService_CheckSvr2CredentialsResponseConvert, + TESTING_FakeRegistrationSession_CreateSession, + TESTING_RegisterAccountResponse_CreateTestValue, + TESTING_RegistrationService_CreateSessionErrorConvert, + TESTING_RegistrationService_ResumeSessionErrorConvert, + TESTING_RegistrationService_UpdateSessionErrorConvert, + TESTING_RegistrationService_RequestVerificationCodeErrorConvert, + TESTING_RegistrationService_SubmitVerificationErrorConvert, + TESTING_RegistrationService_CheckSvr2CredentialsErrorConvert, + TESTING_RegistrationService_RegisterAccountErrorConvert, + TESTING_CdsiLookupResponseConvert, + TESTING_CdsiLookupErrorConvert, + TESTING_ServerMessageAck_Create, + TESTING_ConnectionManager_newLocalOverride, + TESTING_ConnectionManager_isUsingProxy, + TESTING_CreateOTP, + TESTING_CreateOTPFromBase64, + TESTING_SignedPublicPreKey_CheckBridgesCorrectly, + TestingSemaphore_New, + TestingSemaphore_AddPermits, + TestingValueHolder_New, + TestingValueHolder_Get, + TESTING_ReturnPair, + test_only_fn_returns_123, + TESTING_BridgedStringMap_dump_to_json, + TESTING_TokioAsyncContext_NewSingleThreaded, + }; + +export const enum LogLevel { Error = 1, Warn, Info, Debug, Trace } +export interface BridgedStringMap { readonly __type: unique symbol; } +export interface Aes256GcmSiv { readonly __type: unique symbol; } +export interface HsmEnclaveClient { readonly __type: unique symbol; } +export interface LookupRequest { readonly __type: unique symbol; } +export interface CdsiLookup { readonly __type: unique symbol; } +export interface ChatConnectionInfo { readonly __type: unique symbol; } +export interface UnauthenticatedChatConnection { readonly __type: unique symbol; } +export interface AuthenticatedChatConnection { readonly __type: unique symbol; } +export interface HttpRequest { readonly __type: unique symbol; } +export interface ServerMessageAck { readonly __type: unique symbol; } +export interface RegistrationService { readonly __type: unique symbol; } +export interface RegistrationSession { readonly __type: unique symbol; } +export interface RegisterAccountRequest { readonly __type: unique symbol; } +export interface RegisterAccountResponse { readonly __type: unique symbol; } +export interface RegistrationAccountAttributes { readonly __type: unique symbol; } +export interface BackupStoreResponse { readonly __type: unique symbol; } +export interface BackupRestoreResponse { readonly __type: unique symbol; } +export interface TokioAsyncContext { readonly __type: unique symbol; } +export interface ConnectionManager { readonly __type: unique symbol; } +export interface ConnectionProxyConfig { readonly __type: unique symbol; } +export interface CiphertextMessage { readonly __type: unique symbol; } +export interface DecryptionErrorMessage { readonly __type: unique symbol; } +export interface Fingerprint { readonly __type: unique symbol; } +export interface PlaintextContent { readonly __type: unique symbol; } +export interface PreKeyBundle { readonly __type: unique symbol; } +export interface PreKeyRecord { readonly __type: unique symbol; } +export interface PreKeySignalMessage { readonly __type: unique symbol; } +export interface PrivateKey { readonly __type: unique symbol; } +export interface ProtocolAddress { readonly __type: unique symbol; } +export interface PublicKey { readonly __type: unique symbol; } +export interface SenderCertificate { readonly __type: unique symbol; } +export interface SenderKeyDistributionMessage { readonly __type: unique symbol; } +export interface SenderKeyMessage { readonly __type: unique symbol; } +export interface SenderKeyRecord { readonly __type: unique symbol; } +export interface ServerCertificate { readonly __type: unique symbol; } +export interface SessionRecord { readonly __type: unique symbol; } +export interface SignalMessage { readonly __type: unique symbol; } +export interface SignedPreKeyRecord { readonly __type: unique symbol; } +export interface KyberPreKeyRecord { readonly __type: unique symbol; } +export interface UnidentifiedSenderMessageContent { readonly __type: unique symbol; } +export interface SealedSenderDecryptionResult { readonly __type: unique symbol; } +export interface KyberKeyPair { readonly __type: unique symbol; } +export interface KyberPublicKey { readonly __type: unique symbol; } +export interface KyberSecretKey { readonly __type: unique symbol; } +export interface SgxClientState { readonly __type: unique symbol; } +export interface ExpiringProfileKeyCredential { readonly __type: unique symbol; } +export interface ExpiringProfileKeyCredentialResponse { readonly __type: unique symbol; } +export interface GroupMasterKey { readonly __type: unique symbol; } +export interface GroupPublicParams { readonly __type: unique symbol; } +export interface GroupSecretParams { readonly __type: unique symbol; } +export interface ProfileKey { readonly __type: unique symbol; } +export interface ProfileKeyCiphertext { readonly __type: unique symbol; } +export interface ProfileKeyCommitment { readonly __type: unique symbol; } +export interface ProfileKeyCredentialRequest { readonly __type: unique symbol; } +export interface ProfileKeyCredentialRequestContext { readonly __type: unique symbol; } +export interface ReceiptCredential { readonly __type: unique symbol; } +export interface ReceiptCredentialPresentation { readonly __type: unique symbol; } +export interface ReceiptCredentialRequest { readonly __type: unique symbol; } +export interface ReceiptCredentialRequestContext { readonly __type: unique symbol; } +export interface ReceiptCredentialResponse { readonly __type: unique symbol; } +export interface UuidCiphertext { readonly __type: unique symbol; } +export interface ServerPublicParams { readonly __type: unique symbol; } +export interface ServerSecretParams { readonly __type: unique symbol; } +export interface IncrementalMac { readonly __type: unique symbol; } +export interface ValidatingMac { readonly __type: unique symbol; } +export interface MessageBackupKey { readonly __type: unique symbol; } +export interface BackupJsonExporter { readonly __type: unique symbol; } +export interface OnlineBackupValidator { readonly __type: unique symbol; } +export interface SanitizedMetadata { readonly __type: unique symbol; } +export interface NonSuspendingBackgroundThreadRuntime { readonly __type: unique symbol; } +export interface TestingHandleType { readonly __type: unique symbol; } +export interface OtherTestingHandleType { readonly __type: unique symbol; } +export interface ComparableBackup { readonly __type: unique symbol; } +export interface FakeChatConnection { readonly __type: unique symbol; } +export interface FakeChatRemoteEnd { readonly __type: unique symbol; } +export interface FakeChatServer { readonly __type: unique symbol; } +export interface FakeChatResponse { readonly __type: unique symbol; } +export interface TestingSemaphore { readonly __type: unique symbol; } +export interface TestingFutureCancellationCounter { readonly __type: unique symbol; } +export interface TestingValueHolder { readonly __type: unique symbol; } diff --git a/node/ts/SealedSenderMultiRecipientMessage.ts b/node/ts/SealedSenderMultiRecipientMessage.ts index 6b64976c0..22e6c1220 100644 --- a/node/ts/SealedSenderMultiRecipientMessage.ts +++ b/node/ts/SealedSenderMultiRecipientMessage.ts @@ -5,7 +5,7 @@ import { Buffer } from 'node:buffer'; -import Native from '../Native.js'; +import * as Native from './Native.js'; /** * A single recipient parsed from a {@link SealedSenderMultiRecipientMessage}. diff --git a/node/ts/WebpSanitizer.ts b/node/ts/WebpSanitizer.ts index 18d38b90e..828b5bfea 100644 --- a/node/ts/WebpSanitizer.ts +++ b/node/ts/WebpSanitizer.ts @@ -12,7 +12,7 @@ * @module WebpSanitizer */ -import Native from '../Native.js'; +import * as Native from './Native.js'; import type { IoError, InvalidMediaInputError, diff --git a/node/ts/incremental_mac.ts b/node/ts/incremental_mac.ts index abc58b1a7..7f43cb963 100644 --- a/node/ts/incremental_mac.ts +++ b/node/ts/incremental_mac.ts @@ -6,7 +6,7 @@ import * as stream from 'node:stream'; import { Buffer } from 'node:buffer'; -import Native from '../Native.js'; +import * as Native from './Native.js'; import { IncrementalMacVerificationFailed, LibSignalErrorBase, diff --git a/node/ts/index.ts b/node/ts/index.ts index bf31f8092..1f6a72376 100644 --- a/node/ts/index.ts +++ b/node/ts/index.ts @@ -24,7 +24,7 @@ export * as Net from './net.js'; export * as Mp4Sanitizer from './Mp4Sanitizer.js'; export * as WebpSanitizer from './WebpSanitizer.js'; -import Native from '../Native.js'; +import * as Native from './Native.js'; Native.registerErrors(Errors); diff --git a/node/ts/internal.ts b/node/ts/internal.ts index c6ebc92e7..bab46bcd8 100644 --- a/node/ts/internal.ts +++ b/node/ts/internal.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../Native.js'; +import * as Native from './Native.js'; export class BridgedStringMap { readonly _nativeHandle: Native.BridgedStringMap; diff --git a/node/ts/io.ts b/node/ts/io.ts index 17aa0a55a..e99125544 100644 --- a/node/ts/io.ts +++ b/node/ts/io.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../Native.js'; +import * as Native from './Native.js'; import type { IoError } from './Errors.js'; /** diff --git a/node/ts/net.ts b/node/ts/net.ts index 19e033f1f..8a78939ee 100644 --- a/node/ts/net.ts +++ b/node/ts/net.ts @@ -4,7 +4,7 @@ // import type { ReadonlyDeep } from 'type-fest'; -import Native from '../Native.js'; +import * as Native from './Native.js'; import { cdsiLookup, CDSRequestOptionsType, diff --git a/node/ts/net/CDSI.ts b/node/ts/net/CDSI.ts index 5fa7c5756..9cb745a70 100644 --- a/node/ts/net/CDSI.ts +++ b/node/ts/net/CDSI.ts @@ -4,7 +4,7 @@ // import type { ReadonlyDeep } from 'type-fest'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { Aci } from '../Address.js'; import { Buffer } from 'node:buffer'; import { TokioAsyncContext, ServiceAuth } from '../net.js'; diff --git a/node/ts/net/Chat.ts b/node/ts/net/Chat.ts index 4cbdcd1c0..cc8e4daef 100644 --- a/node/ts/net/Chat.ts +++ b/node/ts/net/Chat.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native, { ServerMessageAck, Wrapper } from '../../Native.js'; +import * as Native from '../Native.js'; import { LibSignalError } from '../Errors.js'; import { TokioAsyncContext, Environment } from '../net.js'; import * as KT from './KeyTransparency.js'; @@ -109,7 +109,7 @@ export interface ConnectionInfo { } class ConnectionInfoImpl - implements Wrapper, ConnectionInfo + implements Native.Wrapper, ConnectionInfo { constructor(public _nativeHandle: Native.ChatConnectionInfo) {} @@ -178,7 +178,7 @@ export class UnauthenticatedChatConnection implements ChatConnection { public static fakeConnect( asyncContext: TokioAsyncContext, listener: ChatServiceListener - ): [UnauthenticatedChatConnection, Wrapper] { + ): [UnauthenticatedChatConnection, Native.Wrapper] { const nativeChatListener = makeNativeChatListener(asyncContext, listener); const fakeChat = newNativeHandle( @@ -202,7 +202,7 @@ export class UnauthenticatedChatConnection implements ChatConnection { private constructor( // Not true-private so that they can be accessed by the "Service" interfaces in chat/. readonly _asyncContext: TokioAsyncContext, - readonly _chatService: Wrapper, + readonly _chatService: Native.Wrapper, // Unused except to keep the listener alive since the Rust code only holds a // weak reference to the same object. private readonly chatListener: Native.ChatListener, @@ -293,7 +293,7 @@ export class AuthenticatedChatConnection implements ChatConnection { asyncContext: TokioAsyncContext, listener: ChatServiceListener, alerts?: ReadonlyArray - ): [AuthenticatedChatConnection, Wrapper] { + ): [AuthenticatedChatConnection, Native.Wrapper] { const nativeChatListener = makeNativeChatListener(asyncContext, listener); const fakeChat = newNativeHandle( @@ -316,7 +316,7 @@ export class AuthenticatedChatConnection implements ChatConnection { private constructor( private readonly asyncContext: TokioAsyncContext, - private readonly chatService: Wrapper, + private readonly chatService: Native.Wrapper, // Unused except to keep the listener alive since the Rust code only holds a // weak reference to the same object. private readonly chatListener: Native.ChatListener @@ -379,7 +379,7 @@ class WeakListenerWrapper implements Native.ChatListener { _incoming_message( envelope: Uint8Array, timestamp: number, - ack: ServerMessageAck + ack: Native.ServerMessageAck ): void { this.listener.deref()?._incoming_message(envelope, timestamp, ack); } @@ -400,7 +400,7 @@ function makeNativeChatListener( _incoming_message( envelope: Uint8Array, timestamp: number, - ack: ServerMessageAck + ack: Native.ServerMessageAck ): void { listener.onIncomingMessage( envelope, @@ -424,7 +424,7 @@ function makeNativeChatListener( _incoming_message( _envelope: Uint8Array, _timestamp: number, - _ack: ServerMessageAck + _ack: Native.ServerMessageAck ): void { throw new Error('Event not supported on unauthenticated connection'); }, @@ -446,7 +446,7 @@ function makeNativeChatListener( export function buildHttpRequest( chatRequest: ChatRequest -): Wrapper { +): Native.Wrapper { const { verb, path, body, headers } = chatRequest; const httpRequest = { _nativeHandle: Native.HttpRequest_new(verb, path, body ?? null), diff --git a/node/ts/net/KeyTransparency.ts b/node/ts/net/KeyTransparency.ts index 39d9e0b4b..c03989f2e 100644 --- a/node/ts/net/KeyTransparency.ts +++ b/node/ts/net/KeyTransparency.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { Aci } from '../Address.js'; import { PublicKey } from '../EcKeys.js'; import { Environment, type TokioAsyncContext } from '../net.js'; diff --git a/node/ts/net/Registration.ts b/node/ts/net/Registration.ts index f2022f5e3..742ab576c 100644 --- a/node/ts/net/Registration.ts +++ b/node/ts/net/Registration.ts @@ -5,7 +5,7 @@ import type { ReadonlyDeep } from 'type-fest'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { LibSignalError, RateLimitedError } from '../Errors.js'; import { type Net, type TokioAsyncContext } from '../net.js'; import { PublicKey } from '../EcKeys.js'; diff --git a/node/ts/net/SvrB.ts b/node/ts/net/SvrB.ts index 1b3124fa2..61a5eb403 100644 --- a/node/ts/net/SvrB.ts +++ b/node/ts/net/SvrB.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { TokioAsyncContext, Environment, Net } from '../net.js'; import { BackupKey, BackupForwardSecrecyToken } from '../AccountKeys.js'; import { MessageBackupKey } from '../MessageBackup.js'; diff --git a/node/ts/net/chat/UnauthMessagesService.ts b/node/ts/net/chat/UnauthMessagesService.ts index 7352f8b59..17fef1997 100644 --- a/node/ts/net/chat/UnauthMessagesService.ts +++ b/node/ts/net/chat/UnauthMessagesService.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { ServiceId } from '../../Address.js'; import { RequestOptions, UnauthenticatedChatConnection } from '../Chat.js'; import { GroupSendFullToken } from '../../zkgroup/index.js'; diff --git a/node/ts/net/chat/UnauthUsernamesService.ts b/node/ts/net/chat/UnauthUsernamesService.ts index 1b0e6bf41..27b789999 100644 --- a/node/ts/net/chat/UnauthUsernamesService.ts +++ b/node/ts/net/chat/UnauthUsernamesService.ts @@ -5,7 +5,7 @@ import { Buffer } from 'node:buffer'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { Aci } from '../../Address.js'; import { RequestOptions, UnauthenticatedChatConnection } from '../Chat.js'; diff --git a/node/ts/node-gyp-build.d.ts b/node/ts/node-gyp-build.d.ts new file mode 100644 index 000000000..cea2f315e --- /dev/null +++ b/node/ts/node-gyp-build.d.ts @@ -0,0 +1,3 @@ +declare module 'node-gyp-build' { + export default function load(path: string): any; +} diff --git a/node/ts/test/BridgingTest.ts b/node/ts/test/BridgingTest.ts index d3a8ea8b9..f76dd6523 100644 --- a/node/ts/test/BridgingTest.ts +++ b/node/ts/test/BridgingTest.ts @@ -6,7 +6,7 @@ import * as uuid from 'uuid'; import { assert, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { BridgedStringMap } from '../internal.js'; use(chaiAsPromised); diff --git a/node/ts/test/FutureTest.ts b/node/ts/test/FutureTest.ts index e53fc5887..375a5e18f 100644 --- a/node/ts/test/FutureTest.ts +++ b/node/ts/test/FutureTest.ts @@ -5,7 +5,7 @@ import { assert, expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { ErrorCode, LibSignalError, LibSignalErrorBase } from '../Errors.js'; import { TokioAsyncContext } from '../net.js'; import { setTimeout } from 'node:timers/promises'; diff --git a/node/ts/test/IoTest.ts b/node/ts/test/IoTest.ts index 1025519d6..29ea09fe1 100644 --- a/node/ts/test/IoTest.ts +++ b/node/ts/test/IoTest.ts @@ -7,7 +7,7 @@ import { use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { Buffer } from 'node:buffer'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { Uint8ArrayInputStream } from './ioutil.js'; import { assertArrayEquals } from './util.js'; diff --git a/node/ts/test/KeyTransparencyTest.ts b/node/ts/test/KeyTransparencyTest.ts index 6770edef4..46ec74aa6 100644 --- a/node/ts/test/KeyTransparencyTest.ts +++ b/node/ts/test/KeyTransparencyTest.ts @@ -7,7 +7,7 @@ import { assert, config, expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { Buffer } from 'node:buffer'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import * as util from './util.js'; import { UnauthenticatedChatConnection, diff --git a/node/ts/test/NativeTest.ts b/node/ts/test/NativeTest.ts index 86f8987b4..7950b0cd9 100644 --- a/node/ts/test/NativeTest.ts +++ b/node/ts/test/NativeTest.ts @@ -5,7 +5,7 @@ import { assert, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; use(chaiAsPromised); diff --git a/node/ts/test/NetTest.ts b/node/ts/test/NetTest.ts index 8d47917fe..64db7f685 100644 --- a/node/ts/test/NetTest.ts +++ b/node/ts/test/NetTest.ts @@ -12,7 +12,7 @@ import { Buffer } from 'node:buffer'; import * as util from './util.js'; import { Aci, Pni } from '../Address.js'; -import Native, { type ChatResponse } from '../../Native.js'; +import * as Native from '../Native.js'; import { ErrorCode, LibSignalErrorBase } from '../Errors.js'; import { AuthenticatedChatConnection, @@ -106,13 +106,13 @@ describe('chat service api', () => { ['content-type', 'application/octet-stream'], ['forwarded', '1.1.1.1'], ]; - const expectedWithContent: ChatResponse = { + const expectedWithContent: Native.ChatResponse = { status: status, message: 'OK', headers: headers, body: Buffer.from('content'), }; - const expectedWithoutContent: ChatResponse = { + const expectedWithoutContent: Native.ChatResponse = { status: status, message: 'OK', headers: headers, diff --git a/node/ts/test/RegistrationTest.ts b/node/ts/test/RegistrationTest.ts index 1ba92fe42..2214966df 100644 --- a/node/ts/test/RegistrationTest.ts +++ b/node/ts/test/RegistrationTest.ts @@ -9,7 +9,7 @@ import sinonChai from 'sinon-chai'; import { Buffer } from 'node:buffer'; import * as util from './util.js'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { ErrorCode, LibSignalErrorBase } from '../Errors.js'; import { RegisterAccountResponse, diff --git a/node/ts/test/SvrBTest.ts b/node/ts/test/SvrBTest.ts index c54a7e227..c78e97cbb 100644 --- a/node/ts/test/SvrBTest.ts +++ b/node/ts/test/SvrBTest.ts @@ -9,7 +9,7 @@ import { Buffer } from 'node:buffer'; import { Environment, Net, SvrB } from '../net.js'; import { BackupKey, BackupForwardSecrecyToken } from '../AccountKeys.js'; import { Aci } from '../Address.js'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; describe('SecureValueRecoveryBackup', () => { const testAci = Aci.parseFromServiceIdString( diff --git a/node/ts/test/chat/ServiceTestUtils.ts b/node/ts/test/chat/ServiceTestUtils.ts index 2174aab6e..cb4264fb5 100644 --- a/node/ts/test/chat/ServiceTestUtils.ts +++ b/node/ts/test/chat/ServiceTestUtils.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { TokioAsyncContext, UnauthenticatedChatConnection } from '../../net.js'; /** diff --git a/node/ts/test/chat/UnauthMessagesServiceTest.ts b/node/ts/test/chat/UnauthMessagesServiceTest.ts index ee85231a1..a306e33df 100644 --- a/node/ts/test/chat/UnauthMessagesServiceTest.ts +++ b/node/ts/test/chat/UnauthMessagesServiceTest.ts @@ -7,7 +7,7 @@ import { assert, config, expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { Buffer } from 'node:buffer'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import * as util from '../util.js'; import { MultiRecipientMessageResponse, diff --git a/node/ts/test/chat/UnauthUsernamesServiceTest.ts b/node/ts/test/chat/UnauthUsernamesServiceTest.ts index 591286762..71752d17d 100644 --- a/node/ts/test/chat/UnauthUsernamesServiceTest.ts +++ b/node/ts/test/chat/UnauthUsernamesServiceTest.ts @@ -7,7 +7,7 @@ import { assert, config, expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { Buffer } from 'node:buffer'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import * as util from '../util.js'; import { TokioAsyncContext, UnauthUsernamesService } from '../../net.js'; import { connectUnauth } from './ServiceTestUtils.js'; diff --git a/node/ts/usernames.ts b/node/ts/usernames.ts index aaaf96359..a3d4ffe6c 100644 --- a/node/ts/usernames.ts +++ b/node/ts/usernames.ts @@ -7,7 +7,7 @@ import { randomBytes } from 'node:crypto'; import { RANDOM_LENGTH } from './zkgroup/internal/Constants.js'; -import Native from '../Native.js'; +import * as Native from './Native.js'; export type UsernameLink = { entropy: Uint8Array; diff --git a/node/ts/zkgroup/GenericServerPublicParams.ts b/node/ts/zkgroup/GenericServerPublicParams.ts index e88b81a60..546cce810 100644 --- a/node/ts/zkgroup/GenericServerPublicParams.ts +++ b/node/ts/zkgroup/GenericServerPublicParams.ts @@ -4,7 +4,7 @@ // import ByteArray from './internal/ByteArray.js'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; export default class GenericServerPublicParams extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/GenericServerSecretParams.ts b/node/ts/zkgroup/GenericServerSecretParams.ts index 977218d83..b47d78dca 100644 --- a/node/ts/zkgroup/GenericServerSecretParams.ts +++ b/node/ts/zkgroup/GenericServerSecretParams.ts @@ -4,7 +4,7 @@ // import { randomBytes } from 'node:crypto'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import ByteArray from './internal/ByteArray.js'; import { RANDOM_LENGTH } from './internal/Constants.js'; diff --git a/node/ts/zkgroup/ServerPublicParams.ts b/node/ts/zkgroup/ServerPublicParams.ts index 1f8482610..a65474cf0 100644 --- a/node/ts/zkgroup/ServerPublicParams.ts +++ b/node/ts/zkgroup/ServerPublicParams.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import NotarySignature from './NotarySignature.js'; export default class ServerPublicParams { diff --git a/node/ts/zkgroup/ServerSecretParams.ts b/node/ts/zkgroup/ServerSecretParams.ts index 0bc4b9061..a92207d29 100644 --- a/node/ts/zkgroup/ServerSecretParams.ts +++ b/node/ts/zkgroup/ServerSecretParams.ts @@ -4,7 +4,7 @@ // import { randomBytes } from 'node:crypto'; -import Native from '../../Native.js'; +import * as Native from '../Native.js'; import { RANDOM_LENGTH } from './internal/Constants.js'; import ServerPublicParams from './ServerPublicParams.js'; diff --git a/node/ts/zkgroup/auth/AuthCredentialPresentation.ts b/node/ts/zkgroup/auth/AuthCredentialPresentation.ts index 75137dd71..0a2efb704 100644 --- a/node/ts/zkgroup/auth/AuthCredentialPresentation.ts +++ b/node/ts/zkgroup/auth/AuthCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import UuidCiphertext from '../groups/UuidCiphertext.js'; export default class AuthCredentialPresentation extends ByteArray { diff --git a/node/ts/zkgroup/auth/AuthCredentialWithPni.ts b/node/ts/zkgroup/auth/AuthCredentialWithPni.ts index 542b1d681..a38429a61 100644 --- a/node/ts/zkgroup/auth/AuthCredentialWithPni.ts +++ b/node/ts/zkgroup/auth/AuthCredentialWithPni.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class AuthCredentialWithPni extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/auth/AuthCredentialWithPniResponse.ts b/node/ts/zkgroup/auth/AuthCredentialWithPniResponse.ts index e0de5e90f..358cab5e2 100644 --- a/node/ts/zkgroup/auth/AuthCredentialWithPniResponse.ts +++ b/node/ts/zkgroup/auth/AuthCredentialWithPniResponse.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class AuthCredentialWithPniResponse extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/auth/ClientZkAuthOperations.ts b/node/ts/zkgroup/auth/ClientZkAuthOperations.ts index 9c759f22c..760aeb289 100644 --- a/node/ts/zkgroup/auth/ClientZkAuthOperations.ts +++ b/node/ts/zkgroup/auth/ClientZkAuthOperations.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import ServerPublicParams from '../ServerPublicParams.js'; diff --git a/node/ts/zkgroup/auth/ServerZkAuthOperations.ts b/node/ts/zkgroup/auth/ServerZkAuthOperations.ts index df9c62c95..b45b72692 100644 --- a/node/ts/zkgroup/auth/ServerZkAuthOperations.ts +++ b/node/ts/zkgroup/auth/ServerZkAuthOperations.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ServerSecretParams from '../ServerSecretParams.js'; import AuthCredentialPresentation from './AuthCredentialPresentation.js'; diff --git a/node/ts/zkgroup/backups/BackupAuthCredential.ts b/node/ts/zkgroup/backups/BackupAuthCredential.ts index 760b85dc8..9560ed0ff 100644 --- a/node/ts/zkgroup/backups/BackupAuthCredential.ts +++ b/node/ts/zkgroup/backups/BackupAuthCredential.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; diff --git a/node/ts/zkgroup/backups/BackupAuthCredentialPresentation.ts b/node/ts/zkgroup/backups/BackupAuthCredentialPresentation.ts index 80ca274e6..0966b2d6a 100644 --- a/node/ts/zkgroup/backups/BackupAuthCredentialPresentation.ts +++ b/node/ts/zkgroup/backups/BackupAuthCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import GenericServerSecretParams from '../GenericServerSecretParams.js'; import BackupLevel from './BackupLevel.js'; diff --git a/node/ts/zkgroup/backups/BackupAuthCredentialRequest.ts b/node/ts/zkgroup/backups/BackupAuthCredentialRequest.ts index 3c13a0abd..c1ffb3fce 100644 --- a/node/ts/zkgroup/backups/BackupAuthCredentialRequest.ts +++ b/node/ts/zkgroup/backups/BackupAuthCredentialRequest.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; diff --git a/node/ts/zkgroup/backups/BackupAuthCredentialRequestContext.ts b/node/ts/zkgroup/backups/BackupAuthCredentialRequestContext.ts index 22e3a0976..76783f88b 100644 --- a/node/ts/zkgroup/backups/BackupAuthCredentialRequestContext.ts +++ b/node/ts/zkgroup/backups/BackupAuthCredentialRequestContext.ts @@ -6,7 +6,7 @@ import * as uuid from 'uuid'; import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import BackupAuthCredentialRequest from './BackupAuthCredentialRequest.js'; import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js'; diff --git a/node/ts/zkgroup/backups/BackupAuthCredentialResponse.ts b/node/ts/zkgroup/backups/BackupAuthCredentialResponse.ts index 609a0ba29..988c05c22 100644 --- a/node/ts/zkgroup/backups/BackupAuthCredentialResponse.ts +++ b/node/ts/zkgroup/backups/BackupAuthCredentialResponse.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class BackupAuthCredentialResponse extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/calllinks/CallLinkAuthCredential.ts b/node/ts/zkgroup/calllinks/CallLinkAuthCredential.ts index 677ab7312..9b68f079d 100644 --- a/node/ts/zkgroup/calllinks/CallLinkAuthCredential.ts +++ b/node/ts/zkgroup/calllinks/CallLinkAuthCredential.ts @@ -7,7 +7,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CallLinkSecretParams from './CallLinkSecretParams.js'; import CallLinkAuthCredentialPresentation from './CallLinkAuthCredentialPresentation.js'; diff --git a/node/ts/zkgroup/calllinks/CallLinkAuthCredentialPresentation.ts b/node/ts/zkgroup/calllinks/CallLinkAuthCredentialPresentation.ts index 9591b5beb..05456596e 100644 --- a/node/ts/zkgroup/calllinks/CallLinkAuthCredentialPresentation.ts +++ b/node/ts/zkgroup/calllinks/CallLinkAuthCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CallLinkPublicParams from './CallLinkPublicParams.js'; import GenericServerSecretParams from '../GenericServerSecretParams.js'; diff --git a/node/ts/zkgroup/calllinks/CallLinkAuthCredentialResponse.ts b/node/ts/zkgroup/calllinks/CallLinkAuthCredentialResponse.ts index 74e7038c6..bd2cc6d1f 100644 --- a/node/ts/zkgroup/calllinks/CallLinkAuthCredentialResponse.ts +++ b/node/ts/zkgroup/calllinks/CallLinkAuthCredentialResponse.ts @@ -6,7 +6,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import GenericServerSecretParams from '../GenericServerSecretParams.js'; diff --git a/node/ts/zkgroup/calllinks/CallLinkPublicParams.ts b/node/ts/zkgroup/calllinks/CallLinkPublicParams.ts index 9bcf972a8..fdfe8b9da 100644 --- a/node/ts/zkgroup/calllinks/CallLinkPublicParams.ts +++ b/node/ts/zkgroup/calllinks/CallLinkPublicParams.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class CallLinkPublicParams extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/calllinks/CallLinkSecretParams.ts b/node/ts/zkgroup/calllinks/CallLinkSecretParams.ts index 476b27625..c82032a7b 100644 --- a/node/ts/zkgroup/calllinks/CallLinkSecretParams.ts +++ b/node/ts/zkgroup/calllinks/CallLinkSecretParams.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CallLinkPublicParams from './CallLinkPublicParams.js'; import UuidCiphertext from '../groups/UuidCiphertext.js'; diff --git a/node/ts/zkgroup/calllinks/CreateCallLinkCredential.ts b/node/ts/zkgroup/calllinks/CreateCallLinkCredential.ts index e89ee8774..528db4ff4 100644 --- a/node/ts/zkgroup/calllinks/CreateCallLinkCredential.ts +++ b/node/ts/zkgroup/calllinks/CreateCallLinkCredential.ts @@ -7,7 +7,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CallLinkSecretParams from './CallLinkSecretParams.js'; import CreateCallLinkCredentialPresentation from './CreateCallLinkCredentialPresentation.js'; diff --git a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialPresentation.ts b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialPresentation.ts index 06fdd8883..2cff5afce 100644 --- a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialPresentation.ts +++ b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CallLinkPublicParams from './CallLinkPublicParams.js'; import GenericServerSecretParams from '../GenericServerSecretParams.js'; diff --git a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequest.ts b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequest.ts index cf2df03d3..44a44afe1 100644 --- a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequest.ts +++ b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequest.ts @@ -7,7 +7,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse.js'; import GenericServerSecretParams from '../GenericServerSecretParams.js'; diff --git a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.ts b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.ts index 627c77e0b..673ee30c3 100644 --- a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.ts +++ b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.ts @@ -7,7 +7,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest.js'; import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse.js'; diff --git a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialResponse.ts b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialResponse.ts index 3e5a8fab6..edfe87a28 100644 --- a/node/ts/zkgroup/calllinks/CreateCallLinkCredentialResponse.ts +++ b/node/ts/zkgroup/calllinks/CreateCallLinkCredentialResponse.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class CreateCallLinkCredentialResponse extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/groups/ClientZkGroupCipher.ts b/node/ts/zkgroup/groups/ClientZkGroupCipher.ts index 169399f77..d95a6142e 100644 --- a/node/ts/zkgroup/groups/ClientZkGroupCipher.ts +++ b/node/ts/zkgroup/groups/ClientZkGroupCipher.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import UuidCiphertext from './UuidCiphertext.js'; diff --git a/node/ts/zkgroup/groups/GroupPublicParams.ts b/node/ts/zkgroup/groups/GroupPublicParams.ts index 4c48d6a59..0793be829 100644 --- a/node/ts/zkgroup/groups/GroupPublicParams.ts +++ b/node/ts/zkgroup/groups/GroupPublicParams.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import GroupIdentifier from './GroupIdentifier.js'; export default class GroupPublicParams extends ByteArray { diff --git a/node/ts/zkgroup/groups/GroupSecretParams.ts b/node/ts/zkgroup/groups/GroupSecretParams.ts index fafb7258d..f08a8aaf7 100644 --- a/node/ts/zkgroup/groups/GroupSecretParams.ts +++ b/node/ts/zkgroup/groups/GroupSecretParams.ts @@ -6,7 +6,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import GroupMasterKey from './GroupMasterKey.js'; import GroupPublicParams from './GroupPublicParams.js'; diff --git a/node/ts/zkgroup/groups/ProfileKeyCiphertext.ts b/node/ts/zkgroup/groups/ProfileKeyCiphertext.ts index d2b764717..6b34360a0 100644 --- a/node/ts/zkgroup/groups/ProfileKeyCiphertext.ts +++ b/node/ts/zkgroup/groups/ProfileKeyCiphertext.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ProfileKeyCiphertext extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/groups/UuidCiphertext.ts b/node/ts/zkgroup/groups/UuidCiphertext.ts index 351124def..0c619674e 100644 --- a/node/ts/zkgroup/groups/UuidCiphertext.ts +++ b/node/ts/zkgroup/groups/UuidCiphertext.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class UuidCiphertext extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/groupsend/GroupSendDerivedKeyPair.ts b/node/ts/zkgroup/groupsend/GroupSendDerivedKeyPair.ts index bf7f69d73..452891515 100644 --- a/node/ts/zkgroup/groupsend/GroupSendDerivedKeyPair.ts +++ b/node/ts/zkgroup/groupsend/GroupSendDerivedKeyPair.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ServerSecretParams from '../ServerSecretParams.js'; // For docs diff --git a/node/ts/zkgroup/groupsend/GroupSendEndorsement.ts b/node/ts/zkgroup/groupsend/GroupSendEndorsement.ts index 3f5255a2e..71ae740bb 100644 --- a/node/ts/zkgroup/groupsend/GroupSendEndorsement.ts +++ b/node/ts/zkgroup/groupsend/GroupSendEndorsement.ts @@ -4,7 +4,7 @@ // import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import GroupSecretParams from '../groups/GroupSecretParams.js'; import GroupSendFullToken from './GroupSendFullToken.js'; diff --git a/node/ts/zkgroup/groupsend/GroupSendEndorsementsResponse.ts b/node/ts/zkgroup/groupsend/GroupSendEndorsementsResponse.ts index 0836c2e4b..975e0c415 100644 --- a/node/ts/zkgroup/groupsend/GroupSendEndorsementsResponse.ts +++ b/node/ts/zkgroup/groupsend/GroupSendEndorsementsResponse.ts @@ -6,7 +6,7 @@ import { randomBytes } from 'node:crypto'; import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import GroupSecretParams from '../groups/GroupSecretParams.js'; diff --git a/node/ts/zkgroup/groupsend/GroupSendFullToken.ts b/node/ts/zkgroup/groupsend/GroupSendFullToken.ts index 5337b8497..a1c3c32b3 100644 --- a/node/ts/zkgroup/groupsend/GroupSendFullToken.ts +++ b/node/ts/zkgroup/groupsend/GroupSendFullToken.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { ServiceId } from '../../Address.js'; import GroupSendDerivedKeyPair from './GroupSendDerivedKeyPair.js'; diff --git a/node/ts/zkgroup/groupsend/GroupSendToken.ts b/node/ts/zkgroup/groupsend/GroupSendToken.ts index 15d3d7ec8..cbb59bb5e 100644 --- a/node/ts/zkgroup/groupsend/GroupSendToken.ts +++ b/node/ts/zkgroup/groupsend/GroupSendToken.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import GroupSendFullToken from './GroupSendFullToken.js'; // For docs diff --git a/node/ts/zkgroup/internal/ByteArray.ts b/node/ts/zkgroup/internal/ByteArray.ts index f18bd5766..e0dddbc0a 100644 --- a/node/ts/zkgroup/internal/ByteArray.ts +++ b/node/ts/zkgroup/internal/ByteArray.ts @@ -4,7 +4,7 @@ // import { LibSignalErrorBase } from '../../Errors.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export const UNCHECKED_AND_UNCLONED: unique symbol = Symbol(); diff --git a/node/ts/zkgroup/profiles/ClientZkProfileOperations.ts b/node/ts/zkgroup/profiles/ClientZkProfileOperations.ts index 7c3bb50d2..bfe795977 100644 --- a/node/ts/zkgroup/profiles/ClientZkProfileOperations.ts +++ b/node/ts/zkgroup/profiles/ClientZkProfileOperations.ts @@ -6,7 +6,7 @@ import { randomBytes } from 'node:crypto'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ServerPublicParams from '../ServerPublicParams.js'; import GroupSecretParams from '../groups/GroupSecretParams.js'; diff --git a/node/ts/zkgroup/profiles/ExpiringProfileKeyCredential.ts b/node/ts/zkgroup/profiles/ExpiringProfileKeyCredential.ts index ab2a26d47..0e0d26dba 100644 --- a/node/ts/zkgroup/profiles/ExpiringProfileKeyCredential.ts +++ b/node/ts/zkgroup/profiles/ExpiringProfileKeyCredential.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ExpiringProfileKeyCredential extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.ts b/node/ts/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.ts index ce74ef3ca..d546e3c76 100644 --- a/node/ts/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.ts +++ b/node/ts/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ExpiringProfileKeyCredentialResponse extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/profiles/ProfileKey.ts b/node/ts/zkgroup/profiles/ProfileKey.ts index b39a1b75f..0f72f282a 100644 --- a/node/ts/zkgroup/profiles/ProfileKey.ts +++ b/node/ts/zkgroup/profiles/ProfileKey.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ProfileKeyCommitment from './ProfileKeyCommitment.js'; import ProfileKeyVersion from './ProfileKeyVersion.js'; import { Aci } from '../../Address.js'; diff --git a/node/ts/zkgroup/profiles/ProfileKeyCommitment.ts b/node/ts/zkgroup/profiles/ProfileKeyCommitment.ts index 3c49dd0d6..977edef18 100644 --- a/node/ts/zkgroup/profiles/ProfileKeyCommitment.ts +++ b/node/ts/zkgroup/profiles/ProfileKeyCommitment.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ProfileKeyCommitment extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/profiles/ProfileKeyCredentialPresentation.ts b/node/ts/zkgroup/profiles/ProfileKeyCredentialPresentation.ts index eb4f2b311..a1547c096 100644 --- a/node/ts/zkgroup/profiles/ProfileKeyCredentialPresentation.ts +++ b/node/ts/zkgroup/profiles/ProfileKeyCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import UuidCiphertext from '../groups/UuidCiphertext.js'; import ProfileKeyCiphertext from '../groups/ProfileKeyCiphertext.js'; diff --git a/node/ts/zkgroup/profiles/ProfileKeyCredentialRequest.ts b/node/ts/zkgroup/profiles/ProfileKeyCredentialRequest.ts index 797c71dff..f6d8dff6a 100644 --- a/node/ts/zkgroup/profiles/ProfileKeyCredentialRequest.ts +++ b/node/ts/zkgroup/profiles/ProfileKeyCredentialRequest.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ProfileKeyCredentialRequest extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/profiles/ProfileKeyCredentialRequestContext.ts b/node/ts/zkgroup/profiles/ProfileKeyCredentialRequestContext.ts index f36773543..8a855735a 100644 --- a/node/ts/zkgroup/profiles/ProfileKeyCredentialRequestContext.ts +++ b/node/ts/zkgroup/profiles/ProfileKeyCredentialRequestContext.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest.js'; export default class ProfileKeyCredentialRequestContext extends ByteArray { diff --git a/node/ts/zkgroup/profiles/ServerZkProfileOperations.ts b/node/ts/zkgroup/profiles/ServerZkProfileOperations.ts index afa3976a0..9665ef3d1 100644 --- a/node/ts/zkgroup/profiles/ServerZkProfileOperations.ts +++ b/node/ts/zkgroup/profiles/ServerZkProfileOperations.ts @@ -4,7 +4,7 @@ // import { randomBytes } from 'node:crypto'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import ServerSecretParams from '../ServerSecretParams.js'; diff --git a/node/ts/zkgroup/receipts/ClientZkReceiptOperations.ts b/node/ts/zkgroup/receipts/ClientZkReceiptOperations.ts index a0dfad339..543fea0e9 100644 --- a/node/ts/zkgroup/receipts/ClientZkReceiptOperations.ts +++ b/node/ts/zkgroup/receipts/ClientZkReceiptOperations.ts @@ -5,7 +5,7 @@ import { randomBytes } from 'node:crypto'; import { RANDOM_LENGTH } from '../internal/Constants.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ServerPublicParams from '../ServerPublicParams.js'; import ReceiptCredential from './ReceiptCredential.js'; import ReceiptCredentialPresentation from './ReceiptCredentialPresentation.js'; diff --git a/node/ts/zkgroup/receipts/ReceiptCredential.ts b/node/ts/zkgroup/receipts/ReceiptCredential.ts index 37b5805ad..60da697a6 100644 --- a/node/ts/zkgroup/receipts/ReceiptCredential.ts +++ b/node/ts/zkgroup/receipts/ReceiptCredential.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ReceiptCredential extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/receipts/ReceiptCredentialPresentation.ts b/node/ts/zkgroup/receipts/ReceiptCredentialPresentation.ts index d6e54aade..498d9a091 100644 --- a/node/ts/zkgroup/receipts/ReceiptCredentialPresentation.ts +++ b/node/ts/zkgroup/receipts/ReceiptCredentialPresentation.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ReceiptSerial from './ReceiptSerial.js'; export default class ReceiptCredentialPresentation extends ByteArray { diff --git a/node/ts/zkgroup/receipts/ReceiptCredentialRequest.ts b/node/ts/zkgroup/receipts/ReceiptCredentialRequest.ts index 97fea1181..ee16798b6 100644 --- a/node/ts/zkgroup/receipts/ReceiptCredentialRequest.ts +++ b/node/ts/zkgroup/receipts/ReceiptCredentialRequest.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ReceiptCredentialRequest extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/receipts/ReceiptCredentialRequestContext.ts b/node/ts/zkgroup/receipts/ReceiptCredentialRequestContext.ts index 78855d99d..82f78e489 100644 --- a/node/ts/zkgroup/receipts/ReceiptCredentialRequestContext.ts +++ b/node/ts/zkgroup/receipts/ReceiptCredentialRequestContext.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import ReceiptCredentialRequest from './ReceiptCredentialRequest.js'; export default class ReceiptCredentialRequestContext extends ByteArray { diff --git a/node/ts/zkgroup/receipts/ReceiptCredentialResponse.ts b/node/ts/zkgroup/receipts/ReceiptCredentialResponse.ts index 66f9e1bdb..e2b76cebf 100644 --- a/node/ts/zkgroup/receipts/ReceiptCredentialResponse.ts +++ b/node/ts/zkgroup/receipts/ReceiptCredentialResponse.ts @@ -4,7 +4,7 @@ // import ByteArray from '../internal/ByteArray.js'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; export default class ReceiptCredentialResponse extends ByteArray { private readonly __type?: never; diff --git a/node/ts/zkgroup/receipts/ServerZkReceiptOperations.ts b/node/ts/zkgroup/receipts/ServerZkReceiptOperations.ts index d57788496..230d82356 100644 --- a/node/ts/zkgroup/receipts/ServerZkReceiptOperations.ts +++ b/node/ts/zkgroup/receipts/ServerZkReceiptOperations.ts @@ -4,7 +4,7 @@ // import { randomBytes } from 'node:crypto'; -import Native from '../../../Native.js'; +import * as Native from '../../Native.js'; import { RANDOM_LENGTH } from '../internal/Constants.js'; import ServerSecretParams from '../ServerSecretParams.js'; import ReceiptCredentialRequest from './ReceiptCredentialRequest.js'; diff --git a/rust/bridge/README.md b/rust/bridge/README.md index f15fa4031..63bb109ff 100644 --- a/rust/bridge/README.md +++ b/rust/bridge/README.md @@ -81,7 +81,7 @@ C-style `.h` file that the Swift toolchain can consume. For TypeScript, the [`libsignal-node`] crate is expanded and processed by [`gen_ts_decl.py`](./node/bin/gen_ts_decl.py) and the output is interpolated into -[`Native.ts.d.in`](./node/bin/Native.d.ts.in). The output, however, only +[`Native.ts.in`](./node/bin/Native.ts.in). The output, however, only declares the function signatures; to make them accessible to the JavaScript runtime, additional machinery is used. This takes the form of `#[linkme]` annotations on to the generated entry points; the [`linkme`] crate is used to diff --git a/rust/bridge/node/bin/Native.d.ts.in b/rust/bridge/node/bin/Native.ts.in similarity index 69% rename from rust/bridge/node/bin/Native.d.ts.in rename to rust/bridge/node/bin/Native.ts.in index 9f7cb2b04..0bf705055 100644 --- a/rust/bridge/node/bin/Native.d.ts.in +++ b/rust/bridge/node/bin/Native.ts.in @@ -5,51 +5,51 @@ // WARNING: this file was automatically generated -type Uuid = Uint8Array; +export type Uuid = Uint8Array; /// 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; +export type Timestamp = number; // Rust code produces or consumes values that conform to these interface // definitions. They must be kept in sync to prevent bridging errors. -type LookupResponse = { +export type LookupResponse = { entries: Map; debugPermitsUsed: number; }; -type LookupResponseEntry = { +export type LookupResponseEntry = { readonly aci: string | undefined; readonly pni: string | undefined; }; -type ChatResponse = { +export type ChatResponse = { status: number; message: string | undefined; headers: ReadonlyArray<[string, string]>; body: Uint8Array | undefined; }; -type ChatServiceDebugInfo = { +export type ChatServiceDebugInfo = { ipType: number; durationMillis: number; connectionInfo: string; }; -type ResponseAndDebugInfo = { +export type ResponseAndDebugInfo = { response: ChatResponse; debugInfo: ChatServiceDebugInfo; }; -type SealedSenderMultiRecipientMessageRecipient = { +export type SealedSenderMultiRecipientMessageRecipient = { deviceIds: number[]; registrationIds: number[]; rangeOffset: number; rangeLen: number; }; -type SealedSenderMultiRecipientMessage = { +export type SealedSenderMultiRecipientMessage = { recipientMap: { [serviceId: string]: SealedSenderMultiRecipientMessageRecipient; }; @@ -57,13 +57,13 @@ type SealedSenderMultiRecipientMessage = { offsetOfSharedData: number; }; -enum IdentityChange { +export enum IdentityChange { // This must be kept in sync with the Rust enum of the same name. NewOrUnchanged = 0, ReplacedExisting = 1, } -type IdentityKeyStore = { +export type IdentityKeyStore = { _getIdentityKey: () => Promise; _getLocalRegistrationId: () => Promise; _saveIdentity: ( @@ -78,18 +78,18 @@ type IdentityKeyStore = { _getIdentity: (name: ProtocolAddress) => Promise; }; -type SessionStore = { +export type SessionStore = { _saveSession: (addr: ProtocolAddress, record: SessionRecord) => Promise; _getSession: (addr: ProtocolAddress) => Promise; }; -type PreKeyStore = { +export type PreKeyStore = { _savePreKey: (preKeyId: number, record: PreKeyRecord) => Promise; _getPreKey: (preKeyId: number) => Promise; _removePreKey: (preKeyId: number) => Promise; }; -type SignedPreKeyStore = { +export type SignedPreKeyStore = { _saveSignedPreKey: ( signedPreKeyId: number, record: SignedPreKeyRecord @@ -97,7 +97,7 @@ type SignedPreKeyStore = { _getSignedPreKey: (signedPreKeyId: number) => Promise; }; -type KyberPreKeyStore = { +export type KyberPreKeyStore = { _saveKyberPreKey: ( kyberPreKeyId: number, record: KyberPreKeyRecord @@ -110,7 +110,7 @@ type KyberPreKeyStore = { ) => Promise; }; -type SenderKeyStore = { +export type SenderKeyStore = { _saveSenderKey: ( sender: ProtocolAddress, distributionId: Uuid, @@ -122,14 +122,14 @@ type SenderKeyStore = { ) => Promise; }; -type InputStream = { +export type InputStream = { _read: (amount: number) => Promise; _skip: (amount: number) => Promise; }; -type SyncInputStream = Uint8Array; +export type SyncInputStream = Uint8Array; -type ChatListener = { +export type ChatListener = { _incoming_message: ( envelope: Uint8Array, timestamp: number, @@ -143,11 +143,11 @@ type ChatListener = { ) => void; }; -type ChallengeOption = 'pushChallenge' | 'captcha'; +export type ChallengeOption = 'pushChallenge' | 'captcha'; -type RegistrationPushTokenType = 'apn' | 'fcm'; +export type RegistrationPushTokenType = 'apn' | 'fcm'; -type RegistrationCreateSessionRequest = { +export type RegistrationCreateSessionRequest = { number: string; push_token?: string; push_token_type?: RegistrationPushTokenType; @@ -155,39 +155,55 @@ type RegistrationCreateSessionRequest = { mnc?: string; }; -type RegisterResponseBadge = { +export type RegisterResponseBadge = { id: string; visible: boolean; expirationSeconds: number; }; -type CheckSvr2CredentialsResponse = Map< +export type CheckSvr2CredentialsResponse = Map< string, 'match' | 'no-match' | 'invalid' >; -type SignedPublicPreKey = { +export type SignedPublicPreKey = { keyId: number; publicKey: Uint8Array; signature: Uint8Array; }; -type Wrapper = Readonly<{ +export type Wrapper = Readonly<{ _nativeHandle: T; }>; -type MessageBackupValidationOutcome = { +export type MessageBackupValidationOutcome = { errorMessage: string | null; unknownFieldMessages: Array; }; -type AccountEntropyPool = string; +export type AccountEntropyPool = string; -type CancellablePromise = Promise & { +export type CancellablePromise = Promise & { _cancellationToken: bigint; }; // eslint-disable-next-line @typescript-eslint/no-unused-vars -type Serialized = Uint8Array; +export type Serialized = Uint8Array; -export function registerErrors(errorsModule: Record): void; +type ConnectChatBridge = Wrapper; +type TestingFutureCancellationGuard = Wrapper; + +import load from 'node-gyp-build'; + +type NativeFunctions = { + registerErrors: (errorsModule: Record) => void; + NATIVE_FNS; +}; + +const { registerErrors, NATIVE_FN_NAMES } = load( + `${import.meta.dirname}/../` +) as NativeFunctions; + +export { registerErrors, NATIVE_FN_NAMES }; + +NATIVE_TYPES; diff --git a/rust/bridge/node/bin/gen_ts_decl.py b/rust/bridge/node/bin/gen_ts_decl.py index 696c00159..cb6a2091e 100755 --- a/rust/bridge/node/bin/gen_ts_decl.py +++ b/rust/bridge/node/bin/gen_ts_decl.py @@ -260,11 +260,24 @@ def collect_decls(crate_dir: str, features: Iterable[str] = ()) -> Iterator[str] def expand_template(template_file: str, decls: Iterable[str]) -> str: + decls = list(decls) with open(template_file, "r") as f: contents = f.read() - contents += "\n" - contents += "\n".join(sorted(decls)) - contents += "\n" + + # Rewrite from function syntax to property syntax to take advantage of + # https://www.typescriptlang.org/tsconfig/#strictFunctionTypes. + contents = contents.replace("NATIVE_FNS;", "\n ".join( + x.removeprefix('export function ') + .replace('(', ': (', 1) + .replace('):', ') =>') for x in decls if x.startswith("export function ") + )) + contents = contents.replace("NATIVE_FN_NAMES", "".join( + "\n " + x.removeprefix("export function ").split('(')[0] + "," + for x in decls if x.startswith("export function ") + ) + "\n") + contents = contents.replace("NATIVE_TYPES;", "\n".join( + 'export ' + x.removeprefix('export ') for x in decls if not x.startswith("export function ") + )) return contents @@ -300,7 +313,7 @@ def convert_to_typescript(rust_crates: Iterable[Crate], ts_in_path: str, ts_out_ def main() -> None: args = parse_args() our_abs_dir = os.path.dirname(os.path.realpath(__file__)) - output_file_name = 'Native.d.ts' + output_file_name = 'Native.ts' convert_to_typescript( rust_crates=[ @@ -310,7 +323,7 @@ def main() -> None: Crate(path=os.path.join(our_abs_dir, '..', '..', 'shared', 'testing'), features=('node', 'signal-media')), ], ts_in_path=os.path.join(our_abs_dir, output_file_name + '.in'), - ts_out_path=os.path.join(our_abs_dir, '..', '..', '..', '..', 'node', output_file_name), + ts_out_path=os.path.join(our_abs_dir, '..', '..', '..', '..', 'node', 'ts', output_file_name), verify=args.verify, )