UNPKG

@dash0/sdk-web

Version:

Dash0's Web SDK to collect telemetry from end-users' web browsers

50 lines (49 loc) 2.12 kB
export declare const isResourceTimingAvailable: boolean; export declare const isPerformanceObserverAvailable: any; export declare const PerformanceTimingNames: Readonly<{ CONNECT_END: "connectEnd"; CONNECT_START: "connectStart"; DECODED_BODY_SIZE: "decodedBodySize"; DOM_COMPLETE: "domComplete"; DOM_CONTENT_LOADED_EVENT_END: "domContentLoadedEventEnd"; DOM_CONTENT_LOADED_EVENT_START: "domContentLoadedEventStart"; DOM_INTERACTIVE: "domInteractive"; DOMAIN_LOOKUP_END: "domainLookupEnd"; DOMAIN_LOOKUP_START: "domainLookupStart"; ENCODED_BODY_SIZE: "encodedBodySize"; FETCH_START: "fetchStart"; LOAD_EVENT_END: "loadEventEnd"; LOAD_EVENT_START: "loadEventStart"; NAVIGATION_START: "navigationStart"; REDIRECT_END: "redirectEnd"; REDIRECT_START: "redirectStart"; REQUEST_START: "requestStart"; RESPONSE_END: "responseEnd"; RESPONSE_START: "responseStart"; SECURE_CONNECTION_START: "secureConnectionStart"; START_TIME: "startTime"; UNLOAD_EVENT_END: "unloadEventEnd"; UNLOAD_EVENT_START: "unloadEventStart"; }>; export type ObserveResourcePerformanceResult = { duration: number; resource?: PerformanceResourceTiming | null; }; type ObserveResourcePerformanceResultCallback = (arg: ObserveResourcePerformanceResult) => any; type ObserveResourcePerformanceOptions = { resourceMatcher: (arg: PerformanceResourceTiming) => boolean; maxWaitForResourceMillis: number; maxToleranceForResourceTimingsMillis: number; onEnd: ObserveResourcePerformanceResultCallback; }; type PerformanceObservationContoller = { start: () => void; /** * Ends performance observation and starts matching the observed resources. * @param endTs End performance timing timestamp to use for the end of the resource, instead of the current time when end is called. Useful when calling end from a timeout handler */ end: (endTs?: number) => void; cancel: () => void; }; export declare function observeResourcePerformance(opts: ObserveResourcePerformanceOptions): PerformanceObservationContoller; export {};