import type { EditorView, KeyBinding } from "@codemirror/view"; import type { CodeRecorder } from "@lqv/codemirror/recording"; type RecordType = T extends Record ? K : never; type ArrayType = T extends (infer K)[] ? K : never; /** CodeBooth store state. */ export interface State { /** * Name of active editor group. */ activeGroup: string; /** Class names to attach to root. */ classNames: string[]; /** Group of files/editors. */ groups: Record; /** Console logs. */ messages: React.ReactNode[]; /** Code recorder. */ recorder?: CodeRecorder; /** Used to broadcast run events. */ run: number; /** Keyboard shortcuts. */ shortcuts: Record; /** Get the active file. */ getActiveFile(): ArrayType["files"]>; /** Get the active view. */ getActiveView(): EditorView; } export declare const makeStore: (state?: Partial) => Omit, "subscribe"> & { subscribe: { (listener: (selectedState: State, previousSelectedState: State) => void): () => void; (selector: (state: State) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { equalityFn?: (a: U, b: U) => boolean; fireImmediately?: boolean; }): () => void; }; }; export type Store = ReturnType; export declare const BoothStore: import("react").Context, "subscribe"> & { subscribe: { (listener: (selectedState: State, previousSelectedState: State) => void): () => void; (selector: (state: State) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { equalityFn?: (a: U, b: U) => boolean; fireImmediately?: boolean; }): () => void; }; }>; /** Get a reference to the Zustand store for this CodeBooth. See {@link State} for store shape. */ export declare function useBoothStore(): Store; export {};