UNPKG

@river-build/sdk

Version:

For more details, visit the following resources:

44 lines 2.6 kB
import { BaseDecryptionExtensions, DecryptionSessionError, EncryptedContentItem, EntitlementsDelegate, GroupEncryptionCrypto, GroupSessionsData, KeyFulfilmentData, KeySolicitationContent, KeySolicitationData, KeySolicitationItem, UserDevice } from '@river-build/encryption'; import { AddEventResponse_Error, EncryptedData, UserInboxPayload_GroupEncryptionSessions } from '@river-build/proto'; import { Client } from './client'; export declare class ClientDecryptionExtensions extends BaseDecryptionExtensions { private readonly client; private isMobileSafariBackgrounded; private validatedEvents; private unpackEnvelopeOpts?; constructor(client: Client, crypto: GroupEncryptionCrypto, delegate: EntitlementsDelegate, userId: string, userDevice: UserDevice, unpackEnvelopeOpts: { disableSignatureValidation?: boolean; } | undefined, logId: string); hasStream(streamId: string): boolean; isUserInboxStreamUpToDate(upToDateStreams: Set<string>): boolean; shouldPauseTicking(): boolean; decryptGroupEvent(streamId: string, eventId: string, kind: string, // kind of data encryptedData: EncryptedData): Promise<void>; downloadNewMessages(): Promise<void>; getKeySolicitations(streamId: string): KeySolicitationContent[]; /** * Override the default implementation to use the number of members in the stream * to determine the delay time. */ getRespondDelayMSForKeySolicitation(streamId: string, userId: string): number; isUserEntitledToKeyExchange(streamId: string, userId: string, opts?: { skipOnChainValidation: boolean; }): Promise<boolean>; isValidEvent(item: KeySolicitationItem): { isValid: boolean; reason?: string; }; onDecryptionError(item: EncryptedContentItem, err: DecryptionSessionError): void; ackNewGroupSession(_session: UserInboxPayload_GroupEncryptionSessions): Promise<void>; encryptAndShareGroupSessions({ streamId, item, sessions, algorithm, }: GroupSessionsData): Promise<void>; sendKeySolicitation({ streamId, isNewDevice, missingSessionIds, }: KeySolicitationData): Promise<void>; sendKeyFulfillment({ streamId, userAddress, deviceKey, sessionIds, }: KeyFulfilmentData): Promise<{ error?: AddEventResponse_Error; }>; uploadDeviceKeys(): Promise<void>; onStart(): void; onStop(): Promise<void>; private mobileSafariPageVisibilityChanged; getPriorityForStream(streamId: string, highPriorityIds: Set<string>, recentStreamIds: Set<string>): number; } //# sourceMappingURL=clientDecryptionExtensions.d.ts.map