mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 03:03:26 +00:00
15 lines
599 B
TypeScript
15 lines
599 B
TypeScript
import { UserId } from "@bitwarden/user-core";
|
|
|
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
|
|
|
import { InitializerMetadata } from "./initializer-metadata.interface";
|
|
|
|
/**
|
|
* An object that contains EncStrings and knows how to decrypt them. This is usually a domain object with the
|
|
* corresponding view object as the type argument.
|
|
* @example Cipher implements Decryptable<CipherView>
|
|
*/
|
|
export interface Decryptable<TDecrypted extends InitializerMetadata> extends InitializerMetadata {
|
|
decrypt: (key: SymmetricCryptoKey, userId: UserId) => Promise<TDecrypted>;
|
|
}
|