1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-19 07:35:48 +02:00
bitwarden-browser/src/abstractions/collection.service.ts
Oscar Hinton e516692559
Upgrade TypeScript (#148)
* Update typescript to 3.6.5 along with tslint to latest.

* Upgrade @types/node to 12.12.54 to get rid of compile errors.

* Update tslint.

* Use @types/node 10.17.28 instead
2020-08-12 15:42:42 -04:00

24 lines
1.0 KiB
TypeScript

import { CollectionData } from '../models/data/collectionData';
import { Collection } from '../models/domain/collection';
import { TreeNode } from '../models/domain/treeNode';
import { CollectionView } from '../models/view/collectionView';
export abstract class CollectionService {
decryptedCollectionCache: CollectionView[];
clearCache: () => void;
encrypt: (model: CollectionView) => Promise<Collection>;
decryptMany: (collections: Collection[]) => Promise<CollectionView[]>;
get: (id: string) => Promise<Collection>;
getAll: () => Promise<Collection[]>;
getAllDecrypted: () => Promise<CollectionView[]>;
getAllNested: (collections?: CollectionView[]) => Promise<TreeNode<CollectionView>[]>;
getNested: (id: string) => Promise<TreeNode<CollectionView>>;
upsert: (collection: CollectionData | CollectionData[]) => Promise<any>;
replace: (collections: { [id: string]: CollectionData; }) => Promise<any>;
clear: (userId: string) => Promise<any>;
delete: (id: string | string[]) => Promise<any>;
}