import { Model } from "./Model"; import type { TModelOrObject } from "../types"; declare class JoinModel { protected model: Model; protected type: 'INNER_JOIN' | 'LEFT_JOIN' | 'RIGHT_JOIN' | 'CROSS_JOIN'; private join; constructor(model: Model, type?: 'INNER_JOIN' | 'LEFT_JOIN' | 'RIGHT_JOIN' | 'CROSS_JOIN'); /** * The 'on' method is used to Adds an ON condition to the current JOIN clause. * * Creates a join condition by comparing two column references. * Both parameters must be fully qualified column names in the * format `table.column`. * * @param {TModelOrObject | `${string}.${string}`} m1 The model (e.g User) * @param {TModelOrObject | `${string}.${string}`} m2 The model reference (e.g. Post). * * @returns The current join model instance for method chaining. * * @example * new User() * .joinModel((join) => join.on(User, Post)); * */ on(m1: `${string}.${string}`, m2: `${string}.${string}`): this; on(m1: TModelOrObject, m2: TModelOrObject): this; /** * The 'and' method is used to Adds an additional condition to the current JOIN ON clause using AND. * * This method must be called after `.on()`. * * @param localKey - The left-side column reference. * @param referenceKey - The right-side column reference. * * @returns The current join model instance. * * @example * new User() * .joinModel((join) => * join * .on(User, Post) * .and(Post.columnRef('type'), 'article') * .and(Post.columnRef('published'), true) * ); */ and(localKey: `${string}.${string}`, referenceKey: `${string}.${string}` | string | number | boolean | null | (string | number | boolean | null)[]): this; and(localKey: `${string}.${string}`, operator: "=" | "<" | ">" | "!=" | "<>" | "<=" | ">=" | "LIKE" | "like", referenceKey?: `${string}.${string}` | string | number | boolean | null | (string | number | boolean | null)[]): this; /** * The 'or' method is used to Adds an additional condition to the current JOIN ON clause using OR. * * This method must be called after `.on()`. * * @param localKey - The left-side column reference. * @param referenceKey - The right-side column reference. * * @returns The current join model instance. * * @example * new User() * .joinModel((join) => * join * .on(User, Post) * .or('posts.type', 'article') * .or('posts.published', true) * ); */ or(localKey: `${string}.${string}`, referenceKey: `${string}.${string}` | string | number | boolean | null | (string | number | boolean | null)[]): this; or(localKey: `${string}.${string}`, operator: "=" | "<" | ">" | "!=" | "<>" | "<=" | ">=" | "LIKE" | "like", referenceKey?: `${string}.${string}` | string | number | boolean | null | (string | number | boolean | null)[]): this; protected toString(): string; private handleJoinModel; private onRaw; private formatValue; } export { JoinModel }; export default JoinModel;