Skip to content

Commit

Permalink
fix(legacy store): fix legacy store typing
Browse files Browse the repository at this point in the history
In #4663, the storeXXX methods were removed of the CryptoStore interface but they are used internally by IndexedDBCryptoStore.
  • Loading branch information
florianduros committed Jan 31, 2025
1 parent 0185f30 commit 0c521f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/crypto/store/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ export interface CryptoStore {

// Olm Account
getAccount(txn: unknown, func: (accountPickle: string | null) => void): void;
storeAccount(txn: unknown, accountPickle: string): void;
getCrossSigningKeys(txn: unknown, func: (keys: Record<string, CrossSigningKeyInfo> | null) => void): void;
getSecretStorePrivateKey<K extends keyof SecretStorePrivateKeys>(
txn: unknown,
func: (key: SecretStorePrivateKeys[K] | null) => void,
type: K,
): void;
storeSecretStorePrivateKey<K extends keyof SecretStorePrivateKeys>(
txn: unknown,
type: K,
key: SecretStorePrivateKeys[K],
): void;

// Olm Sessions
countEndToEndSessions(txn: unknown, func: (count: number) => void): void;
Expand All @@ -90,6 +96,8 @@ export interface CryptoStore {
func: (sessions: { [sessionId: string]: ISessionInfo }) => void,
): void;

storeEndToEndSession(deviceKey: string, sessionId: string, sessionInfo: ISessionInfo, txn: unknown): void;

/**
* Get a batch of end-to-end sessions from the database.
*
Expand All @@ -114,6 +122,12 @@ export interface CryptoStore {
txn: unknown,
func: (groupSession: InboundGroupSessionData | null, groupSessionWithheld: IWithheld | null) => void,
): void;
storeEndToEndInboundGroupSession(
senderCurve25519Key: string,
sessionId: string,
sessionData: InboundGroupSessionData,
txn: unknown,
): void;

/**
* Count the number of Megolm sessions in the database.
Expand Down

0 comments on commit 0c521f2

Please sign in to comment.