import { Filter } from "./types"; export declare class ModelEvents { collection?: string; /** * Event callbacks */ protected callbacks: Record; /** * {@inheritdoc} */ constructor(collection?: string); /** * Add callback when model is about to be created or updated * * Triggered before saving the model */ onSaving(callback: (model: any, oldModel?: any) => void): this; /** * Add callback when model is created or updated * * Triggered after saving the model */ onSaved(callback: (model: any, oldModel?: any) => void): this; /** * Add callback when model is about to be created */ onCreating(callback: (model: any) => void): this; /** * Add callback when model is created */ onCreated(callback: (model: any) => void): this; /** * Add callback when model is about to be updated */ onUpdating(callback: (model: any, oldModel: any) => void): this; /** * Add callback when model is updated */ onUpdated(callback: (model: any, oldModel: any) => void): this; /** * Add callback when model is about to be deleted */ onDeleting(callback: (model: any) => void): this; /** * Add callback when model is deleted */ onDeleted(callback: (model: any) => void): this; /** * Add callback when model is about to be fetched */ onFetching(callback: (model: any, filterOptions: Filter) => void): this; /** * Trigger the given event */ trigger(event: string, ...args: any[]): Promise; } //# sourceMappingURL=model-events.d.ts.map