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 { AttachmentView } from '../models/view/attachmentView'; import { CipherView } from '../models/view/cipherView'; import { FieldView } from '../models/view/fieldView'; export abstract class CipherService { decryptedCipherCache: CipherView[]; clearCache: () => void; encrypt: (model: CipherView, key?: SymmetricCryptoKey, originalCipher?: Cipher) => 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; getAllDecryptedForUrl: (url: string, includeOtherTypes?: CipherType[]) => Promise; getAllFromApiForOrganization: (organizationId: string) => Promise; getLastUsedForUrl: (url: string) => Promise; updateLastUsedDate: (id: string) => Promise; saveNeverDomain: (domain: string) => Promise; saveWithServer: (cipher: Cipher) => Promise; shareWithServer: (cipher: CipherView, organizationId: string, collectionIds: string[]) => Promise; shareManyWithServer: (ciphers: CipherView[], organizationId: string, collectionIds: string[]) => Promise; saveAttachmentWithServer: (cipher: Cipher, unencryptedFile: any, admin?: boolean) => Promise; saveAttachmentRawWithServer: (cipher: Cipher, filename: string, data: ArrayBuffer, admin?: boolean) => Promise; saveCollectionsWithServer: (cipher: Cipher) => Promise; upsert: (cipher: CipherData | CipherData[]) => Promise; replace: (ciphers: { [id: string]: CipherData; }) => Promise; clear: (userId: string) => Promise; moveManyWithServer: (ids: string[], folderId: string) => Promise; delete: (id: string | string[]) => Promise; deleteWithServer: (id: string) => Promise; deleteManyWithServer: (ids: 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; getLocaleSortingFunction: () => (a: CipherView, b: CipherView) => number; }