UNPKG

askeroo

Version:

A modern CLI prompt library with flow control, history navigation, and conditional prompts

33 lines 1.32 kB
import { ReactNode } from "react"; interface PromptStateProviderProps { children: ReactNode; } /** * Provider component that manages prompt state updates. * Should be placed high in the component tree (e.g., in ui.tsx) * * Note: This provider is required for prompt state management to work. */ export declare function PromptStateProvider({ children }: PromptStateProviderProps): import("react/jsx-runtime").JSX.Element; /** * Hook for consuming external state in prompt components. * * Use this when your prompt needs to display data from global stores, * services, or other external sources that can update independently. * * Built on React's useSyncExternalStore for safe concurrent rendering. */ export declare function useExternalState<T>(getSnapshot: () => T): T; /** * Notify all prompts subscribed to external state that data has changed. * Call this from your store/service after updating state. */ export declare function notifyExternalStateChange(): void; export declare function getPromptStateNotifier(): (() => void) | null; export declare function setPromptStateNotifier(_notifier: (() => void) | null): void; export declare function usePromptState(): { revision: number; notifyChange: typeof notifyExternalStateChange; }; export {}; //# sourceMappingURL=plugin-state-context.d.ts.map