import { CipherType } from '../enums/cipherType'; import { CipherData } from '../models/data/cipherData'; import { Cipher } from '../models/domain/cipher'; import { Field } from '../models/domain/field'; import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; import { CipherView } from '../models/view/cipherView'; import { FieldView } from '../models/view/fieldView'; export abstract class CipherService { decryptedCipherCache: CipherView[]; clearCache: () => void; encrypt: (model: CipherView) => Promise; encryptFields: (fieldsModel: FieldView[], key: SymmetricCryptoKey) => Promise; encryptField: (fieldModel: FieldView, key: SymmetricCryptoKey) => Promise; get: (id: string) => Promise; getAll: () => Promise; getAllDecrypted: () => Promise; getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise; getAllDecryptedForDomain: (domain: string, includeOtherTypes?: CipherType[]) => Promise; getLastUsedForDomain: (domain: string) => Promise; updateLastUsedDate: (id: string) => Promise; saveNeverDomain: (domain: string) => Promise; saveWithServer: (cipher: Cipher) => Promise; saveAttachmentWithServer: (cipher: Cipher, unencryptedFile: any) => Promise; upsert: (cipher: CipherData | CipherData[]) => Promise; replace: (ciphers: { [id: string]: CipherData; }) => Promise; clear: (userId: string) => Promise; delete: (id: string | string[]) => Promise; deleteWithServer: (id: string) => Promise; deleteAttachment: (id: string, attachmentId: string) => Promise; deleteAttachmentWithServer: (id: string, attachmentId: string) => Promise; sortCiphersByLastUsed: (a: any, b: any) => number; sortCiphersByLastUsedThenName: (a: any, b: any) => number; }