ko
Version:
build & lint library
30 lines (29 loc) • 723 B
TypeScript
import { program, Command } from 'commander';
type RegisterOptions = {
flags: string;
description: string;
defaultValue?: string | boolean;
};
type CMDProperties = {
description: string;
options?: RegisterOptions[];
args?: {
flags: string;
description: string;
}[];
action?: ActionFn;
};
type ActionFn = Parameters<typeof program.action>[0];
declare class Commander {
private STATE;
program: Command;
private pkg;
private cmdSet;
constructor();
registerCommand({ name, description, args, options, }: CMDProperties & {
name: string;
}): void;
bindAction(name: string, fn: ActionFn): void;
parse(): void;
}
export default Commander;