import type { BuildColumns } from "../column-builder.js";
import { entityKind } from "../entity.js";
import type { TypedQueryBuilder } from "../query-builders/query-builder.js";
import type { AddAliasToSelection } from "../query-builders/select.types.js";
import type { ColumnsSelection, SQL } from "../sql/sql.js";
import type { MsSqlColumnBuilderBase } from "./columns/index.js";
import { QueryBuilder } from "./query-builders/query-builder.js";
import type { SelectedFields } from "./query-builders/select.types.js";
import { MsSqlViewBase } from "./view-base.js";
import { MsSqlViewConfig } from "./view-common.js";
export interface ViewBuilderConfig {
    encryption?: boolean;
    schemaBinding?: boolean;
    viewMetadata?: boolean;
    checkOption?: boolean;
}
export declare class ViewBuilderCore<TConfig extends {
    name: string;
    columns?: unknown;
}> {
    protected name: TConfig['name'];
    protected schema: string | undefined;
    static readonly [entityKind]: string;
    readonly _: {
        readonly name: TConfig['name'];
        readonly columns: TConfig['columns'];
    };
    constructor(name: TConfig['name'], schema: string | undefined);
    protected config: ViewBuilderConfig;
    with(config?: ViewBuilderConfig): this;
}
export declare class ViewBuilder<TName extends string = string> extends ViewBuilderCore<{
    name: TName;
}> {
    static readonly [entityKind]: string;
    as<TSelectedFields extends SelectedFields>(qb: TypedQueryBuilder<TSelectedFields> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelectedFields>)): MsSqlViewWithSelection<TName, false, AddAliasToSelection<TSelectedFields, TName, 'mssql'>>;
}
export declare class ManualViewBuilder<TName extends string = string, TColumns extends Record<string, MsSqlColumnBuilderBase> = Record<string, MsSqlColumnBuilderBase>> extends ViewBuilderCore<{
    name: TName;
    columns: TColumns;
}> {
    static readonly [entityKind]: string;
    private columns;
    constructor(name: TName, columns: TColumns, schema: string | undefined);
    existing(): MsSqlViewWithSelection<TName, true, BuildColumns<TName, TColumns, 'mssql'>>;
    as(query: SQL): MsSqlViewWithSelection<TName, false, BuildColumns<TName, TColumns, 'mssql'>>;
}
export declare class MsSqlView<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> extends MsSqlViewBase<TName, TExisting, TSelectedFields> {
    static readonly [entityKind]: string;
    protected $MsSqlViewBrand: 'MsSqlView';
    [MsSqlViewConfig]: ViewBuilderConfig | undefined;
    constructor({ mssqlConfig, config }: {
        mssqlConfig: ViewBuilderConfig | undefined;
        config: {
            name: TName;
            schema: string | undefined;
            selectedFields: SelectedFields;
            query: SQL | undefined;
        };
    });
}
export type MsSqlViewWithSelection<TName extends string, TExisting extends boolean, TSelectedFields extends ColumnsSelection> = MsSqlView<TName, TExisting, TSelectedFields> & TSelectedFields;
export declare function mssqlView<TName extends string>(name: TName): ViewBuilder<TName>;
export declare function mssqlView<TName extends string, TColumns extends Record<string, MsSqlColumnBuilderBase>>(name: TName, columns: TColumns): ManualViewBuilder<TName, TColumns>;
