UNPKG

2.03 kBTypeScriptView Raw
1import type { CaptureContext, Client, ClientOptions, Event, EventHint, Scope as ScopeInterface, ScopeContext, StackParser } from '@sentry/types';
2/**
3 * This type makes sure that we get either a CaptureContext, OR an EventHint.
4 * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:
5 * { user: { id: '123' }, mechanism: { handled: false } }
6 */
7export type ExclusiveEventHintOrCaptureContext = (CaptureContext & Partial<{
8 [key in keyof EventHint]: never;
9}>) | (EventHint & Partial<{
10 [key in keyof ScopeContext]: never;
11}>);
12/**
13 * Adds common information to events.
14 *
15 * The information includes release and environment from `options`,
16 * breadcrumbs and context (extra, tags and user) from the scope.
17 *
18 * Information that is already present in the event is never overwritten. For
19 * nested objects, such as the context, keys are merged.
20 *
21 * @param event The original event.
22 * @param hint May contain additional information about the original exception.
23 * @param scope A scope containing event metadata.
24 * @returns A new event with more information.
25 * @hidden
26 */
27export declare function prepareEvent(options: ClientOptions, event: Event, hint: EventHint, scope?: ScopeInterface, client?: Client, isolationScope?: ScopeInterface): PromiseLike<Event | null>;
28/**
29 * Puts debug IDs into the stack frames of an error event.
30 */
31export declare function applyDebugIds(event: Event, stackParser: StackParser): void;
32/**
33 * Moves debug IDs from the stack frames of an error event into the debug_meta field.
34 */
35export declare function applyDebugMeta(event: Event): void;
36/**
37 * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.
38 * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.
39 */
40export declare function parseEventHintOrCaptureContext(hint: ExclusiveEventHintOrCaptureContext | undefined): EventHint | undefined;
41//# sourceMappingURL=prepareEvent.d.ts.map
\No newline at end of file