///
import { FileCacheOptions, MemoryCacheOptions, NoneCacheOptions, RedisCacheOptions } from '../config/default';
export type CacheArtifactType = 'buffer';
export type CacheArtifact = {
type: CacheArtifactType;
data: Buffer;
};
export interface Persistor {
init?: () => Promise;
flush?: () => Promise;
has: (key: string) => Promise;
read: (key: string) => Promise;
save: (key: string, buf: Buffer) => Promise;
shutdown?: () => Promise;
}
type CreateOptions = {
type: 'file';
options: FileCacheOptions;
} | {
type: 'memory';
options: MemoryCacheOptions;
} | {
type: 'redis';
options: RedisCacheOptions;
} | {
type: 'none';
options: NoneCacheOptions;
};
declare const _default: {
create: ({ type, options }: CreateOptions) => Persistor;
};
export default _default;