import { THistoryDiff } from '../types/historyTypes';
/**
 * État partagé d'un espace (space).
 */
export interface SpaceSharedState {
    pastDiffs: THistoryDiff[];
    futureDiffs: THistoryDiff[];
    actionType?: string;
    payload?: Record<string, any>;
}
export interface Space {
    id: string;
    name: string;
    color?: string;
    description?: string;
    sharedState: SpaceSharedState;
}
export interface SpaceState {
    spaces: Record<string, Space>;
    activeSpaceId: string | null;
    openSpaceIds: string[];
    errors: string[];
    pilotMode: 'MANUAL' | 'AUTO';
}
export interface SpaceActions {
    addSpace: (spaceData: {
        name: string;
        description?: string;
        color?: string;
        sharedState?: Partial<Omit<SpaceSharedState, 'pastDiffs' | 'futureDiffs'>>;
    }) => string | undefined;
    removeSpace: (id: string) => void;
    setActiveSpace: (id: string | null) => void;
    setPilotMode: (mode: 'MANUAL' | 'AUTO') => void;
    openSpace: (id: string) => void;
    closeSpace: (id: string) => void;
    updateSpace: (spaceData: Partial<Space> & {
        id: string;
    }) => void;
    updateSpaceGenericSharedState: (payload: {
        spaceId: string;
        changes: Partial<Omit<SpaceSharedState, 'pastDiffs' | 'futureDiffs'>>;
    }) => void;
    clearErrors: () => void;
    undoSharedState: (spaceId: string) => void;
    redoSharedState: (spaceId: string) => void;
    getSpaceById: (id: string) => Space | undefined;
    getAllSpaces: () => Record<string, Space>;
    getActiveSpace: () => Space | null;
    getActiveSpaceId: () => string | null;
    getOpenSpaces: () => Space[];
    getSpaceErrors: () => string[];
    getPilotMode: () => 'MANUAL' | 'AUTO';
}
export type SpaceStateType = SpaceState & SpaceActions;
export declare const useSpaceStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SpaceStateType>, "setState"> & {
    setState(nextStateOrUpdater: SpaceStateType | Partial<SpaceStateType> | ((state: import("immer").WritableDraft<SpaceStateType>) => void), shouldReplace?: boolean | undefined): void;
}, "setState"> & {
    setState<A extends string | {
        type: string;
    }>(nextStateOrUpdater: SpaceStateType | Partial<SpaceStateType> | ((state: import("immer").WritableDraft<SpaceStateType>) => void), shouldReplace?: boolean | undefined, action?: A | undefined): void;
}, "persist"> & {
    persist: {
        setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SpaceStateType, {
            spaces: Record<string, Partial<Omit<Space, "sharedState">> & {
                sharedState: Partial<Omit<SpaceSharedState, "pastDiffs" | "futureDiffs">>;
            }>;
            activeSpaceId: string | null;
        }>>) => void;
        clearStorage: () => void;
        rehydrate: () => Promise<void> | void;
        hasHydrated: () => boolean;
        onHydrate: (fn: (state: SpaceStateType) => void) => () => void;
        onFinishHydration: (fn: (state: SpaceStateType) => void) => () => void;
        getOptions: () => Partial<import("zustand/middleware").PersistOptions<SpaceStateType, {
            spaces: Record<string, Partial<Omit<Space, "sharedState">> & {
                sharedState: Partial<Omit<SpaceSharedState, "pastDiffs" | "futureDiffs">>;
            }>;
            activeSpaceId: string | null;
        }>>;
    };
}>;
