diff --git a/typings/index.d.ts b/typings/index.d.ts index d1a89d8c2..0a53fdf79 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -159,8 +159,9 @@ declare namespace commander { * * @returns Command for chaining */ - option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; - option(flags: string, description?: string, defaultValue?: any): Command; + option(flags: string, description?: string, defaultValue?: string | boolean): Command; + option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): Command; + option(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): Command; /** * Define a required option, which must have a value after parsing. This usually means @@ -168,8 +169,9 @@ declare namespace commander { * * The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. */ - requiredOption(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; - requiredOption(flags: string, description?: string, defaultValue?: any): Command; + requiredOption(flags: string, description?: string, defaultValue?: string | boolean): Command; + requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): Command; + requiredOption(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): Command; /**