chertoperter
Version:
Fake data generator for Persian developers
29 lines • 1.46 kB
TypeScript
import { I_First_Name_Generator, I_Last_Name_Generator } from '../types';
/**
* Generates a list of first names based on the provided configuration.
* @param {I_First_Name_Generator} [config] - Optional configuration for first name generation.
* @returns {string[]} An array of randomly selected first names.
* @example
* FirstNameGenerator({ gender: 'male' }); // ["دانیال", "ممد", ...]
*/
declare const FirstNameGenerator: (config?: I_First_Name_Generator) => string[];
/**
* Generates a list of last names based on the provided configuration.
* @param {I_Last_Name_Generator} [config] - Optional configuration for last name generation.
* @returns {string[]} An array of randomly selected last names.
* @example
* LastNameGenerator(); // ["رحمانی", "کیانی", ...]
*/
declare const LastNameGenerator: (config?: I_Last_Name_Generator) => string[];
/**
* Generates a random username based on the provided names.
* @param {string[]} names - An array of names to use for username generation.
* @param {number} [length=8] - The maximum length of the generated username.
* @returns {string} A randomly generated username.
* @throws {Error} If the names array is empty.
* @example
* UserNameGenerator(["aida", "mahtab"], 10); // "mahtab_2"
*/
declare function UserNameGenerator(names: string[], length?: number): string;
export { FirstNameGenerator, LastNameGenerator, UserNameGenerator };
//# sourceMappingURL=index.d.ts.map