From 3e1d51c97e1c536612a200dde038aa43a7a9d8b9 Mon Sep 17 00:00:00 2001 From: Philip Walton Date: Tue, 15 Nov 2022 17:21:11 -0800 Subject: [PATCH] Update documentation in README --- README.md | 15 ++++++++------- src/types/base.ts | 12 ++++++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 63728f6a..db258005 100644 --- a/README.md +++ b/README.md @@ -694,14 +694,15 @@ interface Metric { entries: (PerformanceEntry | LayoutShift | FirstInputPolyfillEntry | NavigationTimingPolyfillEntry)[]; /** - * The type of navigation + * The type of navigation. * - * Navigation Timing API (or `undefined` if the browser doesn't - * support that API). - * For pages that are restored from the bfcache, this value will - * be 'back-forward-cache'. - * For pages that are restored after being discarded, this value will - * be 'restore'. + * This will be the value returned by the Navigation Timing API (or + * `undefined` if the browser doesn't support that API), with the following + * exceptions: + * - 'back-forward-cache': for pages that are restored from the bfcache. + * - 'prerender': for pages that were prerendered. + * - 'restore': for pages that were discarded by the browser and then + * restored by the user. */ navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'restore'; } diff --git a/src/types/base.ts b/src/types/base.ts index 1d2d0a6a..a0e6c9d8 100644 --- a/src/types/base.ts +++ b/src/types/base.ts @@ -59,11 +59,15 @@ export interface Metric { entries: (PerformanceEntry | LayoutShift | FirstInputPolyfillEntry | NavigationTimingPolyfillEntry)[]; /** - * The type of navigation + * The type of navigation. * - * Navigation Timing API (or `undefined` if the browser doesn't - * support that API). For pages that are restored from the bfcache, this - * value will be 'back-forward-cache'. + * This will be the value returned by the Navigation Timing API (or + * `undefined` if the browser doesn't support that API), with the following + * exceptions: + * - 'back-forward-cache': for pages that are restored from the bfcache. + * - 'prerender': for pages that were prerendered. + * - 'restore': for pages that were discarded by the browser and then + * restored by the user. */ navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'restore'; }