@spotlightjs/overlay 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE +13 -0
  2. package/dist/App.d.ts +12 -0
  3. package/dist/components/Debugger.d.ts +9 -0
  4. package/dist/components/Overview.d.ts +5 -0
  5. package/dist/components/Tabs.d.ts +14 -0
  6. package/dist/components/Trigger.d.ts +9 -0
  7. package/dist/index.d.ts +28 -0
  8. package/dist/integrations/console/console-tab.d.ts +6 -0
  9. package/dist/integrations/console/index.d.ts +18 -0
  10. package/dist/integrations/console/types.d.ts +7 -0
  11. package/dist/integrations/integration.d.ts +99 -0
  12. package/dist/integrations/sentry/components/DateTime.d.ts +4 -0
  13. package/dist/integrations/sentry/components/EventBreadcrumbs.d.ts +4 -0
  14. package/dist/integrations/sentry/components/EventContexts.d.ts +4 -0
  15. package/dist/integrations/sentry/components/EventDetails.d.ts +1 -0
  16. package/dist/integrations/sentry/components/EventList.d.ts +1 -0
  17. package/dist/integrations/sentry/components/Events/Error/Frame.d.ts +5 -0
  18. package/dist/integrations/sentry/components/Events/Error.d.ts +10 -0
  19. package/dist/integrations/sentry/components/PlatformIcon.d.ts +9 -0
  20. package/dist/integrations/sentry/components/SdkList.d.ts +1 -0
  21. package/dist/integrations/sentry/components/SpanDetails.d.ts +7 -0
  22. package/dist/integrations/sentry/components/SpanTree.d.ts +8 -0
  23. package/dist/integrations/sentry/components/Time.d.ts +4 -0
  24. package/dist/integrations/sentry/components/TimeSince.d.ts +4 -0
  25. package/dist/integrations/sentry/components/TraceDetails.d.ts +1 -0
  26. package/dist/integrations/sentry/components/TraceList.d.ts +1 -0
  27. package/dist/integrations/sentry/data/sentryDataCache.d.ts +33 -0
  28. package/dist/integrations/sentry/data/sentryDataCache.test.d.ts +1 -0
  29. package/dist/integrations/sentry/data/sentryEventsContext.d.ts +7 -0
  30. package/dist/integrations/sentry/data/useSentryEvents.d.ts +1 -0
  31. package/dist/integrations/sentry/data/useSentrySdks.d.ts +1 -0
  32. package/dist/integrations/sentry/data/useSentryTraces.d.ts +1 -0
  33. package/dist/integrations/sentry/index.d.ts +28 -0
  34. package/dist/integrations/sentry/index.test.d.ts +1 -0
  35. package/dist/integrations/sentry/sentry-integration.d.ts +5 -0
  36. package/dist/integrations/sentry/tabs/ErrorsTab.d.ts +1 -0
  37. package/dist/integrations/sentry/tabs/SdksTab.d.ts +1 -0
  38. package/dist/integrations/sentry/tabs/TracesTab.d.ts +1 -0
  39. package/dist/integrations/sentry/types.d.ts +118 -0
  40. package/dist/integrations/sentry/utils/duration.d.ts +2 -0
  41. package/dist/integrations/sentry/utils/traces.d.ts +2 -0
  42. package/dist/integrations/sentry/utils/traces.test.d.ts +1 -0
  43. package/dist/integrations/vite-inspect/index.d.ts +10 -0
  44. package/dist/integrations/vite-inspect/vite-inspect.d.ts +1 -0
  45. package/dist/lib/classNames.d.ts +1 -0
  46. package/dist/lib/eventTarget.d.ts +13 -0
  47. package/dist/lib/logger.d.ts +3 -0
  48. package/dist/lib/useKeyPress.d.ts +6 -0
  49. package/dist/lib/uuid.d.ts +1 -0
  50. package/dist/sentry-spotlight.d.ts +1 -0
  51. package/dist/sentry-spotlight.js +35566 -0
  52. package/dist/sentry-spotlight.umd.cjs +295 -0
  53. package/dist/sidecar.d.ts +4 -0
  54. package/dist/types.d.ts +9 -0
  55. package/package.json +62 -0
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Sentry
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/dist/App.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { type Anchor } from './components/Trigger';
2
+ import type { Integration } from './integrations/integration';
3
+ type AppProps = {
4
+ fullScreen?: boolean;
5
+ showTriggerButton?: boolean;
6
+ defaultEventId?: string;
7
+ integrations?: Integration[];
8
+ sidecar: string;
9
+ anchor?: Anchor;
10
+ };
11
+ export default function App({ fullScreen, showTriggerButton, defaultEventId, integrations, sidecar, anchor, }: AppProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Integration, IntegrationData } from '../integrations/integration';
2
+ export default function Debugger({ integrations, isOpen, setOpen, integrationData, isOnline, }: {
3
+ integrations: Integration[];
4
+ isOpen: boolean;
5
+ setOpen: (value: boolean) => void;
6
+ defaultEventId?: string;
7
+ integrationData: IntegrationData<unknown>;
8
+ isOnline: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Integration, IntegrationData } from '../integrations/integration';
2
+ export default function Overview({ integrations, integrationData, }: {
3
+ integrations: Integration[];
4
+ integrationData: IntegrationData<unknown>;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { IntegrationTab } from '../integrations/integration';
2
+ export type Props = {
3
+ /**
4
+ * Array of tabs to display.
5
+ */
6
+ tabs: IntegrationTab<unknown>[];
7
+ /**
8
+ * Whether the tabs are nested inside another tab.
9
+ * If `nested` is `true`, links will be set relative to the parent
10
+ * tab route instead of absolute to the root.
11
+ */
12
+ nested?: boolean;
13
+ };
14
+ export default function Tabs({ tabs, nested }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { TriggerButtonCount } from '../types';
2
+ export declare const DEFAULT_ANCHOR = "bottomRight";
3
+ export type Anchor = 'bottomRight' | 'bottomLeft' | 'centerRight' | 'centerLeft' | 'topLeft' | 'topRight';
4
+ export default function Trigger({ isOpen, setOpen, count, anchor, }: {
5
+ isOpen: boolean;
6
+ setOpen: (value: boolean) => void;
7
+ count: TriggerButtonCount;
8
+ anchor?: Anchor;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { type Anchor } from './components/Trigger.tsx';
2
+ import type { Integration } from './integrations/integration.ts';
3
+ export { default as console } from './integrations/console/index.ts';
4
+ export { default as sentry } from './integrations/sentry/index.ts';
5
+ export { default as viteInspect } from './integrations/vite-inspect/index.ts';
6
+ /**
7
+ * Open the Spotlight debugger Window
8
+ */
9
+ export declare function openSpotlight(): Promise<void>;
10
+ /**
11
+ * Close the Spotlight debugger Window
12
+ */
13
+ export declare function closeSpotlight(): Promise<void>;
14
+ /**
15
+ * Invokes the passed in callback when the Spotlight debugger Window is closed
16
+ */
17
+ export declare function onClose(cb: () => void): Promise<void>;
18
+ export declare function init({ fullScreen, showTriggerButton, integrations, defaultEventId, injectImmediately, sidecar, anchor, debug, }?: {
19
+ integrations?: Integration[];
20
+ fullScreen?: boolean;
21
+ defaultEventId?: string;
22
+ sidecarUrl?: string;
23
+ showTriggerButton?: boolean;
24
+ injectImmediately?: boolean;
25
+ sidecar?: string;
26
+ anchor?: Anchor;
27
+ debug?: boolean;
28
+ }): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { ConsoleMessage } from './types';
2
+ type Props = {
3
+ processedEvents?: ConsoleMessage[];
4
+ };
5
+ export default function ConsoleTab({ processedEvents }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import ConsoleTab from './console-tab';
2
+ import { ConsoleMessage } from './types';
3
+ export default function consoleIntegration(): {
4
+ name: string;
5
+ forwardedContentType: string[];
6
+ tabs: ({ processedEvents }: {
7
+ processedEvents: any[];
8
+ }) => {
9
+ id: string;
10
+ title: string;
11
+ notificationCount: number;
12
+ content: typeof ConsoleTab;
13
+ }[];
14
+ setup: () => void;
15
+ processEvent({ data }: import("../integration").RawEventContext): {
16
+ event: ConsoleMessage;
17
+ };
18
+ };
@@ -0,0 +1,7 @@
1
+ export type ConsoleMessage = {
2
+ type: Level;
3
+ args: string[];
4
+ msg: string;
5
+ sessionId: string;
6
+ };
7
+ export type Level = 'log' | 'warn' | 'error';
@@ -0,0 +1,99 @@
1
+ /// <reference types="react" />
2
+ export type Integration<T = any> = {
3
+ /**
4
+ * Name of the integration
5
+ */
6
+ name: string;
7
+ /**
8
+ * The content-type http headers determining which events dispatched to spotlight
9
+ * events should be forwarded to this integration.
10
+ *
11
+ * For example: ["application/x-sentry-envelope"]
12
+ */
13
+ forwardedContentType?: string[];
14
+ /**
15
+ * A function returning an array of tabs to be displayed in the UI.
16
+ *
17
+ * @param context contains the processed events for the tabs. Use this information to
18
+ * e.g. update the notification count badge of the tab.
19
+ */
20
+ tabs?: TabsCreationFunction<T>;
21
+ /**
22
+ * Setup hook called when Spotlight is initialized.
23
+ *
24
+ * Use this hook to setup any global state, instrument handlers, etc.
25
+ */
26
+ setup?: () => void | Promise<void>;
27
+ /**
28
+ * Hook called whenever spotlight forwards a new raw event to this integration.
29
+ *
30
+ * Use this hook to process and convert the raw request payload (string) to a
31
+ * data structure that your integration works with in the UI.
32
+ *
33
+ * If you want to disregard the sent event, simply return `undefined`.
34
+ *
35
+ * The returned object will be passed to your tabs function.
36
+ */
37
+ processEvent?: (eventContext: RawEventContext) => ProcessedEventContainer<T> | undefined;
38
+ };
39
+ export type IntegrationTab<T> = {
40
+ /**
41
+ * Id of the tab. This needs to be a unique name.
42
+ */
43
+ id: string;
44
+ /**
45
+ * Title of the tab. This is what will be displayed in the UI.
46
+ */
47
+ title: string;
48
+ /**
49
+ * If this property is set, a count badge will be displayed
50
+ * next to the tab title with the specified value.
51
+ */
52
+ notificationCount?: number;
53
+ /**
54
+ * JSX content of the tab. Go crazy, this is all yours!
55
+ */
56
+ content?: React.ComponentType<{
57
+ processedEvents: T[];
58
+ }>;
59
+ onSelect?: () => void;
60
+ active?: boolean;
61
+ };
62
+ export type ProcessedEventContainer<T> = {
63
+ /**
64
+ * The processed event data to be passed to your tabs.
65
+ */
66
+ event: T;
67
+ /**
68
+ * A level indicating the impact or severity of the processed event. Set this to
69
+ * 'severe' if the event is critical and users should be aware of it (e.g. a thrown error).
70
+ *
71
+ * If this is set to 'severe', a red notification count badge will be displayed
72
+ * next to the spotlight trigger button in the UI.
73
+ *
74
+ * @default value is 'default'
75
+ */
76
+ severity?: Severity;
77
+ };
78
+ export type Severity = 'default' | 'severe';
79
+ export type IntegrationData<T> = Record<string, ProcessedEventContainer<T>[]>;
80
+ type TabsContext<T> = {
81
+ processedEvents: T[];
82
+ };
83
+ type TabsCreationFunction<T> = (context: TabsContext<T>) => IntegrationTab<T>[];
84
+ export type RawEventContext = {
85
+ /**
86
+ * The content-type header of the event
87
+ */
88
+ contentType: string;
89
+ /**
90
+ * The raw data in string form of the request.
91
+ * Use this function to parse and process the raw data it to whatever data structure
92
+ * you expect for the given `contentType`.
93
+ *
94
+ * Return the processed object or undefined if the event should be ignored.
95
+ */
96
+ data: string;
97
+ };
98
+ export declare function initIntegrations(integrations?: Integration[]): Promise<Integration[]>;
99
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export default function DateTime({ date, ...props }: {
3
+ date: string | number | Date;
4
+ } & React.ComponentProps<'time'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { SentryEvent } from '../types';
2
+ export default function EventBreadcrumbs({ event }: {
3
+ event: SentryEvent;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { SentryEvent } from '../types';
2
+ export default function EventContexts({ event }: {
3
+ event: SentryEvent;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function EventDetails(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function EventList(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { EventFrame } from '../../../types';
2
+ export default function Frame({ frame, defaultExpand }: {
3
+ frame: EventFrame;
4
+ defaultExpand: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { SentryErrorEvent } from '../../types';
2
+ export declare function ErrorTitle({ event }: {
3
+ event: SentryErrorEvent;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ErrorSummary({ event }: {
6
+ event: SentryErrorEvent;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export default function Error({ event }: {
9
+ event: SentryErrorEvent;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { SentryEvent } from '../types';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ type Platform = 'python' | 'javascript' | 'node' | 'ruby' | string;
4
+ export default function PlatformIcon({ platform, event, size, ...props }: ComponentPropsWithoutRef<'svg'> & {
5
+ size?: number;
6
+ platform?: Platform;
7
+ event?: SentryEvent;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export default function SdkList(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Span, TraceContext } from '../types';
2
+ export default function SpanDetails({ traceContext, span, startTimestamp, totalDuration, }: {
3
+ traceContext: TraceContext;
4
+ span: Span;
5
+ startTimestamp: number;
6
+ totalDuration: number;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Span, TraceContext } from '../types';
2
+ export default function SpanTree({ traceContext, tree, startTimestamp, totalDuration, depth, }: {
3
+ traceContext: TraceContext;
4
+ tree: Span[];
5
+ startTimestamp: number;
6
+ totalDuration: number;
7
+ depth?: number;
8
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export default function Time({ date, ...props }: {
3
+ date: string | number | Date;
4
+ } & React.ComponentProps<'time'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export default function TimeSince({ date, ...props }: {
3
+ date: string | number | Date;
4
+ } & React.ComponentProps<'time'>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export default function TraceDetails(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function TraceList(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { Envelope } from '@sentry/types';
2
+ import { Sdk, SentryEvent, Span, Trace } from '../types';
3
+ type OnlineSubscription = ['online', (status: boolean) => void];
4
+ type EventSubscription = ['event', (event: SentryEvent) => void];
5
+ type TraceSubscription = ['trace', (trace: Trace) => void];
6
+ type Subscription = OnlineSubscription | EventSubscription | TraceSubscription;
7
+ declare class SentryDataCache {
8
+ protected events: SentryEvent[];
9
+ protected sdks: Sdk[];
10
+ protected traces: Trace[];
11
+ protected tracesById: {
12
+ [id: string]: Trace;
13
+ };
14
+ protected subscribers: Map<string, Subscription>;
15
+ constructor(initial?: (SentryEvent & {
16
+ event_id?: string;
17
+ })[]);
18
+ inferSdkFromEvent(event: SentryEvent): Sdk;
19
+ pushEnvelope(envelope: Envelope): void;
20
+ pushEvent(event: SentryEvent & {
21
+ event_id?: string;
22
+ }): void;
23
+ getEvents(): SentryEvent[];
24
+ getTraces(): Trace[];
25
+ getSdks(): Sdk[];
26
+ getEventById(id: string): SentryEvent | undefined;
27
+ getTraceById(id: string): Trace;
28
+ getEventsByTrace(traceId: string, spanId?: string | null): SentryEvent[];
29
+ getSpanById(traceId: string, spanId: string): Span | undefined;
30
+ subscribe(...args: Subscription): () => void;
31
+ }
32
+ declare const _default: SentryDataCache;
33
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ import { SentryEvent } from '../types';
4
+ export declare const SentryEventsContext: React.Context<SentryEvent[]>;
5
+ export declare const SentryEventsContextProvider: React.FC<{
6
+ children: ReactNode;
7
+ }>;
@@ -0,0 +1 @@
1
+ export declare const useSentryEvents: () => import("../types").SentryEvent[];
@@ -0,0 +1 @@
1
+ export declare const useSentrySdks: () => import("../types").Sdk[];
@@ -0,0 +1 @@
1
+ export declare const useSentryTraces: () => import("../types").Trace[];
@@ -0,0 +1,28 @@
1
+ import type { Envelope } from '@sentry/types';
2
+ import type { RawEventContext, Severity } from '../integration';
3
+ import ErrorsTab from './tabs/ErrorsTab';
4
+ import SdksTab from './tabs/SdksTab';
5
+ export default function sentryIntegration(): {
6
+ name: string;
7
+ forwardedContentType: string[];
8
+ setup: () => void;
9
+ processEvent: (event: RawEventContext) => {
10
+ event: Envelope;
11
+ severity: Severity;
12
+ };
13
+ tabs: () => ({
14
+ id: string;
15
+ title: string;
16
+ notificationCount: number;
17
+ content: typeof ErrorsTab;
18
+ } | {
19
+ id: string;
20
+ title: string;
21
+ content: typeof SdksTab;
22
+ notificationCount?: undefined;
23
+ })[];
24
+ };
25
+ export declare function processEnvelope({ data }: RawEventContext): {
26
+ event: Envelope;
27
+ severity: Severity;
28
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { EventProcessor, Hub, Integration } from '@sentry/types';
2
+ export declare class Spotlight implements Integration {
3
+ name: string;
4
+ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
5
+ }
@@ -0,0 +1 @@
1
+ export default function ErrorsTab(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function SdksTab(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ErrorsTab(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,118 @@
1
+ export type FrameVars = {
2
+ [key: string]: string;
3
+ };
4
+ export type EventFrame = {
5
+ filename: string;
6
+ abs_path?: string;
7
+ function?: string;
8
+ module?: string;
9
+ lineno?: number;
10
+ colno?: number;
11
+ pre_context?: string[];
12
+ post_context?: string[];
13
+ context_line?: string;
14
+ vars?: FrameVars;
15
+ in_app?: boolean;
16
+ };
17
+ export type EventStacktrace = {
18
+ frames: EventFrame[];
19
+ };
20
+ export type EventExceptionValue = {
21
+ type: string;
22
+ value: string;
23
+ stacktrace?: EventStacktrace;
24
+ };
25
+ export type EventException = {
26
+ values: EventExceptionValue[];
27
+ value: undefined;
28
+ } | {
29
+ values: undefined;
30
+ value: EventExceptionValue;
31
+ };
32
+ export type Breadcrumbs = {
33
+ values: {
34
+ message: string;
35
+ category: string;
36
+ timestamp: string;
37
+ type: string | 'default';
38
+ }[];
39
+ };
40
+ type CommonEventAttrs = {
41
+ event_id: string;
42
+ timestamp: number;
43
+ breadcrumbs?: Breadcrumbs;
44
+ transaction?: string;
45
+ environment?: string;
46
+ platform?: string;
47
+ server_name?: string;
48
+ release?: string;
49
+ start_timestamp?: number;
50
+ contexts?: Contexts;
51
+ tags?: Tags;
52
+ extra?: {
53
+ [key: string]: string | number;
54
+ };
55
+ sdk?: Sdk;
56
+ };
57
+ export type Context = {
58
+ [key: string]: string | number;
59
+ };
60
+ export type TraceContext = {
61
+ trace_id: string;
62
+ span_id: string;
63
+ parent_span_id?: string | null;
64
+ op: string;
65
+ description?: string | null;
66
+ status: 'ok' | string;
67
+ };
68
+ export type Contexts = {
69
+ trace?: TraceContext;
70
+ } & {
71
+ [key: string]: Context;
72
+ };
73
+ export type Tags = {
74
+ [key: string]: string;
75
+ };
76
+ export type SentryErrorEvent = CommonEventAttrs & {
77
+ type?: 'error' | 'default';
78
+ exception: EventException;
79
+ };
80
+ export type Span = {
81
+ trace_id: string;
82
+ span_id: string;
83
+ parent_span_id?: string | null;
84
+ op: string;
85
+ description?: string | null;
86
+ start_timestamp: number;
87
+ tags?: Tags | null;
88
+ timestamp: number;
89
+ status: 'ok' | string;
90
+ transaction?: SentryTransactionEvent;
91
+ children?: Span[];
92
+ };
93
+ export type SentryTransactionEvent = CommonEventAttrs & {
94
+ type: 'transaction';
95
+ spans: Span[];
96
+ start_timestamp: string;
97
+ contexts: Contexts & {
98
+ trace: TraceContext;
99
+ };
100
+ };
101
+ export type SentryEvent = SentryErrorEvent | SentryTransactionEvent;
102
+ export type Trace = TraceContext & {
103
+ transactions: SentryTransactionEvent[];
104
+ errors: number;
105
+ start_timestamp: number;
106
+ timestamp: number;
107
+ status: string;
108
+ rootTransaction: SentryTransactionEvent | null;
109
+ rootTransactionName: string;
110
+ spans: Span[];
111
+ spanTree: Span[];
112
+ };
113
+ export type Sdk = {
114
+ name: string;
115
+ version: string;
116
+ lastSeen: number;
117
+ };
118
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function getDuration(start: string | number, end: string | number): number;
2
+ export declare function getSpanDurationClassName(duration: number): "text-red-400" | "text-orange-400" | "text-yellow-400" | undefined;
@@ -0,0 +1,2 @@
1
+ import { Span } from '../types';
2
+ export declare function groupSpans(spans: Span[]): Span[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import ViteInspect from './vite-inspect';
2
+ export default function viteInspectIntegration(): {
3
+ name: string;
4
+ tabs: () => {
5
+ id: string;
6
+ title: string;
7
+ content: typeof ViteInspect;
8
+ }[];
9
+ setup: () => void;
10
+ };
@@ -0,0 +1 @@
1
+ export default function ViteInspect(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function classNames(...classes: (string | undefined | boolean | null)[]): string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Returns the global singleton event target for spotlight.
3
+ *
4
+ * This is used to communicate between spotlight and the outside world.
5
+ * To avoid instances where multiple versions of spotlight code are loaded,
6
+ * we put the target onto the global object.
7
+ *
8
+ * @see https://github.com/getsentry/spotlight/issues/68
9
+ *
10
+ * In case of window being undefined (e.g. in SSR), we return a fallback event target.
11
+ * which is local to one spotlight code instance.
12
+ */
13
+ export declare function getSpotlightEventTarget(): EventTarget;
@@ -0,0 +1,3 @@
1
+ export declare function activateLogger(): void;
2
+ export declare function deactivateLogger(): void;
3
+ export declare function log(...args: unknown[]): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * useKeyPress
3
+ * @param {string} key - the name of the key to respond to, compared against event.key
4
+ * @param {function} action - the action to perform on key press
5
+ */
6
+ export default function useKeyPress(key: string, action: () => void, propagate?: boolean): void;
@@ -0,0 +1 @@
1
+ export declare function generate_uuidv4(): string;
@@ -0,0 +1 @@
1
+ export * from './index'