import { InferredType } from './types'; /** * Infers the TypeScript-compatible type of a given JavaScript value. * * This function is designed to handle primitives (string, number, boolean), arrays, objects, * promises, and mixed types. It recursively analyzes the structure of the value to provide * a corresponding inferred type, handling both simple and complex structures. * * @param {any} value - The JavaScript value for which the type needs to be inferred. * This can be a primitive, object, array, or Promise. * * @returns {InferredType} - Returns the inferred type of the value: * - 'string', 'number', 'boolean' for primitive values * - 'undefined' for undefined values * - 'null' for null values * - 'mixed' for arrays containing elements of different types * - 'Promise' for Promise objects * - 'unknown[]' for empty arrays * - Nested objects are recursively inferred and returned as a type map * - Throws an error for unsupported types like functions. * * Example: * * inferType(123) // Returns 'number' * inferType([1, 'a', true]) // Returns ['mixed'] * inferType({ id: 1, name: 'A' }) // Returns { id: 'number', name: 'string' } * inferType(Promise.resolve()) // Returns 'Promise' */ export declare function inferType(value: any): InferredType; /** * Generates a TypeScript type definition from an inferred structure. * * This function takes an object and generates a TypeScript type definition * by recursively traversing the object structure and inferring types for * its properties. It supports complex nested objects, arrays, and primitive types. * * @param {object} obj - The object whose structure will be inferred and used * to generate a TypeScript type definition. * @param {string} [typeName='GeneratedType'] - The name to assign to the * generated TypeScript type. * * @returns {string} - A string representing the generated TypeScript type definition. * If the object is empty, an empty type (`{}`) is generated. * If the object contains nested structures or arrays, they are * recursively processed and reflected in the type definition. * * Example: * * const obj = { id: 1, name: "Anthony", tasks: ["code", "test"] }; * generateTypeScriptType(obj, 'MyType'); * // Returns: * // type MyType = { * // id: number; * // name: string; * // tasks: string[]; * // }; */ export declare function generateTypeScriptType(obj: object, typeName?: string): string;