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