import csv from 'csv-parser'; import type { Node } from '@pgsql/types'; export declare const parse: >(path: string, opts?: csv.Options) => Promise; export declare const readConfig: (config: string) => unknown; interface FieldOptions { type?: string; from?: string | string[]; parse?: (value: T) => T; wrap?: string[]; wrapAst?: (val: Node) => Node; cast?: string; schema?: string; table?: string; refType?: string; refKey?: string; refField?: string; required?: boolean; } /** * Error thrown when a required field is missing or has an invalid value */ export declare class ValidationError extends Error { readonly fieldName: string; readonly rawValue: unknown; readonly expectedType: string; readonly reason: string; constructor(fieldName: string, rawValue: unknown, expectedType: string, reason: string); } type CoercionFunc = (record: Record) => Node; interface ConfigFields { [key: string]: string | FieldOptions; } export interface GlobalParseOptions { preserveEmptyStrings?: boolean; } interface Config { fields: ConfigFields; preserveEmptyStrings?: boolean; } interface TypesMap { [key: string]: CoercionFunc; } export declare const parseTypes: (config: Config) => TypesMap; export {};