import { CacheHandler, CacheHandlerContext, CacheHandlerValue } from 'next/dist/server/lib/incremental-cache';
import { IncrementalCacheKind, IncrementalCacheValue } from 'next/dist/server/response-cache/types';
import { Revalidate } from 'next/dist/server/lib/revalidate';

interface FileCacheValueContext {
    kind: IncrementalCacheKind;
    revalidate?: Revalidate;
    fetchUrl?: string;
    fetchIdx?: number;
    tags?: string[];
    softTags?: string[];
    isRoutePPREnabled?: boolean;
    isFallback: boolean | undefined;
}

declare class CustomCacheHandler implements CacheHandler {
    private flushToDisk;
    private memoryCache;
    private fileCache?;
    constructor(options: CacheHandlerContext);
    revalidateTag(args: string[]): Promise<void>;
    get(key: string, ctx: FileCacheValueContext): Promise<CacheHandlerValue | null>;
    set(key: string, data: IncrementalCacheValue | null, ctx: FileCacheValueContext): Promise<void>;
    resetRequestCache(): void;
    static normalizeTags(args: string | string[]): string[];
}

export { CustomCacheHandler as CacheHandler, CustomCacheHandler as default };
