import type { Dict } from 'mixpanel-browser'; import React, { type FC, type ReactNode } from 'react'; import type { Endpoints, Stage } from '../../api/endpoints.const'; import { type DecodedToken } from './authToken'; export type MixPanelTrack = (event: string, data?: Dict) => void; type C3UserConfigurationBase = { activeOrganizationId: string; userToken: string; getNewUserToken: () => Promise; analyticsTrack?: MixPanelTrack; currentApp?: 'console' | 'modeler' | 'tasklist' | 'operate' | 'optimize' | 'identity' | 'admin'; currentClusterUuid?: string; handleTheme?: boolean; enableLogs?: boolean; noCloudInUrl?: boolean; /** * Control which features are enabled to optimize API requests. * If not provided, all features are enabled by default for backward compatibility. */ features?: { /** * Enable fetching and displaying organizations. * When false, organizations API calls are disabled. * @default true */ organizations?: boolean; /** * Enable fetching and displaying clusters. * When false, clusters API calls are disabled. * @default true */ clusters?: boolean; }; }; type C3UserConfigurationWithEndpoints = C3UserConfigurationBase & { endpoints: Endpoints; }; type C3UserConfigurationWithStage = C3UserConfigurationBase & { stage: Stage; }; export type C3UserConfiguration = C3UserConfigurationWithEndpoints | C3UserConfigurationWithStage; export type C3UserConfigurationContextValue = C3UserConfiguration & { decodedToken: DecodedToken | null; decodedAudience: string | null; domain: string | null; setActiveOrgId: (id: string) => void; analyticsTrack?: MixPanelTrack; }; export declare const C3UserConfigurationContext: React.Context; declare const C3UserConfigurationProvider: FC; export declare const useC3UserConfiguration: () => C3UserConfigurationContextValue; export default C3UserConfigurationProvider;