import { ICacheActionToArgumentOptions, ICacheActionToHandler, ICacheActionToReturnType, ICacher } from "./i-cacher";
import { ICacherExecuteOptions } from "./i-cacher-execute-options";
import { IFileLoader } from "@wessberg/fileloader";
import { IBufferSerializer } from "./buffer-serializer/i-buffer-serializer";
import { IFileSaver } from "@wessberg/filesaver";
import { ICacherOptions } from "./i-cacher-options";
import { IHasher } from "../hasher/i-hasher";
import { IBuildConfig } from "../build-config/i-build-config";
import { IBuildLogger } from "../build-debugger/i-build-logger";
/**
 * A class that helps with caching the results of executing actions.
 */
export declare class Cacher implements ICacher {
    private readonly fileLoader;
    private readonly fileSaver;
    private readonly bufferSerializer;
    private readonly hasher;
    private readonly config;
    private readonly buildLogger;
    /**
     * The name of the file that contains a map between CacheActions and the latest seen MD5 checksums
     * @type {string}
     */
    private readonly CHECKSUM_CACHE_FILENAME;
    constructor(fileLoader: IFileLoader, fileSaver: IFileSaver, bufferSerializer: IBufferSerializer, hasher: IHasher, config: IBuildConfig, buildLogger: IBuildLogger);
    /**
     * Gets an entry from the cache
     * @param {T} action
     * @param {ICacherOptions} options
     * @returns {Promise<ICacheActionToReturnType[T] | undefined>}
     */
    getFromCache<T extends keyof ICacheActionToArgumentOptions>(action: T, options: ICacherOptions): Promise<ICacheActionToReturnType[T] | undefined>;
    /**
     * Executes an action through the cache as a proxy
     * @param {T} action
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    execute<T extends keyof ICacheActionToArgumentOptions>(action: T, args: ICacheActionToArgumentOptions[T], options: ICacherExecuteOptions<ICacheActionToHandler[T]>): Promise<ICacheActionToReturnType[T]>;
    /**
     * Performs the common functionality no matter the kind of action
     * @param {T} action
     * @param {*} checksumInput
     * @param {*} args
     * @param {ICacherExecuteOptions<ICacheActionToHandler[T]>} options
     * @returns {Promise<ICacheActionToReturnType[T]>}
     */
    private executeCommon<T>(action, checksumInput, args, options);
    /**
     * Performs the common functionality no matter the kind of Rollup action
     * @param {T} action
     * @param {*} args
     * @param {ICacherExecuteOptions<IRollupCacheActionToHandler[T]>} options
     * @param {string} [additionalCacheEntryPath]
     * @returns {Promise<IRollupCacheActionToReturnType[T]>}
     */
    private executeCommonRollup<T>(action, args, options, additionalCacheEntryPath?);
    /**
     * Executes a 'GENERATE_APP_ICON' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeGenerateAppIconsAction(args, options);
    /**
     * Executes a 'OPTIMIZE_ASSETS' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeOptimizeAssetsAction(args, options);
    /**
     * Executes a 'OPTIMIZE_ASSETS' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeStoreHashAction(args, options);
    /**
     * Executes a 'PARSE_MANIFEST_JSON' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeParseManifestJsonAction(args, options);
    /**
     * Executes a 'PARSE_INDEX_HTML' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeParseIndexHtmlAction(args, options);
    /**
     * Executes a 'PARSE_CONFIG' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeParseConfigAction(args, options);
    /**
     * Executes a 'GENERATE_BUNDLE' action through the cache
     * @param {*} args
     * @param {ICacherExecuteOptions} options
     * @returns {Promise<*>}
     */
    private executeGenerateBundleAction(args, options);
    /**
     * Gets the checksum cache map from disk
     * @param {ICacherOptions} options
     * @returns {Promise<Partial<ICacheActionToChecksumPayload>>}
     */
    private getChecksumCacheMap(options);
    /**
     * Adds the given checksum for the given action to the checksum cache map
     * @param {T} action
     * @param {*} checksum
     * @param {ICacherOptions} options
     * @returns {Promise<void>}
     */
    private addToChecksumCacheMap<T>(action, checksum, options);
    /**
     * Gets the path to the cache entry for an action
     * @param {string} appRoot
     * @param {string|CacheAction} [entry]
     * @returns {string}
     */
    private getCacheEntryPath(appRoot, entry?);
    /**
     * Returns true if the cache needs to be updated
     * @param {*} checksumInput
     * @param {CacheAction} action
     * @param {ICacherOptions} options
     * @returns {Promise<boolean>}
     */
    private cacheNeedsUpdate<T>(action, checksumInput, options);
}
