UNPKG

1.23 kBTypeScriptView Raw
1import type { StackFrame } from '@sentry/types';
2type WatchdogReturn = {
3 /** Resets the watchdog timer */
4 poll: () => void;
5 /** Enables or disables the watchdog timer */
6 enabled: (state: boolean) => void;
7};
8type CreateTimerImpl = () => {
9 getTimeMs: () => number;
10 reset: () => void;
11};
12/**
13 * A node.js watchdog timer
14 * @param pollInterval The interval that we expect to get polled at
15 * @param anrThreshold The threshold for when we consider ANR
16 * @param callback The callback to call for ANR
17 * @returns An object with `poll` and `enabled` functions {@link WatchdogReturn}
18 */
19export declare function watchdogTimer(createTimer: CreateTimerImpl, pollInterval: number, anrThreshold: number, callback: () => void): WatchdogReturn;
20interface Location {
21 scriptId: string;
22 lineNumber: number;
23 columnNumber?: number;
24}
25interface CallFrame {
26 functionName: string;
27 location: Location;
28 url: string;
29}
30/**
31 * Converts Debugger.CallFrame to Sentry StackFrame
32 */
33export declare function callFrameToStackFrame(frame: CallFrame, url: string | undefined, getModuleFromFilename: (filename: string | undefined) => string | undefined): StackFrame;
34export {};
35//# sourceMappingURL=anr.d.ts.map
\No newline at end of file