-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrand.d.ts
34 lines (33 loc) · 936 Bytes
/
rand.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export type Options = {
/**
* If to use special characters.
*/
special: boolean | undefined;
/**
* If to use alpha characters.
*/
alpha: boolean | undefined;
/**
* If to use numeric characters.
*/
numbers: boolean | undefined;
/**
* Minimum number of alpha characters.
*/
minAlpha: number | undefined;
/**
* Minimum number of numeric characters.
*/
minNumbers: number | undefined;
/**
* Minimum number of special characters.
*/
minSpecial: number | undefined;
}
/**
* Creates a random string of given length and with the constraints set by the options.
* @param {number} length - Full length of the random string in character count.
* @param {Options} options - Options to constraint the resulting string with.
* @return {string} Value generated.
*/
export default function rand(length: number, options: Options): string;