import type { Scope, Shortcut } from '../types'; import { createFastContext } from '../../fast-context'; import type { ReactNode } from 'react'; export type ShortcutsManagerContextType = { shortcuts: Record; scopes: Record; pressedKeys: string[]; disabled?: boolean; }; const defaultValue = { shortcuts: [], scopes: [], pressedKeys: [], } as unknown as ShortcutsManagerContextType; export const { Provider: ShortcutsManagerContextProvider, useContext: useShortcutsManagerContextSelector, useContextValue: useShortcutsManagerContextValueSelector, useStoreRef: useShortcutsManagerStoreRef, Context: ShortcutsManagerContext, } = createFastContext(defaultValue); export type ShortcutsManagerProps = { children: ReactNode; shortcuts?: Shortcut[]; scopes?: Scope[]; };