import { AbstractLinkColumn, AnyDB, FilterableNode } from './@types/internal-types.js';
import { ColumnNames } from './@types/query-builder.js';
import { Executor } from './executor.js';
/**
 * A base class for query builders that support filtering.
 * It provides the `where` and `orWhere` methods.
 * @template DB - The database type.
 * @template TableName - The name of the table to query.
 */
export declare class FilterableQueryBuilder<DB extends AnyDB, TableName extends keyof DB> {
    _node: FilterableNode;
    _executor: Executor;
    constructor(node: FilterableNode, executor: Executor);
    /**
     * Adds a `where` clause to the query.
     * This can be a simple condition, a nested query, or a cross-filter on a linked table.
     *
     * @param field - The field to filter on.
     * @param operator - The filter operator.
     * @param value - The value to filter by.
     * @returns The query builder instance for chaining.
     *
     * @example
     * ```typescript
     * const users = await qb
     *   .selectFrom('users')
     *   .where('name', '=', 'John Doe')
     *   .execute();
     * ```
     *
     * @example
     * ```typescript
     * const users = await qb
     *   .selectFrom('users')
     *   .where((qb) =>
     *     qb.where('name', '=', 'John Doe').orWhere('email', '=', 'john.doe@example.com')
     *   )
     *   .execute();
     * ```
     *
     * @example
     * ```typescript
     * const users = await qb
     *   .selectFrom('users')
     *   .where('posts', 'hasAnyOf', (qb) => qb.where('isPublished', '=', true))
     *   .execute();
     * ```
     */
    where<TField extends ColumnNames<DB[TableName]> & string, TOperator extends keyof DB[TableName][TField]['filters']>(field: TField, operator: TOperator, value?: DB[TableName][TField] extends AbstractLinkColumn ? ((qb: FilterableQueryBuilder<DB, DB[TableName][TField] extends AbstractLinkColumn ? DB[TableName][TField]['linkedTo'] : never>) => FilterableQueryBuilder<DB, DB[TableName][TField] extends AbstractLinkColumn ? DB[TableName][TField]['linkedTo'] : never>) | DB[TableName][TField]['filters'][TOperator] : DB[TableName][TField]['filters'][TOperator] extends never ? undefined : DB[TableName][TField]['filters'][TOperator]): this;
    where<C extends (builder: WhereQueryBuilder<DB, TableName>) => WhereQueryBuilder<DB, TableName>>(column: C): this;
    /**
     * Adds an `orWhere` clause to the query.
     * This is similar to `where`, but the condition will be joined with `OR`.
     *
     * @param field - The field to filter on.
     * @param operator - The filter operator.
     * @param value - The value to filter by.
     * @returns The query builder instance for chaining.
     *
     * @example
     * ```typescript
     * const users = await qb
     *   .selectFrom('users')
     *   .where('name', '=', 'John Doe')
     *   .orWhere('name', '=', 'Jane Doe')
     *   .execute();
     * ```
     */
    orWhere<TField extends ColumnNames<DB[TableName]> & string, TOperator extends keyof DB[TableName][TField]['filters']>(field: TField, operator: TOperator, value: DB[TableName][TField] extends AbstractLinkColumn ? (qb: FilterableQueryBuilder<DB, DB[TableName][TField] extends AbstractLinkColumn ? DB[TableName][TField]['linkedTo'] : never>) => FilterableQueryBuilder<DB, DB[TableName][TField] extends AbstractLinkColumn ? DB[TableName][TField]['linkedTo'] : never> | DB[TableName][TField]['filters'][TOperator] : DB[TableName][TField]['filters'][TOperator]): this;
    orWhere<C extends (builder: WhereQueryBuilder<DB, TableName>) => WhereQueryBuilder<DB, TableName>>(column: C): this;
}
export declare class WhereQueryBuilder<DB extends AnyDB, TableName extends keyof DB> extends FilterableQueryBuilder<DB, TableName> {
}
