import type { ColumnBuilderBase, ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnBuilderRuntimeConfig, ColumnDataType, HasGenerated } from "../../column-builder.js";
import { ColumnBuilder } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { Column } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { Simplify, Update } from "../../utils.js";
import type { UpdateDeleteAction } from "../foreign-keys.js";
import type { AnyCockroachTable, CockroachTable } from "../table.js";
import type { SQL } from "../../sql/sql.js";
export interface ReferenceConfig {
    ref: () => CockroachColumn;
    config: {
        name?: string;
        onUpdate?: UpdateDeleteAction;
        onDelete?: UpdateDeleteAction;
    };
}
export interface CockroachColumnBuilderBase<T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>, TTypeConfig extends object = object> extends ColumnBuilderBase<T, TTypeConfig & {
    dialect: 'cockroach';
}> {
}
export declare abstract class CockroachColumnBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig> extends ColumnBuilder<T, TRuntimeConfig, TTypeConfig & {
    dialect: 'cockroach';
}, TExtraConfig> implements CockroachColumnBuilderBase<T, TTypeConfig> {
    private foreignKeyConfigs;
    static readonly [entityKind]: string;
    references(ref: ReferenceConfig['ref'], config?: ReferenceConfig['config']): this;
    unique(name?: string): this;
    generatedAlwaysAs(as: SQL | T['data'] | (() => SQL)): HasGenerated<this, {
        type: 'always';
    }>;
}
export declare abstract class CockroachColumnWithArrayBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig> extends CockroachColumnBuilder<T, TRuntimeConfig, TTypeConfig & {
    dialect: 'cockroach';
}, TExtraConfig> {
    static readonly [entityKind]: string;
    array<TSize extends number | undefined = undefined>(size?: TSize): Omit<CockroachArrayBuilder<{
        name: T['name'];
        dataType: 'array';
        columnType: 'CockroachArray';
        data: T['data'][];
        driverParam: T['driverParam'][] | string;
        enumValues: T['enumValues'];
        size: TSize;
        baseBuilder: T;
    } & (T extends {
        notNull: true;
    } ? {
        notNull: true;
    } : {}) & (T extends {
        hasDefault: true;
    } ? {
        hasDefault: true;
    } : {}), T>, 'array'>;
}
export declare abstract class CockroachColumn<T extends ColumnBaseConfig<ColumnDataType, string> = ColumnBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = {}, TTypeConfig extends object = {}> extends Column<T, TRuntimeConfig, TTypeConfig & {
    dialect: 'cockroach';
}> {
    readonly table: CockroachTable;
    static readonly [entityKind]: string;
    constructor(table: CockroachTable, config: ColumnBuilderRuntimeConfig<T['data'], TRuntimeConfig>);
}
export type IndexedExtraConfigType = {
    order?: 'asc' | 'desc';
};
export declare class ExtraConfigColumn<T extends ColumnBaseConfig<ColumnDataType, string> = ColumnBaseConfig<ColumnDataType, string>> extends CockroachColumn<T, IndexedExtraConfigType> {
    static readonly [entityKind]: string;
    getSQLType(): string;
    indexConfig: IndexedExtraConfigType;
    defaultConfig: IndexedExtraConfigType;
    asc(): Omit<this, 'asc' | 'desc'>;
    desc(): Omit<this, 'asc' | 'desc'>;
}
export declare class IndexedColumn {
    static readonly [entityKind]: string;
    constructor(name: string | undefined, keyAsName: boolean, type: string, indexConfig: IndexedExtraConfigType);
    name: string | undefined;
    keyAsName: boolean;
    type: string;
    indexConfig: IndexedExtraConfigType;
}
export type AnyCockroachColumn<TPartial extends Partial<ColumnBaseConfig<ColumnDataType, string>> = {}> = CockroachColumn<Required<Update<ColumnBaseConfig<ColumnDataType, string>, TPartial>>>;
export type CockroachArrayColumnBuilderBaseConfig = ColumnBuilderBaseConfig<'array', 'CockroachArray'> & {
    size: number | undefined;
    baseBuilder: ColumnBuilderBaseConfig<ColumnDataType, string>;
};
export declare class CockroachArrayBuilder<T extends CockroachArrayColumnBuilderBaseConfig, TBase extends ColumnBuilderBaseConfig<ColumnDataType, string> | CockroachArrayColumnBuilderBaseConfig> extends CockroachColumnWithArrayBuilder<T, {
    baseBuilder: TBase extends CockroachArrayColumnBuilderBaseConfig ? CockroachArrayBuilder<TBase, TBase extends {
        baseBuilder: infer TBaseBuilder extends ColumnBuilderBaseConfig<any, any>;
    } ? TBaseBuilder : never> : CockroachColumnWithArrayBuilder<TBase, {}, Simplify<Omit<TBase, keyof ColumnBuilderBaseConfig<any, any>>>>;
    size: T['size'];
}, {
    baseBuilder: TBase extends CockroachArrayColumnBuilderBaseConfig ? CockroachArrayBuilder<TBase, TBase extends {
        baseBuilder: infer TBaseBuilder extends ColumnBuilderBaseConfig<any, any>;
    } ? TBaseBuilder : never> : CockroachColumnWithArrayBuilder<TBase, {}, Simplify<Omit<TBase, keyof ColumnBuilderBaseConfig<any, any>>>>;
    size: T['size'];
}> {
    static readonly [entityKind] = "CockroachArrayBuilder";
    constructor(name: string, baseBuilder: CockroachArrayBuilder<T, TBase>['config']['baseBuilder'], size: T['size']);
}
export declare class CockroachArray<T extends ColumnBaseConfig<'array', 'CockroachArray'> & {
    size: number | undefined;
    baseBuilder: ColumnBuilderBaseConfig<ColumnDataType, string>;
}, TBase extends ColumnBuilderBaseConfig<ColumnDataType, string>> extends CockroachColumn<T, {}, {
    size: T['size'];
    baseBuilder: T['baseBuilder'];
}> {
    readonly baseColumn: CockroachColumn;
    readonly range?: [number | undefined, number | undefined] | undefined;
    readonly size: T['size'];
    static readonly [entityKind]: string;
    constructor(table: AnyCockroachTable<{
        name: T['tableName'];
    }>, config: CockroachArrayBuilder<T, TBase>['config'], baseColumn: CockroachColumn, range?: [number | undefined, number | undefined] | undefined);
    getSQLType(): string;
    mapFromDriverValue(value: unknown[] | string): T['data'];
    mapToDriverValue(value: unknown[], isNestedArray?: boolean): unknown[] | string;
}
