Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/vinext/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import type { Root } from "react-dom/client";
import type { OnRequestErrorHandler } from "./server/instrumentation";
import type { CachedRscResponse, PrefetchCacheEntry } from "./shims/navigation";

// ---------------------------------------------------------------------------
// Window globals — browser-side state shared across module boundaries
Expand Down Expand Up @@ -75,8 +76,17 @@ declare global {
*
* @param href - The destination URL (may be absolute or relative).
* @param redirectDepth - Internal parameter used to detect redirect loops.
* @param navigationKind - Internal hint for traversal vs regular navigation.
* @param historyUpdateMode - Internal hint for when history should publish.
*/
__VINEXT_RSC_NAVIGATE__: ((href: string, redirectDepth?: number) => Promise<void>) | undefined;
__VINEXT_RSC_NAVIGATE__:
| ((
href: string,
redirectDepth?: number,
navigationKind?: "navigate" | "traverse" | "refresh",
historyUpdateMode?: "push" | "replace",
) => Promise<void>)
| undefined;

/**
* A Promise that resolves when the current in-flight popstate RSC navigation
Expand All @@ -93,9 +103,7 @@ declare global {
* Lazily initialised on `window` by `shims/navigation.ts` so the same Map
* instance is shared between the navigation shim and the Link component.
*/
__VINEXT_RSC_PREFETCH_CACHE__:
| Map<string, { response: Response; timestamp: number }>
| undefined;
__VINEXT_RSC_PREFETCH_CACHE__: Map<string, PrefetchCacheEntry> | undefined;

/**
* Set of RSC URLs that have already been prefetched (or are in-flight).
Expand Down
Loading
Loading