diff --git a/types/randomatic/index.d.ts b/types/randomatic/index.d.ts new file mode 100644 index 0000000000..35d1bd9056 --- /dev/null +++ b/types/randomatic/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for randomatic 3.1 +// Project: https://github.com/jonschlinkert/randomatic +// Definitions by: Frelia +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function randomatic(p: string, l?: number, options?: { + chars?: string; + exclude?: string | string[]; +}): string; + +declare namespace randomatic { + const isCrypto: boolean; +} + +export = randomatic; diff --git a/types/randomatic/randomatic-tests.ts b/types/randomatic/randomatic-tests.ts new file mode 100644 index 0000000000..4e4bc7af2f --- /dev/null +++ b/types/randomatic/randomatic-tests.ts @@ -0,0 +1,5 @@ +import * as randomize from 'randomatic'; + +randomize('*', 10); // $ExpectedType string +randomize('?', 20, { chars: 'jonschlinkert' }); // $ExpectedType string +randomize('*', 20, { exclude: '0oOiIlL1' }); // $ExpectedType string diff --git a/types/randomatic/tsconfig.json b/types/randomatic/tsconfig.json new file mode 100644 index 0000000000..afb98469b1 --- /dev/null +++ b/types/randomatic/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", + "randomatic-tests.ts" + ] +} diff --git a/types/randomatic/tslint.json b/types/randomatic/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/randomatic/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }