colorless-green-ipsum
Version:
A philosophical nonsense text generator inspired by Chomsky's famous sentence
32 lines (31 loc) • 1.11 kB
TypeScript
export type StyleName = "common" | "erudite" | "whimsical" | string;
export type WordBank = {
adjectives: string[];
nouns: string[];
adverbs: string[];
verbs: string[];
conjunctions: string[];
};
export declare class ColorlessGreenIpsumGenerator {
private styleWordBanks;
private availableStyles;
private style;
constructor(initialStyle?: StyleName);
getAvailableStyles(): StyleName[];
addCustomStyle(styleName: string, wordBank: Partial<WordBank>): boolean;
removeCustomStyle(styleName: string): boolean;
private get currentWordBank();
private get adjectives();
private get nouns();
private get adverbs();
private get verbs();
private get conjunctions();
setStyle(style: StyleName): boolean;
getStyle(): StyleName;
private getRandomElement;
private capitalizeFirstLetter;
generateSentence(): string;
generateParagraph(sentenceCount?: number): string;
generateIpsum(paragraphCount?: number, sentencesPerParagraph?: number): string;
generate(paragraphCount?: number, sentencesPerParagraph?: number): string;
}