import { Request } from "express"; import Model, { ModelType } from "./Model.js"; import ModelComponent from "./ModelComponent.js"; import ModelQuery, { ModelQueryResult, QueryFields } from "./ModelQuery.js"; export default class ModelFactory { private static readonly factories; static register(modelType: ModelType): void; static get(modelType: ModelType): ModelFactory; static has(modelType: ModelType): boolean; private readonly modelType; private readonly components; protected constructor(modelType: ModelType); addComponent(modelComponentFactory: ModelComponentFactory): void; hasComponent(modelComponentFactory: ModelComponentFactory): boolean; create(data: Pick, isNewModel: boolean): M; get table(): string; select(...fields: QueryFields): ModelQuery; insert(data: Pick): ModelQuery; update(data: Pick): ModelQuery; delete(): ModelQuery; getPrimaryKeyFields(): (keyof M & string)[]; getPrimaryKey(modelData: Pick): Pick[keyof M & string][]; getPrimaryKeyString(modelData: Pick): string; getById(...id: PrimaryKeyValue[]): Promise; paginate(req: Request, perPage?: number, query?: ModelQuery): Promise>; } export declare type ModelComponentFactory = new (model: M) => ModelComponent; export declare type PrimaryKeyValue = string | number | boolean | null | undefined;