File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ interface PerformanceEntryMap {
5858
5959// Update built-in types to be more accurate.
6060declare global {
61- // https://wicg.github.io/nav-speculation/prerendering.html#document-prerendering
6261 interface Document {
63- prerendering ?: boolean
62+ // https://wicg.github.io/nav-speculation/prerendering.html#document-prerendering
63+ prerendering ?: boolean ;
64+ // https://github.com/WICG/page-lifecycle/blob/main/README.md
65+ wasDiscarded ?: boolean ;
6466 }
6567
6668 interface Performance {
Original file line number Diff line number Diff line change @@ -105,12 +105,3 @@ export interface ReportOpts {
105105 * loading. This is equivalent to the corresponding `readyState` value.
106106 */
107107export type LoadState = 'loading' | 'dom-interactive' | 'dom-content-loaded' | 'complete' ;
108-
109- /**
110- * Extend the document with the new wasDiscarded boolean which is not supported
111- * in typescript yet
112- * https://github.com/WICG/page-lifecycle/blob/main/README.md
113- */
114- declare global {
115- interface Document { wasDiscarded ?: boolean ; }
116- }
Original file line number Diff line number Diff line change 105105 */
106106 self .__stubWasDiscarded = () => {
107107 return new Promise ((resolve ) => {
108- const navEntry = performance .getEntriesByType (' navigation' )[0 ];
109108 // Only stub if the page isn't actually discarded.
110109 if (! document .wasDiscarded ) {
111110 Object .defineProperty (document , ' wasDiscarded' , {
You can’t perform that action at this time.
0 commit comments