1 | import { Integrations as CoreIntegrations } from '@sentry/core';
|
2 | import { BrowserOptions } from './backend';
|
3 | import { ReportDialogOptions } from './helpers';
|
4 | import { Breadcrumbs, Dedupe, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';
|
5 | export declare const defaultIntegrations: (CoreIntegrations.FunctionToString | CoreIntegrations.InboundFilters | GlobalHandlers | TryCatch | Breadcrumbs | LinkedErrors | UserAgent | Dedupe)[];
|
6 | /**
|
7 | * The Sentry Browser SDK Client.
|
8 | *
|
9 | * To use this SDK, call the {@link init} function as early as possible when
|
10 | * loading the web page. To set context information or send manual events, use
|
11 | * the provided methods.
|
12 | *
|
13 | * @example
|
14 | *
|
15 | * ```
|
16 | *
|
17 | * import { init } from '@sentry/browser';
|
18 | *
|
19 | * init({
|
20 | * dsn: '__DSN__',
|
21 | * // ...
|
22 | * });
|
23 | * ```
|
24 | *
|
25 | * @example
|
26 | * ```
|
27 | *
|
28 | * import { configureScope } from '@sentry/browser';
|
29 | * configureScope((scope: Scope) => {
|
30 | * scope.setExtra({ battery: 0.7 });
|
31 | * scope.setTag({ user_mode: 'admin' });
|
32 | * scope.setUser({ id: '4711' });
|
33 | * });
|
34 | * ```
|
35 | *
|
36 | * @example
|
37 | * ```
|
38 | *
|
39 | * import { addBreadcrumb } from '@sentry/browser';
|
40 | * addBreadcrumb({
|
41 | * message: 'My Breadcrumb',
|
42 | * // ...
|
43 | * });
|
44 | * ```
|
45 | *
|
46 | * @example
|
47 | *
|
48 | * ```
|
49 | *
|
50 | * import * as Sentry from '@sentry/browser';
|
51 | * Sentry.captureMessage('Hello, world!');
|
52 | * Sentry.captureException(new Error('Good bye'));
|
53 | * Sentry.captureEvent({
|
54 | * message: 'Manual',
|
55 | * stacktrace: [
|
56 | * // ...
|
57 | * ],
|
58 | * });
|
59 | * ```
|
60 | *
|
61 | * @see {@link BrowserOptions} for documentation on configuration options.
|
62 | */
|
63 | export declare function init(options?: BrowserOptions): void;
|
64 | /**
|
65 | * Present the user with a report dialog.
|
66 | *
|
67 | * @param options Everything is optional, we try to fetch all info need from the global scope.
|
68 | */
|
69 | export declare function showReportDialog(options?: ReportDialogOptions): void;
|
70 | /**
|
71 | * This is the getter for lastEventId.
|
72 | *
|
73 | * @returns The last event id of a captured event.
|
74 | */
|
75 | export declare function lastEventId(): string | undefined;
|
76 | /**
|
77 | * This function is here to be API compatible with the loader.
|
78 | * @hidden
|
79 | */
|
80 | export declare function forceLoad(): void;
|
81 | /**
|
82 | * This function is here to be API compatible with the loader.
|
83 | * @hidden
|
84 | */
|
85 | export declare function onLoad(callback: () => void): void;
|
86 | /**
|
87 | * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
|
88 | *
|
89 | * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
|
90 | * the client to wait until all events are sent before resolving the promise.
|
91 | * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
92 | * doesn't (or if there's no client defined).
|
93 | */
|
94 | export declare function flush(timeout?: number): PromiseLike<boolean>;
|
95 | /**
|
96 | * Call `close()` on the current client, if there is one. See {@link Client.close}.
|
97 | *
|
98 | * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
|
99 | * parameter will cause the client to wait until all events are sent before disabling itself.
|
100 | * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
101 | * doesn't (or if there's no client defined).
|
102 | */
|
103 | export declare function close(timeout?: number): PromiseLike<boolean>;
|
104 | /**
|
105 | * Wrap code within a try/catch block so the SDK is able to capture errors.
|
106 | *
|
107 | * @param fn A function to wrap.
|
108 | *
|
109 | * @returns The result of wrapped function call.
|
110 | */
|
111 | export declare function wrap(fn: (...args: any) => any): any;
|
112 | //# sourceMappingURL=sdk.d.ts.map |
\ | No newline at end of file |