import { writable } from 'svelte/store';

export type FocusStrategy = 'first-input' | 'trigger';
export type InteractionMode = 'mouse' | 'keyboard';

interface FocusRequest {
    strategy: FocusStrategy;
    description?: string;
    timestamp: number;
}

function createFocusStore() {
    const { subscribe, set, update } = writable<FocusRequest | null>(null);

    return {
        subscribe,
        request: (strategy: FocusStrategy, description?: string) => {
            set({ strategy, description, timestamp: Date.now() });
        }
    };
}

export const focusStore = createFocusStore();
export const interactionMode = writable<InteractionMode>('mouse');
