import { DAppProvider } from 'wallet-comms-sdk'; import { SessionInfo, AccountDTO, AppNotification, DappRpcRequest } from '../types'; import { WalletDB } from '../persistence'; import { KeyManager } from './key'; type MethodHandler = { resolve: (value: any) => void; reject: (value: any) => void; }; export type SessionEvent = { type: 'session_added'; accountId: number; sessionInfo: SessionInfo; } | { type: 'session_removed'; accountId: number; sessionId: string; } | { type: 'sessions_cleared'; accountId: number; } | { type: 'new_notification'; notification: AppNotification; } | { type: 'new_request'; request: DappRpcRequest; }; export type SessionUpdateCallback = (event: SessionEvent) => void; export declare class SessionManager { private readonly walletDb; private readonly keyManager; private readonly providers; private readonly handlers; private removeOnClose; private updateCallback?; constructor(walletDb: WalletDB, keyManager: KeyManager); onUpdate(callback: SessionUpdateCallback): void; private notify; getHandler(request: string): MethodHandler | undefined; add(account: AccountDTO, provider: DAppProvider, sessionInfo: SessionInfo): void; remove(accountId: number, sessionId: string): void; reload(accounts: Map): Promise; clear(): void; revoke(accountId: number, sessionId: string): Promise; replayMessage(accountId: number, sessionId: string, payload: string): Promise; private registerHandlers; } export {}; //# sourceMappingURL=session.d.ts.map