/**
 * CSV Service
 *
 * Parses, stringifies, and filters CSV data for dataset entities.
 * Conventional CSV: the header row is the column list, every cell is a
 * string. There is no typed column schema — callers derive columns from the
 * header. Uses csv-parse and csv-stringify for reliable CSV handling.
 */
import type { DatasetRow } from '../core/validation.js';
export interface DatasetFilter {
    [column: string]: string | {
        gte?: string | number;
        lte?: string | number;
        contains?: string;
    };
}
export declare class CSVService {
    /**
     * Parse CSV text into string-keyed rows. The header row supplies the
     * column names. Returns an empty array for empty CSV or header-only CSV.
     */
    parseRows(csvText: string): DatasetRow[];
    /**
     * Column names from the CSV header row. Empty array for empty CSV.
     */
    columns(csvText: string): string[];
    /**
     * Stringify rows back to CSV text. `columns` fixes the column order and set;
     * cells missing from a row serialize empty, keys not in `columns` are
     * dropped. With `includeHeader: false` only the data rows are emitted (used
     * to append rows after an existing body without rewriting it).
     */
    stringifyRows(rows: DatasetRow[], columns: string[], includeHeader?: boolean): string;
    /**
     * Filter rows. Supports equality (`{ col: 'x' }`), substring
     * (`{ col: { contains } }`), and range (`{ col: { gte, lte } }`). Range
     * comparisons are numeric when both the cell and the bound parse as finite
     * numbers, otherwise lexical — sensible defaults for an untyped CSV.
     */
    filterRows(rows: DatasetRow[], filter: DatasetFilter): DatasetRow[];
}
