source: trip-planner-front/node_modules/nanoid/non-secure/index.d.ts@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 928 bytes
RevLine 
[6a3a178]1/**
2 * Generate URL-friendly unique ID. This method uses the non-secure
3 * predictable random generator with bigger collision probability.
4 *
5 * ```js
6 * import { nanoid } from 'nanoid/non-secure'
7 * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
8 * ```
9 *
10 * @param size Size of the ID. The default size is 21.
11 * @returns A random string.
12 */
13export 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 = //=> "8ё56а"
28 * ```
29 */
30export function customAlphabet(alphabet: string, size: number): () => string
Note: See TracBrowser for help on using the repository browser.