UNPKG

mongoose-history-diff

Version:

A mongoose plugin to take diffs and history of your documents

22 lines (21 loc) 770 B
import { ExcludeFieldT } from './utils'; import { RawChangeT } from './types'; export declare type PrefilterT = (path: Array<string>, key: string) => boolean; export declare type StackT = { lhs: any; rhs: any; }; export declare type DeepDiffOptsT = { prefilter: PrefilterT; orderIndependent: boolean; key?: string; path?: Array<string>; stack?: Array<StackT>; }; export declare const deepDiff: (lhs: any, rhs: any, changes: RawChangeT[] | undefined, opts: DeepDiffOptsT) => void; export declare const revertChanges: (target: any, changes: Array<RawChangeT>) => any; export default class MHD { static orderIndependent: boolean; static excludedFields: Array<ExcludeFieldT>; static findDiff(lhs: any, rhs: any): Array<RawChangeT>; }