/** * Reconstructs a nested object structure from a flat object with dot or square bracket notation keys. * Handles arrays, nested objects, and escaped special characters. * * @param obj - The flat object with dot or square bracket notation keys. * @returns A nested object structure preserving the original hierarchy. * * @example * // Basic dot notation * fromDotNotation({ 'user.name': 'John', 'user.address.city': 'NY' }); * // { user: { name: 'John', address: { city: 'NY' } } } * * @example * // Array indices with square brackets * fromDotNotation({ 'items[0].name': 'Laptop', 'items[1].name': 'Phone' }); * // { items: [{ name: 'Laptop' }, { name: 'Phone' }] } * * @example * // Escaped dots in property names * fromDotNotation({ 'config\\.dev.port': 3000 }); * // { 'config.dev': { port: 3000 } } * * @example * // Mixed arrays and objects * fromDotNotation({ 'users[0].name': 'Alice', 'users[0].age': 30, 'count': 1 }); * // { users: [{ name: 'Alice', age: 30 }], count: 1 } * * @example * // Real-world: Reconstruct from flattened form data * const formData = { * 'profile.firstName': 'John', * 'profile.lastName': 'Doe', * 'addresses[0].street': '123 Main St', * 'addresses[0].city': 'NYC' * }; * fromDotNotation(formData); * // { * // profile: { firstName: 'John', lastName: 'Doe' }, * // addresses: [{ street: '123 Main St', city: 'NYC' }] * // } * * @note Array indices in square brackets create array elements at the specified positions. * @note Dots can be escaped with backslashes to represent literal dots in property names. * @note Opposite operation of flattenObject(). * @note Automatically detects whether to create arrays or objects based on next key. * @note Useful for form data parsing and API request handling. * * @complexity Time: O(n * d), Space: O(n) - Where n is keys, d is average path depth */ export declare function fromDotNotation(obj: Record): Record; //# sourceMappingURL=fromDotNotation.d.ts.map