import type { Ast } from "postgresql-eslint-parser"; /** * Local extensions for AST nodes whose interface upstream is incomplete * (the parser exposes only `{ type }` for these but the actual node * carries more fields). Each entry should be removed once the upstream * parser package adds the field to its type definition. */ export type TruncateStmt = Ast.TruncateStmt & { behavior?: string; relations?: unknown[]; restart_seqs?: boolean; }; /** * Type predicates for the parser's AST union types. Using them in `if` * conditions narrows the type so callers don't need `as` casts at every * field access. */ export declare const isColumnRef: (node: unknown) => node is Ast.ColumnRef; export declare const isAStar: (node: unknown) => node is Ast.A_Star; export declare const isResTarget: (node: unknown) => node is Ast.ResTarget; export declare const isColumnDef: (node: unknown) => node is Ast.ColumnDef; export declare const isConstraint: (node: unknown) => node is Ast.Constraint; export declare const isSubLink: (node: unknown) => node is Ast.SubLink; /** * Compute the full source range of an expression node by walking every * descendant and taking the union of their `range` values. Useful when * the node's own `range` is incomplete — e.g. `TypeCast.range` only * covers the `CAST` keyword or the `::` operator, not the surrounding * argument and type. * * Range values of `[0, 0]` (the parser's "no location" placeholder) * are skipped so they do not drag the start position to 0. */ export declare const getFullSourceRange: (node: unknown) => [number, number] | null; /** * Extract the unqualified PostgreSQL type name from a `ColumnDef.typeName` * value. The parser stores qualified names across numeric-string keys * ("0", "1", ...). The type name is at the highest-numbered segment; * lower segments are schema qualifiers (`pg_catalog`, `public`, ...). */ export declare const getTypeName: (typeName: unknown) => string | undefined; //# sourceMappingURL=ast.d.ts.map