import type { PluginManifestV2, PluginPlatform } from "./manifest-types.js";
export interface ParsedSemVer {
    readonly major: number;
    readonly minor: number;
    readonly patch: number;
    readonly prerelease: readonly (string | number)[];
    readonly build: readonly string[];
}
export type PluginApiNegotiationCode = "api.invalid-range" | "api.incompatible-major" | "api.unsupported-version";
export type PluginApiNegotiationResult = {
    readonly ok: true;
    readonly version: string;
    readonly major: number;
} | {
    readonly ok: false;
    readonly code: PluginApiNegotiationCode;
    readonly requestedRange: string;
    readonly supportedVersions: readonly string[];
};
export type PluginCompatibilityResult = {
    readonly ok: true;
    readonly version: string;
    readonly major: number;
    readonly platform: PluginPlatform;
} | {
    readonly ok: false;
    readonly code: PluginApiNegotiationCode | "platform.unsupported";
    readonly requestedRange: string;
    readonly supportedVersions: readonly string[];
    readonly platform: string;
};
export declare function parseSemVer(value: unknown): ParsedSemVer | null;
export declare function isCanonicalSemVer(value: unknown): value is string;
export declare function compareSemVer(left: ParsedSemVer, right: ParsedSemVer): number;
export declare function isSupportedPluginApiRange(value: unknown): value is string;
export declare function pluginApiRangeAcceptsVersion(range: string, version: string): boolean;
export declare function negotiatePluginApiVersion(requestedRange: string, supportedVersions?: readonly string[]): PluginApiNegotiationResult;
export declare function negotiatePluginCompatibility(manifest: Pick<PluginManifestV2, "apiVersion" | "platforms">, platform: string, supportedVersions?: readonly string[]): PluginCompatibilityResult;
