From d730f94be2975694dca164e13c98fb6f05ad4627 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 1 Mar 2019 20:12:40 +1100 Subject: [PATCH 1/2] Added type defs for repeat-string --- types/repeat-string/index.d.ts | 9 ++++++++ types/repeat-string/repeat-string-tests.ts | 3 +++ types/repeat-string/tsconfig.json | 25 ++++++++++++++++++++++ types/repeat-string/tslint.json | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 types/repeat-string/index.d.ts create mode 100644 types/repeat-string/repeat-string-tests.ts create mode 100644 types/repeat-string/tsconfig.json create mode 100644 types/repeat-string/tslint.json diff --git a/types/repeat-string/index.d.ts b/types/repeat-string/index.d.ts new file mode 100644 index 0000000000..e593a62b68 --- /dev/null +++ b/types/repeat-string/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for repeat-string 1.6 +// Project: https://github.com/jonschlinkert/repeat-string +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Repeat the given `string` the specified `number` of times. + */ +export default function(str: string, num: number): string; diff --git a/types/repeat-string/repeat-string-tests.ts b/types/repeat-string/repeat-string-tests.ts new file mode 100644 index 0000000000..7095ea672b --- /dev/null +++ b/types/repeat-string/repeat-string-tests.ts @@ -0,0 +1,3 @@ +import Repeat from "repeat-string"; + +Repeat('A', 5); diff --git a/types/repeat-string/tsconfig.json b/types/repeat-string/tsconfig.json new file mode 100644 index 0000000000..a56114d84f --- /dev/null +++ b/types/repeat-string/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "repeat-string-tests.ts" + ] +} diff --git a/types/repeat-string/tslint.json b/types/repeat-string/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/repeat-string/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 7f1bccc091d452d9d90ada531792c09a309f1adc Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Wed, 6 Mar 2019 21:44:52 +1100 Subject: [PATCH 2/2] Updated export type --- types/repeat-string/index.d.ts | 4 +++- types/repeat-string/repeat-string-tests.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/repeat-string/index.d.ts b/types/repeat-string/index.d.ts index e593a62b68..5664484e22 100644 --- a/types/repeat-string/index.d.ts +++ b/types/repeat-string/index.d.ts @@ -6,4 +6,6 @@ /** * Repeat the given `string` the specified `number` of times. */ -export default function(str: string, num: number): string; +declare function repeat(str: string, num: number): string; + +export = repeat; diff --git a/types/repeat-string/repeat-string-tests.ts b/types/repeat-string/repeat-string-tests.ts index 7095ea672b..c2692d7569 100644 --- a/types/repeat-string/repeat-string-tests.ts +++ b/types/repeat-string/repeat-string-tests.ts @@ -1,3 +1,3 @@ -import Repeat from "repeat-string"; +import Repeat = require("repeat-string"); Repeat('A', 5);