File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ interface PerformanceEntryMap {
58
58
59
59
// Update built-in types to be more accurate.
60
60
declare global {
61
- // https://wicg.github.io/nav-speculation/prerendering.html#document-prerendering
62
61
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 ;
64
66
}
65
67
66
68
interface Performance {
Original file line number Diff line number Diff line change @@ -105,12 +105,3 @@ export interface ReportOpts {
105
105
* loading. This is equivalent to the corresponding `readyState` value.
106
106
*/
107
107
export 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 105
105
*/
106
106
self .__stubWasDiscarded = () => {
107
107
return new Promise ((resolve ) => {
108
- const navEntry = performance .getEntriesByType (' navigation' )[0 ];
109
108
// Only stub if the page isn't actually discarded.
110
109
if (! document .wasDiscarded ) {
111
110
Object .defineProperty (document , ' wasDiscarded' , {
You can’t perform that action at this time.
0 commit comments