import type { BetweenExpressionNode, BinaryExpressionNode, ColumnReferenceNode, DeleteStatementNode, FunctionCallExpressionNode, AllColumnsNode, InsertStatementNode, InsertValuesNode, OnConflictClauseNode, OnConflictDoNothingNode, OnConflictDoUpdateNode, OnConflictTargetNode, FromClauseNode, GroupedExpressionNode, IdentifierNode, InListExpressionNode, JoinClauseNode, LiteralNode, ObjectNameNode, OrderByItemNode, ParameterExpressionNode, RawFragmentNode, SelectExpressionNode, SelectQualifiedStarNode, SelectStarNode, SelectStatementNode, CompoundSelectNode, SegmentedStatementNode, SetClauseNode, SqlNode, StatementNode, SubqueryNode, SubqueryExpressionNode, TableReferenceNode, UnaryExpressionNode, UpdateStatementNode, WithClauseNode, CommonTableExpressionNode, CaseExpressionNode, WindowSpecificationNode, WindowReferenceNode, WindowFrameNode, WindowFrameBoundNode, ExistsExpressionNode } from "./nodes.js";
export type VisitContext = {
    readonly parent: SqlNode | null;
    readonly property: string | null;
    readonly index?: number;
};
type NodeKindMap = {
    readonly raw_fragment: RawFragmentNode;
    readonly select_statement: SelectStatementNode;
    readonly compound_select: CompoundSelectNode;
    readonly insert_statement: InsertStatementNode;
    readonly update_statement: UpdateStatementNode;
    readonly delete_statement: DeleteStatementNode;
    readonly on_conflict_clause: OnConflictClauseNode;
    readonly on_conflict_target: OnConflictTargetNode;
    readonly on_conflict_do_nothing: OnConflictDoNothingNode;
    readonly on_conflict_do_update: OnConflictDoUpdateNode;
    readonly function_call: FunctionCallExpressionNode;
    readonly with_clause: WithClauseNode;
    readonly common_table_expression: CommonTableExpressionNode;
    readonly segmented_statement: SegmentedStatementNode;
    readonly select_star: SelectStarNode;
    readonly select_qualified_star: SelectQualifiedStarNode;
    readonly select_expression: SelectExpressionNode;
    readonly from_clause: FromClauseNode;
    readonly join_clause: JoinClauseNode;
    readonly table_reference: TableReferenceNode;
    readonly subquery: SubqueryNode;
    readonly subquery_expression: SubqueryExpressionNode;
    readonly order_by_item: OrderByItemNode;
    readonly set_clause: SetClauseNode;
    readonly column_reference: ColumnReferenceNode;
    readonly literal: LiteralNode;
    readonly parameter: ParameterExpressionNode;
    readonly grouped_expression: GroupedExpressionNode;
    readonly binary_expression: BinaryExpressionNode;
    readonly unary_expression: UnaryExpressionNode;
    readonly in_list_expression: InListExpressionNode;
    readonly between_expression: BetweenExpressionNode;
    readonly case_expression: CaseExpressionNode;
    readonly exists_expression: ExistsExpressionNode;
    readonly identifier: IdentifierNode;
    readonly object_name: ObjectNameNode;
    readonly insert_values: InsertValuesNode;
    readonly window_specification: WindowSpecificationNode;
    readonly window_reference: WindowReferenceNode;
    readonly window_frame: WindowFrameNode;
    readonly window_frame_bound: WindowFrameBoundNode;
    readonly all_columns: AllColumnsNode;
};
type NodeKind = keyof NodeKindMap;
type NodeTransformResult<T extends SqlNode> = SqlNode | T | void;
export type AstVisitor = {
    readonly enter?: (node: SqlNode, context: VisitContext) => SqlNode | void;
    readonly exit?: (node: SqlNode, context: VisitContext) => SqlNode | void;
} & {
    readonly [K in NodeKind]?: (node: NodeKindMap[K], context: VisitContext) => NodeTransformResult<NodeKindMap[K]>;
} & {
    readonly [K in NodeKind as `${K}_exit`]?: (node: NodeKindMap[K], context: VisitContext) => NodeTransformResult<NodeKindMap[K]>;
};
/**
 * Traverses and optionally transforms a statement node.
 *
 * @example
 * ```ts
 * const rewritten = visitStatement(statement, visitor);
 * ```
 */
export declare function visitStatement<T extends StatementNode>(statement: T, visitor: AstVisitor): T;
/**
 * Specialised helper for visiting select statements.
 *
 * @example
 * ```ts
 * const rewritten = visitSelectStatement(select, visitor);
 * ```
 */
export declare function visitSelectStatement(statement: SelectStatementNode, visitor: AstVisitor): SelectStatementNode;
export {};
//# sourceMappingURL=visitor.d.ts.map