import { ModelAggregate } from "./ModelAggregate"; import { Model } from "./model"; type OnDelete = "unset" | "remove" | "ignore"; export declare class ModelSync { protected model: typeof Model; protected columns: string | string[]; protected embedMethod: string; /** * What do do when model is deleted */ protected whenDelete: OnDelete; /** * Embed on create */ protected embedOnCreate: string; /** * Sync mode */ protected syncMode: "single" | "many"; /** * Query runner using `when` method */ protected queryRunner?: (query: ModelAggregate) => void; /** * Define when should the synced model starts to update when any of the given columns is updated in the original model */ protected _updateWhenChange?: string[]; /** * Constructor */ constructor(model: typeof Model, columns: string | string[], embedMethod?: string); /** * Define when should the synced model starts to update when any of the given columns is updated in the original model */ updateWhenChange(columns: string | string[]): this; /** * Set query runner */ where(queryRunner: (query: ModelAggregate) => void): this; /** * Unset on delete */ unsetOnDelete(): this; /** * Ignore on delete */ ignoreOnDelete(): this; /** * Remove on delete */ removeOnDelete(): this; /** * Embed on create to injected model one the original model is created */ embedOnCreateFrom(column: string): this; /** * Mark as many sync */ syncMany(): this; /** * Start syncing the model */ sync(model: Model, saveMode: "create" | "update", oldModel?: Model): Promise; /** * Sync update */ syncUpdate(model: Model, oldModel?: Model): Promise; /** * Sync model destruction */ syncDestruction(model: Model): Promise; } export {}; //# sourceMappingURL=ModelSync.d.ts.map