"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateTypeFromSchema = void 0;
const generateTypeFromSchema = (schema) => {
    if (schema.type === 'array') {
        const itemType = schema.items ? (0, exports.generateTypeFromSchema)(schema.items) : 'unknown';
        return `${itemType}[]`;
    }
    if (schema.type === 'object' && schema.properties) {
        const props = Object.entries(schema.properties).map(([key, prop]) => {
            const isRequired = schema.required?.includes(key);
            const propType = (0, exports.generateTypeFromSchema)(prop);
            return `${key}${isRequired ? '' : '?'}: ${propType}`;
        });
        return props.length > 0 ? `{ ${props.join('; ')} }` : '{}';
    }
    switch (schema.type) {
        case 'string':
            return 'string';
        case 'number':
            return 'number';
        case 'boolean':
            return 'boolean';
        default:
            return 'unknown';
    }
};
exports.generateTypeFromSchema = generateTypeFromSchema;
