import { IRelationDescriptor, IModelDescriptor, IBuilderMiddleware, ISelectQueryBuilder } from './interfaces.js'; import { ModelBase } from './model.js'; import { BelongsToRelation, NativeOrmRelation } from './relations.js'; export { DiscriminationMapMiddleware } from './discrimination-middleware.js'; export declare class HasManyRelationMiddleware implements IBuilderMiddleware { protected _relationQuery: ISelectQueryBuilder; protected _description: IRelationDescriptor; protected _path: string; constructor(_relationQuery: ISelectQueryBuilder, _description: IRelationDescriptor, _path: string); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; } export declare class BelongsToRelationRecursiveMiddleware implements IBuilderMiddleware { protected _relationQuery: ISelectQueryBuilder; protected _description: IRelationDescriptor; protected _targetModelDescriptor: IModelDescriptor; constructor(_relationQuery: ISelectQueryBuilder, _description: IRelationDescriptor, _targetModelDescriptor: IModelDescriptor); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; } export declare class QueryRelationMiddleware implements IBuilderMiddleware { protected callback: (data: ModelBase[]) => ISelectQueryBuilder; protected mapper: (owner: ModelBase, data: ModelBase[]) => ModelBase | ModelBase[]; protected _description: IRelationDescriptor; constructor(callback: (data: ModelBase[]) => ISelectQueryBuilder, mapper: (owner: ModelBase, data: ModelBase[]) => ModelBase | ModelBase[], _description: IRelationDescriptor); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; } export declare class VirtualRelationMiddleware implements IBuilderMiddleware { protected relationCallback: (this: ISelectQueryBuilder, relation: NativeOrmRelation) => void; protected callback: (data: ModelBase[]) => ISelectQueryBuilder; protected mapper: (owner: ModelBase, data: ModelBase[]) => ModelBase | ModelBase[]; protected _description: IRelationDescriptor; constructor(relationCallback: (this: ISelectQueryBuilder, relation: NativeOrmRelation) => void, callback: (data: ModelBase[]) => ISelectQueryBuilder, mapper: (owner: ModelBase, data: ModelBase[]) => ModelBase | ModelBase[], _description: IRelationDescriptor); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; } export declare class HasManyToManyRelationMiddleware implements IBuilderMiddleware { protected _relationQuery: ISelectQueryBuilder; protected _description: IRelationDescriptor; protected _targetModelDescriptor: IModelDescriptor; protected _relationDescriptor?: IRelationDescriptor | undefined; /** * @param _relationQuery - the join query through the junction table * @param _description - the *synthetic* owner -> junction descriptor built by * `ManyToManyRelation.compile()`. It says `Type: Many` and its `ForeignKey` is the * junction's source column, which is what the row-matching below needs. * @param _targetModelDescriptor - descriptor of the model on the far side of the junction * @param _relationDescriptor - the model's own `@HasManyToMany` descriptor. Optional so no * existing caller breaks, but without it the `ManyToManyRelationList` handed to the * user carries the synthetic descriptor instead — no `JunctionModel`, no junction * key names — and `sync()` / `update()` / the set operations all fail on it. */ constructor(_relationQuery: ISelectQueryBuilder, _description: IRelationDescriptor, _targetModelDescriptor: IModelDescriptor, _relationDescriptor?: IRelationDescriptor | undefined); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; private pickProps; } export declare class BelongsToPopulateDataMiddleware implements IBuilderMiddleware { protected _description: IRelationDescriptor; protected relation: BelongsToRelation; constructor(_description: IRelationDescriptor, relation: BelongsToRelation); afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(data: ModelBase[]): Promise; } export declare class BelongsToRelationResultTransformMiddleware implements IBuilderMiddleware { afterQuery(data: any[]): any[]; modelCreation(_: any): ModelBase | null; afterHydration(_data: Array): Promise; /** * Dynamically sets a deeply nested value in an object. * Optionally "bores" a path to it if its undefined. * * @param obj - The object which contains the value you want to change/set. * @param path - The array representation of path to the value you want to change/set. * @param value - The value you want to set it to. * @param setrecursively - If true, will set value of non-existing path as well. */ protected setDeep(obj: any, path: any[], value: any, setrecursively?: boolean): void; protected keyTransform(key: string): string[]; } //# sourceMappingURL=middlewares.d.ts.map