/** * DataLex contract registry — the consumer side of the manifest-spec * `datalex_contract` interop pattern. * * Reads a DataLex manifest (JSON file) and indexes its contracts by id so * the DQL compiler can resolve `datalex_contract = "domain.Entity.name@1"` * references at compile time. Resolution failures are returned as * structured `ContractResolution` values; they become DQL compiler * diagnostics in the analyzer wiring (Phase 2.1 follow-up). * * See: * - manifest-spec/docs/interop.md (resolution rules) * - manifest-spec/schemas/v1/datalex-manifest.schema.json (source of truth) */ import { type ContractRef, type ContractResolution, type DataLexConformance, type DataLexContract, type DataLexManifest, type DataLexRelationship, type JoinPathResolution } from './types.js'; interface IndexedContract { contract: DataLexContract; domain: string; entity: string; } /** * Loads a DataLex manifest into an indexed contract lookup. One registry * instance per DQL project. Re-create or call `reload()` between * compilation runs if the manifest changes on disk. */ export declare class DataLexContractRegistry { private readonly source; private readonly byId; private readonly diagnostics; private readonly relationshipList; private readonly conformanceList; constructor(source?: { manifestPath?: string; manifest?: DataLexManifest; }); /** Reload from the configured source. Useful when the manifest is regenerated mid-session. */ reload(): void; /** * Resolve a `datalex_contract` reference from a DQL block. * * The resolution rules match `manifest-spec/docs/interop.md`: * - The ref MUST parse as `..` with an * optional `@` suffix. Otherwise: `malformed_ref`. * - The id MUST exist in the registry. Otherwise: `not_found`. * - If a version is pinned, a contract with that version MUST exist * under the id. Otherwise: `version_mismatch`. * - If no version is pinned, the highest version wins; the caller may * emit a "version-pinning recommended" warning separately. */ resolve(ref: ContractRef): ContractResolution; /** All contracts known to this registry, in stable id-then-version order. */ list(): IndexedContract[]; /** True when the registry was constructed from a real source. */ isLoaded(): boolean; /** Diagnostics emitted while loading the manifest (parse errors, schema drift, etc.). */ loadDiagnostics(): string[]; /** All typed relationships from the manifest (any layer), in load order. */ relationships(): DataLexRelationship[]; /** All concept-to-physical conformance records from the manifest. */ conformance(): DataLexConformance[]; /** * Conformance record for a business concept (e.g. "Customer"), so a consumer * can resolve its canonical join key and the physical models that realize it. * Matches case-insensitively on concept name, and on domain when provided. */ conformanceFor(concept: string, domain?: string): DataLexConformance | undefined; /** * Resolve a grain-safe join path between two entities. Returns the connecting * relationship oriented base -> target, with `fansOut` set when joining * `target` onto `base` can multiply base rows. Column-carrying (logical / * physical) relationships are preferred over column-less conceptual ones. */ joinPath(baseEntity: string, targetEntity: string, opts?: { baseDomain?: string; targetDomain?: string; }): JoinPathResolution; private endpointMatches; private invertCardinality; private loadFromDisk; private indexManifest; } export {}; //# sourceMappingURL=registry.d.ts.map