1 | import { Attachment, Breadcrumb, CaptureContext, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, RequestSession, Scope as ScopeInterface, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export declare class Scope implements ScopeInterface {
|
7 |
|
8 | protected _notifyingListeners: boolean;
|
9 |
|
10 | protected _scopeListeners: Array<(scope: Scope) => void>;
|
11 |
|
12 | protected _eventProcessors: EventProcessor[];
|
13 |
|
14 | protected _breadcrumbs: Breadcrumb[];
|
15 |
|
16 | protected _user: User;
|
17 |
|
18 | protected _tags: {
|
19 | [key: string]: Primitive;
|
20 | };
|
21 |
|
22 | protected _extra: Extras;
|
23 |
|
24 | protected _contexts: Contexts;
|
25 |
|
26 | protected _attachments: Attachment[];
|
27 | |
28 |
|
29 |
|
30 |
|
31 | protected _sdkProcessingMetadata: {
|
32 | [key: string]: unknown;
|
33 | };
|
34 |
|
35 | protected _fingerprint?: string[];
|
36 |
|
37 | protected _level?: Severity | SeverityLevel;
|
38 |
|
39 | protected _transactionName?: string;
|
40 |
|
41 | protected _span?: Span;
|
42 |
|
43 | protected _session?: Session;
|
44 |
|
45 | protected _requestSession?: RequestSession;
|
46 | constructor();
|
47 | /**
|
48 | * Inherit values from the parent scope.
|
49 | * @param scope to clone.
|
50 | */
|
51 | static clone(scope?: Scope): Scope;
|
52 | /**
|
53 | * Add internal on change listener. Used for sub SDKs that need to store the scope.
|
54 | * @hidden
|
55 | */
|
56 | addScopeListener(callback: (scope: Scope) => void): void;
|
57 | /**
|
58 | * @inheritDoc
|
59 | */
|
60 | addEventProcessor(callback: EventProcessor): this;
|
61 | /**
|
62 | * @inheritDoc
|
63 | */
|
64 | setUser(user: User | null): this;
|
65 | /**
|
66 | * @inheritDoc
|
67 | */
|
68 | getUser(): User | undefined;
|
69 | /**
|
70 | * @inheritDoc
|
71 | */
|
72 | getRequestSession(): RequestSession | undefined;
|
73 | /**
|
74 | * @inheritDoc
|
75 | */
|
76 | setRequestSession(requestSession?: RequestSession): this;
|
77 | /**
|
78 | * @inheritDoc
|
79 | */
|
80 | setTags(tags: {
|
81 | [key: string]: Primitive;
|
82 | }): this;
|
83 | /**
|
84 | * @inheritDoc
|
85 | */
|
86 | setTag(key: string, value: Primitive): this;
|
87 | /**
|
88 | * @inheritDoc
|
89 | */
|
90 | setExtras(extras: Extras): this;
|
91 | /**
|
92 | * @inheritDoc
|
93 | */
|
94 | setExtra(key: string, extra: Extra): this;
|
95 | /**
|
96 | * @inheritDoc
|
97 | */
|
98 | setFingerprint(fingerprint: string[]): this;
|
99 | /**
|
100 | * @inheritDoc
|
101 | */
|
102 | setLevel(level: Severity | SeverityLevel): this;
|
103 | /**
|
104 | * @inheritDoc
|
105 | */
|
106 | setTransactionName(name?: string): this;
|
107 | /**
|
108 | * @inheritDoc
|
109 | */
|
110 | setContext(key: string, context: Context | null): this;
|
111 | /**
|
112 | * @inheritDoc
|
113 | */
|
114 | setSpan(span?: Span): this;
|
115 | /**
|
116 | * @inheritDoc
|
117 | */
|
118 | getSpan(): Span | undefined;
|
119 | /**
|
120 | * @inheritDoc
|
121 | */
|
122 | getTransaction(): Transaction | undefined;
|
123 | /**
|
124 | * @inheritDoc
|
125 | */
|
126 | setSession(session?: Session): this;
|
127 | /**
|
128 | * @inheritDoc
|
129 | */
|
130 | getSession(): Session | undefined;
|
131 | /**
|
132 | * @inheritDoc
|
133 | */
|
134 | update(captureContext?: CaptureContext): this;
|
135 | /**
|
136 | * @inheritDoc
|
137 | */
|
138 | clear(): this;
|
139 | /**
|
140 | * @inheritDoc
|
141 | */
|
142 | addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
143 | /**
|
144 | * @inheritDoc
|
145 | */
|
146 | clearBreadcrumbs(): this;
|
147 | /**
|
148 | * @inheritDoc
|
149 | */
|
150 | addAttachment(attachment: Attachment): this;
|
151 | /**
|
152 | * @inheritDoc
|
153 | */
|
154 | getAttachments(): Attachment[];
|
155 | /**
|
156 | * @inheritDoc
|
157 | */
|
158 | clearAttachments(): this;
|
159 | /**
|
160 | * Applies data from the scope to the event and runs all event processors on it.
|
161 | *
|
162 | * @param event Event
|
163 | * @param hint Object containing additional information about the original exception, for use by the event processors.
|
164 | * @hidden
|
165 | */
|
166 | applyToEvent(event: Event, hint?: EventHint): PromiseLike<Event | null>;
|
167 | /**
|
168 | * Add data which will be accessible during event processing but won't get sent to Sentry
|
169 | */
|
170 | setSDKProcessingMetadata(newData: {
|
171 | [key: string]: unknown;
|
172 | }): this;
|
173 | /**
|
174 | * This will be called after {@link applyToEvent} is finished.
|
175 | */
|
176 | protected _notifyEventProcessors(processors: EventProcessor[], event: Event | null, hint: EventHint, index?: number): PromiseLike<Event | null>;
|
177 | |
178 |
|
179 |
|
180 | protected _notifyScopeListeners(): void;
|
181 | |
182 |
|
183 |
|
184 |
|
185 | private _applyFingerprint;
|
186 | }
|
187 |
|
188 |
|
189 |
|
190 |
|
191 | export declare function addGlobalEventProcessor(callback: EventProcessor): void;
|
192 |
|
\ | No newline at end of file |