askeroo
Version:
A modern CLI prompt library with flow control, history navigation, and conditional prompts
47 lines • 1.73 kB
TypeScript
/**
* FieldDiscoveryService - Handles field discovery for static groups
*
* Static groups need to pre-scan their fields before rendering to know what
* fields will be shown. This service manages the discovery process, tracks
* discovered fields, and provides re-discovery capabilities.
*/
import { RuntimeState } from "./runtime-state.js";
export interface DiscoveredField {
id: string;
label: string;
type: string;
}
export declare class FieldDiscoveryService {
private state;
private isScanning;
private discoveredFieldsByGroup;
private groupBodyFunctions;
constructor(state: RuntimeState);
isCurrentlyScanning(): boolean;
getDiscoveredFields(groupId: string): DiscoveredField[] | undefined;
registerDiscoveredField(groupId: string, field: DiscoveredField): void;
storeGroupBodyFunction(groupId: string, body: () => Promise<any>): void;
hasStoredBodyFunction(groupId: string): boolean;
/**
* Scan a static group to discover all its fields
* Executes the group body in scanning mode to find all fields
*/
scanGroupFields(groupId: string, body: () => Promise<any>): Promise<DiscoveredField[]>;
/**
* Re-scan a static group's fields
* Used when a group needs to be re-rendered with updated fields
*/
rescanGroupFields(groupId: string): Promise<DiscoveredField[] | undefined>;
/**
* Clear all discovered fields and stored body functions
* Typically used when resetting the runtime
*/
clearAll(): void;
getDebugInfo(): {
isScanning: boolean;
discoveredGroupsCount: number;
storedBodiesCount: number;
groups: string[];
};
}
//# sourceMappingURL=discovery-service.d.ts.map