-
-
Notifications
You must be signed in to change notification settings - Fork 649
Open
Description
export interface ISessionInfo {
deviceKey?: string;
sessionId?: string;
session?: string;
lastReceivedMessageTs?: number;
}
interface CryptoStore {
getEndToEndSession(
deviceKey: string,
sessionId: string,
txn: unknown,
func: (session: ISessionInfo) => void,
): void;
}class Backend implements CryptoStore {
public getEndToEndSession(
deviceKey: string,
sessionId: string,
txn: IDBTransaction,
func: (sessions: { [ sessionId: string ]: ISessionInfo }) => void,
): void {}
}class IndexedDBCryptoStore implements CryptoStore {
public getEndToEndSession(
deviceKey: string,
sessionId: string,
txn: IDBTransaction,
func: (sessions: { [ sessionId: string ]: ISessionInfo }) => void,
): void {}
}This is allowed, because ISessionInfo (as an interface) only "comments" on the properties of corresponding types, so ISessionInfo, only having optional properties, could apply over any type.
Metadata
Metadata
Assignees
Labels
No labels