Skip to content
Myr

Merge pull request #713 from sveinburne/feature/enhanced-typedefs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tomoaki Abe · committed by GitHub · parents d812171, 965188f · Browse files · 1 file+19 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • typedefs: Command and Option types added to commander namespace

Diff stats

1 file+19 added−8 removed

  • other:+19 added−8 removed

1 file+19 added−8 removed

modified:typings/index.d.ts+19 added-8 removed
1// Type definitions for commander 2.112// Project: https://github.com/visionmedia/commander.js2// Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>3// Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped54declare class Option {6declare namespace local {78 class Option {9 flags: string;10 required: boolean;11 optional: boolean;12 bool: boolean;
7 unmodified lines
20 * @param {string} flags21 * @param {string} [description]22 */23 constructor(flags: string, description?: string);20}24 }2522declare class Command extends NodeJS.EventEmitter {26 class Command extends NodeJS.EventEmitter {27 [key: string]: any;2829 args: string[];30
93 unmodified lines
124 * @param {string[]} args125 * @returns {Command} for chaining126 */127 parseExpectedArgs(args: string[]): Command;128129 /**130 * Register callback `fn` for the command.131 *132 * @example
133 unmodified lines
266267 /**268 * Output help information for this command.269 *265 * @param {(str: string) => string} [cb] 270 * @param {(str: string) => string} [cb]271 */272 outputHelp(cb?: (str: string) => string): void;273274 /** Output help information and exit. */275 help(): void;276 }277278}279280declare namespace commander {281282 type Command = local.Command283284 type Option = local.Option285286 interface CommandOptions {287 noHelp?: boolean;288 isDefault?: boolean;289 }
3 unmodified lines
293 unknown: string[];294 }295296 interface CommanderStatic extends Command {286 Command: typeof Command;287 Option: typeof Option;297 Command: typeof local.Command;298 Option: typeof local.Option;299 CommandOptions: CommandOptions;300 ParseOptionsResult: ParseOptionsResult;301 }302303}304305declare const commander: commander.CommanderStatic;295export = commander;306export = commander;