UNPKG

1.54 kBTypeScriptView Raw
1import { EventProcessor, Hub, Integration } from '@sentry/types';
2interface Report {
3 [key: string]: unknown;
4 type: ReportTypes;
5 url: string;
6 body?: ReportBody;
7}
8declare type ReportTypes = 'crash' | 'deprecation' | 'intervention';
9declare type ReportBody = CrashReportBody | DeprecationReportBody | InterventionReportBody;
10interface CrashReportBody {
11 [key: string]: unknown;
12 crashId: string;
13 reason?: string;
14}
15interface DeprecationReportBody {
16 [key: string]: unknown;
17 id: string;
18 anticipatedRemoval?: Date;
19 message: string;
20 sourceFile?: string;
21 lineNumber?: number;
22 columnNumber?: number;
23}
24interface InterventionReportBody {
25 [key: string]: unknown;
26 id: string;
27 message: string;
28 sourceFile?: string;
29 lineNumber?: number;
30 columnNumber?: number;
31}
32/** Reporting API integration - https://w3c.github.io/reporting/ */
33export declare class ReportingObserver implements Integration {
34 private readonly _options;
35 /**
36 * @inheritDoc
37 */
38 static id: string;
39 /**
40 * @inheritDoc
41 */
42 readonly name: string;
43 /**
44 * Returns current hub.
45 */
46 private _getCurrentHub?;
47 /**
48 * @inheritDoc
49 */
50 constructor(_options?: {
51 types?: ReportTypes[];
52 });
53 /**
54 * @inheritDoc
55 */
56 setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
57 /**
58 * @inheritDoc
59 */
60 handler(reports: Report[]): void;
61}
62export {};
63//# sourceMappingURL=reportingobserver.d.ts.map
\No newline at end of file