import type { RawDocument } from '@levo.libraries/types'; import type { LemaCollection } from '../collection'; /** * Transform data to string format based on field kind for CSV export * * Converts complex data structures into string representations suitable * for CSV export. Handles various field types including dates, arrays, * files, locations, and nested records with recursive processing. * * @param item - Raw document data to be transformed * @param fields - Field definitions from the Lema collection * @returns Transformed document with all values converted to strings * * @example * ```typescript * const data = { * name: 'John Doe', * created_at: '2024-01-01T00:00:00Z', * tags: ['tag1', 'tag2'], * is_active: true * }; * * const fields = [ * { key: 'name', kind: 'string' }, * { key: 'created_at', kind: 'date' }, * { key: 'tags', kind: 'array-string' }, * { key: 'is_active', kind: 'boolean' } * ]; * * const result = stringify(data, fields); * // Returns: { * // name: 'John Doe', * // created_at: '2024-Jan-01 12:00 AM UTC', * // tags: 'tag1, tag2', * // is_active: 'Yes' * // } * ``` */ export declare const stringify: (item: RawDocument, fields: LemaCollection["fields"], useCollectionId?: boolean) => RawDocument;