diff --git a/types/filenamify/filenamify-tests.ts b/types/filenamify/filenamify-tests.ts new file mode 100644 index 0000000000..212ff424cf --- /dev/null +++ b/types/filenamify/filenamify-tests.ts @@ -0,0 +1,10 @@ +import * as filenamify from 'filenamify'; + +filenamify(''); +// => 'foo!bar' + +filenamify('foo:"bar"', {replacement: '🐴'}); +// => 'foo🐴bar' + +filenamify.path('/some/!path'); +// => '/some/path' diff --git a/types/filenamify/index.d.ts b/types/filenamify/index.d.ts new file mode 100644 index 0000000000..981b04443d --- /dev/null +++ b/types/filenamify/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for filenamify 2.0 +// Project: https://github.com/sindresorhus/filenamify +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function filenamify(input: string, options?: filenamify.Options): string; + +declare namespace filenamify { + interface Options { + replacement: string; + } + function path(input: string, options?: filenamify.Options): string; +} + +export = filenamify; diff --git a/types/filenamify/tsconfig.json b/types/filenamify/tsconfig.json new file mode 100644 index 0000000000..aec1f33988 --- /dev/null +++ b/types/filenamify/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "filenamify-tests.ts" + ] +} diff --git a/types/filenamify/tslint.json b/types/filenamify/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/filenamify/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}