import { type PartSpan } from "../ir/part-span.js"; import type { Token } from "../token/token.js"; import type { Scope } from "./scope.js"; export type ClauseKind = "select" | "from" | "join" | "where" | "groupBy" | "having" | "qualify" | "window" | "orderBy" | "limit"; export interface ClauseInfo { kind: ClauseKind; /** The clause's leading keyword token span (GROUP BY / ORDER BY span both tokens; a JOIN spans its * full `[NATURAL] [LATERAL] [INNER|LEFT|RIGHT|FULL|CROSS|SEMI|ANTI|ASOF] JOIN` keyword run). */ anchorSpan: PartSpan; /** The full clause construct, anchor through the end of the last IR-held content: see the file's * stated boundaries above for what this does NOT include. */ span: PartSpan; } /** Per-scope clause list for `scope` (typically the `scope` a `frameAt` hit returns), ordered by * document position. `tokens` is the SAME token stream the owning SqlDocument/parse() already * carries: cell-relative when called with a cell's own tokens, document-coordinate otherwise (the * caller picks; `SqlDocument.clausesOf` handles the cell-relative case and shifts the result). Emits * only clauses that actually exist in the text; never fabricates. Total: never throws. */ export declare function clausesOf(scope: Scope, tokens: readonly Token[]): ClauseInfo[];