@@ -10,6 +10,8 @@ import { CachedFetchValue } from "next/dist/server/response-cache";
10
10
import type { OutgoingHttpHeaders } from "http" ;
11
11
import { getTagsFromHeaders } from "./helpers/getTagsFromHeaders" ;
12
12
13
+ type CacheHandlerType = typeof import ( '../handlers/next-15-cache-handler' ) . Next15CacheHandler ;
14
+
13
15
type NextRouteMetadata = {
14
16
status : number | undefined ;
15
17
headers : OutgoingHttpHeaders | undefined ;
@@ -80,7 +82,7 @@ export type RegisterInitialCacheOptions = {
80
82
*
81
83
*/
82
84
export async function registerInitialCache (
83
- CacheHandler : CacheHandler ,
85
+ CacheHandler : CacheHandlerType ,
84
86
options : RegisterInitialCacheOptions = { } ,
85
87
) {
86
88
const debug = typeof process . env . NEXT_PRIVATE_DEBUG_CACHE !== "undefined" ;
@@ -125,11 +127,11 @@ export async function registerInitialCache(
125
127
dev : process . env . NODE_ENV === "development" ,
126
128
} ;
127
129
128
- let cacheHandler : CacheHandler ;
130
+ let cacheHandler : InstanceType < CacheHandlerType > ;
129
131
130
132
try {
131
- cacheHandler = new Next15CacheHandler (
132
- context as ConstructorParameters < typeof Next15CacheHandler > [ 0 ] ,
133
+ cacheHandler = new CacheHandler (
134
+ context as ConstructorParameters < typeof CacheHandler > [ 0 ] ,
133
135
) ;
134
136
} catch ( error ) {
135
137
if ( debug ) {
0 commit comments