import { entityKind } from "../entity.js";
import type { AnyCockroachColumn, CockroachColumn } from "./columns/index.js";
import type { CockroachTable } from "./table.js";
export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';
export type Reference = () => {
    readonly name?: string;
    readonly columns: CockroachColumn[];
    readonly foreignTable: CockroachTable;
    readonly foreignColumns: CockroachColumn[];
};
export declare class ForeignKeyBuilder {
    static readonly [entityKind]: string;
    constructor(config: () => {
        name?: string;
        columns: CockroachColumn[];
        foreignColumns: CockroachColumn[];
    }, actions?: {
        onUpdate?: UpdateDeleteAction;
        onDelete?: UpdateDeleteAction;
    } | undefined);
    onUpdate(action: UpdateDeleteAction): this;
    onDelete(action: UpdateDeleteAction): this;
}
export type AnyForeignKeyBuilder = ForeignKeyBuilder;
export declare class ForeignKey {
    readonly table: CockroachTable;
    static readonly [entityKind]: string;
    readonly reference: Reference;
    readonly onUpdate: UpdateDeleteAction | undefined;
    readonly onDelete: UpdateDeleteAction | undefined;
    readonly name?: string;
    constructor(table: CockroachTable, builder: ForeignKeyBuilder);
    getName(): string | undefined;
}
type ColumnsWithTable<TTableName extends string, TColumns extends CockroachColumn[]> = {
    [Key in keyof TColumns]: AnyCockroachColumn<{
        tableName: TTableName;
    }>;
};
export declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [
    AnyCockroachColumn<{
        tableName: TTableName;
    }>,
    ...AnyCockroachColumn<{
        tableName: TTableName;
    }>[]
]>(config: {
    name?: string;
    columns: TColumns;
    foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
}): ForeignKeyBuilder;
export {};
