import { Datasource } from '../datasource';
import type { GetReleasesConfig, ReleaseResult } from '../types';
type PackageReleases = Map<string, string[]>;
interface RegistryCache {
    lastSync: Date;
    packageReleases: PackageReleases;
    contentLength: number;
    isSupported: boolean;
    registryUrl: string;
}
export declare const memCache: Map<string, RegistryCache>;
export declare class VersionsDatasource extends Datasource {
    readonly id: string;
    private isInitialFetch;
    constructor(id: string);
    getRegistryCache(registryUrl: string): RegistryCache;
    getReleases({ registryUrl, packageName, }: GetReleasesConfig): Promise<ReleaseResult | null>;
    /**
     * Since each `/versions` reponse exceed 10MB,
     * there is potential for a memory leak if we construct slices
     * of the response body and cache them long-term:
     *
     *   https://bugs.chromium.org/p/v8/issues/detail?id=2869
     *
     * This method meant to be called for `version` and `packageName`
     * before storing them in the cache.
     */
    private copystr;
    private updatePackageReleases;
    updateRubyGemsVersions(regCache: RegistryCache): Promise<void>;
    private updateRubyGemsVersionsPromise;
    syncVersions(regCache: RegistryCache): Promise<void>;
}
export {};
