import { OneOrMany, SourceRecord } from "../source.js"; import { LicenseMatch } from "../utilities/license-identification.js"; //#region src/lib/sources/license-file.d.ts /** * A license file record. The `type` discriminator is always present so the * framework's deep-strip never collapses the record to a half-shape: * * - `type: 'spdx'` — normalized text matches a template exactly, or the file * explicitly points to a license. * - `type: 'modified'` — a close template was found, but the text differs. * - `type: 'uncertain'` — a weaker or ambiguous candidate was found. * - `type: 'unknown'` with no `match` — a license file was located on disk but * its contents do not match any SPDX template (e.g. proprietary "All Rights * Reserved" notices). The `source` path is still retained on the surrounding * record. Downstream consumers that need to detect a proprietary project can * either check `data.type === 'unknown'` or fall back to the package manifest * sentinel (`license: "UNLICENSED"` in package.json). */ export type LicenseFileRecord = { match?: LicenseMatch; type: 'modified' | 'spdx' | 'uncertain' | 'unknown'; }; export type LicenseFileData = OneOrMany> | undefined; //#endregion