import { type FoldRule } from "../ident/fold.js"; /** Qualifier roles, normalized across dialects (vendor vocabulary noted per dialect at its * config): "catalog" covers database/project, "schema" covers dataset/attached-database, * "server" is tsql's linked-server level. The object's own name is never a role — it is the * final part, always. */ export type NameRole = "server" | "catalog" | "schema"; /** A dialect's namespace shape: its qualifier roles OUTER→INNER, and the fold/delimiter rule * its identifiers obey. Declared once per dialect in src//fold.ts, doc-cited there. */ export interface QualifiedNameConfig { roles: readonly NameRole[]; rule: FoldRule; } /** A structured, dialect-resolved name. Plain frozen data like every IR node. */ export interface QualifiedName { /** The object's OWN name (the last part), delimiters stripped, as written. */ name: string; /** Every part as written, outermost first, delimiters stripped. An elided middle part is "". */ parts: string[]; /** tsql linked-server level. Absent = not written. */ server?: string; /** Catalog level (vendor: catalog / database / project). Absent = not written. */ catalog?: string; /** Schema level (vendor: schema / dataset / attached database). Absent = not written; * "" = written-and-elided (`db..table`). */ schema?: string; /** Folded identity parts (the dialect's own quoting-aware fold). COMPARE with these — never * display them, never re-fold. */ key: string[]; /** The qualified name as ONE display-ready string. Source-derived: the raw parts joined as * written (quoting kept). Synthesized: parts joined with dialect quoting where needed. */ fqn: string; } /** * Build a QualifiedName from SOURCE-derived raw parts (as they appear in the text, delimiters * intact where the user wrote them). `fqn` preserves the user's spelling and quoting exactly. */ export declare function qualifiedNameOf(rawParts: string[], config: QualifiedNameConfig): QualifiedName; /** * Build a QualifiedName from SYNTHESIZED plain parts (a provider's resolved relation — no source * text exists). `fqn` renders each part with the dialect's quoting exactly where the part needs * delimiters to round-trip; plain identifier parts stay bare. */ export declare function synthesizedQualifiedName(parts: string[], config: QualifiedNameConfig): QualifiedName;