Skip to content

Commit f464e32

Browse files
authored
fix(typegen): merge cacheLife types into next/cache instead of shadowing it (#98252)
1 parent 64596d1 commit f464e32

9 files changed

Lines changed: 148 additions & 325 deletions

File tree

‎packages/next/cache.d.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { cacheTag } from 'next/dist/server/use-cache/cache-tag'
2020

2121
export { cacheTag }
2222

23+
export interface CacheLifeProfiles {}
24+
2325
/**
2426
* Cache this `"use cache"` for a timespan defined by the `"default"` profile.
2527
* ```
@@ -128,7 +130,9 @@ export function cacheLife(profile: 'max'): void
128130
*
129131
* You can define custom profiles in `next.config.ts`.
130132
*/
131-
export function cacheLife(profile: string): void
133+
export function cacheLife(
134+
profile: keyof CacheLifeProfiles extends never ? string : never
135+
): void
132136

133137
/**
134138
* Cache this `"use cache"` using a custom timespan.

0 commit comments

Comments
 (0)