import type { SchemaProvider } from "./schema-provider.js"; export interface Column { name: string; type?: string; /** NOT NULL-ness, when the mapping states it. Absent = unknown — never guessed. */ nullable?: boolean; } /** A leaf is either a bare type string, or the object form for declaring nullability (for * type-only, use the bare string). `nullable` is required — see the header note. */ export type SchemaLeaf = string | { type?: string; nullable: boolean; }; export type SchemaMapping = { [key: string]: SchemaMapping | SchemaLeaf; }; export declare class Schema implements SchemaProvider { /** A declared mapping is a CLOSED world: a miss means the table does not exist (unknown-table fires). */ readonly world: "closed"; /** A full upfront mapping's answers never change, so its invalidation signal is constant 0 — a * memo keyed on a Schema never has to invalidate (contrast CallbackSchema, which bumps). */ readonly version = 0; private readonly mapping; /** Per-dialect lazy index cache — one Schema instance serves files of different dialects (the * LSP reality: one workspace schema, many open documents each with their own dialect). Keyed * by the dialect tag itself; `undefined` (no dialect) gets its own row — today's legacy fold. */ private readonly indexes; constructor(mapping: SchemaMapping); /** Columns for a table identified by its name parts, or undefined if unknown. `parts` are RAW * (unfolded) — the fold for `dialect` happens here, once. Resolution is exact-path first, then * UNIQUE suffix match on part boundaries (#38): a partial qualification (`gold.orders` for * declared `prod.gold.orders`) resolves; a nonexistent qualified path or an ambiguous bare * name is a MISS (closed world: unknown table / ambiguity diagnosed by the caller via * `tableCandidates`), never silently some same-named table from another schema. */ columnsFor(parts: string[], dialect?: string): Column[] | undefined; /** Every declared table whose full path ends with `parts` (folded, part-boundary suffix) — the * candidates a reference COULD mean. Exactly one = resolvable; several = ambiguous (the caller * diagnoses, naming them); none = unknown. Exact full-path hits return just that hit. */ tableCandidates(parts: string[], dialect?: string): string[][]; private matches; /** The bare names of every table in the catalog — the table-name candidate list for completion. * (Names are the folded last path part; a fully-qualified path resolves via columnsFor.) */ tables(dialect?: string): string[]; /** The immediate children of a namespace path (#38 stage 6): segment completion after a * qualifier dot. `prefixParts` are RAW (as typed); matching folds per level. Names return AS * DECLARED (display), each the NEXT SEGMENT only — a completion client replaces the token at * the caret, so a full path would double-insert. [] when the prefix names no namespace. */ childrenOf(prefixParts: string[], dialect?: string): { name: string; kind: "namespace" | "table"; }[]; private indexFor; private ingest; } /** * Parse a Databricks/Spark struct type string into its fields, or undefined if `type` * is not a struct (a primitive, array, map, or anything unparseable — callers stop there). * Handles nesting: a field's `type` may itself be `struct<…>` and is parsed on demand. * "struct" -> [{name:"city",type:"string"}, {name:"zip",type:"int"}] */ export declare function parseStructFields(type: string): Column[] | undefined;