/** * This module reads a delimited file's header line and refuses one that drops a column an adapter indexes. * * A fetch module checks the file it has written against the columns its adapter reads by name, * because a renamed column reaches the adapter as an empty string on every row rather than as an error. * The check belongs here rather than in each publisher's module: every caller needs the same two steps, * and each one that wrote them again would also be a second answer to how the file is parsed. */ import type { PathBuilderLike } from "path-ts"; /** * The header line's column names. * * Read through `CSVSpliterator`, which is the reader the adapters use, rather than through * a split of a fetch module's own: which columns a publisher quotes is a property of * the edition, and a second reader would be a second answer to that question. * `columnScan: "rows"` keeps the first row from decoding the whole file. * * The default `"auto"` decodes the whole file even for one row. * * @param path The written file. * @param columnDelimiter [","] The publisher's delimiter. * @throws When the file holds no row at all, so an empty or truncated file reports itself * rather than reading as a file with no columns. */ export declare function readDelimitedHeader(path: PathBuilderLike, columnDelimiter?: string): Promise; /** * Refuse a header that doesn't name every column a caller reads. * * @param columns The header {@linkcode readDelimitedHeader} returned. * @param required The columns the adapter indexes by name. * @param context What's being checked. * This value opens the message. * @throws Naming the columns that are absent, so a renamed column is a reported failure * rather than an empty string on every row the adapter emits. */ export declare function assertHeaderColumns(columns: readonly string[], required: readonly string[], context: string): void; //# sourceMappingURL=header.d.ts.map