import { entityKind } from "../../entity.js";
import { MsSqlDialect, type MsSqlDialectConfig } from "../dialect.js";
import type { WithSubqueryWithSelection } from "../subquery.js";
import type { TypedQueryBuilder } from "../../query-builders/query-builder.js";
import type { ColumnsSelection } from "../../sql/sql.js";
import { WithSubquery } from "../../subquery.js";
import { MsSqlSelectBuilder } from "./select.js";
import type { SelectedFields } from "./select.types.js";
export declare class QueryBuilder {
    static readonly [entityKind]: string;
    private dialect;
    private dialectConfig;
    constructor(dialect?: MsSqlDialect | MsSqlDialectConfig);
    $with<TAlias extends string>(alias: TAlias): {
        as<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): WithSubqueryWithSelection<TSelection, TAlias>;
    };
    with(...queries: WithSubquery[]): {
        select: {
            (): MsSqlSelectBuilder<undefined, never, "qb">;
            <TSelection extends SelectedFields>(fields: TSelection): MsSqlSelectBuilder<TSelection, never, "qb">;
        };
        selectDistinct: {
            (): MsSqlSelectBuilder<undefined, never, "qb">;
            <TSelection extends SelectedFields>(fields: TSelection): MsSqlSelectBuilder<TSelection, never, "qb">;
        };
    };
    select(): MsSqlSelectBuilder<undefined, never, 'qb'>;
    select<TSelection extends SelectedFields>(fields: TSelection): MsSqlSelectBuilder<TSelection, never, 'qb'>;
    selectDistinct(): MsSqlSelectBuilder<undefined, never, 'qb'>;
    selectDistinct<TSelection extends SelectedFields>(fields: TSelection): MsSqlSelectBuilder<TSelection, never, 'qb'>;
    private getDialect;
}
