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",