File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
packages/open-next/src/types Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,29 @@ export type CachedFile =
54
54
meta ?: Meta ;
55
55
} ;
56
56
57
- export type FetchCache = Object ;
57
+ // type taken from: https://github.com/vercel/next.js/blob/9a1cd356/packages/next/src/server/response-cache/types.ts#L26-L38
58
+ export type CachedFetchValue = {
59
+ kind : "FETCH" ;
60
+ data : {
61
+ headers : { [ k : string ] : string } ;
62
+ body : string ;
63
+ url : string ;
64
+ status ?: number ;
65
+ // field used by older versions of Next.js (see: https://github.com/vercel/next.js/blob/fda1ecc/packages/next/src/server/response-cache/types.ts#L23)
66
+ tags ?: string [ ] ;
67
+ } ;
68
+ // tags are only present with file-system-cache
69
+ // fetch cache stores tags outside of cache entry
70
+ tags ?: string [ ] ;
71
+ } ;
58
72
59
73
export type WithLastModified < T > = {
60
74
lastModified ?: number ;
61
75
value ?: T ;
62
76
} ;
63
77
64
78
export type CacheValue < IsFetch extends boolean > = ( IsFetch extends true
65
- ? FetchCache
79
+ ? Partial < CachedFetchValue >
66
80
: CachedFile ) & { revalidate ?: number | false } ;
67
81
68
82
export type IncrementalCache = {
You can’t perform that action at this time.
0 commit comments