import { isUserTimingAPISupported } from './is-user-timing-api-supported' ; import { isNodeJSEnv } from './is-nodejs-env' ; /**
 * Response type of `PerfMarks.getNavigationMarker()` and `Perf.getEntriesByType()` methods
 *
 */ export type PerfMarksPerformanceNavigationTiming = PerformanceNavigationTiming | { [ key ] : any ; } ; param markName returns const getEntriesByType = ( entryName ) : PerfMarksPerformanceNavigationTiming [ ] => { if ( ! isUserTimingAPISupported || isNodeJSEnv ) { return [ ] ; } return ( performance . getEntriesByType ( entryName ) as PerfMarksPerformanceNavigationTiming [ ] ) || [ ] ; } ; returns const getNavigationMarker = ( ) : PerfMarksPerformanceNavigationTiming => getEntriesByType ( 'navigation' ) . pop ( ) || { } ; export { getNavigationMarker , getEntriesByType } ;