/** * The world: the in-memory representation of a loaded dataset root, plus the * top-level semantic-rule runner. * * A `World` holds every schema and every table (as a concrete * `TableTypeBase` instance). `runSemanticRules` walks the world, asking each * structurally-valid table for its intra-table and cross-file violations, * then appends the one global rule that has to see the whole graph at once * (cycle detection). */ import { SchemaDescription, Violation } from './model'; import type { TableTypeBase } from './table-type'; /** A schema loaded from disk. */ export interface LoadedSchema { /** Schema name (the folder name). */ readonly name: string; /** Absolute path to the schema folder. */ readonly dirPath: string; /** Description from `.json`, or null if that file is missing. */ readonly description: SchemaDescription | null; /** Tables in this schema. */ readonly tables: TableTypeBase[]; } /** The whole loaded dataset root. */ export interface World { /** Absolute path to the root. */ readonly rootDir: string; /** Schemas keyed by name. */ readonly schemas: Map; /** Tables keyed by `schema.table`. */ readonly tables: Map; } /** * Run all semantic rules over a world. * * @param world The loaded dataset root. * @returns Every semantic violation found. */ export declare function runSemanticRules(world: World): Violation[];