mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-09 22:43:05 +00:00
6daed83d88
Change-Type: patch
54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
declare module 'capitano' {
|
|
export function parse(argv: string[]): Cli;
|
|
|
|
export interface Cli {
|
|
command: string;
|
|
options: {};
|
|
global: {};
|
|
}
|
|
|
|
export interface OptionDefinition {
|
|
signature: string;
|
|
description: string;
|
|
parameter?: string;
|
|
boolean?: boolean;
|
|
alias?: string | string[];
|
|
}
|
|
|
|
export interface CommandDefinition<P = {}, O = {}> {
|
|
signature: string;
|
|
description: string;
|
|
help: string;
|
|
options?: OptionDefinition[];
|
|
permission?: 'user';
|
|
action(params: P, options: O, done: () => void): void;
|
|
}
|
|
|
|
export interface Command {
|
|
signature: Signature;
|
|
options: Option[];
|
|
isWildcard(): boolean;
|
|
}
|
|
|
|
export interface Signature {
|
|
hasParameters(): boolean;
|
|
hasVariadicParameters(): boolean;
|
|
isWildcard(): boolean;
|
|
allowsStdin(): boolean;
|
|
}
|
|
|
|
export interface Option {
|
|
signature: Signature;
|
|
alias: string | string[];
|
|
boolean: boolean;
|
|
parameter: string;
|
|
required: boolean | string;
|
|
}
|
|
|
|
export function command(command: CommandDefinition): void;
|
|
|
|
export const state: {
|
|
getMatchCommand: (signature: string, callback: (e: Error, cmd: Command) => void) => void
|
|
};
|
|
}
|