import { ErrorNode } from 'antlr4ts/tree';
import { CursorQuery } from '../cursor';
import { AlterDatabaseContext, AlterTableContext, AlterViewContext, AnalyzeContext, AsDatabaseContext, AutoOptimizeTableContext, ColumnReferenceContext, CreateTableContext, DereferenceContext, DescribeCatalogContext, DescribeDatabaseContext, DescribeTableContext, DropDatabaseContext, DropTableContext, InsertContext, JoinConditionContext, LikeTableContext, PartitionedByContext, QueryPrimaryContext, StatementContext, TableReferenceContext, UseContext } from '../lib/FlinkSQLParser';
import { Named, TableColumnMetadataArgs } from '../metadata.typing';
import { FlinkSQLRelationVisitor, InsertRelation, QueryRelation, TableRelation } from './flinksql-relation.visitor';
declare type CompletionRelationCategory = 'table' | 'view' | 'CTE';
interface CompletionRelation<Category = CompletionRelationCategory> {
    category: Category;
    label: string;
}
declare type ContextCompletions<C> = {
    type: 'column';
    relations: CompletionRelation[];
    columns: Array<{
        relation?: CompletionRelation;
        name: string;
        desc?: C;
    }>;
} | {
    type: 'relation';
    relations: CompletionRelation[];
    incompleteReference?: string[];
} | {
    type: 'database';
    incompleteReference?: string;
} | {
    type: 'catalog';
} | {
    type: 'other';
};
export interface Snippet {
    label: string;
    template: string;
    filterText: string;
}
export interface Snippets {
    snippets: Snippet[];
}
export declare type Completions<C> = ContextCompletions<C> & Snippets;
export declare class CompletionVisitor<C extends Named> extends FlinkSQLRelationVisitor<void> {
    private cursor;
    private getColumns?;
    private caretScope?;
    private hasCompletions;
    private completions;
    private relationInStatementContext?;
    constructor(cursor: CursorQuery, getColumns?: ((args?: TableColumnMetadataArgs | undefined) => C[]) | undefined);
    defaultResult(): void;
    aggregateResult(): void;
    onColumnReference(): void;
    private updateQueryCompletionItems;
    private handleRelationContext;
    private handleScopedColumn;
    private handleDatabaseContext;
    getSuggestions(): Completions<C>;
    onRelation(relation: TableRelation | QueryRelation | InsertRelation): void;
    visitErrorNode(node: ErrorNode): void;
    visitStatement(ctx: StatementContext): void;
    visitUse(ctx: UseContext): void;
    visitAnalyze(ctx: AnalyzeContext): void;
    visitCreateTable(ctx: CreateTableContext): void;
    visitLikeTable(ctx: LikeTableContext): void;
    visitAsDatabase(ctx: AsDatabaseContext): void;
    visitDropDatabase(ctx: DropDatabaseContext): void;
    visitDropTable(ctx: DropTableContext): void;
    visitAutoOptimizeTable(ctx: AutoOptimizeTableContext): void;
    visitDescribeCatalog(ctx: DescribeCatalogContext): void;
    visitDescribeDatabase(ctx: DescribeDatabaseContext): void;
    visitDescribeTable(ctx: DescribeTableContext): void;
    visitAlterDatabase(ctx: AlterDatabaseContext): void;
    visitAlterTable(ctx: AlterTableContext): void;
    visitAlterView(ctx: AlterViewContext): void;
    visitInsert(ctx: InsertContext): void;
    visitQueryPrimary(ctx: QueryPrimaryContext): void;
    visitTableReference(ctx: TableReferenceContext): void;
    visitColumnReference(ctx: ColumnReferenceContext): void;
    visitDereference(ctx: DereferenceContext): void;
    visitJoinCondition(ctx: JoinConditionContext): void;
    visitPartitionedBy(ctx: PartitionedByContext): void;
    private handleColumnsContext;
}
export {};
