import { SQL } from "../sql/sql.js";
import { entityKind } from "../entity.js";
import type { CockroachColumn, ExtraConfigColumn } from "./columns/index.js";
import { IndexedColumn } from "./columns/index.js";
import type { CockroachTable } from "./table.js";
interface IndexConfig {
    name?: string;
    columns: Partial<IndexedColumn | SQL>[];
    /**
     * If true, the index will be created as `create unique index` instead of `create index`.
     */
    unique: boolean;
    /**
     * If true, the index will be created as `create index ... on only <table>` instead of `create index ... on <table>`.
     */
    only: boolean;
    /**
     * Condition for partial index.
     */
    where?: SQL;
    /**
     * The optional USING clause method for the index
     */
    method?: 'btree' | string;
}
export type IndexColumn = CockroachColumn;
export type CockroachIndexMethod = 'btree' | 'hash' | 'gin' | 'cspann';
export declare class IndexBuilderOn {
    private unique;
    private name?;
    static readonly [entityKind]: string;
    constructor(unique: boolean, name?: string | undefined);
    on(...columns: [Partial<ExtraConfigColumn> | SQL, ...Partial<ExtraConfigColumn | SQL>[]]): IndexBuilder;
    onOnly(...columns: [Partial<ExtraConfigColumn | SQL>, ...Partial<ExtraConfigColumn | SQL>[]]): IndexBuilder;
    /**
     * Specify what index method to use. Choices are `btree`, `hash`, `gin`, `cspann`. The default method is `btree`.
     *
     * @param method The name of the index method to be used
     * @param columns
     * @returns
     */
    using(method: CockroachIndexMethod, ...columns: [Partial<ExtraConfigColumn | SQL>, ...Partial<ExtraConfigColumn | SQL>[]]): IndexBuilder;
}
export interface AnyIndexBuilder {
    build(table: CockroachTable): Index;
}
export interface IndexBuilder extends AnyIndexBuilder {
}
export declare class IndexBuilder implements AnyIndexBuilder {
    static readonly [entityKind]: string;
    constructor(columns: Partial<IndexedColumn | SQL>[], unique: boolean, only: boolean, name?: string, method?: string);
    where(condition: SQL): this;
}
export declare class Index {
    static readonly [entityKind]: string;
    readonly config: IndexConfig & {
        table: CockroachTable;
    };
    constructor(config: IndexConfig, table: CockroachTable);
}
export type GetColumnsTableName<TColumns> = TColumns extends CockroachColumn ? TColumns['_']['name'] : TColumns extends CockroachColumn[] ? TColumns[number]['_']['name'] : never;
export declare function index(name?: string): IndexBuilderOn;
export declare function uniqueIndex(name?: string): IndexBuilderOn;
export {};
