/** * JSON Schema Default Value Extraction * * Utilities to recursively extract default values from JSON Schema definitions. * Priority order: * 1. Explicit `default` property (highest) * 2. First item of `examples` array * 3. `const` value * 4. First `enum` value * 5. Smart type-based defaults (computed) */ import type { JSONSchemaDefinition } from './schema-types'; /** * Extract default values from a JSON Schema definition. * * Recursively walks the schema and builds an object containing all defined defaults. * For object types, extracts defaults only for required properties. * For nullable types (union with null), returns null. * For arrays with minItems, generates the minimum required items. * * @param schema - The JSON Schema to extract defaults from * @returns The extracted default value, or undefined if none found * * @example * ```typescript * const schema = { * type: 'object', * properties: { * name: { type: 'string' }, * age: { type: 'integer', minimum: 0, maximum: 120 }, * active: { type: 'boolean' } * }, * required: ['name', 'age'] * } * const defaults = extractSchemaDefaults(schema) * // { name: '', age: 60 } // only required props, smart defaults * ``` */ export declare function extractSchemaDefaults(schema: JSONSchemaDefinition): unknown;