1 | import { Dsn } from './dsn';
|
2 | import { Event, EventHint } from './event';
|
3 | import { Integration, IntegrationClass } from './integration';
|
4 | import { Options } from './options';
|
5 | import { Scope } from './scope';
|
6 | import { Session } from './session';
|
7 | import { Severity } from './severity';
|
8 | /**
|
9 | * User-Facing Sentry SDK Client.
|
10 | *
|
11 | * This interface contains all methods to interface with the SDK once it has
|
12 | * been installed. It allows to send events to Sentry, record breadcrumbs and
|
13 | * set a context included in every event. Since the SDK mutates its environment,
|
14 | * there will only be one instance during runtime.
|
15 | *
|
16 | */
|
17 | export interface Client<O extends Options = Options> {
|
18 | /**
|
19 | * Captures an exception event and sends it to Sentry.
|
20 | *
|
21 | * @param exception An exception-like object.
|
22 | * @param hint May contain additional information about the original exception.
|
23 | * @param scope An optional scope containing event metadata.
|
24 | * @returns The event id
|
25 | */
|
26 | captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
|
27 | /**
|
28 | * Captures a message event and sends it to Sentry.
|
29 | *
|
30 | * @param message The message to send to Sentry.
|
31 | * @param level Define the level of the message.
|
32 | * @param hint May contain additional information about the original exception.
|
33 | * @param scope An optional scope containing event metadata.
|
34 | * @returns The event id
|
35 | */
|
36 | captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined;
|
37 | /**
|
38 | * Captures a manually created event and sends it to Sentry.
|
39 | *
|
40 | * @param event The event to send to Sentry.
|
41 | * @param hint May contain additional information about the original exception.
|
42 | * @param scope An optional scope containing event metadata.
|
43 | * @returns The event id
|
44 | */
|
45 | captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
|
46 | /** Captures a session
|
47 | *
|
48 | * @param session Session to be delivered
|
49 | */
|
50 | captureSession?(session: Session): void;
|
51 | /** Returns the current Dsn. */
|
52 | getDsn(): Dsn | undefined;
|
53 | /** Returns the current options. */
|
54 | getOptions(): O;
|
55 | /**
|
56 | * A promise that resolves when all current events have been sent.
|
57 | * If you provide a timeout and the queue takes longer to drain the promise returns false.
|
58 | *
|
59 | * @param timeout Maximum time in ms the client should wait.
|
60 | */
|
61 | close(timeout?: number): PromiseLike<boolean>;
|
62 | /**
|
63 | * A promise that resolves when all current events have been sent.
|
64 | * If you provide a timeout and the queue takes longer to drain the promise returns false.
|
65 | *
|
66 | * @param timeout Maximum time in ms the client should wait.
|
67 | */
|
68 | flush(timeout?: number): PromiseLike<boolean>;
|
69 | /** Returns an array of installed integrations on the client. */
|
70 | getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
|
71 | /** This is an internal function to setup all integrations that should run on the client */
|
72 | setupIntegrations(): void;
|
73 | }
|
74 | //# sourceMappingURL=client.d.ts.map |
\ | No newline at end of file |