import IOSchema from '../schema.js'; import IODefinitions from '../../core/definitions.js'; import '../types/memberdef.js'; import '../schema-types.js'; /** * Result of inferring definitions from data */ interface InferredDefs { definitions: IODefinitions; rootSchema: IOSchema; } /** * Infers Internet Object definitions from plain JavaScript data. * * This utility analyzes the structure and types of the input data * and generates proper Definitions with: * - `$schema` for the root object (default schema) * - Named schemas like `$borrowedBy`, `$membershipType` for nested objects * * Implements Deep Multi-Pass Inference: * - Phase 1: Discovery - traverse data and identify all schema types * - Phase 2: Collection - gather ALL instances of each schema globally * - Phase 3: Conflict Resolution - resolve name conflicts for same key at different paths * - Phase 4: Merging - merge all instances to build comprehensive schemas * - Phase 5: Finalization - set up definitions with proper ordering * * @param data - The JavaScript data to infer definitions from * @returns InferredDefs containing Definitions and the root schema */ declare function inferDefs(data: any): InferredDefs; export { type InferredDefs, inferDefs as default, inferDefs };