callcatcher
Version:
Your native NodeJS monitoring API
28 lines (27 loc) • 928 B
TypeScript
import Nedb from 'nedb';
import { Hit } from '../interfaces/hit';
/**
* Proprietary interface with NeDB<Hit>
* @see {@link https://github.com/louischatriot/nedb|Nedb}
*/
export declare class Report extends Nedb<Hit> {
/**
* constructor.
* @param {string | Nedb.DataStoreOptions} [pathOrOptions] - NeDB options
*/
constructor(pathOrOptions?: string | Nedb.DataStoreOptions);
/**
* @callback insertionCallback
* @param {(Error | null)} error
* @param {Hit[]} documents
* @return {void}
*/
/**
* Insert a new hit (array) in the database.
* Emits a 'hit' event containing the inserted data.
* Emits an 'error' event if an error occurred during insertion.
* @param {T} newDocs
* @param {insertionCallback} cb
*/
insert<T extends Hit>(newDocs: T | T[], cb?: (err: (Error | null), documents: T[]) => void): void;
}