2023-02-03 18:56:44 +01:00
|
|
|
// In order for variables to be considered on the global scope they must be
|
|
|
|
// declared using var and not const or let, which is why this rule is disabled
|
|
|
|
/* eslint-disable no-var */
|
2023-07-26 14:13:28 +02:00
|
|
|
import * as Sentry from '@sentry/browser';
|
2023-02-03 18:56:44 +01:00
|
|
|
|
|
|
|
declare class Platform {
|
|
|
|
openTab: (opts: { url: string }) => void;
|
|
|
|
|
|
|
|
closeCurrentWindow: () => void;
|
|
|
|
}
|
2023-06-14 17:23:16 +02:00
|
|
|
|
2023-08-16 21:26:20 +02:00
|
|
|
type SentryObject = Sentry & {
|
2023-07-26 14:13:28 +02:00
|
|
|
// Verifies that the user has opted into metrics and then updates the sentry
|
|
|
|
// instance to track sessions and begins the session.
|
|
|
|
startSession: () => void;
|
|
|
|
|
|
|
|
// Verifies that the user has opted out of metrics and then updates the
|
|
|
|
// sentry instance to NOT track sessions and ends the current session.
|
|
|
|
endSession: () => void;
|
|
|
|
|
|
|
|
// Calls either startSession or endSession based on optin status
|
|
|
|
toggleSession: () => void;
|
2023-08-16 21:26:20 +02:00
|
|
|
};
|
2023-07-26 14:13:28 +02:00
|
|
|
|
2023-02-03 18:56:44 +01:00
|
|
|
export declare global {
|
|
|
|
var platform: Platform;
|
2023-07-26 14:13:28 +02:00
|
|
|
// Sentry is undefined in dev, so use optional chaining
|
|
|
|
var sentry: SentryObject | undefined;
|
2023-06-14 17:23:16 +02:00
|
|
|
|
|
|
|
namespace jest {
|
|
|
|
interface Matchers<R> {
|
|
|
|
toBeFulfilled(): Promise<R>;
|
|
|
|
toNeverResolve(): Promise<R>;
|
|
|
|
}
|
|
|
|
}
|
2023-02-03 18:56:44 +01:00
|
|
|
}
|