mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
* Bump lodash from 4.17.15 to 4.17.19 (#52) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * Bump @actions/core from 1.1.3 to 1.2.6 (#60) Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.1.3 to 1.2.6. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * updating node_nodules * updated package-lock Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
65 lines
3.1 KiB
TypeScript
65 lines
3.1 KiB
TypeScript
/// <reference types="node" />
|
|
import { Dictionary } from './common-types';
|
|
import { Middleware } from './middleware';
|
|
import { Positional } from './parse-command';
|
|
import { RequireDirectoryOptions } from 'require-directory';
|
|
import { UsageInstance } from './usage';
|
|
import { ValidationInstance } from './validation';
|
|
import { YargsInstance, Options, OptionDefinition, Context, Arguments, DetailedArguments } from './yargs';
|
|
export declare function command(yargs: YargsInstance, usage: UsageInstance, validation: ValidationInstance, globalMiddleware?: Middleware[]): CommandInstance;
|
|
/** Instance of the command module. */
|
|
export interface CommandInstance {
|
|
addDirectory(dir: string, context: Context, req: NodeRequireFunction, callerFile: string, opts?: RequireDirectoryOptions<any>): void;
|
|
addHandler(handler: CommandHandlerDefinition): void;
|
|
addHandler(cmd: string | string[], description: CommandHandler['description'], builder?: CommandBuilderDefinition | CommandBuilder, handler?: CommandHandlerCallback, commandMiddleware?: Middleware[], deprecated?: boolean): void;
|
|
cmdToParseOptions(cmdString: string): Positionals;
|
|
freeze(): void;
|
|
getCommandHandlers(): Dictionary<CommandHandler>;
|
|
getCommands(): string[];
|
|
hasDefaultCommand(): boolean;
|
|
reset(): CommandInstance;
|
|
runCommand(command: string | null, yargs: YargsInstance, parsed: DetailedArguments, commandIndex?: number): Arguments | Promise<Arguments>;
|
|
runDefaultBuilderOn(yargs: YargsInstance): void;
|
|
unfreeze(): void;
|
|
}
|
|
export interface CommandHandlerDefinition extends Partial<Pick<CommandHandler, 'deprecated' | 'description' | 'handler' | 'middlewares'>> {
|
|
aliases?: string[];
|
|
builder?: CommandBuilder | CommandBuilderDefinition;
|
|
command?: string | string[];
|
|
desc?: CommandHandler['description'];
|
|
describe?: CommandHandler['description'];
|
|
}
|
|
export declare function isCommandHandlerDefinition(cmd: string | string[] | CommandHandlerDefinition): cmd is CommandHandlerDefinition;
|
|
export interface CommandBuilderDefinition {
|
|
builder?: CommandBuilder;
|
|
deprecated?: boolean;
|
|
handler: CommandHandlerCallback;
|
|
middlewares?: Middleware[];
|
|
}
|
|
export declare function isCommandBuilderDefinition(builder?: CommandBuilder | CommandBuilderDefinition): builder is CommandBuilderDefinition;
|
|
export interface CommandHandlerCallback {
|
|
(argv: Arguments): any;
|
|
}
|
|
export interface CommandHandler {
|
|
builder: CommandBuilder;
|
|
demanded: Positional[];
|
|
deprecated?: boolean;
|
|
description?: string | false;
|
|
handler: CommandHandlerCallback;
|
|
middlewares: Middleware[];
|
|
optional: Positional[];
|
|
original: string;
|
|
}
|
|
export declare type CommandBuilder = CommandBuilderCallback | Dictionary<OptionDefinition>;
|
|
interface CommandBuilderCallback {
|
|
(y: YargsInstance): YargsInstance | void;
|
|
}
|
|
export declare function isCommandBuilderCallback(builder: CommandBuilder): builder is CommandBuilderCallback;
|
|
interface Positionals extends Pick<Options, 'alias' | 'array' | 'default'> {
|
|
demand: Dictionary<boolean>;
|
|
}
|
|
export interface FinishCommandHandler {
|
|
(handlerResult: any): any;
|
|
}
|
|
export {};
|