1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export function nanoid (size?: number): string
|
14 |
|
15 | /**
|
16 | * Generate URL-friendly unique ID based on the custom alphabet.
|
17 | * This method uses the non-secure predictable random generator
|
18 | * with bigger collision probability.
|
19 | *
|
20 | * @param alphabet Alphabet used to generate the ID.
|
21 | * @param size Size of the ID.
|
22 | * @returns A random string.
|
23 | *
|
24 | * ```js
|
25 | * import { customAlphabet } from 'nanoid/non-secure'
|
26 | * const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
27 | * model.id =
|
28 | * ```
|
29 | */
|
30 | export function customAlphabet (alphabet: string, size: number): () => string
|
31 |
|
\ | No newline at end of file |