@aziontech/opennextjs-azion
Version:
Azion builder for next apps
24 lines (23 loc) • 1.36 kB
TypeScript
/**
* This code was originally copied and modified from the @opennextjs/aws repository.
* Significant changes have been made to adapt it for use with Azion.
*/
import type { CacheEntryType, CacheValue, IncrementalCache, WithLastModified } from "@opennextjs/aws/types/overrides.js";
export declare const CACHE_DIR = "data-cache/_next_cache";
export declare const NAME = "azion-storage-incremental-cache";
/**
* This cache uses Workers storage.
*
*/
declare class StorageIncrementalCache implements IncrementalCache {
readonly name = "azion-storage-incremental-cache";
private readonly storageCachePrefix;
get<CacheType extends CacheEntryType = "cache">(key: string, cacheType?: CacheType): Promise<WithLastModified<CacheValue<CacheType>> | null>;
set<CacheType extends CacheEntryType = "cache">(key: string, value: CacheValue<CacheType>, cacheType?: CacheType): Promise<void>;
delete(key: string): Promise<void>;
protected getCacheURL(key: string, cacheType?: CacheEntryType, bucketPrefix?: string): string;
protected getCacheApiOrStorage(key: string, cacheType: CacheEntryType): Promise<string>;
protected setCacheApiOrStorage(key: string, value: CacheValue<CacheEntryType>, cacheType: CacheEntryType, onlyCacheApi?: boolean): Promise<void>;
}
declare const _default: StorageIncrementalCache;
export default _default;