import { parseArgs } from "./args.js"; import type { CliIo } from "./types.js"; export type RouteContext = { argv: string[]; command: string; subcommand: string | undefined; rest: string[]; io: CliIo; }; export type Route = { matches: (context: RouteContext) => boolean; run: (context: RouteContext) => Promise | void | false; }; export type CommandHandler = (options: ReturnType, io: CliIo) => Promise | void; export declare function singleCommandRoutes(entries: Array<[string, CommandHandler]>): Route[]; export declare function subcommandRoutes(command: string, entries: Array<[string, CommandHandler]>): Route[]; export declare function subcommandRoute(command: string, subcommand: string, handler: CommandHandler): Route; export declare function route(command: string, subcommand: string | undefined, run: (context: RouteContext) => Promise | void | false): Route;