@bturkis/loremipsum 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ interface LoremOptions {
2
+ /** Number of items to generate */
3
+ count?: number;
4
+ /** Type of content to generate */
5
+ type?: 'paragraph' | 'sentence' | 'word';
6
+ /** Output format */
7
+ format?: 'text' | 'html' | 'markdown' | 'json';
8
+ /** Language/locale code */
9
+ locale?: LocaleCode;
10
+ /** Start with "Lorem ipsum dolor sit amet..." */
11
+ startWithLorem?: boolean;
12
+ /** Seed for reproducible output */
13
+ seed?: number;
14
+ /** Min words per sentence (default: 5) */
15
+ minWordsPerSentence?: number;
16
+ /** Max words per sentence (default: 15) */
17
+ maxWordsPerSentence?: number;
18
+ /** Min sentences per paragraph (default: 3) */
19
+ minSentencesPerParagraph?: number;
20
+ /** Max sentences per paragraph (default: 7) */
21
+ maxSentencesPerParagraph?: number;
22
+ }
23
+ type LocaleCode = 'la' | 'tr' | 'en' | 'de' | 'fr' | 'es' | 'it' | 'pt' | 'nl' | 'pl' | 'ru' | 'el' | 'ar' | 'he' | 'ja' | 'zh' | 'ko' | 'hi' | 'th' | 'vi' | 'id' | 'cs' | 'sv' | 'da' | 'fi' | 'no' | 'uk' | 'ro' | 'hu' | 'bg';
24
+ interface LocaleInfo {
25
+ code: LocaleCode;
26
+ name: string;
27
+ nativeName: string;
28
+ words: string[];
29
+ }
30
+ interface GenerateResult {
31
+ text: string;
32
+ html?: string;
33
+ markdown?: string;
34
+ json?: object;
35
+ locale: LocaleCode;
36
+ count: number;
37
+ type: 'paragraph' | 'sentence' | 'word';
38
+ }
39
+
40
+ declare class LoremGenerator {
41
+ private options;
42
+ private random;
43
+ constructor(options?: LoremOptions);
44
+ private getRandomInt;
45
+ private getRandomWord;
46
+ private capitalize;
47
+ generateWords(count: number): string[];
48
+ generateSentence(isFirst?: boolean): string;
49
+ generateSentences(count: number): string[];
50
+ generateParagraph(isFirst?: boolean): string;
51
+ generateParagraphs(count: number): string[];
52
+ generate(): GenerateResult;
53
+ private toHTML;
54
+ private toMarkdown;
55
+ private toJSON;
56
+ }
57
+ declare function paragraphs(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
58
+ declare function sentences(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
59
+ declare function words(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
60
+ declare function generate(options?: LoremOptions): GenerateResult;
61
+ declare function getAvailableLocales(): {
62
+ code: LocaleCode;
63
+ name: string;
64
+ nativeName: string;
65
+ }[];
66
+
67
+ declare const locales: Record<LocaleCode, LocaleInfo>;
68
+ declare function getLocale(code: LocaleCode): LocaleInfo;
69
+ declare function getAllLocales(): LocaleInfo[];
70
+ declare function getLocaleWords(code: LocaleCode): string[];
71
+
72
+ declare const lorem: {
73
+ paragraphs: typeof paragraphs;
74
+ sentences: typeof sentences;
75
+ words: typeof words;
76
+ generate: typeof generate;
77
+ getAvailableLocales: typeof getAvailableLocales;
78
+ Generator: typeof LoremGenerator;
79
+ };
80
+
81
+ export { type GenerateResult, type LocaleCode, type LocaleInfo, LoremGenerator, type LoremOptions, lorem as default, generate, getAllLocales, getAvailableLocales, getLocale, getLocaleWords, locales, lorem, paragraphs, sentences, words };
@@ -0,0 +1,81 @@
1
+ interface LoremOptions {
2
+ /** Number of items to generate */
3
+ count?: number;
4
+ /** Type of content to generate */
5
+ type?: 'paragraph' | 'sentence' | 'word';
6
+ /** Output format */
7
+ format?: 'text' | 'html' | 'markdown' | 'json';
8
+ /** Language/locale code */
9
+ locale?: LocaleCode;
10
+ /** Start with "Lorem ipsum dolor sit amet..." */
11
+ startWithLorem?: boolean;
12
+ /** Seed for reproducible output */
13
+ seed?: number;
14
+ /** Min words per sentence (default: 5) */
15
+ minWordsPerSentence?: number;
16
+ /** Max words per sentence (default: 15) */
17
+ maxWordsPerSentence?: number;
18
+ /** Min sentences per paragraph (default: 3) */
19
+ minSentencesPerParagraph?: number;
20
+ /** Max sentences per paragraph (default: 7) */
21
+ maxSentencesPerParagraph?: number;
22
+ }
23
+ type LocaleCode = 'la' | 'tr' | 'en' | 'de' | 'fr' | 'es' | 'it' | 'pt' | 'nl' | 'pl' | 'ru' | 'el' | 'ar' | 'he' | 'ja' | 'zh' | 'ko' | 'hi' | 'th' | 'vi' | 'id' | 'cs' | 'sv' | 'da' | 'fi' | 'no' | 'uk' | 'ro' | 'hu' | 'bg';
24
+ interface LocaleInfo {
25
+ code: LocaleCode;
26
+ name: string;
27
+ nativeName: string;
28
+ words: string[];
29
+ }
30
+ interface GenerateResult {
31
+ text: string;
32
+ html?: string;
33
+ markdown?: string;
34
+ json?: object;
35
+ locale: LocaleCode;
36
+ count: number;
37
+ type: 'paragraph' | 'sentence' | 'word';
38
+ }
39
+
40
+ declare class LoremGenerator {
41
+ private options;
42
+ private random;
43
+ constructor(options?: LoremOptions);
44
+ private getRandomInt;
45
+ private getRandomWord;
46
+ private capitalize;
47
+ generateWords(count: number): string[];
48
+ generateSentence(isFirst?: boolean): string;
49
+ generateSentences(count: number): string[];
50
+ generateParagraph(isFirst?: boolean): string;
51
+ generateParagraphs(count: number): string[];
52
+ generate(): GenerateResult;
53
+ private toHTML;
54
+ private toMarkdown;
55
+ private toJSON;
56
+ }
57
+ declare function paragraphs(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
58
+ declare function sentences(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
59
+ declare function words(count?: number, options?: Omit<LoremOptions, 'count' | 'type'>): string;
60
+ declare function generate(options?: LoremOptions): GenerateResult;
61
+ declare function getAvailableLocales(): {
62
+ code: LocaleCode;
63
+ name: string;
64
+ nativeName: string;
65
+ }[];
66
+
67
+ declare const locales: Record<LocaleCode, LocaleInfo>;
68
+ declare function getLocale(code: LocaleCode): LocaleInfo;
69
+ declare function getAllLocales(): LocaleInfo[];
70
+ declare function getLocaleWords(code: LocaleCode): string[];
71
+
72
+ declare const lorem: {
73
+ paragraphs: typeof paragraphs;
74
+ sentences: typeof sentences;
75
+ words: typeof words;
76
+ generate: typeof generate;
77
+ getAvailableLocales: typeof getAvailableLocales;
78
+ Generator: typeof LoremGenerator;
79
+ };
80
+
81
+ export { type GenerateResult, type LocaleCode, type LocaleInfo, LoremGenerator, type LoremOptions, lorem as default, generate, getAllLocales, getAvailableLocales, getLocale, getLocaleWords, locales, lorem, paragraphs, sentences, words };