import type { DatedFact, FactAssessment, FactLabels, FactPolicy, FactsAssessment } from './types.js'; /** * Judge one dated fact at request time. It answers "may I show this?" and * never throws because of bad data. * * Order of checks, first match wins: * 1. A missing or blank `source`, an unparseable `checkedAt` or `expiresAt`, * or a `checkedAt` in the future beyond the kit's grace (14 hours for a * bare date, none for a timestamp) gives level 'invalid', display * 'withhold'. This fails closed. For an unparseable date the `reason` * names what is wrong (fraction digits, separator, timezone, offset form, * partial date); the grammar itself is not widened. * 2. `expiresAt` reached gives 'expired' and 'withhold'. `boundary` picks * whether exactly-at counts: 'inclusive' (the default) withholds AT the * instant, 'exclusive' shows AT it and withholds from the next * millisecond. A bare-date `expiresAt` is UTC midnight at the start of that * date. * 3. No thresholds (neither `fact.policy` nor `defaults`) gives 'invalid'. * 4. Otherwise the age gives 'fresh' (show), 'aging' (caveat) or 'stale' * (caveat, or withhold when the policy's `staleDisplay` is 'withhold'). * Boundaries are the kit's usual: inclusive thresholds on floored whole * days. * * `fact.policy` replaces `defaults` thresholds for that fact. `staleDisplay` * falls back field by field: fact policy, then defaults, then 'caveat'. * * `labels` reuses the kit's messages pattern for the short `label`. * * @throws {TypeError} for programmer errors: `now` not a valid Date, a fact * that is not an object, a policy, defaults, `staleDisplay`, `boundary` or * `labels` of the wrong type, or a label function that returns a non-string. * @throws {RangeError} for thresholds that are numbers but out of range * (negative, fractional, or warnAfterDays above staleAfterDays). */ export declare function assessFact(fact: DatedFact, now: Date, defaults?: FactPolicy, labels?: FactLabels): FactAssessment; /** * Judge many facts against one clock and one set of defaults. Each fact gets * the same verdict `assessFact` would give it. `facts` must be an array * without holes; `results` keeps input order. See `FactsAssessment`. */ export declare function assessFacts(facts: readonly DatedFact[], now: Date, defaults?: FactPolicy, labels?: FactLabels): FactsAssessment;