import type { Knex } from 'knex'; import type { FieldMeta, ModelPayload, ScopeType, ModelHookEventType, ModelHookContextType, ModelQueryBuilder } from './types'; export declare const PRIMARY_KEY_META: unique symbol; export declare const FIELD_META: unique symbol; export declare const RELATION_META: unique symbol; export declare const SOFT_DELETE_META: unique symbol; export declare const ATTRIBUTE_META: unique symbol; export declare const FORMATTER_META: unique symbol; export declare const SCOPE_META: unique symbol; export declare const EXPRESSION_META: unique symbol; export declare const Casts: { string: { fromDB: (v: any) => any; toDB: (v: any) => any; }; number: { fromDB: (v: any) => any; toDB: (v: any) => any; }; boolean: { fromDB: (v: any) => boolean; toDB: (v: any) => 0 | 1; }; date: { fromDB: (v: any) => Date | null; toDB: (v: any) => any; }; json: { fromDB: (v: any) => any; toDB: (v: any) => string; }; }; export interface Model { id: number; created_at: Date; updated_at: Date; } export declare abstract class Model { static table: string; static primaryKey: string; static softDelete: boolean; static deletedAtColumn: string; static searchMode?: 'like' | 'fulltext'; protected _original: Record; protected _exists: boolean; protected _trx?: Knex.Transaction; private static _hooks; private _instanceHooks; private _disabledHooks; constructor(data?: Record); protected static newInstance(this: T): InstanceType & Model; static [FIELD_META]?: Record; static getDefaultFields(): Record; static get fields(): Record; static get fillable(): string[]; static get selectable(): string[]; static get searchable(): string[]; static getTable(): string; static getPrimaryKey(): string; static [RELATION_META]?: Record; static get relations(): Record; static get attributes(): Record; static get formatters(): Record; static get scopes(): Record; getOriginal(key?: string): any; getChanges(): Record; getPrevious(): Record; static query(this: T, trx?: Knex | Knex.Transaction): ModelQueryBuilder>; castFromDB(row: Record): this; castToDB(): Record; getDirty(): Record; static hydrate(this: T, rows: any[] | null | undefined): InstanceType[]; fill(this: T, payload: ModelPayload): T; static create(this: T, payload: ModelPayload>, trx?: Knex.Transaction): Promise>; static update(this: T, payload: ModelPayload>, uniqueKeys: (keyof InstanceType & string)[], trx?: Knex.Transaction): Promise>; static upsert(this: T, payload: ModelPayload>, uniqueKeys: (keyof InstanceType & string)[], trx?: Knex.Transaction): Promise>; save(options?: { trx?: Knex.Transaction; }): Promise; pump(this: T, payload: ModelPayload, options?: { trx?: Knex.Transaction; }): Promise; pump(this: T, payload: ModelPayload[], options?: { trx?: Knex.Transaction; }): Promise; static getSoftDeleteConfig(): any; static isSoftDelete(): boolean; static getDeletedAtColumn(): string | null; delete(): Promise; forceDelete(): Promise; restore(): Promise; on(event: ModelHookEventType, fn: (ctx: ModelHookContextType) => any): this; off(event: ModelHookEventType): this; protected runHook(event: ModelHookEventType, ctx: ModelHookContextType): Promise; toJSON(): Record; useTransaction(trx: Knex.Transaction): this; }