feat(parameterize): add parameterize typings (#42721)

* feat(parameterize): add parameterize typings

* with declare module

* Update parameterize-tests.ts

* Update index.d.ts

* Update parameterize-tests.ts

* Update index.d.ts

* Update parameterize-tests.ts

* Update index.d.ts
This commit is contained in:
Eduardo Turiño 2020-03-02 18:57:32 +00:00 committed by GitHub
parent b0e4982083
commit a768b733e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 0 deletions

7
types/parameterize/index.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Type definitions for parameterize 1.0
// Project: https://github.com/fyalavuz/node-parameterize#readme
// Definitions by: Eduardo Turiño <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function parameterize(s: string, num_chars?: number, delimiter?: string): string;
export = parameterize;

View File

@ -0,0 +1,5 @@
import parameterize = require('parameterize');
parameterize('asa'); // $ExpectType string
parameterize('aeda', 12); // $ExpectType string
parameterize('aeda', 12, '_'); // $ExpectType string

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"parameterize-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }