import { type LicenseDecision } from "@mailwoman/license/decision"; import { type CorpusSourceInput, type CorpusSourceInputs, type CorpusSourceMapping } from "#source-register/corpus-inputs"; import type { AddressSourceRegister } from "#source-register/types"; /** * The SPDX prefix for a license the SPDX list omits. */ export declare const LICENSE_REF_PREFIX = "LicenseRef-"; /** * The id one license decision contributes to a row's `license` column. */ export declare function decisionLicenseID(decision: LicenseDecision): string; /** * The license decisions a source's register inputs point at, one per distinct `licenseID` in input order. * * `missing` lists each input whose `license` names a decision the register doesn't declare. * A caller decides whether that's a refusal or a recorded gap. */ export declare function inputDecisions(inputs: readonly CorpusSourceInput[], decisions: ReadonlyMap): { found: Decision[]; missing: CorpusSourceInput[]; }; /** * The `license` value for rows of a source, or `null` when the mapping lists no register source. * * @throws When an input points at a license decision the register doesn't declare. */ export declare function mappingLicenseID(mapping: CorpusSourceMapping, decisions: ReadonlyMap): string | null; /** * Answers the `license` value for each corpus source. */ export interface RowLicenses { /** * The license id for rows of `source`, or `null` when the source has none. */ licenseOf(source: string): string | null; /** * The license id for rows of `source`. * * @throws When the source has none, naming `context`. */ require(source: string, context: string): string; } /** * Builds the lookup over an already-read register and source table. */ export declare function createRowLicenses(register: Pick, inputs: CorpusSourceInputs): RowLicenses; /** * `rows` with each `license` set to its source's license id, appended as the last key. * * A builder writing its own schema calls it before a row reaches a file. * * @throws When a row's source has no license id, naming `context`. */ export declare function stampRowLicenses(rows: Iterable, context: string, licenses?: RowLicenses): Promise>; /** * The lookup over the committed register and `corpus-source-inputs.json`. * * It reads both files without auditing them, because the audit runs where a build admits its sources. */ export declare function committedRowLicenses(): Promise; /** * The two committed files {@linkcode committedRowLicenses} reads, so a build * can fingerprint the license ids it stamped. */ export declare function committedRowLicenseInputs(): { register: string; corpusSourceInputs: string; }; //# sourceMappingURL=row-license.d.ts.map