/** * MC Version Compatibility Checker * * Evaluates plugin compatibility with the current Minecraft server version. * * @since v1.66.0 */ import { type HealthCheckConfig, type HealthComponent } from './health-types.js'; /** * Minecraft version structure */ export interface McVersion { major: number; minor: number; patch: number; raw: string; } /** * Compatibility status */ export type CompatibilityStatus = 'compatible' | 'likely_compatible' | 'possibly_compatible' | 'outdated' | 'incompatible' | 'unknown'; /** * Compatibility check result */ export interface CompatibilityCheckResult { /** Current server MC version */ serverVersion: string; /** Plugin's supported MC versions */ supportedVersions: string[]; /** Compatibility status */ status: CompatibilityStatus; /** Score (0-100) */ score: number; /** Human-readable description */ description: string; /** Highest supported MC version by the plugin */ highestSupported: string | null; } /** * Year-based versioning boundary (June 2026 sweep). * * Mojang abandoned `1.x` versioning: 26.1 ("Tiny Takeover", released * 2026-03-24) is the DIRECT SUCCESSOR of the 1.21.x line — version majors * are now the two-digit year. There are no Minecraft majors between 2 and * 24, so any parsed major >= this threshold is a year-scheme version. * * Ordering consequence: numeric comparison already ranks year versions * above legacy 1.x (26 > 1), which matches Mojang's succession — see * {@link compareMcVersions}. */ export declare const YEAR_VERSIONING_MIN_MAJOR = 25; /** * Last minor of the legacy 1.x line. 1.21.x was the final 1.x release * family; a plugin whose declared support tops out at 1.21 is "current as * of the scheme change" — its relationship to a 26.x server is UNKNOWN * (data simply predates year-versioning), not incompatible. */ export declare const FINAL_LEGACY_MINOR = 21; /** * True when a version belongs to Mojang's year-based scheme (26.1, 26.1.2, * 27.2, ...). Accepts a parsed McVersion or a raw string; unparseable * strings are NOT year versions. */ export declare function isYearVersion(version: McVersion | string): boolean; /** * Parse a Minecraft version string * * Handles both legacy (`1.21.4`) and year-based (`26.1.2`) versions — the * year scheme is plain numeric `major.minor[.patch]`, so no special casing * is needed here. */ export declare function parseMcVersion(version: string): McVersion | null; /** * Compare two MC versions * Returns: negative if a < b, positive if a > b, 0 if equal * * Year-versioning note (June 2026 sweep): Mojang's 26.1 is the successor of * the 1.21.x line, so year versions must rank ABOVE every legacy 1.x * version. Plain numeric major comparison already does this (26 > 1) — * `1.21.11 < 26.1` and `26.1 < 26.2` both hold. Pinned by tests; do not * add scheme-specific ordering here. */ export declare function compareMcVersions(a: McVersion, b: McVersion): number; /** * Calculate how many minor versions behind * * Different majors keep the conservative "10 minors behind" sentinel. * The 1.x → 26.x scheme discontinuity is deliberately NOT handled here — * {@link getCompatibilityStatus} short-circuits cross-scheme comparisons * to 'unknown'/boundary statuses before this sentinel can mislabel a * 1.21-era plugin as catastrophically behind a 26.x server. */ export declare function getMinorVersionsBehind(current: McVersion, supported: McVersion): number; /** * Check if a version string matches or is within range */ export declare function versionMatches(serverVersion: McVersion, supportedVersion: string): boolean; /** * Find the highest supported MC version from a list */ export declare function findHighestSupportedVersion(versions: string[]): McVersion | null; /** * Determine compatibility status */ export declare function getCompatibilityStatus(serverVersion: McVersion, supportedVersions: string[], knownIncompatible?: boolean): CompatibilityStatus; /** * Calculate compatibility score */ export declare function calculateCompatibilityScore(status: CompatibilityStatus, config?: HealthCheckConfig['compatibilityScoring']): number; /** * Get compatibility description */ export declare function getCompatibilityDescription(serverVersion: string, status: CompatibilityStatus, highestSupported: McVersion | null): string; /** * Check MC compatibility and return health component */ export declare function checkMcCompatibility(serverVersionStr: string, supportedVersions: string[], knownIncompatible?: boolean, config?: HealthCheckConfig['compatibilityScoring']): HealthComponent; /** * Full compatibility check result */ export declare function checkCompatibility(serverVersionStr: string, supportedVersions: string[], knownIncompatible?: boolean, config?: HealthCheckConfig['compatibilityScoring']): CompatibilityCheckResult; //# sourceMappingURL=compatibility-checker.d.ts.map