From ad15fab9181930b4a85cd19aa5bf91f210852065 Mon Sep 17 00:00:00 2001 From: amikhalev Date: Wed, 28 Jun 2017 11:29:53 -0600 Subject: [PATCH] Changed uses of any in yargs to object --- types/yargs/index.d.ts | 13 +++++++------ types/yargs/yargs-tests.ts | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/types/yargs/index.d.ts b/types/yargs/index.d.ts index 02d4c6cb69..db8d48d14d 100644 --- a/types/yargs/index.d.ts +++ b/types/yargs/index.d.ts @@ -5,6 +5,7 @@ // Jeffery Grajkowski // Jeff Kenney // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // unified-signatures: Because there is useful information in the argument names of the overloaded signatures // prefer-method-signature: Because it makes more sense for optional functions provided in options objects @@ -119,11 +120,11 @@ declare namespace yargs { choices(key: string, values: Choices): Argv; config(): Argv; - config(explicitConfigurationObject: any): Argv; - config(key: string, description?: string, parseFn?: (configPath: string) => any): Argv; - config(keys: string[], description?: string, parseFn?: (configPath: string) => any): Argv; - config(key: string, parseFn: (configPath: string) => any): Argv; - config(keys: string[], parseFn: (configPath: string) => any): Argv; + config(explicitConfigurationObject: object): Argv; + config(key: string, description?: string, parseFn?: (configPath: string) => object): Argv; + config(keys: string[], description?: string, parseFn?: (configPath: string) => object): Argv; + config(key: string, parseFn: (configPath: string) => object): Argv; + config(keys: string[], parseFn: (configPath: string) => object): Argv; conflicts(key: string, value: string): Argv; conflicts(conflicts: { [key: string]: string }): Argv; @@ -207,7 +208,7 @@ declare namespace yargs { choices?: Choices; coerce?: (arg: any) => any; config?: boolean; - configParser?: (configPath: string) => any; + configParser?: (configPath: string) => object; count?: boolean; default?: any; defaultDescription?: string; diff --git a/types/yargs/yargs-tests.ts b/types/yargs/yargs-tests.ts index 8a0120f80d..2847242fd4 100644 --- a/types/yargs/yargs-tests.ts +++ b/types/yargs/yargs-tests.ts @@ -561,7 +561,7 @@ function Argv$commandObject() { choices: ["a", "b", "c"], coerce: f => JSON.stringify(f), config: true, - configParser: t => t, + configParser: t => JSON.parse(fs.readFileSync(t, "utf8")), count: true, default: "myvalue", defaultDescription: "description",