import { SqlPrintToken, SqlPrintTokenContainerType } from "../models/SqlPrintToken";
import { IndentCharOption, NewlineOption } from "./LinePrinter";
import { BaseFormattingOptions, WithClauseStyle, CommentStyle } from "./SqlFormatter";
import { CommaBreakStyle as HelperCommaBreakStyle } from "./OnelineFormattingHelper";
import { CommentExportMode } from "../types/Formatting";
/**
 * CommaBreakStyle determines how commas are placed in formatted SQL output.
 * - 'none': No line break for commas
 * - 'before': Line break before comma
 * - 'after': Line break after comma
 */
export type CommaBreakStyle = HelperCommaBreakStyle;
/**
 * AndBreakStyle determines how AND operators are placed in formatted SQL output.
 * - 'none': No line break for AND
 * - 'before': Line break before AND
 * - 'after': Line break after AND
 */
export type AndBreakStyle = 'none' | 'before' | 'after';
/**
 * OrBreakStyle determines how OR operators are placed in formatted SQL output.
 * - 'none': No line break for OR
 * - 'before': Line break before OR
 * - 'after': Line break after OR
 */
export type OrBreakStyle = 'none' | 'before' | 'after';
/**
 * JoinOnBreakStyle determines whether JOIN ON starts on the JOIN line or its own indented line.
 * - 'none': Keep ON inline with the JOIN target
 * - 'before': Break before ON and indent the join condition
 * - 'after': Legacy alias accepted as 'none'
 */
export type JoinOnBreakStyle = 'none' | 'before' | 'after';
/**
 * Options for configuring SqlPrinter formatting behavior
 */
export interface SqlPrinterOptions extends BaseFormattingOptions {
    /** Container types that should increase indentation level */
    indentIncrementContainerTypes?: SqlPrintTokenContainerType[];
}
/**
 * SqlPrinter formats a SqlPrintToken tree into a SQL string with flexible style options.
 *
 * This class provides various formatting options including:
 * - Indentation control (character and size)
 * - Line break styles for commas and AND operators
 * - Keyword case transformation
 * - Comment handling
 * - WITH clause formatting styles
 *
 * @example
 * const printer = new SqlPrinter({
 *   indentChar: '  ',
 *   indentSize: 1,
 *   keywordCase: 'upper',
 *   commaBreak: 'after',
 *   withClauseStyle: 'cte-oneline'
 * });
 * const formatted = printer.print(sqlToken);
 */
export declare class SqlPrinter {
    /** Indent character (e.g., ' ' or '\\t') */
    indentChar: IndentCharOption;
    /** Indent size (number of indentChar repetitions per level) */
    indentSize: number;
    /** Newline character (e.g., '\\n' or '\\r\\n') */
    newline: NewlineOption;
    /** Comma break style: 'none', 'before', or 'after' */
    commaBreak: CommaBreakStyle;
    /** WITH clause comma break style (defaults to commaBreak) */
    cteCommaBreak: CommaBreakStyle;
    /** VALUES clause comma break style (defaults to commaBreak) */
    valuesCommaBreak: CommaBreakStyle;
    /** AND break style: 'none', 'before', or 'after' */
    andBreak: AndBreakStyle;
    /** OR break style: 'none', 'before', or 'after' */
    orBreak: OrBreakStyle;
    /** JOIN ON break style: 'none' or 'before' (legacy 'after' is treated as 'none') */
    joinOnBreak: JoinOnBreakStyle;
    /** Keyword case style: 'none', 'upper' | 'lower' */
    keywordCase: 'none' | 'upper' | 'lower';
    /** Comment export mode controlling how comments are emitted */
    commentExportMode: CommentExportMode;
    /** WITH clause formatting style (default: 'standard') */
    withClauseStyle: WithClauseStyle;
    /** Comment formatting style (default: 'block') */
    commentStyle: CommentStyle;
    private linePrinter;
    private indentIncrementContainers;
    /** Track whether we are currently inside a WITH clause for full-oneline formatting */
    private insideWithClause;
    /** Whether to keep parentheses content on one line */
    private parenthesesOneLine;
    /** Whether to keep BETWEEN expressions on one line */
    private betweenOneLine;
    /** Whether to keep VALUES clause on one line */
    private valuesOneLine;
    /** Whether to keep IN value lists on one line */
    private inOneLine;
    /** Whether to keep JOIN conditions on one line */
    private joinOneLine;
    /** Whether to keep CASE expressions on one line */
    private caseOneLine;
    /** Whether to keep subqueries on one line */
    private subqueryOneLine;
    /** Whether to indent nested parentheses when boolean groups get expanded */
    private indentNestedParentheses;
    /** Whether to keep INSERT column lists on one line */
    private insertColumnsOneLine;
    /** Whether to keep MERGE WHEN predicates on a single line */
    private whenOneLine;
    /** Optional maximum width for opt-in one-line constructs */
    private oneLineMaxLength?;
    /** Whether to indent AND/OR continuation lines inside JOIN ON predicates */
    private joinConditionContinuationIndent;
    /** Tracks nesting depth while formatting MERGE WHEN predicate segments */
    private mergeWhenPredicateDepth;
    /** Tracks nesting depth while formatting JOIN ON condition segments */
    private joinOnClauseDepth;
    /** Shared helper for oneline-specific formatting decisions */
    private onelineHelper;
    /** Containers whose one-line rendering was rejected by oneLineMaxLength */
    private expandedOneLineFallbackTokens;
    /** Pending line comment that needs a forced newline before next token */
    private pendingLineCommentBreak;
    /** Accumulates lines when reconstructing multi-line block comments inside CommentBlocks */
    private smartCommentBlockBuilder;
    /** Tracks function calls whose arguments must expand because rendered comments are present */
    private commentedFunctionCallDepth;
    /**
     * @param options Optional style settings for pretty printing
     */
    constructor(options?: SqlPrinterOptions);
    /**
     * Converts a SqlPrintToken tree to a formatted SQL string.
     * @param token The root SqlPrintToken to format
     * @param level Initial indentation level (default: 0)
     * @returns Formatted SQL string
     * @example
     * const printer = new SqlPrinter({ indentChar: '  ', keywordCase: 'upper' });
     * const formatted = printer.print(sqlToken);
     */
    print(token: SqlPrintToken, level?: number): string;
    private resolveCommentExportMode;
    private rendersInlineComments;
    private shouldRenderComment;
    private appendToken;
    private shouldAlignExplainStatementChild;
    private shouldExpandCommentedFunctionCall;
    private containsCommentBlock;
    private containsRenderableCommentBlock;
    private isLogicalOperatorWithComment;
    private currentLineEndsWithLogicalOperator;
    private isCaseContext;
    /**
     * Determines if a token should be skipped during printing.
     * Tokens are skipped if they have no content and no inner tokens,
     * except for special token types that have semantic meaning despite empty text.
     */
    private shouldSkipToken;
    private applyKeywordCase;
    private handleKeywordToken;
    private ensureSpaceBeforeKeyword;
    private ensureTrailingSpace;
    /**
     * Normalizes INSERT column list token text when one-line formatting is active.
     */
    private tryAppendInsertClauseTokenText;
    private handleCommaToken;
    private handleArgumentSplitterToken;
    private handleAndOperatorToken;
    private handleParenthesisToken;
    private handleOrOperatorToken;
    private getJoinConditionContinuationLevel;
    /**
     * Decide whether a parentheses group should increase indentation when inside nested structures.
     * We only expand groups that contain further parentheses so simple comparisons stay compact.
     */
    private shouldIndentNestedParentheses;
    /**
     * Recursively inspect descendants to find additional parentheses groups.
     * Helps detect complex boolean groups like ((A) OR (B) OR (C)).
     */
    private containsParenExpression;
    private handleJoinClauseToken;
    /**
     * Decides whether the current container should collapse into a single line.
     */
    private shouldFormatContainerAsOneline;
    private isInValueListExpression;
    private getInValueListParts;
    /**
     * Detects an INSERT column list that must stay on a single line.
     */
    private isInsertClauseOneline;
    /**
     * Handles space tokens with context-aware filtering.
     * Skips spaces in CommentBlocks when in specific CTE modes to prevent duplication.
     */
    private handleSpaceToken;
    private findPreviousSignificantToken;
    private shouldSkipSpaceBeforeParenthesis;
    private shouldAlignCreateTableSelect;
    private isCreateTableSpacingContext;
    private isCreateTableNameToken;
    private isCreateTableConstraintKeyword;
    private isIdentifierAttachedToConstraint;
    private printCommentToken;
    private handleSmartCommentBlockToken;
    private handleCommentBlockContainer;
    private getEmptyBlockCommentText;
    private normalizeSmartBlockLine;
    private extractLineCommentContent;
    private flushSmartCommentBlockBuilder;
    private shouldFallbackSmartLineCommentToBlock;
    private buildSmartLineComment;
    private collectCommentBlockLines;
    private extractRawCommentBlockLines;
    private extractDirectBlockCommentTexts;
    private normalizeCommentForSmart;
    private buildBlockComment;
    private getIndentString;
    private sanitizeCommentLine;
    private escapeCommentDelimiters;
    private getCommentBaseIndentLevel;
    private resolveCommentIndentLevel;
    /**
     * Handles commentNewline tokens with conditional newline behavior.
     * In multiline mode (newline !== ' '), adds a newline after comments.
     * In oneliner mode (newline === ' '), does nothing to keep comments on same line.
     * Skips newlines in CTE modes (full-oneline, cte-oneline) to maintain one-line format.
     */
    private handleCommentNewlineToken;
    /**
     * Determines whether to skip commentNewline tokens.
     * Skips in CTE modes to maintain one-line formatting.
     */
    private shouldSkipCommentNewline;
    private shouldAddNewlineBeforeLeadingComments;
    private getLeadingCommentIndentLevel;
    private shouldKeepLeadingCommentOnCommaLine;
    /**
     * Determines if the printer is in oneliner mode.
     * Oneliner mode uses single spaces instead of actual newlines.
     */
    private isOnelineMode;
    private normalizeOneLineMaxLength;
    private normalizeKeywordCase;
    private normalizeJoinOnBreak;
    private fitsOneLineMaxLength;
    /**
     * Handles CTE tokens with one-liner formatting.
     * Creates a nested SqlPrinter instance for proper CTE oneline formatting.
     */
    private tryHandleCteOnelineToken;
    private shouldPreserveCteComments;
    /**
     * Creates a SqlPrinter instance configured for CTE oneline formatting.
     */
    private createCteOnelinePrinter;
    /**
     * Handles tokens with oneline formatting (parentheses, BETWEEN, VALUES, JOIN, CASE, subqueries).
     * Creates a unified oneline printer that formats everything as one line regardless of content type.
     */
    private tryHandleOnelineToken;
    private tryHandleInOneLineToken;
    private appendExpandedInValueList;
    private splitValueListItems;
    private isBooleanParenExpression;
    private containsLogicalOperator;
    private getClauseBreakIndentLevel;
    private isMergeActionContainer;
    private shouldBreakAfterOpeningParen;
    private shouldBreakBeforeClosingParen;
    private shouldConvertSpaceToClauseBreak;
    /**
     * Creates a unified SqlPrinter instance configured for oneline formatting.
     * Works for all oneline options: parentheses, BETWEEN, VALUES, JOIN, CASE, subqueries.
     * Sets all oneline options to false to prevent recursion and uses newline=' ' for actual oneline effect.
     */
    private createOnelinePrinter;
    /**
     * Removes duplicate consecutive spaces while preserving single spaces.
     * Simple and safe space normalization for CTE oneline mode.
     */
    private cleanDuplicateSpaces;
}
