UNPKG

chrobject

Version:

Stores chronicles of plain objects as diffs and snapshots

24 lines (23 loc) 1.32 kB
import { Entity } from '../utils/Entity'; import { Snapshot } from '../utils/Snapshot'; import { Diff } from '../utils/Diff'; import { Creator } from '../utils/Creator'; import { StorageStrategy, FindDiffsCondition } from '../storage/StorageStrategy'; import { IDeepDiff } from '../utils/IDeepDiff'; import { EntryAppServiceOptions } from '../utils/EntryAppServiceOptions'; export declare class EntryAppService { entity: Entity; storage: StorageStrategy; options: EntryAppServiceOptions; constructor(entity: Entity, storage: StorageStrategy, options?: EntryAppServiceOptions); getDiffs(condition: FindDiffsCondition, callback: (err: Error, diffs?: Diff[]) => void): void; getSnapshotById(id: string, callback: (err: Error, snapshot?: Snapshot) => void): void; saveSnapshotAndDiff(obj: Object, creator: Creator, timestamp: Date, callback: (err: Error, result?: { snapshot?: Snapshot; diff?: Diff; }) => void): void; saveSnapshot(obj: Object, creator: Creator, timestamp: Date, callback: (err: Error, snapshot?: Snapshot) => void): void; saveDiff(obj: Object, creator: Creator, timestamp: Date, callback: (err: Error, diff?: Diff) => void): void; diff(snapOne: Snapshot, snapTwo: Snapshot): Diff; deepDiff(one: Object, two: Object, path?: string): IDeepDiff[]; }