import type { Dialect, ParseError, ParsedStatement } from './types'; /** Maps byte offsets in a source string to 1-based line/column positions. */ export declare class LineMap { /** Offset at which each line starts. `lineStarts[0]` is always 0. */ private readonly lineStarts; constructor(source: string); locate(offset: number): { line: number; column: number; }; } interface ParseOutput { statements: ParsedStatement[]; parseErrors: ParseError[]; lineMap: LineMap; } /** * Parse a migration's SQL into top-level statements. * * The whole file is parsed at once when possible (the most accurate path). If * that fails — e.g. the file uses a construct the parser doesn't model — we fall * back to splitting on statement boundaries and parsing each independently, so a * single unparseable statement never blinds the linter to the rest of the file. */ export declare function parseSql(sql: string, dialect: Dialect): ParseOutput; interface Chunk { text: string; offset: number; } /** * Split SQL into statements on top-level semicolons, while respecting string * literals, quoted identifiers, line/block comments, and dollar-quoted strings. */ export declare function splitStatements(sql: string): Chunk[]; /** A comment found in the SQL, with the 1-based line it begins on. */ export interface SqlComment { /** Comment body, without the surrounding line- or block-comment markers. */ text: string; line: number; } /** * Extract every line (`--`) and block comment from the SQL, with line numbers. * * Uses the same scanner as {@link splitStatements} so that string literals, * quoted identifiers and dollar-quoted bodies are skipped — text that merely * looks like a comment inside a string is never reported as one. This is what * suppression directives are read from. */ export declare function scanComments(sql: string): SqlComment[]; export {}; //# sourceMappingURL=parser.d.ts.map