2018-02-19 18:33:32 +01:00
|
|
|
import { CollectionData } from '../models/data';
|
2018-01-10 05:12:18 +01:00
|
|
|
|
2018-02-19 18:33:32 +01:00
|
|
|
import { Collection } from '../models/domain';
|
2018-01-10 05:12:18 +01:00
|
|
|
|
2018-02-19 18:33:32 +01:00
|
|
|
import { CollectionView } from '../models/view';
|
2018-01-25 20:57:42 +01:00
|
|
|
|
2018-01-23 23:29:15 +01:00
|
|
|
export abstract class CollectionService {
|
2018-01-25 20:57:42 +01:00
|
|
|
decryptedCollectionCache: CollectionView[];
|
2018-01-10 05:12:18 +01:00
|
|
|
|
2018-01-23 23:29:15 +01:00
|
|
|
clearCache: () => void;
|
|
|
|
get: (id: string) => Promise<Collection>;
|
|
|
|
getAll: () => Promise<Collection[]>;
|
2018-01-25 20:57:42 +01:00
|
|
|
getAllDecrypted: () => Promise<CollectionView[]>;
|
2018-01-23 23:29:15 +01:00
|
|
|
upsert: (collection: CollectionData | CollectionData[]) => Promise<any>;
|
|
|
|
replace: (collections: { [id: string]: CollectionData; }) => Promise<any>;
|
|
|
|
clear: (userId: string) => Promise<any>;
|
|
|
|
delete: (id: string | string[]) => Promise<any>;
|
2018-01-10 05:12:18 +01:00
|
|
|
}
|