diff --git a/types/wildstring/index.d.ts b/types/wildstring/index.d.ts new file mode 100644 index 0000000000..f995b60b62 --- /dev/null +++ b/types/wildstring/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for wildstring 1.0 +// Project: https://github.com/deltreey/wildstring#readme +// Definitions by: CiarĂ¡n Ingle +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const wildstring: { + wildcard: string; + + caseSensitive: boolean; + + match: (pattern: string, string: string) => boolean; + + replace: (pattern: string, strings: string | ReadonlyArray) => string; +}; + +export {}; +export = wildstring; diff --git a/types/wildstring/tsconfig.json b/types/wildstring/tsconfig.json new file mode 100644 index 0000000000..afb17b5af5 --- /dev/null +++ b/types/wildstring/tsconfig.json @@ -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", + "wildstring-tests.ts" + ] +} diff --git a/types/wildstring/tslint.json b/types/wildstring/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/wildstring/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/wildstring/wildstring-tests.ts b/types/wildstring/wildstring-tests.ts new file mode 100644 index 0000000000..c9ec948c79 --- /dev/null +++ b/types/wildstring/wildstring-tests.ts @@ -0,0 +1,9 @@ +import wildstring = require('wildstring'); + +wildstring.wildcard = '*'; +wildstring.caseSensitive = true; + +wildstring.match('Test*', 'Testing'); + +wildstring.replace('I * node.*', 'script'); +wildstring.replace('I * node.*', [ 'love', 'js' ]);