fiction-word
Version:
A random word generator.
15 lines (14 loc) • 503 B
TypeScript
export interface WordOptions {
length?: number;
lengthType?: "flex" | "exact";
distribution?: [number, number][];
distributionType?: "dictionary" | "corpus";
}
/**
* @description Generates a word based on the given length or a normally distributed number.
* @param givenLength - The given length of the word.
* @param lengthType - The type of length variance.
* @returns The generated word.
*/
declare function makeWord(options?: number | WordOptions): string;
export { makeWord };