refactor(core): Add transition.to property to FakeNavigation

This matches the upstream changes in f19930f98a
This commit is contained in:
Andrew Scott 2025-12-03 09:56:32 -08:00 committed by Alex Rickabaugh
parent 9dd08c571a
commit 5988bdedae
2 changed files with 7 additions and 1 deletions

View file

@ -66,6 +66,7 @@ export declare class Navigation extends EventTarget {
export declare class NavigationTransition {
readonly navigationType: NavigationTypeString;
readonly from: NavigationHistoryEntry;
readonly to: NavigationDestination;
readonly finished: Promise<void>;
readonly committed: Promise<void>;
}

View file

@ -1020,7 +1020,11 @@ function dispatchNavigateEvent({
);
return;
}
const transition = new InternalNavigationTransition(navigation.currentEntry, navigationType);
const transition = new InternalNavigationTransition(
navigation.currentEntry,
event.destination,
navigationType,
);
navigation.transition = transition;
// Mark transition.finished as handled (Spec Step 33.4)
transition.finished.catch(() => {});
@ -1227,6 +1231,7 @@ class InternalNavigationTransition implements NavigationTransition {
committedReject!: (reason: Error) => void;
constructor(
readonly from: NavigationHistoryEntry,
readonly to: NavigationDestination,
readonly navigationType: NavigationTypeString,
) {
this.finished = new Promise<void>((resolve, reject) => {