1 | import { Event, Integration, StackFrame } from '@sentry/types';
|
2 | /** Internal */
|
3 | interface SentryGlobal {
|
4 | Sentry?: {
|
5 | Integrations?: Integration[];
|
6 | };
|
7 | SENTRY_ENVIRONMENT?: string;
|
8 | SENTRY_DSN?: string;
|
9 | SENTRY_RELEASE?: {
|
10 | id?: string;
|
11 | };
|
12 | __SENTRY__: {
|
13 | globalEventProcessors: any;
|
14 | hub: any;
|
15 | logger: any;
|
16 | };
|
17 | }
|
18 | /**
|
19 | * Safely get global scope object
|
20 | *
|
21 | * @returns Global scope object
|
22 | */
|
23 | export declare function getGlobalObject<T>(): T & SentryGlobal;
|
24 | /**
|
25 | * UUID4 generator
|
26 | *
|
27 | * @returns string Generated UUID4.
|
28 | */
|
29 | export declare function uuid4(): string;
|
30 | /**
|
31 | * Parses string form of URL into an object
|
32 | * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
|
33 | * // intentionally using regex and not <a/> href parsing trick because React Native and other
|
34 | * // environments where DOM might not be available
|
35 | * @returns parsed URL object
|
36 | */
|
37 | export declare function parseUrl(url: string): {
|
38 | host?: string;
|
39 | path?: string;
|
40 | protocol?: string;
|
41 | relative?: string;
|
42 | };
|
43 | /**
|
44 | * Extracts either message or type+value from an event that can be used for user-facing logs
|
45 | * @returns event's description
|
46 | */
|
47 | export declare function getEventDescription(event: Event): string;
|
48 | /** JSDoc */
|
49 | export declare function consoleSandbox(callback: () => any): any;
|
50 | /**
|
51 | * Adds exception values, type and value to an synthetic Exception.
|
52 | * @param event The event to modify.
|
53 | * @param value Value of the exception.
|
54 | * @param type Type of the exception.
|
55 | * @hidden
|
56 | */
|
57 | export declare function addExceptionTypeValue(event: Event, value?: string, type?: string): void;
|
58 | /**
|
59 | * Adds exception mechanism to a given event.
|
60 | * @param event The event to modify.
|
61 | * @param mechanism Mechanism of the mechanism.
|
62 | * @hidden
|
63 | */
|
64 | export declare function addExceptionMechanism(event: Event, mechanism?: {
|
65 | [key: string]: any;
|
66 | }): void;
|
67 | /**
|
68 | * A safe form of location.href
|
69 | */
|
70 | export declare function getLocationHref(): string;
|
71 | /**
|
72 | * Represents Semantic Versioning object
|
73 | */
|
74 | interface SemVer {
|
75 | major?: number;
|
76 | minor?: number;
|
77 | patch?: number;
|
78 | prerelease?: string;
|
79 | buildmetadata?: string;
|
80 | }
|
81 | /**
|
82 | * Parses input into a SemVer interface
|
83 | * @param input string representation of a semver version
|
84 | */
|
85 | export declare function parseSemver(input: string): SemVer;
|
86 | /**
|
87 | * Extracts Retry-After value from the request header or returns default value
|
88 | * @param now current unix timestamp
|
89 | * @param header string representation of 'Retry-After' header
|
90 | */
|
91 | export declare function parseRetryAfterHeader(now: number, header?: string | number | null): number;
|
92 | /**
|
93 | * This function adds context (pre/post/line) lines to the provided frame
|
94 | *
|
95 | * @param lines string[] containing all lines
|
96 | * @param frame StackFrame that will be mutated
|
97 | * @param linesOfContext number of context lines we want to add pre/post
|
98 | */
|
99 | export declare function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext?: number): void;
|
100 | /**
|
101 | * Strip the query string and fragment off of a given URL or path (if present)
|
102 | *
|
103 | * @param urlPath Full URL or path, including possible query string and/or fragment
|
104 | * @returns URL or path without query string or fragment
|
105 | */
|
106 | export declare function stripUrlQueryAndFragment(urlPath: string): string;
|
107 | export {};
|
108 | //# sourceMappingURL=misc.d.ts.map |
\ | No newline at end of file |