import type { PackageInfo, PackageName, VersionSpec } from './package-types';
/**
 * Get the latest version of a package (versions[0] is always the latest)
 */
export declare function getLatestVersion(packageName: PackageName): Promise<string | null>;
/**
 * Get all available versions for a package
 */
export declare function getAvailableVersions(packageName: PackageName): Promise<string[]>;
/**
 * Get PHP versions suitable for CI/CD workflows
 * Returns the latest versions from each supported major.minor branch
 */
export declare function getPhpVersionsForWorkflow(options?: {
  supportedBranches?: string[]
  fallbackVersions?: string[]
}): string[];
/**
 * Check if a specific version is available for a package
 */
export declare function isVersionAvailable(packageName: PackageName, version: string): Promise<boolean>;
/**
 * Resolve a version specification to an actual version
 */
export declare function resolveVersion(packageName: PackageName, versionSpec?: VersionSpec): Promise<string | null>;
/**
 * Get comprehensive package information
 */
export declare function getPackageInfo(packageName: PackageName): Promise<PackageInfo | null>;
/**
 * Resolve package name to domain (handles aliases)
 */
export declare function resolvePackageDomain(packageName: PackageName): string | null;
/**
 * Get all packages that match a search term
 */
export declare function searchPackages(searchTerm: string): Promise<PackageInfo[]>;
/**
 * Get packages by category based on domain patterns
 */
export declare function getPackagesByPattern(pattern: RegExp): Promise<PackageInfo[]>;
/**
 * Get popular packages (those with many versions, indicating active development)
 */
export declare function getPopularPackages(minVersions?: number): Promise<PackageInfo[]>;
/**
 * Get recently updated packages (those with many versions, assuming frequent updates)
 */
export declare function getActivePackages(limit?: number): Promise<PackageInfo[]>;
/**
 * Validate a package specification
 */
// eslint-disable-next-line no-unused-vars
export declare function validatePackageSpec(packageSpec: string): Promise<{
  isValid: boolean
  packageName?: PackageName
  version?: string
  error?: string
}>;
/**
 * Parses a semver-ish version string.
 *
 * Tolerant of what registries actually publish: a missing patch (`0.16`), build
 * metadata (`+d5181a9c9`), and a `v` prefix. Non-numeric junk becomes 0 rather
 * than NaN, because NaN silently poisons every comparison it touches - that is
 * how a prerelease could sort above a stable release.
 */
export declare function parseVersion(version: string): ParsedVersion;
/**
 * Orders two versions, newest first. Precedence follows semver: compare
 * major/minor/patch numerically, then treat a prerelease as *lower* than the
 * release it precedes (`1.0.0-rc.1` < `1.0.0`), comparing identifiers so that
 * numeric ones sort numerically and `alpha` < `beta` < `rc`.
 */
export declare function compareVersionsDesc(a: string, b: string): number;
/**
 * Resolve a version constraint against available versions in S3 metadata.
 *
 * Ranges follow npm/semver semantics, which for `^` on a 0.x version means the
 * MINOR is pinned: `^0.16.0` is `>=0.16.0 <0.17.0`, not `>=0.16.0 <1.0.0`.
 * Zero-major releases make no compatibility promise between minors, so treating
 * `^0.16.0` as "any 0.x" hands back a toolchain that cannot build the project -
 * which is exactly what `^0.16.0` did when it resolved to 0.17.0-dev.
 *
 * Prereleases are excluded unless the constraint itself names one, again per
 * semver: `^0.16.0` must not select `0.17.0-dev`, but `^0.16.0-dev` may select
 * `0.16.0-dev.5`.
 */
export declare function resolveVersionFromMetadata(constraint: string, availableVersions: string[]): string | null;
/** A version split into its comparable parts. */
declare interface ParsedVersion {
  major: number
  minor: number
  patch: number
  prerelease: string[]
}
