import { Command, CommandTree } from "./commands.js"; import { Args, DistillInput, Params } from "./units.js"; export type AnalyzeOptions = { commands: C; }; export type Analysis = { tree: TreeAnalysis; commandSpec: Command; command: CommandAnalysis; extraArgs: string[]; }; export type SelectedCommand = { argx: string[]; path: string[]; command: Command; }; export type DistillArgs = { [I in A[number] as I["name"]]: DistillInput; }; export type DistillParams

= { [K in keyof P]: DistillInput; }; export type CommandAnalysis> = { path: string[]; args: DistillArgs; params: DistillParams; extraArgs: string[]; }; export type TreeAnalysis = (NonNullable>); type TreeAnalysisWeak = (C extends Command ? CommandAnalysis | undefined : C extends { [key: string]: CommandTree; } ? { [K in keyof C]: TreeAnalysisWeak; } : never); export {};