mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(router): Add missing types to transition (#60307)
The 'types' property was added recently and is available in all browsers that support view transitions fixes #60285 PR Close #60307
This commit is contained in:
committed by
Jessica Janiuk
parent
0142ae1c8e
commit
1226eaad51
@@ -1117,6 +1117,7 @@ export interface ViewTransitionInfo {
|
||||
ready: Promise<void>;
|
||||
updateCallbackDone: Promise<void>;
|
||||
skipTransition(): void;
|
||||
readonly types: Set<string>;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,12 @@ export interface ViewTransitionInfo {
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/skipTransition
|
||||
*/
|
||||
skipTransition(): void;
|
||||
|
||||
/**
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition#browser_compatibility
|
||||
* @see https://developer.chrome.com/docs/web-platform/view-transitions/same-document#default_style_and_transition_reference
|
||||
*/
|
||||
readonly types: Set<string>;
|
||||
};
|
||||
/**
|
||||
* The `ActivatedRouteSnapshot` that the navigation is transitioning from.
|
||||
@@ -125,7 +131,8 @@ export function createViewTransition(
|
||||
// routes (the DOM update). This view transition waits for the next change detection to
|
||||
// complete (below), which includes the update phase of the routed components.
|
||||
return createRenderPromise(injector);
|
||||
});
|
||||
// TODO(atscott): Types in DefinitelyTyped are not up-to-date
|
||||
}) as ViewTransition & {readonly types: Set<string>};
|
||||
const {onViewTransitionCreated} = transitionOptions;
|
||||
if (onViewTransitionCreated) {
|
||||
runInInjectionContext(injector, () => onViewTransitionCreated({transition, from, to}));
|
||||
|
||||
Reference in New Issue
Block a user