/** * @file Pure helpers over the standard OSV advisory schema. When a check has a * machine-readable advisory (an OSV record) the affected-version set is a * deterministic computation over that data — no model extraction needed. */ /** * Compare two semver versions. Returns -1, 0, or 1. */ export declare function compareSemverVersions(a: string, b: string): number; /** * Test whether a version is affected by one `affected` entry: either it is * explicitly listed in `versions`, or it falls inside any of the entry's * ranges. */ export declare function isVersionAffectedByEntry(affected: OsvAffected, version: string): boolean; export interface OsvRangeEvent { fixed?: string | undefined; introduced?: string | undefined; } export interface OsvRange { events: OsvRangeEvent[]; type: string; } export interface OsvAffected { ranges?: OsvRange[] | undefined; versions?: string[] | undefined; } export interface OsvAdvisory { affected: OsvAffected[]; } /** * Test whether a version falls inside one OSV range. Events are walked in * order: an `introduced` opens an affected window and a `fixed` closes it, so a * version is affected when it is `>= introduced` and `< fixed` for any open * pair. An `introduced` with no closing `fixed` leaves the window open to every * higher version. */ export declare function isVersionAffectedByRange(range: OsvRange, version: string): boolean; /** * Return the subset of `available` that the advisory marks affected, preserving * the input order. A version is affected when any `affected` entry names it in * `versions` or covers it with a range. */ export declare function osvVulnerableVersions(advisory: OsvAdvisory, available: string[]): string[];