mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 02:11:54 +00:00
revert
This commit is contained in:
committed by
Aiden McClelland
parent
56d7cae16d
commit
3e2e1c92dd
@@ -3,9 +3,9 @@ import { Operation } from './json-patch-lib'
|
||||
// revise a collection of nodes.
|
||||
export type Revision = { id: number, patch: Operation[], expireId: string | null }
|
||||
// dump/replace the entire store with T
|
||||
export type Dump<T extends HashMap> = { id: number, value: T, expireId: string | null }
|
||||
export type Dump<T> = { id: number, value: T, expireId: string | null }
|
||||
|
||||
export type Update<T extends HashMap> = Revision | Dump<T>
|
||||
export type Update<T> = Revision | Dump<T>
|
||||
|
||||
export enum PatchOp {
|
||||
ADD = 'add',
|
||||
@@ -13,20 +13,17 @@ export enum PatchOp {
|
||||
REPLACE = 'replace',
|
||||
}
|
||||
|
||||
export interface Http<T extends HashMap> {
|
||||
export interface Http<T> {
|
||||
getRevisions (since: number): Promise<Revision[] | Dump<T>>
|
||||
getDump (): Promise<Dump<T>>
|
||||
}
|
||||
|
||||
export interface Bootstrapper<T extends HashMap> {
|
||||
export interface Bootstrapper<T> {
|
||||
init (): Promise<DBCache<T>>
|
||||
update (cache: DBCache<T>): Promise<void>
|
||||
}
|
||||
|
||||
export interface DBCache<T extends HashMap>{
|
||||
export interface DBCache<T extends { [key: string]: any }>{
|
||||
sequence: number,
|
||||
data: T
|
||||
}
|
||||
|
||||
export type HashMap = { [type: string]: any }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user