/** * A corpus adapter over an evaluation source's record reader. * * The adapter and the evaluation source read the publisher's file through one function, * so a fix to the reader reaches both. * A record holds only the address components the reader chose, never the publisher's * name for the site or the organization, so a row cannot join an address to a * person a small charity's name could identify. * * The row is rendered by the country's codex layout, and its id is content-addressed * over the rendered components. * Two records at one address are one row, and the second is counted * under {@linkcode EvaluationAdapterRefusal.Duplicate}. */ import type { PathBuilderLike } from "path-ts"; import type { EvaluationRecordReading, EvaluationSource } from "#evaluation/source"; import { type AddressRole, type CanonicalRow, type CorpusAdapter } from "#types"; /** * Why an address record the reader admitted yielded no corpus row. */ export declare const EvaluationAdapterRefusal: { /** * The country's layout doesn't print every component the record holds. */ readonly Unrenderable: "row:unrenderable"; /** * Another record already produced this exact row. */ readonly Duplicate: "row:duplicate"; }; /** * What an adapter over an evaluation source's reader declares beyond the source itself. */ export interface EvaluationCorpusAdapterSpec { /** * The adapter id, written as a literal `*_ADAPTER_ID` constant in the adapter's module * so the `wire-identifiers` check can read it. * It must equal the evaluation source's id. */ id: string; /** * The evaluation source whose id, country and license the adapter stamps on every row. */ source: Pick; /** * The `SourceRegister` value naming the publication. */ register: string; /** * The adapter stamps this BCP 47 locale on every row. */ locale: string; addressRole: AddressRole; description: string; /** * The record reader the evaluation source also calls, over the adapter's input file. */ read(path: PathBuilderLike): AsyncIterable; } /** * One reader's verdict as a corpus row, or the reason it yields none. */ export declare function evaluationRecordRow(spec: Pick, reading: EvaluationRecordReading): { readonly admitted: CanonicalRow; } | { readonly refused: string; }; /** * A corpus adapter, under the evaluation source's id, that emits each record its reader admits. * * @throws When `spec.id` differs from the evaluation source's id. */ export declare function createEvaluationCorpusAdapter(spec: EvaluationCorpusAdapterSpec): CorpusAdapter; //# sourceMappingURL=corpus-adapter.d.ts.map