UNPKG

@bonginkan/maria

Version:

MARIA OS v5.9.5 – Self-Evolving Organizational Intelligence OS | Speed Improvement Phase 3: LLM Optimization + Command Refactoring | Performance Measurement + Run Evidence System | Zero ESLint/TypeScript Errors | 人とAIが役割を持ち、学び、進化し続けるための仕事のOS | GraphRAG ×

64 lines (63 loc) 1.9 kB
/** * CSV Format Handler * * Handles CSV serialization/deserialization with streaming support */ import { EventEmitter } from "node:events"; import type { IFormatHandler, SupportedFormat, ValidationResult } from "../../types/porter-types"; export interface CSVOptions { delimiter?: string; quote?: string; escape?: string; lineEnd?: string; header?: boolean; skipEmptyLines?: boolean; trim?: boolean; columns?: string[]; maxFieldSize?: number; maxRecords?: number; } export declare class CSVFormatHandler extends EventEmitter implements IFormatHandler { readonly format: SupportedFormat; readonly supportedOperations: ("read" | "write" | "stream")[]; private readonly defaultOptions; /** * Validate CSV data */ validate(data: unknown, schema?: unknown): Promise<ValidationResult>; /** * Serialize array of objects to CSV */ serialize(data: unknown[], options?: CSVOptions): Promise<string>; /** * Deserialize CSV string to array of objects */ deserialize(data: string, options?: CSVOptions): Promise<Array<Record<string, unknown>>>; /** * Stream serialize array of objects to CSV */ streamSerialize(data: AsyncIterable<Record<string, unknown>>, options?: CSVOptions): AsyncIterable<Buffer>; /** * Stream deserialize CSV to objects */ streamDeserialize(data: AsyncIterable<Buffer>, options?: CSVOptions): AsyncIterable<Record<string, unknown>>; /** * Parse CSV string into records */ private parseCSVString; /** * Parse single CSV line into fields */ private parseLine; /** * Serialize record to CSV line */ private serializeRecord; /** * Get format-specific health status */ getHealthStatus(): { status: "healthy" | "degraded" | "unhealthy"; details: unknown; }; }