chore: add prettier and reformat lib

This commit is contained in:
waterplea
2022-07-24 17:53:24 +03:00
committed by Matt Hill
parent c7006e0eb2
commit 2fef1e572c
12 changed files with 2600 additions and 112 deletions

View File

@@ -1,9 +1,14 @@
import { Operation } from './json-patch-lib'
// revise a collection of nodes.
export type Revision = { id: number, patch: Operation<unknown>[], expireId: string | null }
export type Revision = {
id: number
patch: Operation<unknown>[]
expireId: string | null
}
// dump/replace the entire store with T
export type Dump<T> = { id: number, value: T, expireId: string | null }
export type Dump<T> = { id: number; value: T; expireId: string | null }
export type Update<T> = Revision | Dump<T>
@@ -14,16 +19,16 @@ export enum PatchOp {
}
export interface Http<T> {
getRevisions (since: number): Promise<Revision[] | Dump<T>>
getDump (): Promise<Dump<T>>
getRevisions(since: number): Promise<Revision[] | Dump<T>>
getDump(): Promise<Dump<T>>
}
export interface Bootstrapper<T> {
init (): Promise<DBCache<T>>
update (cache: DBCache<T>): Promise<void>
init(): Promise<DBCache<T>>
update(cache: DBCache<T>): Promise<void>
}
export interface DBCache<T extends Record<string, any>>{
sequence: number,
export interface DBCache<T extends Record<string, any>> {
sequence: number
data: T
}