1 | import type { Attachment, Breadcrumb, CaptureContext, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, PropagationContext, 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 | protected _propagationContext: PropagationContext;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | protected _sdkProcessingMetadata: {
|
34 | [key: string]: unknown;
|
35 | };
|
36 |
|
37 | protected _fingerprint?: string[];
|
38 |
|
39 | protected _level?: Severity | SeverityLevel;
|
40 |
|
41 | protected _transactionName?: string;
|
42 |
|
43 | protected _span?: Span;
|
44 |
|
45 | protected _session?: Session;
|
46 |
|
47 | protected _requestSession?: RequestSession;
|
48 | constructor();
|
49 | /**
|
50 | * Inherit values from the parent scope.
|
51 | * @param scope to clone.
|
52 | */
|
53 | static clone(scope?: Scope): Scope;
|
54 | /**
|
55 | * Add internal on change listener. Used for sub SDKs that need to store the scope.
|
56 | * @hidden
|
57 | */
|
58 | addScopeListener(callback: (scope: Scope) => void): void;
|
59 | /**
|
60 | * @inheritDoc
|
61 | */
|
62 | addEventProcessor(callback: EventProcessor): this;
|
63 | /**
|
64 | * @inheritDoc
|
65 | */
|
66 | setUser(user: User | null): this;
|
67 | /**
|
68 | * @inheritDoc
|
69 | */
|
70 | getUser(): User | undefined;
|
71 | /**
|
72 | * @inheritDoc
|
73 | */
|
74 | getRequestSession(): RequestSession | undefined;
|
75 | /**
|
76 | * @inheritDoc
|
77 | */
|
78 | setRequestSession(requestSession?: RequestSession): this;
|
79 | /**
|
80 | * @inheritDoc
|
81 | */
|
82 | setTags(tags: {
|
83 | [key: string]: Primitive;
|
84 | }): this;
|
85 | /**
|
86 | * @inheritDoc
|
87 | */
|
88 | setTag(key: string, value: Primitive): this;
|
89 | /**
|
90 | * @inheritDoc
|
91 | */
|
92 | setExtras(extras: Extras): this;
|
93 | /**
|
94 | * @inheritDoc
|
95 | */
|
96 | setExtra(key: string, extra: Extra): this;
|
97 | /**
|
98 | * @inheritDoc
|
99 | */
|
100 | setFingerprint(fingerprint: string[]): this;
|
101 | /**
|
102 | * @inheritDoc
|
103 | */
|
104 | setLevel(level: Severity | SeverityLevel): this;
|
105 | /**
|
106 | * @inheritDoc
|
107 | */
|
108 | setTransactionName(name?: string): this;
|
109 | /**
|
110 | * @inheritDoc
|
111 | */
|
112 | setContext(key: string, context: Context | null): this;
|
113 | /**
|
114 | * @inheritDoc
|
115 | */
|
116 | setSpan(span?: Span): this;
|
117 | /**
|
118 | * @inheritDoc
|
119 | */
|
120 | getSpan(): Span | undefined;
|
121 | /**
|
122 | * @inheritDoc
|
123 | */
|
124 | getTransaction(): Transaction | undefined;
|
125 | /**
|
126 | * @inheritDoc
|
127 | */
|
128 | setSession(session?: Session): this;
|
129 | /**
|
130 | * @inheritDoc
|
131 | */
|
132 | getSession(): Session | undefined;
|
133 | /**
|
134 | * @inheritDoc
|
135 | */
|
136 | update(captureContext?: CaptureContext): this;
|
137 | /**
|
138 | * @inheritDoc
|
139 | */
|
140 | clear(): this;
|
141 | /**
|
142 | * @inheritDoc
|
143 | */
|
144 | addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
145 | /**
|
146 | * @inheritDoc
|
147 | */
|
148 | getLastBreadcrumb(): Breadcrumb | undefined;
|
149 | /**
|
150 | * @inheritDoc
|
151 | */
|
152 | clearBreadcrumbs(): this;
|
153 | /**
|
154 | * @inheritDoc
|
155 | */
|
156 | addAttachment(attachment: Attachment): this;
|
157 | /**
|
158 | * @inheritDoc
|
159 | */
|
160 | getAttachments(): Attachment[];
|
161 | /**
|
162 | * @inheritDoc
|
163 | */
|
164 | clearAttachments(): this;
|
165 | /**
|
166 | * Applies data from the scope to the event and runs all event processors on it.
|
167 | *
|
168 | * @param event Event
|
169 | * @param hint Object containing additional information about the original exception, for use by the event processors.
|
170 | * @hidden
|
171 | */
|
172 | applyToEvent(event: Event, hint?: EventHint, additionalEventProcessors?: EventProcessor[]): PromiseLike<Event | null>;
|
173 | /**
|
174 | * Add data which will be accessible during event processing but won't get sent to Sentry
|
175 | */
|
176 | setSDKProcessingMetadata(newData: {
|
177 | [key: string]: unknown;
|
178 | }): this;
|
179 | /**
|
180 | * @inheritDoc
|
181 | */
|
182 | setPropagationContext(context: PropagationContext): this;
|
183 | /**
|
184 | * @inheritDoc
|
185 | */
|
186 | getPropagationContext(): PropagationContext;
|
187 | /**
|
188 | * Get the breadcrumbs for this scope.
|
189 | */
|
190 | protected _getBreadcrumbs(): Breadcrumb[];
|
191 | /**
|
192 | * This will be called on every set call.
|
193 | */
|
194 | protected _notifyScopeListeners(): void;
|
195 | /**
|
196 | * Applies fingerprint from the scope to the event if there's one,
|
197 | * uses message if there's one instead or get rid of empty fingerprint
|
198 | */
|
199 | private _applyFingerprint;
|
200 | }
|
201 | //# sourceMappingURL=scope.d.ts.map |
\ | No newline at end of file |