export type CacheKey = string;
/**
 * Function to create cache key from params of the async function you want to cache
 */
export type CreateCacheKeyFn<AsyncFnToCache extends AsyncFn> = (...params: Parameters<AsyncFnToCache>) => CacheKey;
type AsyncFn = (...params: any[]) => Promise<any>;
export type CreateCacheFn = <AsyncFnToCache extends AsyncFn>(createCacheKey: CreateCacheKeyFn<AsyncFnToCache>, options?: CacheOptions) => {
    withCache: (fn: AsyncFnToCache) => AsyncFnToCache;
    clearCache: (specificKey?: CacheKey) => void;
};
type CacheOptions = {
    cacheMaxSize?: number;
};
/**
 * Universal cache creator for any async function
 *
 * @param createCacheKey - function to create cache key from params of the async function you want to cache
 * @param options - optional object with cache options
 * @returns - object with two methods: withCache and clearCache.
 * "withCache" is a function that wraps the async function you want to cache.
 * "clearCache" is a function to clear the cache.
 * @example
 * const myAsyncFn = async (a: number, b: number) => a + b;
 *
 * // define here how to create cache-key for your function
 * const createExecuteQueryCacheKey: CreateCacheKeyFn<typeof myAsyncFn> = (a, b) => `${a}+${b}`;
 *
 * const { withCache, clearCache } = createCache(createExecuteQueryCacheKey);
 * const executeQueryWithCache = withCache(executeQuery);
 */
export declare const createCache: CreateCacheFn;
export {};
