export declare const COMMAND_DEFINITION_MARKER: unique symbol; export type CommandOptionType = "boolean" | "string" | "number" | "array"; export interface CommandOptionSpec { type: CommandOptionType; default?: TValue; alias?: string | string[]; hasSensitiveValue?: boolean; description?: string; } export interface DefaultedCommandOptionSpec extends CommandOptionSpec { default: TValue; } export type CommandOptionSpecInit = Omit, "type">; export interface CommandOptionsSchema { [optionName: string]: CommandOptionSpec; } type CommandOptionValue = TSpec extends CommandOptionSpec ? TSpec extends { default: any; } ? TValue : TValue | undefined : any; export type CommandOptionValues = { [K in keyof TSchema]: CommandOptionValue; }; export interface CommandContext { args: string[]; options: CommandOptionValues; fail(message: string): never; } export interface CommandDefinition { name: string | string[]; description?: string; options?: TSchema; arguments?: "none" | "any"; canExecute?(context: CommandContext): Promise | boolean; disableAnalytics?: boolean; enableHooks?: boolean; run(context: CommandContext): Promise | void; } export type DefinedCommand = CommandDefinition & { readonly [COMMAND_DEFINITION_MARKER]: true; }; interface IOptionHelper { (init: CommandOptionSpecInit & { default: TValue; }): DefaultedCommandOptionSpec; (init?: CommandOptionSpecInit): CommandOptionSpec; } export declare const booleanOption: IOptionHelper; export declare const stringOption: IOptionHelper; export declare const numberOption: IOptionHelper; export declare const arrayOption: IOptionHelper; export declare function defineCommand(definition: CommandDefinition): DefinedCommand; export declare function isCommandDefinition(value: any): value is DefinedCommand; export {};