askeroo
Version:
A modern CLI prompt library with flow control, history navigation, and conditional prompts
28 lines • 1.32 kB
TypeScript
import * as React from "react";
import { PromptPlugin, PluginOptionsWithBuiltins, PluginComponentProps } from "../types/index.js";
export type { PromptPlugin };
declare class PromptRegistry {
private plugins;
register(plugin: PromptPlugin): void;
get(type: string): PromptPlugin | undefined;
getAll(): PromptPlugin[];
getComponent(type: string): React.ComponentType<any> | undefined;
shouldAutoSubmit(type: string): boolean;
isContainer(type: string): boolean;
getComponents(): Record<string, React.ComponentType<any>>;
}
export declare const globalRegistry: PromptRegistry;
export declare function registerPlugin(plugin: PromptPlugin): void;
export declare function createPrompt<T = any, R = any>(config: {
type: string;
component?: React.ComponentType<PluginComponentProps<T, R>> | ((props: any) => React.ReactElement | null);
transform?: (opts: T, context: {
currentGroup?: string;
}, id: string) => T;
autoSubmit?: boolean;
isContainer?: boolean;
execute?: (runtime: any, opts: T, body?: () => Promise<any>) => Promise<R>;
onEnter?: (runtime: any, opts: T) => Promise<void> | void;
onExit?: (runtime: any, opts: T) => Promise<void> | void;
}): (opts?: PluginOptionsWithBuiltins<T, R>) => Promise<R>;
//# sourceMappingURL=registry.d.ts.map