|
6 | 6 | * found in the LICENSE file at https://angular.dev/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -/// <reference types="dom-view-transitions" /> |
10 | | - |
11 | 9 | import {DOCUMENT} from '@angular/common'; |
12 | 10 | import { |
13 | 11 | afterNextRender, |
@@ -56,37 +54,11 @@ export interface ViewTransitionsFeatureOptions { |
56 | 54 | * @experimental |
57 | 55 | */ |
58 | 56 | export interface ViewTransitionInfo { |
59 | | - // TODO(atscott): This type can/should be the built-in `ViewTransition` type |
60 | | - // from @types/dom-view-transitions but exporting that type from the public API is currently not |
61 | | - // supported by tooling. |
62 | 57 | /** |
63 | 58 | * The `ViewTransition` returned by the call to `startViewTransition`. |
64 | 59 | * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition |
65 | 60 | */ |
66 | | - transition: { |
67 | | - /** |
68 | | - * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/finished |
69 | | - */ |
70 | | - finished: Promise<void>; |
71 | | - /** |
72 | | - * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/ready |
73 | | - */ |
74 | | - ready: Promise<void>; |
75 | | - /** |
76 | | - * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/updateCallbackDone |
77 | | - */ |
78 | | - updateCallbackDone: Promise<void>; |
79 | | - /** |
80 | | - * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/skipTransition |
81 | | - */ |
82 | | - skipTransition(): void; |
83 | | - |
84 | | - /** |
85 | | - * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition#browser_compatibility |
86 | | - * @see https://developer.chrome.com/docs/web-platform/view-transitions/same-document#default_style_and_transition_reference |
87 | | - */ |
88 | | - readonly types: Set<string>; |
89 | | - }; |
| 61 | + transition: ViewTransition; |
90 | 62 | /** |
91 | 63 | * The `ActivatedRouteSnapshot` that the navigation is transitioning from. |
92 | 64 | */ |
@@ -131,8 +103,7 @@ export function createViewTransition( |
131 | 103 | // routes (the DOM update). This view transition waits for the next change detection to |
132 | 104 | // complete (below), which includes the update phase of the routed components. |
133 | 105 | return createRenderPromise(injector); |
134 | | - // TODO(atscott): Types in DefinitelyTyped are not up-to-date |
135 | | - }) as ViewTransition & {readonly types: Set<string>}; |
| 106 | + }); |
136 | 107 | const {onViewTransitionCreated} = transitionOptions; |
137 | 108 | if (onViewTransitionCreated) { |
138 | 109 | runInInjectionContext(injector, () => onViewTransitionCreated({transition, from, to})); |
|
0 commit comments