@trpc/next
Version:
25 lines • 1.01 kB
text/typescript
import { TRPCLink } from "@trpc/client";
import { AnyRouter, inferClientTypes, inferRouterContext } from "@trpc/server/unstable-core-do-not-import";
import { TransformerOptions } from "@trpc/client/unstable-internals";
//#region src/app-dir/links/nextCache.d.ts
type NextCacheLinkOptions<TRouter extends AnyRouter> = {
/**
* The router to call.
*/
router: TRouter;
/**
* Creates the context for each call.
*/
createContext: () => Promise<inferRouterContext<TRouter>>;
/** how many seconds the cache should hold before revalidating */
revalidate?: number | false;
} & TransformerOptions<inferClientTypes<TRouter>>;
/**
* A terminating link that calls the router directly and caches query
* results with Next.js `unstable_cache`.
*
* @see https://trpc.io/docs/client/nextjs/app-router-setup
*/
export declare function experimental_nextCacheLink<TRouter extends AnyRouter>(opts: NextCacheLinkOptions<TRouter>): TRPCLink<TRouter>;
//#endregion
//# sourceMappingURL=nextCache.d.cts.map