|
|
@@ -0,0 +1,16 @@ |
|
|
|
export default interface Storage<T> { |
|
|
|
queryItems(): Promise<T[]> |
|
|
|
saveItem(item: T): Promise<void> |
|
|
|
deleteItem(item: T): Promise<boolean> |
|
|
|
} |
|
|
|
|
|
|
|
export interface Collection<T> { |
|
|
|
items: T[], |
|
|
|
lastModifiedBy: string, |
|
|
|
lastModifiedAt: Date, |
|
|
|
} |
|
|
|
|
|
|
|
export type Serializer<T = unknown> = (t: T) => string |
|
|
|
export type Deserializer<T = unknown> = (s: string) => T |
|
|
|
|
|
|
|
export class OutOfSyncError {} |