diff --git a/types/string-length/index.d.ts b/types/string-length/index.d.ts new file mode 100644 index 0000000000..4f4ce92f3c --- /dev/null +++ b/types/string-length/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for string-length 2.0 +// Project: https://github.com/sindresorhus/string-length#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = stringLength; + +declare function stringLength(input: string): number; diff --git a/types/string-length/string-length-tests.ts b/types/string-length/string-length-tests.ts new file mode 100644 index 0000000000..aea7a4a4ce --- /dev/null +++ b/types/string-length/string-length-tests.ts @@ -0,0 +1,4 @@ +import stringLength = require('string-length'); + +stringLength('🐴'); // $ExpectType number +stringLength('\u001B[1municorn\u001B[22m'); // $ExpectType number diff --git a/types/string-length/tsconfig.json b/types/string-length/tsconfig.json new file mode 100644 index 0000000000..33d5f5e197 --- /dev/null +++ b/types/string-length/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "string-length-tests.ts" + ] +} diff --git a/types/string-length/tslint.json b/types/string-length/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/string-length/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }