import { Context, HttpClientRequestOptions, HttpClientResponse } from 'egg';
import { AbstractService } from '../../common/AbstractService.ts';
import type { AbbreviatedPackageJSONType, AbbreviatedPackageManifestType, PackageJSONType, PackageManifestType } from '../../repository/PackageRepository.ts';
import { DIST_NAMES } from '../entity/Package.ts';
import { type CreateUpdateProxyCacheTask, type UpdateProxyCacheTaskOptions, Task } from '../entity/Task.ts';
type GetSourceManifestAndCacheReturnType<T> = T extends DIST_NAMES.ABBREVIATED | DIST_NAMES.MANIFEST ? AbbreviatedPackageJSONType | PackageJSONType : T extends DIST_NAMES.FULL_MANIFESTS | DIST_NAMES.ABBREVIATED_MANIFESTS ? AbbreviatedPackageManifestType | PackageManifestType : never;
export declare class ProxyCacheService extends AbstractService {
    private readonly httpClient;
    private readonly npmRegistry;
    private readonly nfsAdapter;
    private readonly proxyCacheRepository;
    private readonly registryManagerService;
    private readonly taskService;
    private readonly cacheService;
    private readonly backgroundTaskHelper;
    getPackageVersionTarResponse(fullname: string, ctx: Context): Promise<HttpClientResponse>;
    getPackageManifest(fullname: string, fileType: DIST_NAMES.FULL_MANIFESTS | DIST_NAMES.ABBREVIATED_MANIFESTS): Promise<AbbreviatedPackageManifestType | PackageManifestType>;
    getPackageVersionManifest(fullname: string, fileType: DIST_NAMES.ABBREVIATED | DIST_NAMES.MANIFEST, versionOrTag: string): Promise<AbbreviatedPackageJSONType | PackageJSONType>;
    removeProxyCache(fullname: string, fileType: DIST_NAMES, version?: string): Promise<void>;
    replaceTarballUrl<T extends DIST_NAMES>(manifest: GetSourceManifestAndCacheReturnType<T>, fileType: T): GetSourceManifestAndCacheReturnType<T>;
    createTask(targetName: string, options: UpdateProxyCacheTaskOptions): Promise<CreateUpdateProxyCacheTask>;
    findExecuteTask(): Promise<Task<import("../entity/Task.ts").TaskBaseData> | null>;
    executeTask(task: Task): Promise<void>;
    private getRewrittenManifest;
    private storeRewrittenManifest;
    getProxyResponse(ctx: Partial<Context>, options?: HttpClientRequestOptions): Promise<HttpClientResponse>;
}
export {};
