UNPKG

807 BTypeScriptView Raw
1// Type definitions for randomstring 1.1.4
2// Project: https://github.com/klughammer/node-randomstring
3// Definitions by: Isman Usoh <https://github.com/isman-usoh/>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6declare namespace Randomstring {
7 type Charset = "alphanumeric"
8 | "alphabetic"
9 | "numeric"
10 | "hex"
11 | "binary"
12 | "octal"
13 | string;
14 type Capitalization = "lowercase" | "uppercase";
15 interface GenerateOptions {
16 length?: number | undefined;
17 readable?: boolean | undefined;
18 charset?: Charset | undefined;
19 capitalization?: Capitalization | undefined;
20 }
21
22 function generate(options?: GenerateOptions | number): string;
23}
24
25declare module "randomstring" {
26 export = Randomstring;
27}