import { Envelope } from '@sentry/core'; import { AggregateCallData, Sdk, SentryErrorEvent, SentryEvent, SentryLogEventItem, SentryProcessedProfile, Trace } from '../types'; export type SentryProfileWithTraceMeta = SentryProcessedProfile & { timestamp: number; active_thread_id: string; }; export type OnlineSubscription = ["online", (status: boolean) => void]; export type EventSubscription = ["event", (event: SentryEvent) => void]; export type TraceSubscription = ["trace", (trace: Trace) => void]; export type Subscription = OnlineSubscription | EventSubscription | TraceSubscription; export interface EventsSliceState { eventsById: Map; } export interface EventsSliceActions { pushEvent: (event: SentryEvent & { event_id?: string; }) => Promise; getEvents: () => SentryEvent[]; } export interface TracesSliceState { tracesById: Map; } export interface TracesSliceActions { getTraces: () => Trace[]; } export interface ProfilesSliceState { profilesByTraceId: Map; } export interface ProfilesSliceActions { getProfileByTraceId: (id: string) => SentryProfileWithTraceMeta | undefined; getAggregateCallData: () => AggregateCallData[]; } export interface SubscriptionsSliceState { subscribers: Map; } export interface SubscriptionsSliceActions { subscribe: (...args: Subscription) => () => void; } export interface SettingsSliceState { contextLinesProvider: string; } export interface SettingsSliceActions { setSidecarUrl: (url: string) => void; } export interface EnvelopesSliceState { envelopes: Map; } export interface EnvelopesSliceActions { pushEnvelope: (params: Envelope) => number; getEnvelopeById: (id: string) => Envelope | undefined; getEnvelopes: () => Array; } export interface SDKsSliceState { sdks: Map; } export interface LogsSliceState { logsById: Map; logsByTraceId: Map>; } export interface LogsSliceActions { getLogById: (id: string) => SentryLogEventItem | undefined; getLogs: () => SentryLogEventItem[]; getLogsByTraceId: (traceId: string) => SentryLogEventItem[]; } export interface SDKsSliceActions { inferSdkFromEvent: (event: SentryEvent) => Sdk; storeSdkRecord: (sdk: Sdk) => Sdk; getSdks: () => Sdk[]; } export interface SharedSliceActions { getEventById: (id: string) => SentryEvent | undefined; getTraceById: (id: string) => Trace | undefined; getEventsByTrace: (traceId: string, spanId?: string | null) => SentryEvent[]; processStacktrace: (errorEvent: SentryErrorEvent) => Promise; resetData: () => void; } export type SentryStoreState = EventsSliceState & TracesSliceState & ProfilesSliceState & SubscriptionsSliceState & SettingsSliceState & EnvelopesSliceState & LogsSliceState & SDKsSliceState; export type SentryStoreActions = EventsSliceActions & TracesSliceActions & ProfilesSliceActions & SubscriptionsSliceActions & SettingsSliceActions & EnvelopesSliceActions & LogsSliceActions & SDKsSliceActions & SharedSliceActions; export type SentryStore = SentryStoreState & SentryStoreActions;