UNPKG

@mojojs/core

Version:

Real-time web framework

39 lines (38 loc) 891 B
import type { App } from './app.js'; interface Command { (app: App, args: string[]): Promise<void>; description: string; hidden?: boolean; usage: string; } /** * Command line interface class. */ export declare class CLI { /** * Paths to search for commands. */ commandPaths: string[]; /** * Registered commands. */ commands: Record<string, Command>; _app: WeakRef<App>; _loaded: boolean | undefined; constructor(app: App); /** * Add a command. */ addCommand(name: string, command: Command): void; /** * Detect command from environment. */ detectCommand(): string | null; /** * Start command line interface. */ start(command?: string, ...args: string[]): Promise<void>; _listCommands(showAll?: boolean): Promise<void>; _loadCommands(): Promise<void>; } export {};