import { type LicenseDecision } from "@mailwoman/license/decision"; import { SourceOperation } from "@mailwoman/license/operations"; import { type LicenseRequest } from "@mailwoman/license/tree"; import type { PathBuilderLike } from "path-ts"; import { type AddressSourceRecord, type AddressSourceRegister } from "#source-register/types"; /** * Resolves the path of the committed register through the package's `./data/*` export. * * Resolution happens on call so that importing this module works before the build has written the register. */ export declare function addressSourceRegisterPath(): string; /** * Replaces generated license decisions with recorded ones that share a license id. * * The build generates an `unchecked` decision for each license and rewrites the register * whole, so reviewed decisions live in a separate input and merge here. * * @throws When a recorded decision refers to a license that the generated set lacks. * Such a decision is a typo or refers to a removed source. */ export declare function applyLicenseDecisions(generated: readonly LicenseDecision[], recorded: ReadonlyMap>): LicenseDecision[]; /** * Returns every reason that a source may not enter a training corpus, or an empty array when it may. * * `request` names the action and its offering. * The decision tree reads the source's license decision for it, and this function adds the register * row's own blockers: its status, its address roles, its coverage and its personal-data review. * * The function returns reasons so that callers can tell the different blockers apart. */ export declare function ingestEligibilityProblems(source: AddressSourceRecord, register: AddressSourceRegister, request?: Pick): readonly string[]; /** * Returns one message for each structural problem in a register. * * The content digest is checked separately on read, because the build audits registers * before it writes a digest. */ export declare function auditAddressSourceRegister(register: AddressSourceRegister): string[]; /** * Computes the SHA-256 digest of the register without its `contentDigest` field. * * The build and the read audit share this function so that they serialize identically. * The digest covers the parsed object, so reformatting the file keeps it valid. * * Key order is part of the serialization, so reordering keys by hand changes the digest. */ export declare function registerContentDigest(register: AddressSourceRegister): string; /** * Reads the committed register and checks its digest and structure. * * @throws When the file doesn't parse or the audit reports a problem. * The message lists every problem. */ export declare function readAddressSourceRegister(path?: PathBuilderLike): Promise; //# sourceMappingURL=register.d.ts.map