import { Draft } from 'immer';
import { UseBoundStore, StoreApi } from 'zustand';

interface SSESliceState {
    sse: {
        notificationCount: number | null;
        notificationConnected: boolean;
        notificationError: string | null;
        commandQueueConnected: boolean;
        commandQueueError: string | null;
    };
    setNotificationCount: (count: number | null) => void;
    setNotificationConnected: (connected: boolean) => void;
    setNotificationError: (error: string | null) => void;
    setCommandQueueConnected: (connected: boolean) => void;
    setCommandQueueError: (error: string | null) => void;
}
type ImmerSet$2<TState> = (updater: (state: Draft<TState>) => void, shouldReplace?: false, action?: never) => void;
/** Resets the SSE slice fields in an Immer draft. Call inside your app's resetStore action. */
declare function resetSSEState(state: Draft<{
    sse: SSESliceState['sse'];
}>): void;
declare function createSSESlice<TState extends SSESliceState>(set: ImmerSet$2<TState>): SSESliceState;

/**
 * Open string type — preset validation stays in the app layer.
 * CC uses a 22-value union locally; the shared factory accepts any string.
 */
type ThemePresetName = string;
type ThemeColorScheme = 'light' | 'dark' | 'auto';
interface ThemeSliceState {
    theme: {
        preset: ThemePresetName;
        colorScheme: ThemeColorScheme;
    };
    setTheme: (updates: {
        preset?: ThemePresetName;
        colorScheme?: ThemeColorScheme;
    }) => void;
}
interface ThemeSliceOptions {
    /** Default preset name when no localStorage entry exists. Defaults to 'tactical'. */
    defaultPreset?: ThemePresetName;
    /** Default color scheme when no localStorage entry exists. Defaults to 'dark'. */
    defaultColorScheme?: ThemeColorScheme;
}
type ImmerSet$1<TState> = (updater: (state: Draft<TState>) => void, shouldReplace?: false, action?: never) => void;
/** Resets the theme slice fields in an Immer draft. Call inside your app's resetStore action. */
declare function resetThemeState(state: Draft<{
    theme: ThemeSliceState['theme'];
}>, options?: ThemeSliceOptions): void;
declare function createThemeSlice<TState extends ThemeSliceState>(set: ImmerSet$1<TState>, options?: ThemeSliceOptions): ThemeSliceState;

/**
 * Time range selector for dashboard metrics
 */
type TimeRange = '1h' | '24h' | '7d' | '30d';

interface TimeRangeSliceState {
    timeRange: {
        value: TimeRange;
    };
    setTimeRange: (value: TimeRange) => void;
}
type ImmerSet<TState> = (updater: (state: Draft<TState>) => void, shouldReplace?: false, action?: never) => void;
/** Resets the timeRange slice fields in an Immer draft. Call inside your app's resetStore action. */
declare function resetTimeRangeState(state: Draft<{
    timeRange: TimeRangeSliceState['timeRange'];
}>): void;
declare function createTimeRangeSlice<TState extends TimeRangeSliceState>(set: ImmerSet<TState>): TimeRangeSliceState;

interface ElevasisAppState extends SSESliceState, ThemeSliceState, TimeRangeSliceState {
    resetStore: () => void;
}
interface CreateElevasisAppStoreOptions {
    defaultPreset?: ThemePresetName;
    defaultColorScheme?: ThemeColorScheme;
    devtoolsName?: string;
    devtoolsEnabled?: boolean;
}
type ElevasisAppStore = UseBoundStore<StoreApi<ElevasisAppState>>;
declare function createElevasisAppStore(options?: CreateElevasisAppStoreOptions): ElevasisAppStore;

export { createElevasisAppStore, createSSESlice, createThemeSlice, createTimeRangeSlice, resetSSEState, resetThemeState, resetTimeRangeState };
export type { CreateElevasisAppStoreOptions, ElevasisAppState, ElevasisAppStore, SSESliceState, ThemeColorScheme, ThemePresetName, ThemeSliceOptions, ThemeSliceState, TimeRangeSliceState };
