mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 02:11:54 +00:00
chore: add prettier and reformat lib
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user