import { PreKey } from '@wireapp/api-client/lib/auth'; import { QualifiedUserClients } from '@wireapp/api-client/lib/conversation'; import { QualifiedId, QualifiedUserPreKeyBundleMap } from '@wireapp/api-client/lib/user'; import { Logger } from 'logdown'; import { APIClient } from '@wireapp/api-client'; import { CryptoClient } from '../../ProteusService/CryptoClient'; interface ConstructSessionIdParams { userId: QualifiedId; clientId: string; domain?: string; } type InitSessionsResult = { /** valid sessions that either already existed or have been freshly created */ sessions: string[]; /** client that do we do not have sessions with and that do not have existence on backend (deleted clients) */ unknowns?: QualifiedUserClients; /** clients for which we had problem fetch prekeys (federated server down) */ failed?: QualifiedId[]; }; declare const constructSessionId: ({ userId, clientId }: ConstructSessionIdParams) => string; /** * Will make sure the session is available in cryptoClient * @param sessionId the session to init */ declare const initSession: ({ userId, clientId, initialPrekey }: { userId: QualifiedId; clientId: string; initialPrekey?: PreKey; }, { cryptoClient, apiClient }: { apiClient: APIClient; cryptoClient: CryptoClient; }) => Promise; interface GetSessionsAndClientsFromRecipientsProps { recipients: QualifiedUserClients | QualifiedUserPreKeyBundleMap; apiClient: APIClient; cryptoClient: CryptoClient; logger?: Logger; } /** * Will make sure all the sessions need to encrypt for those user/clients pair are set */ declare const initSessions: ({ recipients, apiClient, cryptoClient, logger, }: GetSessionsAndClientsFromRecipientsProps) => Promise; interface DeleteSessionParams { userId: QualifiedId; clientId: string; cryptoClient: CryptoClient; } declare function deleteSession(params: DeleteSessionParams): Promise; type EncryptedPayloads = Record>>; /** * creates an encrypted payload that can be sent to backend from a bunch of sessionIds/encrypted payload */ declare const buildEncryptedPayloads: (payloads: Map) => EncryptedPayloads; export { constructSessionId, initSession, initSessions, deleteSession, buildEncryptedPayloads }; //# sourceMappingURL=SessionHandler.d.ts.map