@@ -5,15 +5,13 @@ import crypto from 'crypto'
5
5
import { pathToRegexp , Path } from 'path-to-regexp'
6
6
import { NEXT_CACHE_IMPLICIT_TAG_ID } from 'next/dist/lib/constants'
7
7
import type {
8
- CacheHandler ,
9
- BaseLogger ,
10
8
NextCacheHandlerContext ,
11
9
CacheStrategy ,
12
10
CacheHandlerContext ,
13
11
CacheEntry ,
14
12
IncrementalCacheValue
15
13
} from '@dbbs/next-cache-handler-common'
16
- import { ConsoleLogger } from './logger'
14
+ import { ConsoleLogger , type BaseLogger } from './logger'
17
15
import { FileSystemCache } from './strategies/fileSystem'
18
16
19
17
export enum HEADER_DEVICE_TYPE {
@@ -23,6 +21,25 @@ export enum HEADER_DEVICE_TYPE {
23
21
Tablet = 'cloudfront-is-tablet-viewer'
24
22
}
25
23
24
+ export declare class CacheHandler {
25
+ static logger : BaseLogger
26
+ static cacheCookies : string [ ]
27
+ static cacheQueries : string [ ]
28
+ static cache : CacheStrategy
29
+
30
+ nextOptions : NextCacheHandlerContext
31
+ cookieCacheKey : string
32
+ queryCacheKey : string
33
+ device ?: string
34
+ serverCacheDirPath : string
35
+
36
+ constructor ( context : NextCacheHandlerContext )
37
+
38
+ get ( pageKey : string , ctx : CacheHandlerContext ) : Promise < CacheEntry | null >
39
+ set ( pageKey : string , data : IncrementalCacheValue | null , ctx : CacheHandlerContext ) : Promise < void >
40
+ revalidateTag ( tag : string ) : Promise < void >
41
+ }
42
+
26
43
export const CURRENT_CACHE_KEY_HEADER_NAME = 'x-current-cache-key'
27
44
28
45
export class Cache implements CacheHandler {
0 commit comments