UNPKG

1.46 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/randomstring`
3
4# Summary
5This package contains type definitions for randomstring (https://github.com/klughammer/node-randomstring).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/randomstring.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/randomstring/index.d.ts)
10````ts
11// Type definitions for randomstring 1.1.4
12// Project: https://github.com/klughammer/node-randomstring
13// Definitions by: Isman Usoh <https://github.com/isman-usoh/>
14// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
16declare namespace Randomstring {
17 type Charset = "alphanumeric"
18 | "alphabetic"
19 | "numeric"
20 | "hex"
21 | "binary"
22 | "octal"
23 | string;
24 type Capitalization = "lowercase" | "uppercase";
25 interface GenerateOptions {
26 length?: number | undefined;
27 readable?: boolean | undefined;
28 charset?: Charset | undefined;
29 capitalization?: Capitalization | undefined;
30 }
31
32 function generate(options?: GenerateOptions | number): string;
33}
34
35declare module "randomstring" {
36 export = Randomstring;
37}
38
39````
40
41### Additional Details
42 * Last updated: Fri, 29 Oct 2021 23:01:24 GMT
43 * Dependencies: none
44 * Global values: `Randomstring`
45
46# Credits
47These definitions were written by [Isman Usoh](https://github.com/isman-usoh).
48
\No newline at end of file