Skip to content

Commit a8206d3

Browse files
bug: fix exporting types
1 parent 8a80289 commit a8206d3

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

packages/cache-core/src/cacheHandler.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import crypto from 'crypto'
55
import { pathToRegexp, Path } from 'path-to-regexp'
66
import { NEXT_CACHE_IMPLICIT_TAG_ID } from 'next/dist/lib/constants'
77
import type {
8-
CacheHandler,
9-
BaseLogger,
108
NextCacheHandlerContext,
119
CacheStrategy,
1210
CacheHandlerContext,
1311
CacheEntry,
1412
IncrementalCacheValue
1513
} from '@dbbs/next-cache-handler-common'
16-
import { ConsoleLogger } from './logger'
14+
import { ConsoleLogger, type BaseLogger } from './logger'
1715
import { FileSystemCache } from './strategies/fileSystem'
1816

1917
export enum HEADER_DEVICE_TYPE {
@@ -23,6 +21,25 @@ export enum HEADER_DEVICE_TYPE {
2321
Tablet = 'cloudfront-is-tablet-viewer'
2422
}
2523

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+
2643
export const CURRENT_CACHE_KEY_HEADER_NAME = 'x-current-cache-key'
2744

2845
export class Cache implements CacheHandler {

packages/common/src/types/index.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,3 @@ export interface CacheHandlerContext {
3232
softTags?: string[]
3333
serverCacheDirPath: string
3434
}
35-
36-
export declare class CacheHandler {
37-
static logger: BaseLogger
38-
static cacheCookies: string[]
39-
static cacheQueries: string[]
40-
static cache: CacheStrategy
41-
42-
nextOptions: NextCacheHandlerContext
43-
cookieCacheKey: string
44-
queryCacheKey: string
45-
device?: string
46-
serverCacheDirPath: string
47-
48-
constructor(context: NextCacheHandlerContext)
49-
50-
get(pageKey: string, ctx: CacheHandlerContext): Promise<CacheEntry | null>
51-
set(pageKey: string, data: IncrementalCacheValue | null, ctx: CacheHandlerContext): Promise<void>
52-
revalidateTag(tag: string): Promise<void>
53-
}

0 commit comments

Comments
 (0)