@sentry/browser-utils 10.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/build/cjs/debug-build.js +6 -0
- package/build/cjs/debug-build.js.map +1 -0
- package/build/cjs/getNativeImplementation.js +51 -0
- package/build/cjs/getNativeImplementation.js.map +1 -0
- package/build/cjs/htmlTreeAsString.js +110 -0
- package/build/cjs/htmlTreeAsString.js.map +1 -0
- package/build/cjs/index.js +54 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/instrument/dom.js +137 -0
- package/build/cjs/instrument/dom.js.map +1 -0
- package/build/cjs/instrument/history.js +56 -0
- package/build/cjs/instrument/history.js.map +1 -0
- package/build/cjs/instrument/xhr.js +108 -0
- package/build/cjs/instrument/xhr.js.map +1 -0
- package/build/cjs/is.js +15 -0
- package/build/cjs/is.js.map +1 -0
- package/build/cjs/metrics/browserMetrics.js +535 -0
- package/build/cjs/metrics/browserMetrics.js.map +1 -0
- package/build/cjs/metrics/cls.js +64 -0
- package/build/cjs/metrics/cls.js.map +1 -0
- package/build/cjs/metrics/elementTiming.js +72 -0
- package/build/cjs/metrics/elementTiming.js.map +1 -0
- package/build/cjs/metrics/inp.js +170 -0
- package/build/cjs/metrics/inp.js.map +1 -0
- package/build/cjs/metrics/instrument.js +152 -0
- package/build/cjs/metrics/instrument.js.map +1 -0
- package/build/cjs/metrics/lcp.js +77 -0
- package/build/cjs/metrics/lcp.js.map +1 -0
- package/build/cjs/metrics/resourceTiming.js +44 -0
- package/build/cjs/metrics/resourceTiming.js.map +1 -0
- package/build/cjs/metrics/utils.js +137 -0
- package/build/cjs/metrics/utils.js.map +1 -0
- package/build/cjs/metrics/web-vitals/getCLS.js +46 -0
- package/build/cjs/metrics/web-vitals/getCLS.js.map +1 -0
- package/build/cjs/metrics/web-vitals/getINP.js +60 -0
- package/build/cjs/metrics/web-vitals/getINP.js.map +1 -0
- package/build/cjs/metrics/web-vitals/getLCP.js +62 -0
- package/build/cjs/metrics/web-vitals/getLCP.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/InteractionManager.js +87 -0
- package/build/cjs/metrics/web-vitals/lib/InteractionManager.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/LCPEntryManager.js +11 -0
- package/build/cjs/metrics/web-vitals/lib/LCPEntryManager.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/LayoutShiftManager.js +27 -0
- package/build/cjs/metrics/web-vitals/lib/LayoutShiftManager.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/bindReporter.js +31 -0
- package/build/cjs/metrics/web-vitals/lib/bindReporter.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/generateUniqueID.js +8 -0
- package/build/cjs/metrics/web-vitals/lib/generateUniqueID.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/getActivationStart.js +11 -0
- package/build/cjs/metrics/web-vitals/lib/getActivationStart.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/getNavigationEntry.js +17 -0
- package/build/cjs/metrics/web-vitals/lib/getNavigationEntry.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/getVisibilityWatcher.js +48 -0
- package/build/cjs/metrics/web-vitals/lib/getVisibilityWatcher.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/globalListeners.js +18 -0
- package/build/cjs/metrics/web-vitals/lib/globalListeners.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/initMetric.js +34 -0
- package/build/cjs/metrics/web-vitals/lib/initMetric.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/initUnique.js +16 -0
- package/build/cjs/metrics/web-vitals/lib/initUnique.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/observe.js +20 -0
- package/build/cjs/metrics/web-vitals/lib/observe.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/onHidden.js +17 -0
- package/build/cjs/metrics/web-vitals/lib/onHidden.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js +32 -0
- package/build/cjs/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/runOnce.js +14 -0
- package/build/cjs/metrics/web-vitals/lib/runOnce.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/whenActivated.js +14 -0
- package/build/cjs/metrics/web-vitals/lib/whenActivated.js.map +1 -0
- package/build/cjs/metrics/web-vitals/lib/whenIdleOrHidden.js +24 -0
- package/build/cjs/metrics/web-vitals/lib/whenIdleOrHidden.js.map +1 -0
- package/build/cjs/metrics/web-vitals/onFCP.js +37 -0
- package/build/cjs/metrics/web-vitals/onFCP.js.map +1 -0
- package/build/cjs/metrics/web-vitals/onTTFB.js +35 -0
- package/build/cjs/metrics/web-vitals/onTTFB.js.map +1 -0
- package/build/cjs/metrics/webVitalSpans.js +199 -0
- package/build/cjs/metrics/webVitalSpans.js.map +1 -0
- package/build/cjs/networkUtils.js +70 -0
- package/build/cjs/networkUtils.js.map +1 -0
- package/build/cjs/types.js +8 -0
- package/build/cjs/types.js.map +1 -0
- package/build/esm/debug-build.js +4 -0
- package/build/esm/debug-build.js.map +1 -0
- package/build/esm/getNativeImplementation.js +46 -0
- package/build/esm/getNativeImplementation.js.map +1 -0
- package/build/esm/htmlTreeAsString.js +108 -0
- package/build/esm/htmlTreeAsString.js.map +1 -0
- package/build/esm/index.js +15 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/instrument/dom.js +134 -0
- package/build/esm/instrument/dom.js.map +1 -0
- package/build/esm/instrument/history.js +53 -0
- package/build/esm/instrument/history.js.map +1 -0
- package/build/esm/instrument/xhr.js +104 -0
- package/build/esm/instrument/xhr.js.map +1 -0
- package/build/esm/is.js +13 -0
- package/build/esm/is.js.map +1 -0
- package/build/esm/metrics/browserMetrics.js +524 -0
- package/build/esm/metrics/browserMetrics.js.map +1 -0
- package/build/esm/metrics/cls.js +61 -0
- package/build/esm/metrics/cls.js.map +1 -0
- package/build/esm/metrics/elementTiming.js +69 -0
- package/build/esm/metrics/elementTiming.js.map +1 -0
- package/build/esm/metrics/inp.js +162 -0
- package/build/esm/metrics/inp.js.map +1 -0
- package/build/esm/metrics/instrument.js +145 -0
- package/build/esm/metrics/instrument.js.map +1 -0
- package/build/esm/metrics/lcp.js +72 -0
- package/build/esm/metrics/lcp.js.map +1 -0
- package/build/esm/metrics/resourceTiming.js +42 -0
- package/build/esm/metrics/resourceTiming.js.map +1 -0
- package/build/esm/metrics/utils.js +128 -0
- package/build/esm/metrics/utils.js.map +1 -0
- package/build/esm/metrics/web-vitals/getCLS.js +43 -0
- package/build/esm/metrics/web-vitals/getCLS.js.map +1 -0
- package/build/esm/metrics/web-vitals/getINP.js +57 -0
- package/build/esm/metrics/web-vitals/getINP.js.map +1 -0
- package/build/esm/metrics/web-vitals/getLCP.js +59 -0
- package/build/esm/metrics/web-vitals/getLCP.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/InteractionManager.js +85 -0
- package/build/esm/metrics/web-vitals/lib/InteractionManager.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/LCPEntryManager.js +9 -0
- package/build/esm/metrics/web-vitals/lib/LCPEntryManager.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/LayoutShiftManager.js +25 -0
- package/build/esm/metrics/web-vitals/lib/LayoutShiftManager.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/bindReporter.js +29 -0
- package/build/esm/metrics/web-vitals/lib/bindReporter.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/generateUniqueID.js +6 -0
- package/build/esm/metrics/web-vitals/lib/generateUniqueID.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/getActivationStart.js +9 -0
- package/build/esm/metrics/web-vitals/lib/getActivationStart.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/getNavigationEntry.js +15 -0
- package/build/esm/metrics/web-vitals/lib/getNavigationEntry.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js +46 -0
- package/build/esm/metrics/web-vitals/lib/getVisibilityWatcher.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/globalListeners.js +15 -0
- package/build/esm/metrics/web-vitals/lib/globalListeners.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/initMetric.js +32 -0
- package/build/esm/metrics/web-vitals/lib/initMetric.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/initUnique.js +14 -0
- package/build/esm/metrics/web-vitals/lib/initUnique.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/observe.js +18 -0
- package/build/esm/metrics/web-vitals/lib/observe.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/onHidden.js +15 -0
- package/build/esm/metrics/web-vitals/lib/onHidden.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js +29 -0
- package/build/esm/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/runOnce.js +12 -0
- package/build/esm/metrics/web-vitals/lib/runOnce.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/whenActivated.js +12 -0
- package/build/esm/metrics/web-vitals/lib/whenActivated.js.map +1 -0
- package/build/esm/metrics/web-vitals/lib/whenIdleOrHidden.js +22 -0
- package/build/esm/metrics/web-vitals/lib/whenIdleOrHidden.js.map +1 -0
- package/build/esm/metrics/web-vitals/onFCP.js +34 -0
- package/build/esm/metrics/web-vitals/onFCP.js.map +1 -0
- package/build/esm/metrics/web-vitals/onTTFB.js +32 -0
- package/build/esm/metrics/web-vitals/onTTFB.js.map +1 -0
- package/build/esm/metrics/webVitalSpans.js +191 -0
- package/build/esm/metrics/webVitalSpans.js.map +1 -0
- package/build/esm/networkUtils.js +64 -0
- package/build/esm/networkUtils.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/types.js +6 -0
- package/build/esm/types.js.map +1 -0
- package/build/types/debug-build.d.ts +7 -0
- package/build/types/debug-build.d.ts.map +1 -0
- package/build/types/getNativeImplementation.d.ts +69 -0
- package/build/types/getNativeImplementation.d.ts.map +1 -0
- package/build/types/htmlTreeAsString.d.ts +11 -0
- package/build/types/htmlTreeAsString.d.ts.map +1 -0
- package/build/types/index.d.ts +15 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/instrument/dom.d.ts +11 -0
- package/build/types/instrument/dom.d.ts.map +1 -0
- package/build/types/instrument/history.d.ts +15 -0
- package/build/types/instrument/history.d.ts.map +1 -0
- package/build/types/instrument/xhr.d.ts +14 -0
- package/build/types/instrument/xhr.d.ts.map +1 -0
- package/build/types/is.d.ts +7 -0
- package/build/types/is.d.ts.map +1 -0
- package/build/types/metrics/browserMetrics.d.ts +116 -0
- package/build/types/metrics/browserMetrics.d.ts.map +1 -0
- package/build/types/metrics/cls.d.ts +17 -0
- package/build/types/metrics/cls.d.ts.map +1 -0
- package/build/types/metrics/elementTiming.d.ts +19 -0
- package/build/types/metrics/elementTiming.d.ts.map +1 -0
- package/build/types/metrics/inp.d.ts +35 -0
- package/build/types/metrics/inp.d.ts.map +1 -0
- package/build/types/metrics/instrument.d.ts +121 -0
- package/build/types/metrics/instrument.d.ts.map +1 -0
- package/build/types/metrics/lcp.d.ts +22 -0
- package/build/types/metrics/lcp.d.ts.map +1 -0
- package/build/types/metrics/resourceTiming.d.ts +13 -0
- package/build/types/metrics/resourceTiming.d.ts.map +1 -0
- package/build/types/metrics/utils.d.ts +73 -0
- package/build/types/metrics/utils.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/getCLS.d.ts +26 -0
- package/build/types/metrics/web-vitals/getCLS.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/getINP.d.ts +34 -0
- package/build/types/metrics/web-vitals/getINP.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/getLCP.d.ts +16 -0
- package/build/types/metrics/web-vitals/getLCP.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/InteractionManager.d.ts +37 -0
- package/build/types/metrics/web-vitals/lib/InteractionManager.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/LCPEntryManager.d.ts +5 -0
- package/build/types/metrics/web-vitals/lib/LCPEntryManager.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/LayoutShiftManager.d.ts +7 -0
- package/build/types/metrics/web-vitals/lib/LayoutShiftManager.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/bindReporter.d.ts +7 -0
- package/build/types/metrics/web-vitals/lib/bindReporter.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/generateUniqueID.d.ts +7 -0
- package/build/types/metrics/web-vitals/lib/generateUniqueID.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/getActivationStart.d.ts +2 -0
- package/build/types/metrics/web-vitals/lib/getActivationStart.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/getNavigationEntry.d.ts +2 -0
- package/build/types/metrics/web-vitals/lib/getNavigationEntry.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/getVisibilityWatcher.d.ts +5 -0
- package/build/types/metrics/web-vitals/lib/getVisibilityWatcher.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/globalListeners.d.ts +11 -0
- package/build/types/metrics/web-vitals/lib/globalListeners.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/initMetric.d.ts +21 -0
- package/build/types/metrics/web-vitals/lib/initMetric.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/initUnique.d.ts +7 -0
- package/build/types/metrics/web-vitals/lib/initUnique.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/observe.d.ts +23 -0
- package/build/types/metrics/web-vitals/lib/observe.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/onHidden.d.ts +27 -0
- package/build/types/metrics/web-vitals/lib/onHidden.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.d.ts +15 -0
- package/build/types/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/runOnce.d.ts +2 -0
- package/build/types/metrics/web-vitals/lib/runOnce.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/whenActivated.d.ts +2 -0
- package/build/types/metrics/web-vitals/lib/whenActivated.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/lib/whenIdleOrHidden.d.ts +6 -0
- package/build/types/metrics/web-vitals/lib/whenIdleOrHidden.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/onFCP.d.ts +11 -0
- package/build/types/metrics/web-vitals/onFCP.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/onTTFB.d.ts +20 -0
- package/build/types/metrics/web-vitals/onTTFB.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/base.d.ts +103 -0
- package/build/types/metrics/web-vitals/types/base.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/cls.d.ts +58 -0
- package/build/types/metrics/web-vitals/types/cls.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/fcp.d.ts +47 -0
- package/build/types/metrics/web-vitals/types/fcp.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/inp.d.ts +150 -0
- package/build/types/metrics/web-vitals/types/inp.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/lcp.d.ts +74 -0
- package/build/types/metrics/web-vitals/types/lcp.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types/ttfb.d.ts +60 -0
- package/build/types/metrics/web-vitals/types/ttfb.d.ts.map +1 -0
- package/build/types/metrics/web-vitals/types.d.ts +78 -0
- package/build/types/metrics/web-vitals/types.d.ts.map +1 -0
- package/build/types/metrics/webVitalSpans.d.ts +65 -0
- package/build/types/metrics/webVitalSpans.d.ts.map +1 -0
- package/build/types/networkUtils.d.ts +25 -0
- package/build/types/networkUtils.d.ts.map +1 -0
- package/build/types/types.d.ts +15 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types-ts3.8/debug-build.d.ts +7 -0
- package/build/types-ts3.8/getNativeImplementation.d.ts +69 -0
- package/build/types-ts3.8/htmlTreeAsString.d.ts +11 -0
- package/build/types-ts3.8/index.d.ts +15 -0
- package/build/types-ts3.8/instrument/dom.d.ts +11 -0
- package/build/types-ts3.8/instrument/history.d.ts +15 -0
- package/build/types-ts3.8/instrument/xhr.d.ts +14 -0
- package/build/types-ts3.8/is.d.ts +7 -0
- package/build/types-ts3.8/metrics/browserMetrics.d.ts +119 -0
- package/build/types-ts3.8/metrics/cls.d.ts +17 -0
- package/build/types-ts3.8/metrics/elementTiming.d.ts +19 -0
- package/build/types-ts3.8/metrics/inp.d.ts +35 -0
- package/build/types-ts3.8/metrics/instrument.d.ts +121 -0
- package/build/types-ts3.8/metrics/lcp.d.ts +22 -0
- package/build/types-ts3.8/metrics/resourceTiming.d.ts +13 -0
- package/build/types-ts3.8/metrics/utils.d.ts +73 -0
- package/build/types-ts3.8/metrics/web-vitals/getCLS.d.ts +26 -0
- package/build/types-ts3.8/metrics/web-vitals/getINP.d.ts +34 -0
- package/build/types-ts3.8/metrics/web-vitals/getLCP.d.ts +16 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/InteractionManager.d.ts +37 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/LCPEntryManager.d.ts +5 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/LayoutShiftManager.d.ts +7 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/bindReporter.d.ts +7 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/generateUniqueID.d.ts +7 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/getActivationStart.d.ts +2 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/getNavigationEntry.d.ts +2 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/getVisibilityWatcher.d.ts +5 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/globalListeners.d.ts +11 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/initMetric.d.ts +21 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/initUnique.d.ts +7 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/observe.d.ts +23 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/onHidden.d.ts +27 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/polyfills/interactionCountPolyfill.d.ts +15 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/runOnce.d.ts +2 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/whenActivated.d.ts +2 -0
- package/build/types-ts3.8/metrics/web-vitals/lib/whenIdleOrHidden.d.ts +6 -0
- package/build/types-ts3.8/metrics/web-vitals/onFCP.d.ts +11 -0
- package/build/types-ts3.8/metrics/web-vitals/onTTFB.d.ts +20 -0
- package/build/types-ts3.8/metrics/web-vitals/types/base.d.ts +106 -0
- package/build/types-ts3.8/metrics/web-vitals/types/cls.d.ts +58 -0
- package/build/types-ts3.8/metrics/web-vitals/types/fcp.d.ts +47 -0
- package/build/types-ts3.8/metrics/web-vitals/types/inp.d.ts +150 -0
- package/build/types-ts3.8/metrics/web-vitals/types/lcp.d.ts +74 -0
- package/build/types-ts3.8/metrics/web-vitals/types/ttfb.d.ts +60 -0
- package/build/types-ts3.8/metrics/web-vitals/types.d.ts +78 -0
- package/build/types-ts3.8/metrics/webVitalSpans.d.ts +65 -0
- package/build/types-ts3.8/networkUtils.d.ts +28 -0
- package/build/types-ts3.8/types.d.ts +15 -0
- package/package.json +69 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
type InstrumentHandlerTypePerformanceObserver = 'longtask' | 'event' | 'navigation' | 'paint' | 'resource' | 'element' | 'first-input';
|
|
2
|
+
interface PerformanceEntry {
|
|
3
|
+
readonly duration: number;
|
|
4
|
+
readonly entryType: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly startTime: number;
|
|
7
|
+
toJSON(): Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface PerformanceEventTiming extends PerformanceEntry {
|
|
10
|
+
processingStart: number;
|
|
11
|
+
processingEnd: number;
|
|
12
|
+
duration: number;
|
|
13
|
+
cancelable?: boolean;
|
|
14
|
+
target?: unknown | null;
|
|
15
|
+
interactionId?: number;
|
|
16
|
+
}
|
|
17
|
+
interface PerformanceScriptTiming extends PerformanceEntry {
|
|
18
|
+
sourceURL: string;
|
|
19
|
+
sourceFunctionName: string;
|
|
20
|
+
sourceCharPosition: number;
|
|
21
|
+
invoker: string;
|
|
22
|
+
invokerType: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PerformanceLongAnimationFrameTiming extends PerformanceEntry {
|
|
25
|
+
scripts: PerformanceScriptTiming[];
|
|
26
|
+
}
|
|
27
|
+
interface Metric {
|
|
28
|
+
/**
|
|
29
|
+
* The name of the metric (in acronym form).
|
|
30
|
+
*/
|
|
31
|
+
name: 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
|
|
32
|
+
/**
|
|
33
|
+
* The current value of the metric.
|
|
34
|
+
*/
|
|
35
|
+
value: number;
|
|
36
|
+
/**
|
|
37
|
+
* The rating as to whether the metric value is within the "good",
|
|
38
|
+
* "needs improvement", or "poor" thresholds of the metric.
|
|
39
|
+
*/
|
|
40
|
+
rating: 'good' | 'needs-improvement' | 'poor';
|
|
41
|
+
/**
|
|
42
|
+
* The delta between the current value and the last-reported value.
|
|
43
|
+
* On the first report, `delta` and `value` will always be the same.
|
|
44
|
+
*/
|
|
45
|
+
delta: number;
|
|
46
|
+
/**
|
|
47
|
+
* A unique ID representing this particular metric instance. This ID can
|
|
48
|
+
* be used by an analytics tool to dedupe multiple values sent for the same
|
|
49
|
+
* metric instance, or to group multiple deltas together and calculate a
|
|
50
|
+
* total. It can also be used to differentiate multiple different metric
|
|
51
|
+
* instances sent from the same page, which can happen if the page is
|
|
52
|
+
* restored from the back/forward cache (in that case new metrics object
|
|
53
|
+
* get created).
|
|
54
|
+
*/
|
|
55
|
+
id: string;
|
|
56
|
+
/**
|
|
57
|
+
* Any performance entries relevant to the metric value calculation.
|
|
58
|
+
* The array may also be empty if the metric value was not based on any
|
|
59
|
+
* entries (e.g. a CLS value of 0 given no layout shifts).
|
|
60
|
+
*/
|
|
61
|
+
entries: PerformanceEntry[];
|
|
62
|
+
/**
|
|
63
|
+
* The type of navigation
|
|
64
|
+
*
|
|
65
|
+
* Navigation Timing API (or `undefined` if the browser doesn't
|
|
66
|
+
* support that API). For pages that are restored from the bfcache, this
|
|
67
|
+
* value will be 'back-forward-cache'.
|
|
68
|
+
*/
|
|
69
|
+
navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'restore';
|
|
70
|
+
}
|
|
71
|
+
type CleanupHandlerCallback = () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Add a callback that will be triggered when a CLS metric is available.
|
|
74
|
+
* Returns a cleanup callback which can be called to remove the instrumentation handler.
|
|
75
|
+
*
|
|
76
|
+
* Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.
|
|
77
|
+
* This will lead to the CLS being finalized and frozen.
|
|
78
|
+
*/
|
|
79
|
+
export declare function addClsInstrumentationHandler(callback: (data: {
|
|
80
|
+
metric: Metric;
|
|
81
|
+
}) => void, stopOnCallback?: boolean): CleanupHandlerCallback;
|
|
82
|
+
/**
|
|
83
|
+
* Add a callback that will be triggered when a LCP metric is available.
|
|
84
|
+
* Returns a cleanup callback which can be called to remove the instrumentation handler.
|
|
85
|
+
*
|
|
86
|
+
* Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.
|
|
87
|
+
* This will lead to the LCP being finalized and frozen.
|
|
88
|
+
*/
|
|
89
|
+
export declare function addLcpInstrumentationHandler(callback: (data: {
|
|
90
|
+
metric: Metric;
|
|
91
|
+
}) => void, stopOnCallback?: boolean): CleanupHandlerCallback;
|
|
92
|
+
/**
|
|
93
|
+
* Add a callback that will be triggered when a TTFD metric is available.
|
|
94
|
+
*/
|
|
95
|
+
export declare function addTtfbInstrumentationHandler(callback: (data: {
|
|
96
|
+
metric: Metric;
|
|
97
|
+
}) => void): CleanupHandlerCallback;
|
|
98
|
+
export type InstrumentationHandlerCallback = (data: {
|
|
99
|
+
metric: Pick<Metric, Exclude<keyof Metric, 'entries'>> & {
|
|
100
|
+
entries: PerformanceEventTiming[];
|
|
101
|
+
};
|
|
102
|
+
}) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Add a callback that will be triggered when a INP metric is available.
|
|
105
|
+
* Returns a cleanup callback which can be called to remove the instrumentation handler.
|
|
106
|
+
*/
|
|
107
|
+
export declare function addInpInstrumentationHandler(callback: InstrumentationHandlerCallback): CleanupHandlerCallback;
|
|
108
|
+
export declare function addPerformanceInstrumentationHandler(type: 'event', callback: (data: {
|
|
109
|
+
entries: ((PerformanceEntry & {
|
|
110
|
+
target?: unknown | null;
|
|
111
|
+
}) | PerformanceEventTiming)[];
|
|
112
|
+
}) => void): CleanupHandlerCallback;
|
|
113
|
+
export declare function addPerformanceInstrumentationHandler(type: InstrumentHandlerTypePerformanceObserver, callback: (data: {
|
|
114
|
+
entries: PerformanceEntry[];
|
|
115
|
+
}) => void): CleanupHandlerCallback;
|
|
116
|
+
/**
|
|
117
|
+
* Check if a PerformanceEntry is a PerformanceEventTiming by checking for the `duration` property.
|
|
118
|
+
*/
|
|
119
|
+
export declare function isPerformanceEventTiming(entry: PerformanceEntry): entry is PerformanceEventTiming;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=instrument.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Client } from '@sentry/core';
|
|
2
|
+
import { WebVitalReportEvent } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 60 seconds is the maximum for a plausible LCP value.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_PLAUSIBLE_LCP_DURATION = 60000;
|
|
7
|
+
export declare function isValidLcpMetric(lcpValue: number | undefined): lcpValue is number;
|
|
8
|
+
/**
|
|
9
|
+
* Starts tracking the Largest Contentful Paint on the current page and collects the value once
|
|
10
|
+
*
|
|
11
|
+
* - the page visibility is hidden
|
|
12
|
+
* - a navigation span is started (to stop LCP measurement for SPA soft navigations)
|
|
13
|
+
*
|
|
14
|
+
* Once either of these events triggers, the LCP value is sent as a standalone span and we stop
|
|
15
|
+
* measuring LCP for subsequent routes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function trackLcpAsStandaloneSpan(client: Client): void;
|
|
18
|
+
/**
|
|
19
|
+
* Exported only for testing!
|
|
20
|
+
*/
|
|
21
|
+
export declare function _sendStandaloneLcpSpan(lcpValue: number, entry: LargestContentfulPaint | undefined, pageloadSpanId: string, reportEvent: WebVitalReportEvent): void;
|
|
22
|
+
//# sourceMappingURL=lcp.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpanAttributes } from '@sentry/core';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a PerformanceResourceTiming entry to span data for the resource span. Most importantly,
|
|
4
|
+
* it converts the timing values from timestamps relative to the `performance.timeOrigin` to absolute timestamps
|
|
5
|
+
* in seconds.
|
|
6
|
+
*
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming#timestamps
|
|
8
|
+
*
|
|
9
|
+
* @param resourceTiming
|
|
10
|
+
* @returns An array where the first element is the attribute name and the second element is the attribute value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resourceTimingToSpanAttributes(resourceTiming: PerformanceResourceTiming): SpanAttributes;
|
|
13
|
+
//# sourceMappingURL=resourceTiming.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Client, Span, SpanAttributes, SpanTimeInput, StartSpanOptions } from '@sentry/core';
|
|
2
|
+
export type WebVitalReportEvent = 'pagehide' | 'navigation';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a given value is a valid measurement value.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isMeasurementValue(value: unknown): value is number;
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to start child on transactions. This function will make sure that the transaction will
|
|
9
|
+
* use the start timestamp of the created child span if it is earlier than the transactions actual
|
|
10
|
+
* start timestamp.
|
|
11
|
+
*/
|
|
12
|
+
export declare function startAndEndSpan(parentSpan: Span, startTimeInSeconds: number, endTime: SpanTimeInput, { ...ctx }: StartSpanOptions): Span | undefined;
|
|
13
|
+
interface StandaloneWebVitalSpanOptions {
|
|
14
|
+
name: string;
|
|
15
|
+
transaction?: string;
|
|
16
|
+
attributes: SpanAttributes;
|
|
17
|
+
startTime: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Starts an inactive, standalone span used to send web vital values to Sentry.
|
|
21
|
+
* DO NOT use this for arbitrary spans, as these spans require special handling
|
|
22
|
+
* during ingestion to extract metrics.
|
|
23
|
+
*
|
|
24
|
+
* This function adds a bunch of attributes and data to the span that's shared
|
|
25
|
+
* by all web vital standalone spans. However, you need to take care of adding
|
|
26
|
+
* the actual web vital value as an event to the span. Also, you need to assign
|
|
27
|
+
* a transaction name and some other values that are specific to the web vital.
|
|
28
|
+
*
|
|
29
|
+
* Ultimately, you also need to take care of ending the span to send it off.
|
|
30
|
+
*
|
|
31
|
+
* @param options
|
|
32
|
+
*
|
|
33
|
+
* @returns an inactive, standalone and NOT YET ended span
|
|
34
|
+
*/
|
|
35
|
+
export declare function startStandaloneWebVitalSpan(options: StandaloneWebVitalSpanOptions): Span | undefined;
|
|
36
|
+
/** Get the browser performance API. */
|
|
37
|
+
export declare function getBrowserPerformanceAPI(): Performance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Converts from milliseconds to seconds
|
|
40
|
+
* @param time time in ms
|
|
41
|
+
*/
|
|
42
|
+
export declare function msToSec(time: number): number;
|
|
43
|
+
/**
|
|
44
|
+
* Converts ALPN protocol ids to name and version.
|
|
45
|
+
*
|
|
46
|
+
* (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)
|
|
47
|
+
* @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol
|
|
48
|
+
*/
|
|
49
|
+
export declare function extractNetworkProtocol(nextHopProtocol: string): {
|
|
50
|
+
name: string;
|
|
51
|
+
version: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Generic support check for web vitals
|
|
55
|
+
*/
|
|
56
|
+
export declare function supportsWebVital(entryType: 'layout-shift' | 'largest-contentful-paint'): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Listens for events on which we want to collect a previously accumulated web vital value.
|
|
59
|
+
* Currently, this includes:
|
|
60
|
+
*
|
|
61
|
+
* - pagehide (i.e. user minimizes browser window, hides tab, etc)
|
|
62
|
+
* - soft navigation (we only care about the vital of the initially loaded route)
|
|
63
|
+
*
|
|
64
|
+
* As a "side-effect", this function will also collect the span id of the pageload span.
|
|
65
|
+
*
|
|
66
|
+
* @param collectorCallback the callback to be called when the first of these events is triggered. Parameters:
|
|
67
|
+
* - event: the event that triggered the reporting of the web vital value.
|
|
68
|
+
* - pageloadSpanId: the span id of the pageload span. This is used to link the web vital span to the pageload span.
|
|
69
|
+
* - pageloadSpan: the pageload span instance. This is used for full access to the pageload span for span streaming.
|
|
70
|
+
*/
|
|
71
|
+
export declare function listenForWebVitalReportEvents(client: Client, collectorCallback: (event: WebVitalReportEvent, pageloadSpanId: string, pageloadSpan?: Span) => void): void;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CLSMetric, MetricRatingThresholds, ReportOpts } from './types';
|
|
2
|
+
/** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */
|
|
3
|
+
export declare const CLSThresholds: MetricRatingThresholds;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the [CLS](https://web.dev/articles/cls) value for the current page and
|
|
6
|
+
* calls the `callback` function once the value is ready to be reported, along
|
|
7
|
+
* with all `layout-shift` performance entries that were used in the metric
|
|
8
|
+
* value calculation. The reported value is a `double` (corresponding to a
|
|
9
|
+
* [layout shift score](https://web.dev/articles/cls#layout_shift_score)).
|
|
10
|
+
*
|
|
11
|
+
* If the `reportAllChanges` configuration option is set to `true`, the
|
|
12
|
+
* `callback` function will be called as soon as the value is initially
|
|
13
|
+
* determined as well as any time the value changes throughout the page
|
|
14
|
+
* lifespan.
|
|
15
|
+
*
|
|
16
|
+
* _**Important:** CLS should be continually monitored for changes throughout
|
|
17
|
+
* the entire lifespan of a page—including if the user returns to the page after
|
|
18
|
+
* it's been hidden/backgrounded. However, since browsers often [will not fire
|
|
19
|
+
* additional callbacks once the user has backgrounded a
|
|
20
|
+
* page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
|
|
21
|
+
* `callback` is always called when the page's visibility state changes to
|
|
22
|
+
* hidden. As a result, the `callback` function might be called multiple times
|
|
23
|
+
* during the same page load._
|
|
24
|
+
*/
|
|
25
|
+
export declare const onCLS: (onReport: (metric: CLSMetric) => void, opts?: ReportOpts) => void;
|
|
26
|
+
//# sourceMappingURL=getCLS.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { INPMetric, INPReportOpts, MetricRatingThresholds } from './types';
|
|
2
|
+
/** Thresholds for INP. See https://web.dev/articles/inp#what_is_a_good_inp_score */
|
|
3
|
+
export declare const INPThresholds: MetricRatingThresholds;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the [INP](https://web.dev/articles/inp) value for the current
|
|
6
|
+
* page and calls the `callback` function once the value is ready, along with
|
|
7
|
+
* the `event` performance entries reported for that interaction. The reported
|
|
8
|
+
* value is a `DOMHighResTimeStamp`.
|
|
9
|
+
*
|
|
10
|
+
* A custom `durationThreshold` configuration option can optionally be passed
|
|
11
|
+
* to control what `event-timing` entries are considered for INP reporting. The
|
|
12
|
+
* default threshold is `40`, which means INP scores of less than 40 will not
|
|
13
|
+
* be reported. To avoid reporting no interactions in these cases, the library
|
|
14
|
+
* will fall back to the input delay of the first interaction. Note that this
|
|
15
|
+
* will not affect your 75th percentile INP value unless that value is also
|
|
16
|
+
* less than 40 (well below the recommended
|
|
17
|
+
* [good](https://web.dev/articles/inp#what_is_a_good_inp_score) threshold).
|
|
18
|
+
*
|
|
19
|
+
* If the `reportAllChanges` configuration option is set to `true`, the
|
|
20
|
+
* `callback` function will be called as soon as the value is initially
|
|
21
|
+
* determined as well as any time the value changes throughout the page
|
|
22
|
+
* lifespan.
|
|
23
|
+
*
|
|
24
|
+
* _**Important:** INP should be continually monitored for changes throughout
|
|
25
|
+
* the entire lifespan of a page—including if the user returns to the page after
|
|
26
|
+
* it's been hidden/backgrounded. However, since browsers often [will not fire
|
|
27
|
+
* additional callbacks once the user has backgrounded a
|
|
28
|
+
* page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
|
|
29
|
+
* `callback` is always called when the page's visibility state changes to
|
|
30
|
+
* hidden. As a result, the `callback` function might be called multiple times
|
|
31
|
+
* during the same page load._
|
|
32
|
+
*/
|
|
33
|
+
export declare const onINP: (onReport: (metric: INPMetric) => void, opts?: INPReportOpts) => void;
|
|
34
|
+
//# sourceMappingURL=getINP.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LCPMetric, MetricRatingThresholds, ReportOpts } from './types';
|
|
2
|
+
/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */
|
|
3
|
+
export declare const LCPThresholds: MetricRatingThresholds;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and
|
|
6
|
+
* calls the `callback` function once the value is ready (along with the
|
|
7
|
+
* relevant `largest-contentful-paint` performance entry used to determine the
|
|
8
|
+
* value). The reported value is a `DOMHighResTimeStamp`.
|
|
9
|
+
*
|
|
10
|
+
* If the `reportAllChanges` configuration option is set to `true`, the
|
|
11
|
+
* `callback` function will be called any time a new `largest-contentful-paint`
|
|
12
|
+
* performance entry is dispatched, or once the final value of the metric has
|
|
13
|
+
* been determined.
|
|
14
|
+
*/
|
|
15
|
+
export declare const onLCP: (onReport: (metric: LCPMetric) => void, opts?: ReportOpts) => void;
|
|
16
|
+
//# sourceMappingURL=getLCP.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface Interaction {
|
|
2
|
+
_latency: number;
|
|
3
|
+
id: number;
|
|
4
|
+
entries: PerformanceEventTiming[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare class InteractionManager {
|
|
10
|
+
/**
|
|
11
|
+
* A list of longest interactions on the page (by latency) sorted so the
|
|
12
|
+
* longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER
|
|
13
|
+
* long.
|
|
14
|
+
*/
|
|
15
|
+
_longestInteractionList: Interaction[];
|
|
16
|
+
/**
|
|
17
|
+
* A mapping of longest interactions by their interaction ID.
|
|
18
|
+
* This is used for faster lookup.
|
|
19
|
+
*/
|
|
20
|
+
_longestInteractionMap: Map<number, Interaction>;
|
|
21
|
+
_onBeforeProcessingEntry?: (entry: PerformanceEventTiming) => void;
|
|
22
|
+
_onAfterProcessingINPCandidate?: (interaction: Interaction) => void;
|
|
23
|
+
_resetInteractions(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the estimated p98 longest interaction based on the stored
|
|
26
|
+
* interaction candidates and the interaction count for the current page.
|
|
27
|
+
*/
|
|
28
|
+
_estimateP98LongestInteraction(): Interaction | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Takes a performance entry and adds it to the list of worst interactions
|
|
31
|
+
* if its duration is long enough to make it among the worst. If the
|
|
32
|
+
* entry is part of an existing interaction, it is merged and the latency
|
|
33
|
+
* and entries list is updated as needed.
|
|
34
|
+
*/
|
|
35
|
+
_processEntry(entry: PerformanceEventTiming): void;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=InteractionManager.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MetricRatingThresholds, MetricType } from '../types';
|
|
2
|
+
export declare const bindReporter: <MetricName extends MetricType["name"]>(callback: (metric: Extract<MetricType, {
|
|
3
|
+
name: MetricName;
|
|
4
|
+
}>) => void, metric: Extract<MetricType, {
|
|
5
|
+
name: MetricName;
|
|
6
|
+
}>, thresholds: MetricRatingThresholds, reportAllChanges?: boolean) => (forceReport?: boolean) => void;
|
|
7
|
+
//# sourceMappingURL=bindReporter.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performantly generate a unique, 30-char string by combining a version
|
|
3
|
+
* number, the current timestamp with a 13-digit number integer.
|
|
4
|
+
* @return {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare const generateUniqueID: () => string;
|
|
7
|
+
//# sourceMappingURL=generateUniqueID.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* web-vitals 5.1.0 switched listeners to be added on the window rather than the document.
|
|
3
|
+
* Instead of having to check for window/document every time we add a listener, we can use this function.
|
|
4
|
+
*/
|
|
5
|
+
export declare function addPageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
/**
|
|
7
|
+
* web-vitals 5.1.0 switched listeners to be removed from the window rather than the document.
|
|
8
|
+
* Instead of having to check for window/document every time we remove a listener, we can use this function.
|
|
9
|
+
*/
|
|
10
|
+
export declare function removePageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
|
|
11
|
+
//# sourceMappingURL=globalListeners.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MetricType } from '../types';
|
|
2
|
+
export declare const initMetric: <MetricName extends MetricType["name"]>(name: MetricName, value?: number) => {
|
|
3
|
+
name: MetricName;
|
|
4
|
+
value: number;
|
|
5
|
+
rating: "good";
|
|
6
|
+
delta: number;
|
|
7
|
+
entries: (Extract<import("../types").CLSMetric, {
|
|
8
|
+
name: MetricName;
|
|
9
|
+
}> | Extract<import("../types").FCPMetric, {
|
|
10
|
+
name: MetricName;
|
|
11
|
+
}> | Extract<import("../types").INPMetric, {
|
|
12
|
+
name: MetricName;
|
|
13
|
+
}> | Extract<import("../types").LCPMetric, {
|
|
14
|
+
name: MetricName;
|
|
15
|
+
}> | Extract<import("../types").TTFBMetric, {
|
|
16
|
+
name: MetricName;
|
|
17
|
+
}>)["entries"];
|
|
18
|
+
id: string;
|
|
19
|
+
navigationType: "navigate" | "reload" | "back-forward" | "back-forward-cache" | "prerender" | "restore";
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=initMetric.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that accepts and identity object and a class object and returns
|
|
3
|
+
* either a new instance of that class or an existing instance, if the
|
|
4
|
+
* identity object was previously used.
|
|
5
|
+
*/
|
|
6
|
+
export declare function initUnique<T>(identityObj: object, ClassObj: new () => T): T;
|
|
7
|
+
//# sourceMappingURL=initUnique.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface PerformanceEntryMap {
|
|
2
|
+
event: PerformanceEventTiming[];
|
|
3
|
+
'first-input': PerformanceEventTiming[];
|
|
4
|
+
'layout-shift': LayoutShift[];
|
|
5
|
+
'largest-contentful-paint': LargestContentfulPaint[];
|
|
6
|
+
'long-animation-frame': PerformanceLongAnimationFrameTiming[];
|
|
7
|
+
paint: PerformancePaintTiming[];
|
|
8
|
+
navigation: PerformanceNavigationTiming[];
|
|
9
|
+
resource: PerformanceResourceTiming[];
|
|
10
|
+
longtask: PerformanceEntry[];
|
|
11
|
+
element: PerformanceEntry[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Takes a performance entry type and a callback function, and creates a
|
|
15
|
+
* `PerformanceObserver` instance that will observe the specified entry type
|
|
16
|
+
* with buffering enabled and call the callback _for each entry_.
|
|
17
|
+
*
|
|
18
|
+
* This function also feature-detects entry support and wraps the logic in a
|
|
19
|
+
* try/catch to avoid errors in unsupporting browsers.
|
|
20
|
+
*/
|
|
21
|
+
export declare const observe: <K extends keyof PerformanceEntryMap>(type: K, callback: (entries: PerformanceEntryMap[K]) => void, opts?: PerformanceObserverInit) => PerformanceObserver | undefined;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=observe.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface OnHiddenCallback {
|
|
2
|
+
(event: Event): void;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Sentry-specific change:
|
|
6
|
+
*
|
|
7
|
+
* This function's logic was NOT updated to web-vitals 4.2.4 or 5.x but we continue
|
|
8
|
+
* to use the web-vitals 3.5.2 version due to having stricter browser support.
|
|
9
|
+
*
|
|
10
|
+
* PR with context that made the changes:
|
|
11
|
+
* https://github.com/GoogleChrome/web-vitals/pull/442/files#r1530492402
|
|
12
|
+
*
|
|
13
|
+
* The PR removed listening to the `pagehide` event, in favour of only listening to
|
|
14
|
+
* the `visibilitychange` event. This is "more correct" but some browsers we still
|
|
15
|
+
* support (Safari <14.4) don't fully support `visibilitychange` or have known bugs
|
|
16
|
+
* with respect to the `visibilitychange` event.
|
|
17
|
+
*
|
|
18
|
+
* TODO (v11): If we decide to drop support for Safari 14.4, we can use the logic
|
|
19
|
+
* from web-vitals 4.2.4. In this case, we also need to update the integration tests
|
|
20
|
+
* that currently trigger the `pagehide` event to simulate the page being hidden.
|
|
21
|
+
*
|
|
22
|
+
* @param {OnHiddenCallback} cb - Callback to be executed when the page is hidden or unloaded.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated use `whenIdleOrHidden` or `addPageListener('visibilitychange')` instead
|
|
25
|
+
*/
|
|
26
|
+
export declare const onHidden: (cb: OnHiddenCallback) => void;
|
|
27
|
+
//# sourceMappingURL=onHidden.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Performance {
|
|
3
|
+
interactionCount: number;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns the `interactionCount` value using the native API (if available)
|
|
8
|
+
* or the polyfill estimate in this module.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getInteractionCount: () => number;
|
|
11
|
+
/**
|
|
12
|
+
* Feature detects native support or initializes the polyfill if needed.
|
|
13
|
+
*/
|
|
14
|
+
export declare const initInteractionCountPolyfill: () => void;
|
|
15
|
+
//# sourceMappingURL=interactionCountPolyfill.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FCPMetric, MetricRatingThresholds, ReportOpts } from './types';
|
|
2
|
+
/** Thresholds for FCP. See https://web.dev/articles/fcp#what_is_a_good_fcp_score */
|
|
3
|
+
export declare const FCPThresholds: MetricRatingThresholds;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the [FCP](https://web.dev/articles/fcp) value for the current page and
|
|
6
|
+
* calls the `callback` function once the value is ready, along with the
|
|
7
|
+
* relevant `paint` performance entry used to determine the value. The reported
|
|
8
|
+
* value is a `DOMHighResTimeStamp`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const onFCP: (onReport: (metric: FCPMetric) => void, opts?: ReportOpts) => void;
|
|
11
|
+
//# sourceMappingURL=onFCP.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MetricRatingThresholds, ReportOpts, TTFBMetric } from './types';
|
|
2
|
+
/** Thresholds for TTFB. See https://web.dev/articles/ttfb#what_is_a_good_ttfb_score */
|
|
3
|
+
export declare const TTFBThresholds: MetricRatingThresholds;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the [TTFB](https://web.dev/articles/ttfb) value for the
|
|
6
|
+
* current page and calls the `callback` function once the page has loaded,
|
|
7
|
+
* along with the relevant `navigation` performance entry used to determine the
|
|
8
|
+
* value. The reported value is a `DOMHighResTimeStamp`.
|
|
9
|
+
*
|
|
10
|
+
* Note, this function waits until after the page is loaded to call `callback`
|
|
11
|
+
* in order to ensure all properties of the `navigation` entry are populated.
|
|
12
|
+
* This is useful if you want to report on other metrics exposed by the
|
|
13
|
+
* [Navigation Timing API](https://w3c.github.io/navigation-timing/). For
|
|
14
|
+
* example, the TTFB metric starts from the page's [time
|
|
15
|
+
* origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it
|
|
16
|
+
* includes time spent on DNS lookup, connection negotiation, network latency,
|
|
17
|
+
* and server processing time.
|
|
18
|
+
*/
|
|
19
|
+
export declare const onTTFB: (onReport: (metric: TTFBMetric) => void, opts?: ReportOpts) => void;
|
|
20
|
+
//# sourceMappingURL=onTTFB.d.ts.map
|