diff --git a/types/sprintf/index.d.ts b/types/sprintf/index.d.ts index 018a1a33b1..f9c3396e6a 100644 --- a/types/sprintf/index.d.ts +++ b/types/sprintf/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for sprintff -// Project: https://github.com/maritz/node-sprintff +// Type definitions for sprintf 0.1 +// Project: https://github.com/maritz/node-sprintf // Definitions by: Carlos Ballesteros Velasco +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/sprintff.d.ts - -export declare function sprintf(fmt: string, ...args: any[]): string; -export declare function vsprintf(fmt: string, args: any[]): string; +export function sprintf(fmt: string, ...args: any[]): string; +export function vsprintf(fmt: string, args: any[]): string; diff --git a/types/sprintf/sprintf-tests.ts b/types/sprintf/sprintf-tests.ts index 3dca1f4f02..0ad5f0b937 100644 --- a/types/sprintf/sprintf-tests.ts +++ b/types/sprintf/sprintf-tests.ts @@ -1,13 +1,12 @@ - import sprintf = require('sprintf'); -var str: string; -var num: number; +declare const str: string; +declare const num: number; -sprintf.sprintf(str, str); +sprintf.sprintf(str, str); // $ExpectType string sprintf.sprintf(str, str, num); sprintf.sprintf(str, num, str); -sprintf.vsprintf(str, [str]); +sprintf.vsprintf(str, [str]); // $ExpectType string sprintf.vsprintf(str, [str, num]); sprintf.vsprintf(str, [num, str]); diff --git a/types/sprintf/tsconfig.json b/types/sprintf/tsconfig.json index c71ae46eb4..e8d46d5357 100644 --- a/types/sprintf/tsconfig.json +++ b/types/sprintf/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "sprintf-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/sprintf/tslint.json b/types/sprintf/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sprintf/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }