28 lines
665 B
TypeScript
28 lines
665 B
TypeScript
export type ErrorReportingUser = {
|
|
id?: string;
|
|
email?: string;
|
|
username?: string;
|
|
};
|
|
|
|
export type ErrorReportingLevel =
|
|
| "fatal"
|
|
| "error"
|
|
| "warning"
|
|
| "info"
|
|
| "debug"
|
|
| "log";
|
|
|
|
export interface ErrorReportingService {
|
|
captureException(
|
|
error: unknown,
|
|
context?: Record<string, unknown>,
|
|
): Promise<string | undefined> | string | undefined;
|
|
captureMessage(
|
|
message: string,
|
|
level?: ErrorReportingLevel,
|
|
): Promise<string | undefined> | string | undefined;
|
|
setUser(user: ErrorReportingUser | null): void;
|
|
setTag(key: string, value: string): void;
|
|
withScope<T>(fn: () => T, context?: Record<string, unknown>): T;
|
|
}
|