Monorepo containing core modules of Zeichen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

storage.ts 389 B

12345678910111213141516
  1. export default interface Storage<T> {
  2. queryItems(): Promise<T[]>
  3. saveItem(item: T): Promise<void>
  4. deleteItem(item: T): Promise<boolean>
  5. }
  6. export interface Collection<T> {
  7. items: T[],
  8. lastModifiedBy: string,
  9. lastModifiedAt: Date,
  10. }
  11. export type Serializer<T = unknown> = (t: T) => string
  12. export type Deserializer<T = unknown> = (s: string) => T
  13. export class OutOfSyncError {}