@utilix-tech/sdk 0.1.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +199 -0
  3. package/dist/api-8aZtWhSj.d.cts +308 -0
  4. package/dist/api-8aZtWhSj.d.ts +308 -0
  5. package/dist/chunk-2CJSLYWI.js +520 -0
  6. package/dist/chunk-3BAHSW4C.js +1385 -0
  7. package/dist/chunk-6YPV2AB5.js +1246 -0
  8. package/dist/chunk-BPVAB4P2.js +1126 -0
  9. package/dist/chunk-FL53T24A.js +257 -0
  10. package/dist/chunk-L6KCTHUW.js +1086 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/chunk-ROTPLW7T.js +265 -0
  13. package/dist/chunk-TSAGO3XP.js +1253 -0
  14. package/dist/chunk-UC656APA.js +1080 -0
  15. package/dist/chunk-W4UBLYFU.js +1219 -0
  16. package/dist/chunk-XST6X3HT.js +896 -0
  17. package/dist/chunk-XXYZLLHI.js +2227 -0
  18. package/dist/chunk-ZKL2VX2G.js +2215 -0
  19. package/dist/chunk-ZPQZEIXP.js +685 -0
  20. package/dist/code-QNrdLIR3.d.cts +327 -0
  21. package/dist/code-QNrdLIR3.d.ts +327 -0
  22. package/dist/color-tPwZCr9H.d.cts +229 -0
  23. package/dist/color-tPwZCr9H.d.ts +229 -0
  24. package/dist/css-Cf7AMGM-.d.cts +318 -0
  25. package/dist/css-Cf7AMGM-.d.ts +318 -0
  26. package/dist/data-rMjWNiOJ.d.cts +215 -0
  27. package/dist/data-rMjWNiOJ.d.ts +215 -0
  28. package/dist/encoding-7gmq-vkV.d.cts +108 -0
  29. package/dist/encoding-7gmq-vkV.d.ts +108 -0
  30. package/dist/generators-BGtRGpJZ.d.cts +118 -0
  31. package/dist/generators-BGtRGpJZ.d.ts +118 -0
  32. package/dist/hashing-CnetQFD_.d.cts +76 -0
  33. package/dist/hashing-CnetQFD_.d.ts +76 -0
  34. package/dist/index.cjs +15466 -0
  35. package/dist/index.d.cts +18 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +20 -0
  38. package/dist/json-BjSoIS1h.d.cts +198 -0
  39. package/dist/json-BjSoIS1h.d.ts +198 -0
  40. package/dist/misc-DcVBManm.d.cts +201 -0
  41. package/dist/misc-DcVBManm.d.ts +201 -0
  42. package/dist/network-CNtmrDeN.d.cts +170 -0
  43. package/dist/network-CNtmrDeN.d.ts +170 -0
  44. package/dist/text-DqAjPtQ0.d.cts +319 -0
  45. package/dist/text-DqAjPtQ0.d.ts +319 -0
  46. package/dist/time-DbT8fjaF.d.cts +145 -0
  47. package/dist/time-DbT8fjaF.d.ts +145 -0
  48. package/dist/tools/api.cjs +1216 -0
  49. package/dist/tools/api.d.cts +1 -0
  50. package/dist/tools/api.d.ts +1 -0
  51. package/dist/tools/api.js +2 -0
  52. package/dist/tools/code.cjs +2212 -0
  53. package/dist/tools/code.d.cts +1 -0
  54. package/dist/tools/code.d.ts +1 -0
  55. package/dist/tools/code.js +2 -0
  56. package/dist/tools/color.cjs +1122 -0
  57. package/dist/tools/color.d.cts +1 -0
  58. package/dist/tools/color.d.ts +1 -0
  59. package/dist/tools/color.js +2 -0
  60. package/dist/tools/css.cjs +1242 -0
  61. package/dist/tools/css.d.cts +1 -0
  62. package/dist/tools/css.d.ts +1 -0
  63. package/dist/tools/css.js +2 -0
  64. package/dist/tools/data.cjs +1097 -0
  65. package/dist/tools/data.d.cts +1 -0
  66. package/dist/tools/data.d.ts +1 -0
  67. package/dist/tools/data.js +2 -0
  68. package/dist/tools/encoding.cjs +261 -0
  69. package/dist/tools/encoding.d.cts +1 -0
  70. package/dist/tools/encoding.d.ts +1 -0
  71. package/dist/tools/encoding.js +2 -0
  72. package/dist/tools/generators.cjs +521 -0
  73. package/dist/tools/generators.d.cts +1 -0
  74. package/dist/tools/generators.d.ts +1 -0
  75. package/dist/tools/generators.js +2 -0
  76. package/dist/tools/hashing.cjs +259 -0
  77. package/dist/tools/hashing.d.cts +1 -0
  78. package/dist/tools/hashing.d.ts +1 -0
  79. package/dist/tools/hashing.js +2 -0
  80. package/dist/tools/json.cjs +1270 -0
  81. package/dist/tools/json.d.cts +1 -0
  82. package/dist/tools/json.d.ts +1 -0
  83. package/dist/tools/json.js +2 -0
  84. package/dist/tools/misc.cjs +1082 -0
  85. package/dist/tools/misc.d.cts +1 -0
  86. package/dist/tools/misc.d.ts +1 -0
  87. package/dist/tools/misc.js +2 -0
  88. package/dist/tools/network.cjs +1381 -0
  89. package/dist/tools/network.d.cts +1 -0
  90. package/dist/tools/network.d.ts +1 -0
  91. package/dist/tools/network.js +2 -0
  92. package/dist/tools/text.cjs +2224 -0
  93. package/dist/tools/text.d.cts +1 -0
  94. package/dist/tools/text.d.ts +1 -0
  95. package/dist/tools/text.js +2 -0
  96. package/dist/tools/time.cjs +681 -0
  97. package/dist/tools/time.d.cts +1 -0
  98. package/dist/tools/time.d.ts +1 -0
  99. package/dist/tools/time.js +2 -0
  100. package/dist/tools/units.cjs +892 -0
  101. package/dist/tools/units.d.cts +1 -0
  102. package/dist/tools/units.d.ts +1 -0
  103. package/dist/tools/units.js +2 -0
  104. package/dist/units-6lwDYBvX.d.cts +302 -0
  105. package/dist/units-6lwDYBvX.d.ts +302 -0
  106. package/package.json +148 -0
@@ -0,0 +1,319 @@
1
+ /**
2
+ * @module text
3
+ * Text processing utilities for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - word-counter : countWords, formatReadingTime
7
+ * - case-converter : convertCase, convertAll
8
+ * - lorem-ipsum : generateWords, generateSentences, generateParagraphs, generate
9
+ * - slug-generator : slugify, slugifyAll
10
+ * - string-escape : escapeString, unescapeString, escapeAll
11
+ * - line-ops : applyOp, applyOps
12
+ * - html-to-markdown: htmlToMarkdown, markdownToHtml
13
+ * - number-words : numberToWords, numberToOrdinal, ordinalWords, numberToRoman, romanToNumber
14
+ * - text-stats : analyzeText, readabilityScore, wordFrequency, sentenceCount, syllableCount
15
+ * - text-diff : diffLines, diffLinesSimple
16
+ * - diff-viewer : parseDiff, generateDiff, diffStats
17
+ * - markdown-preview: renderMarkdown, extractHeadings
18
+ * - html-table : detectDelimiter, parseTableData, generateHtmlTable, generateMarkdownTable, csvToHtml, csvToMarkdown
19
+ * - ascii-art : textToAscii, getAvailableFonts, addBorder, centerText
20
+ * - morse-code : textToMorse, morseToText, isValidMorse, getMorseForChar, getMorseTiming
21
+ */
22
+ interface WordCountResult {
23
+ words: number;
24
+ chars: number;
25
+ charsNoSpaces: number;
26
+ lines: number;
27
+ sentences: number;
28
+ paragraphs: number;
29
+ readingTimeSec: number;
30
+ }
31
+ declare function countWords(text: string): WordCountResult;
32
+ declare function formatReadingTime(seconds: number): string;
33
+ type CaseFormat = 'camelCase' | 'PascalCase' | 'snake_case' | 'kebab-case' | 'SCREAMING_SNAKE' | 'Title Case' | 'lowercase' | 'UPPERCASE' | 'dot.case' | 'path/case';
34
+ declare const CASE_FORMATS: CaseFormat[];
35
+ declare function convertCase(input: string, format: CaseFormat): string;
36
+ declare function convertAll(input: string): Record<CaseFormat, string>;
37
+ type LoremUnit = 'words' | 'sentences' | 'paragraphs';
38
+ declare function generateWords(count: number, startClassic?: boolean): string;
39
+ declare function generateSentences(count: number): string;
40
+ declare function generateParagraphs(count: number): string;
41
+ declare function generate(unit: LoremUnit, count: number): string;
42
+ type SlugSeparator = '-' | '_' | '.';
43
+ declare function slugify(input: string, separator?: SlugSeparator): string;
44
+ declare function slugifyAll(input: string): Record<SlugSeparator, string>;
45
+ type EscapeMode = 'json' | 'javascript' | 'html' | 'url' | 'csv';
46
+ declare const ESCAPE_MODES: EscapeMode[];
47
+ declare function escapeString(input: string, mode: EscapeMode): string;
48
+ declare function unescapeString(input: string, mode: EscapeMode): string;
49
+ declare function escapeAll(input: string): Record<EscapeMode, string>;
50
+ type LineOp = 'sort-asc' | 'sort-desc' | 'sort-natural' | 'reverse' | 'dedupe' | 'dedupe-ci' | 'shuffle' | 'trim' | 'remove-empty' | 'number-lines';
51
+ declare const LINE_OPS: LineOp[];
52
+ declare function applyOp(input: string, op: LineOp): string;
53
+ declare function applyOps(input: string, ops: LineOp[]): string;
54
+ interface ConvertOptions {
55
+ headingStyle: 'atx' | 'setext';
56
+ bulletStyle: '-' | '*' | '+';
57
+ codeBlockStyle: 'fenced' | 'indented';
58
+ linkStyle: 'inline' | 'reference';
59
+ }
60
+ declare const DEFAULT_CONVERT_OPTIONS: ConvertOptions;
61
+ declare function htmlToMarkdown(html: string, options?: Partial<ConvertOptions>): string;
62
+ declare function markdownToHtml(markdown: string): string;
63
+ declare function numberToWords(n: number): string | {
64
+ error: string;
65
+ };
66
+ declare function numberToOrdinal(n: number): string | {
67
+ error: string;
68
+ };
69
+ declare function ordinalWords(n: number): string | {
70
+ error: string;
71
+ };
72
+ declare function numberToRoman(n: number): string | {
73
+ error: string;
74
+ };
75
+ declare function romanToNumber(roman: string): number | {
76
+ error: string;
77
+ };
78
+ interface TextAnalysis {
79
+ charCount: number;
80
+ charCountNoSpaces: number;
81
+ wordCount: number;
82
+ sentenceCount: number;
83
+ paragraphCount: number;
84
+ lineCount: number;
85
+ avgWordLength: number;
86
+ avgWordsPerSentence: number;
87
+ longestWord: string;
88
+ mostFrequentWord: string;
89
+ uniqueWordCount: number;
90
+ estimatedReadTime: number;
91
+ }
92
+ interface ReadabilityScore {
93
+ fleschReadingEase: number;
94
+ fleschKincaidGrade: number;
95
+ readingLevel: string;
96
+ }
97
+ declare function sentenceCount(text: string): number;
98
+ declare function syllableCount(word: string): number;
99
+ declare function analyzeText(text: string): TextAnalysis;
100
+ declare function readabilityScore(text: string): ReadabilityScore | {
101
+ error: string;
102
+ };
103
+ declare function wordFrequency(text: string, limit?: number): Array<{
104
+ word: string;
105
+ count: number;
106
+ percent: number;
107
+ }>;
108
+ type DiffType = 'equal' | 'added' | 'removed';
109
+ interface DiffLine {
110
+ type: DiffType;
111
+ text: string;
112
+ lineNumLeft?: number;
113
+ lineNumRight?: number;
114
+ }
115
+ interface DiffResult {
116
+ lines: DiffLine[];
117
+ addedCount: number;
118
+ removedCount: number;
119
+ unchangedCount: number;
120
+ }
121
+ declare function diffLines(left: string, right: string): DiffResult;
122
+ declare function diffLinesSimple(left: string, right: string): DiffResult;
123
+ type LineType = 'added' | 'removed' | 'context' | 'header' | 'hunk';
124
+ interface DiffViewerLine {
125
+ type: LineType;
126
+ content: string;
127
+ lineNumber?: {
128
+ old?: number;
129
+ new?: number;
130
+ };
131
+ }
132
+ interface DiffHunk {
133
+ header: string;
134
+ lines: DiffViewerLine[];
135
+ oldStart: number;
136
+ oldCount: number;
137
+ newStart: number;
138
+ newCount: number;
139
+ }
140
+ interface DiffFile {
141
+ oldPath: string;
142
+ newPath: string;
143
+ hunks: DiffHunk[];
144
+ added: number;
145
+ removed: number;
146
+ isBinary: boolean;
147
+ isNew: boolean;
148
+ isDeleted: boolean;
149
+ }
150
+ interface ParsedDiff {
151
+ files: DiffFile[];
152
+ totalAdded: number;
153
+ totalRemoved: number;
154
+ stats: string;
155
+ }
156
+ declare function parseDiff(unifiedDiff: string): ParsedDiff | {
157
+ error: string;
158
+ };
159
+ declare function generateDiff(original: string, modified: string, filename?: string): string;
160
+ declare function diffStats(diff: ParsedDiff): {
161
+ files: number;
162
+ added: number;
163
+ removed: number;
164
+ };
165
+ interface MarkdownResult {
166
+ html: string;
167
+ wordCount: number;
168
+ headings: Array<{
169
+ level: number;
170
+ text: string;
171
+ }>;
172
+ }
173
+ declare function extractHeadings(markdown: string): Array<{
174
+ level: number;
175
+ text: string;
176
+ }>;
177
+ declare function renderMarkdown(input: string): MarkdownResult;
178
+ interface TableOptions {
179
+ hasHeader?: boolean;
180
+ delimiter?: ',' | '\t' | ';' | '|';
181
+ caption?: string;
182
+ bordered?: boolean;
183
+ striped?: boolean;
184
+ sortable?: boolean;
185
+ id?: string;
186
+ }
187
+ interface ParsedTable {
188
+ headers: string[];
189
+ rows: string[][];
190
+ delimiter: string;
191
+ rowCount: number;
192
+ colCount: number;
193
+ }
194
+ declare function detectDelimiter(csv: string): ',' | '\t' | ';' | '|';
195
+ declare function parseTableData(input: string, options?: TableOptions): ParsedTable | {
196
+ error: string;
197
+ };
198
+ declare function generateHtmlTable(data: ParsedTable, options?: TableOptions): string;
199
+ declare function generateMarkdownTable(data: ParsedTable): string;
200
+ declare function csvToHtml(input: string, options?: TableOptions): string | {
201
+ error: string;
202
+ };
203
+ declare function csvToMarkdown(input: string, options?: TableOptions): string | {
204
+ error: string;
205
+ };
206
+ type AsciiFont = 'block' | 'banner' | 'small' | 'dots';
207
+ interface AsciiOptions {
208
+ font: AsciiFont;
209
+ width?: number;
210
+ align?: 'left' | 'center' | 'right';
211
+ }
212
+ declare function textToAscii(text: string, options?: AsciiOptions): string;
213
+ declare function getAvailableFonts(): Array<{
214
+ value: AsciiFont;
215
+ label: string;
216
+ preview: string;
217
+ }>;
218
+ declare function addBorder(text: string, style: 'box' | 'double' | 'rounded' | 'stars'): string;
219
+ declare function centerText(text: string, width: number): string;
220
+ interface MorseOptions {
221
+ separator?: string;
222
+ wordSeparator?: string;
223
+ dotChar?: string;
224
+ dashChar?: string;
225
+ }
226
+ declare const MORSE_CODE: Record<string, string>;
227
+ declare function textToMorse(text: string, options?: MorseOptions): string;
228
+ declare function morseToText(morse: string, options?: MorseOptions): string | {
229
+ error: string;
230
+ };
231
+ declare function isValidMorse(morse: string): boolean;
232
+ declare function getMorseForChar(char: string): string | null;
233
+ declare function getMorseTiming(morse: string): Array<{
234
+ type: 'dot' | 'dash' | 'gap' | 'wordgap';
235
+ duration: number;
236
+ }>;
237
+
238
+ type text_AsciiFont = AsciiFont;
239
+ type text_AsciiOptions = AsciiOptions;
240
+ declare const text_CASE_FORMATS: typeof CASE_FORMATS;
241
+ type text_CaseFormat = CaseFormat;
242
+ type text_ConvertOptions = ConvertOptions;
243
+ declare const text_DEFAULT_CONVERT_OPTIONS: typeof DEFAULT_CONVERT_OPTIONS;
244
+ type text_DiffFile = DiffFile;
245
+ type text_DiffHunk = DiffHunk;
246
+ type text_DiffLine = DiffLine;
247
+ type text_DiffResult = DiffResult;
248
+ type text_DiffType = DiffType;
249
+ type text_DiffViewerLine = DiffViewerLine;
250
+ declare const text_ESCAPE_MODES: typeof ESCAPE_MODES;
251
+ type text_EscapeMode = EscapeMode;
252
+ declare const text_LINE_OPS: typeof LINE_OPS;
253
+ type text_LineOp = LineOp;
254
+ type text_LineType = LineType;
255
+ type text_LoremUnit = LoremUnit;
256
+ declare const text_MORSE_CODE: typeof MORSE_CODE;
257
+ type text_MarkdownResult = MarkdownResult;
258
+ type text_MorseOptions = MorseOptions;
259
+ type text_ParsedDiff = ParsedDiff;
260
+ type text_ParsedTable = ParsedTable;
261
+ type text_ReadabilityScore = ReadabilityScore;
262
+ type text_SlugSeparator = SlugSeparator;
263
+ type text_TableOptions = TableOptions;
264
+ type text_TextAnalysis = TextAnalysis;
265
+ type text_WordCountResult = WordCountResult;
266
+ declare const text_addBorder: typeof addBorder;
267
+ declare const text_analyzeText: typeof analyzeText;
268
+ declare const text_applyOp: typeof applyOp;
269
+ declare const text_applyOps: typeof applyOps;
270
+ declare const text_centerText: typeof centerText;
271
+ declare const text_convertAll: typeof convertAll;
272
+ declare const text_convertCase: typeof convertCase;
273
+ declare const text_countWords: typeof countWords;
274
+ declare const text_csvToHtml: typeof csvToHtml;
275
+ declare const text_csvToMarkdown: typeof csvToMarkdown;
276
+ declare const text_detectDelimiter: typeof detectDelimiter;
277
+ declare const text_diffLines: typeof diffLines;
278
+ declare const text_diffLinesSimple: typeof diffLinesSimple;
279
+ declare const text_diffStats: typeof diffStats;
280
+ declare const text_escapeAll: typeof escapeAll;
281
+ declare const text_escapeString: typeof escapeString;
282
+ declare const text_extractHeadings: typeof extractHeadings;
283
+ declare const text_formatReadingTime: typeof formatReadingTime;
284
+ declare const text_generate: typeof generate;
285
+ declare const text_generateDiff: typeof generateDiff;
286
+ declare const text_generateHtmlTable: typeof generateHtmlTable;
287
+ declare const text_generateMarkdownTable: typeof generateMarkdownTable;
288
+ declare const text_generateParagraphs: typeof generateParagraphs;
289
+ declare const text_generateSentences: typeof generateSentences;
290
+ declare const text_generateWords: typeof generateWords;
291
+ declare const text_getAvailableFonts: typeof getAvailableFonts;
292
+ declare const text_getMorseForChar: typeof getMorseForChar;
293
+ declare const text_getMorseTiming: typeof getMorseTiming;
294
+ declare const text_htmlToMarkdown: typeof htmlToMarkdown;
295
+ declare const text_isValidMorse: typeof isValidMorse;
296
+ declare const text_markdownToHtml: typeof markdownToHtml;
297
+ declare const text_morseToText: typeof morseToText;
298
+ declare const text_numberToOrdinal: typeof numberToOrdinal;
299
+ declare const text_numberToRoman: typeof numberToRoman;
300
+ declare const text_numberToWords: typeof numberToWords;
301
+ declare const text_ordinalWords: typeof ordinalWords;
302
+ declare const text_parseDiff: typeof parseDiff;
303
+ declare const text_parseTableData: typeof parseTableData;
304
+ declare const text_readabilityScore: typeof readabilityScore;
305
+ declare const text_renderMarkdown: typeof renderMarkdown;
306
+ declare const text_romanToNumber: typeof romanToNumber;
307
+ declare const text_sentenceCount: typeof sentenceCount;
308
+ declare const text_slugify: typeof slugify;
309
+ declare const text_slugifyAll: typeof slugifyAll;
310
+ declare const text_syllableCount: typeof syllableCount;
311
+ declare const text_textToAscii: typeof textToAscii;
312
+ declare const text_textToMorse: typeof textToMorse;
313
+ declare const text_unescapeString: typeof unescapeString;
314
+ declare const text_wordFrequency: typeof wordFrequency;
315
+ declare namespace text {
316
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
317
+ }
318
+
319
+ export { generateWords as $, type AsciiFont as A, csvToHtml as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, csvToMarkdown as F, detectDelimiter as G, diffLines as H, diffLinesSimple as I, diffStats as J, escapeAll as K, LINE_OPS as L, MORSE_CODE as M, escapeString as N, extractHeadings as O, type ParsedDiff as P, formatReadingTime as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, generate as U, generateDiff as V, type WordCountResult as W, generateHtmlTable as X, generateMarkdownTable as Y, generateParagraphs as Z, generateSentences as _, type AsciiOptions as a, getAvailableFonts as a0, getMorseForChar as a1, getMorseTiming as a2, htmlToMarkdown as a3, isValidMorse as a4, markdownToHtml as a5, morseToText as a6, numberToOrdinal as a7, numberToRoman as a8, numberToWords as a9, ordinalWords as aa, parseDiff as ab, parseTableData as ac, readabilityScore as ad, renderMarkdown as ae, romanToNumber as af, sentenceCount as ag, slugify as ah, slugifyAll as ai, syllableCount as aj, textToAscii as ak, textToMorse as al, unescapeString as am, wordFrequency as an, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type TextAnalysis as q, addBorder as r, analyzeText as s, text as t, applyOp as u, applyOps as v, centerText as w, convertAll as x, convertCase as y, countWords as z };
@@ -0,0 +1,319 @@
1
+ /**
2
+ * @module text
3
+ * Text processing utilities for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - word-counter : countWords, formatReadingTime
7
+ * - case-converter : convertCase, convertAll
8
+ * - lorem-ipsum : generateWords, generateSentences, generateParagraphs, generate
9
+ * - slug-generator : slugify, slugifyAll
10
+ * - string-escape : escapeString, unescapeString, escapeAll
11
+ * - line-ops : applyOp, applyOps
12
+ * - html-to-markdown: htmlToMarkdown, markdownToHtml
13
+ * - number-words : numberToWords, numberToOrdinal, ordinalWords, numberToRoman, romanToNumber
14
+ * - text-stats : analyzeText, readabilityScore, wordFrequency, sentenceCount, syllableCount
15
+ * - text-diff : diffLines, diffLinesSimple
16
+ * - diff-viewer : parseDiff, generateDiff, diffStats
17
+ * - markdown-preview: renderMarkdown, extractHeadings
18
+ * - html-table : detectDelimiter, parseTableData, generateHtmlTable, generateMarkdownTable, csvToHtml, csvToMarkdown
19
+ * - ascii-art : textToAscii, getAvailableFonts, addBorder, centerText
20
+ * - morse-code : textToMorse, morseToText, isValidMorse, getMorseForChar, getMorseTiming
21
+ */
22
+ interface WordCountResult {
23
+ words: number;
24
+ chars: number;
25
+ charsNoSpaces: number;
26
+ lines: number;
27
+ sentences: number;
28
+ paragraphs: number;
29
+ readingTimeSec: number;
30
+ }
31
+ declare function countWords(text: string): WordCountResult;
32
+ declare function formatReadingTime(seconds: number): string;
33
+ type CaseFormat = 'camelCase' | 'PascalCase' | 'snake_case' | 'kebab-case' | 'SCREAMING_SNAKE' | 'Title Case' | 'lowercase' | 'UPPERCASE' | 'dot.case' | 'path/case';
34
+ declare const CASE_FORMATS: CaseFormat[];
35
+ declare function convertCase(input: string, format: CaseFormat): string;
36
+ declare function convertAll(input: string): Record<CaseFormat, string>;
37
+ type LoremUnit = 'words' | 'sentences' | 'paragraphs';
38
+ declare function generateWords(count: number, startClassic?: boolean): string;
39
+ declare function generateSentences(count: number): string;
40
+ declare function generateParagraphs(count: number): string;
41
+ declare function generate(unit: LoremUnit, count: number): string;
42
+ type SlugSeparator = '-' | '_' | '.';
43
+ declare function slugify(input: string, separator?: SlugSeparator): string;
44
+ declare function slugifyAll(input: string): Record<SlugSeparator, string>;
45
+ type EscapeMode = 'json' | 'javascript' | 'html' | 'url' | 'csv';
46
+ declare const ESCAPE_MODES: EscapeMode[];
47
+ declare function escapeString(input: string, mode: EscapeMode): string;
48
+ declare function unescapeString(input: string, mode: EscapeMode): string;
49
+ declare function escapeAll(input: string): Record<EscapeMode, string>;
50
+ type LineOp = 'sort-asc' | 'sort-desc' | 'sort-natural' | 'reverse' | 'dedupe' | 'dedupe-ci' | 'shuffle' | 'trim' | 'remove-empty' | 'number-lines';
51
+ declare const LINE_OPS: LineOp[];
52
+ declare function applyOp(input: string, op: LineOp): string;
53
+ declare function applyOps(input: string, ops: LineOp[]): string;
54
+ interface ConvertOptions {
55
+ headingStyle: 'atx' | 'setext';
56
+ bulletStyle: '-' | '*' | '+';
57
+ codeBlockStyle: 'fenced' | 'indented';
58
+ linkStyle: 'inline' | 'reference';
59
+ }
60
+ declare const DEFAULT_CONVERT_OPTIONS: ConvertOptions;
61
+ declare function htmlToMarkdown(html: string, options?: Partial<ConvertOptions>): string;
62
+ declare function markdownToHtml(markdown: string): string;
63
+ declare function numberToWords(n: number): string | {
64
+ error: string;
65
+ };
66
+ declare function numberToOrdinal(n: number): string | {
67
+ error: string;
68
+ };
69
+ declare function ordinalWords(n: number): string | {
70
+ error: string;
71
+ };
72
+ declare function numberToRoman(n: number): string | {
73
+ error: string;
74
+ };
75
+ declare function romanToNumber(roman: string): number | {
76
+ error: string;
77
+ };
78
+ interface TextAnalysis {
79
+ charCount: number;
80
+ charCountNoSpaces: number;
81
+ wordCount: number;
82
+ sentenceCount: number;
83
+ paragraphCount: number;
84
+ lineCount: number;
85
+ avgWordLength: number;
86
+ avgWordsPerSentence: number;
87
+ longestWord: string;
88
+ mostFrequentWord: string;
89
+ uniqueWordCount: number;
90
+ estimatedReadTime: number;
91
+ }
92
+ interface ReadabilityScore {
93
+ fleschReadingEase: number;
94
+ fleschKincaidGrade: number;
95
+ readingLevel: string;
96
+ }
97
+ declare function sentenceCount(text: string): number;
98
+ declare function syllableCount(word: string): number;
99
+ declare function analyzeText(text: string): TextAnalysis;
100
+ declare function readabilityScore(text: string): ReadabilityScore | {
101
+ error: string;
102
+ };
103
+ declare function wordFrequency(text: string, limit?: number): Array<{
104
+ word: string;
105
+ count: number;
106
+ percent: number;
107
+ }>;
108
+ type DiffType = 'equal' | 'added' | 'removed';
109
+ interface DiffLine {
110
+ type: DiffType;
111
+ text: string;
112
+ lineNumLeft?: number;
113
+ lineNumRight?: number;
114
+ }
115
+ interface DiffResult {
116
+ lines: DiffLine[];
117
+ addedCount: number;
118
+ removedCount: number;
119
+ unchangedCount: number;
120
+ }
121
+ declare function diffLines(left: string, right: string): DiffResult;
122
+ declare function diffLinesSimple(left: string, right: string): DiffResult;
123
+ type LineType = 'added' | 'removed' | 'context' | 'header' | 'hunk';
124
+ interface DiffViewerLine {
125
+ type: LineType;
126
+ content: string;
127
+ lineNumber?: {
128
+ old?: number;
129
+ new?: number;
130
+ };
131
+ }
132
+ interface DiffHunk {
133
+ header: string;
134
+ lines: DiffViewerLine[];
135
+ oldStart: number;
136
+ oldCount: number;
137
+ newStart: number;
138
+ newCount: number;
139
+ }
140
+ interface DiffFile {
141
+ oldPath: string;
142
+ newPath: string;
143
+ hunks: DiffHunk[];
144
+ added: number;
145
+ removed: number;
146
+ isBinary: boolean;
147
+ isNew: boolean;
148
+ isDeleted: boolean;
149
+ }
150
+ interface ParsedDiff {
151
+ files: DiffFile[];
152
+ totalAdded: number;
153
+ totalRemoved: number;
154
+ stats: string;
155
+ }
156
+ declare function parseDiff(unifiedDiff: string): ParsedDiff | {
157
+ error: string;
158
+ };
159
+ declare function generateDiff(original: string, modified: string, filename?: string): string;
160
+ declare function diffStats(diff: ParsedDiff): {
161
+ files: number;
162
+ added: number;
163
+ removed: number;
164
+ };
165
+ interface MarkdownResult {
166
+ html: string;
167
+ wordCount: number;
168
+ headings: Array<{
169
+ level: number;
170
+ text: string;
171
+ }>;
172
+ }
173
+ declare function extractHeadings(markdown: string): Array<{
174
+ level: number;
175
+ text: string;
176
+ }>;
177
+ declare function renderMarkdown(input: string): MarkdownResult;
178
+ interface TableOptions {
179
+ hasHeader?: boolean;
180
+ delimiter?: ',' | '\t' | ';' | '|';
181
+ caption?: string;
182
+ bordered?: boolean;
183
+ striped?: boolean;
184
+ sortable?: boolean;
185
+ id?: string;
186
+ }
187
+ interface ParsedTable {
188
+ headers: string[];
189
+ rows: string[][];
190
+ delimiter: string;
191
+ rowCount: number;
192
+ colCount: number;
193
+ }
194
+ declare function detectDelimiter(csv: string): ',' | '\t' | ';' | '|';
195
+ declare function parseTableData(input: string, options?: TableOptions): ParsedTable | {
196
+ error: string;
197
+ };
198
+ declare function generateHtmlTable(data: ParsedTable, options?: TableOptions): string;
199
+ declare function generateMarkdownTable(data: ParsedTable): string;
200
+ declare function csvToHtml(input: string, options?: TableOptions): string | {
201
+ error: string;
202
+ };
203
+ declare function csvToMarkdown(input: string, options?: TableOptions): string | {
204
+ error: string;
205
+ };
206
+ type AsciiFont = 'block' | 'banner' | 'small' | 'dots';
207
+ interface AsciiOptions {
208
+ font: AsciiFont;
209
+ width?: number;
210
+ align?: 'left' | 'center' | 'right';
211
+ }
212
+ declare function textToAscii(text: string, options?: AsciiOptions): string;
213
+ declare function getAvailableFonts(): Array<{
214
+ value: AsciiFont;
215
+ label: string;
216
+ preview: string;
217
+ }>;
218
+ declare function addBorder(text: string, style: 'box' | 'double' | 'rounded' | 'stars'): string;
219
+ declare function centerText(text: string, width: number): string;
220
+ interface MorseOptions {
221
+ separator?: string;
222
+ wordSeparator?: string;
223
+ dotChar?: string;
224
+ dashChar?: string;
225
+ }
226
+ declare const MORSE_CODE: Record<string, string>;
227
+ declare function textToMorse(text: string, options?: MorseOptions): string;
228
+ declare function morseToText(morse: string, options?: MorseOptions): string | {
229
+ error: string;
230
+ };
231
+ declare function isValidMorse(morse: string): boolean;
232
+ declare function getMorseForChar(char: string): string | null;
233
+ declare function getMorseTiming(morse: string): Array<{
234
+ type: 'dot' | 'dash' | 'gap' | 'wordgap';
235
+ duration: number;
236
+ }>;
237
+
238
+ type text_AsciiFont = AsciiFont;
239
+ type text_AsciiOptions = AsciiOptions;
240
+ declare const text_CASE_FORMATS: typeof CASE_FORMATS;
241
+ type text_CaseFormat = CaseFormat;
242
+ type text_ConvertOptions = ConvertOptions;
243
+ declare const text_DEFAULT_CONVERT_OPTIONS: typeof DEFAULT_CONVERT_OPTIONS;
244
+ type text_DiffFile = DiffFile;
245
+ type text_DiffHunk = DiffHunk;
246
+ type text_DiffLine = DiffLine;
247
+ type text_DiffResult = DiffResult;
248
+ type text_DiffType = DiffType;
249
+ type text_DiffViewerLine = DiffViewerLine;
250
+ declare const text_ESCAPE_MODES: typeof ESCAPE_MODES;
251
+ type text_EscapeMode = EscapeMode;
252
+ declare const text_LINE_OPS: typeof LINE_OPS;
253
+ type text_LineOp = LineOp;
254
+ type text_LineType = LineType;
255
+ type text_LoremUnit = LoremUnit;
256
+ declare const text_MORSE_CODE: typeof MORSE_CODE;
257
+ type text_MarkdownResult = MarkdownResult;
258
+ type text_MorseOptions = MorseOptions;
259
+ type text_ParsedDiff = ParsedDiff;
260
+ type text_ParsedTable = ParsedTable;
261
+ type text_ReadabilityScore = ReadabilityScore;
262
+ type text_SlugSeparator = SlugSeparator;
263
+ type text_TableOptions = TableOptions;
264
+ type text_TextAnalysis = TextAnalysis;
265
+ type text_WordCountResult = WordCountResult;
266
+ declare const text_addBorder: typeof addBorder;
267
+ declare const text_analyzeText: typeof analyzeText;
268
+ declare const text_applyOp: typeof applyOp;
269
+ declare const text_applyOps: typeof applyOps;
270
+ declare const text_centerText: typeof centerText;
271
+ declare const text_convertAll: typeof convertAll;
272
+ declare const text_convertCase: typeof convertCase;
273
+ declare const text_countWords: typeof countWords;
274
+ declare const text_csvToHtml: typeof csvToHtml;
275
+ declare const text_csvToMarkdown: typeof csvToMarkdown;
276
+ declare const text_detectDelimiter: typeof detectDelimiter;
277
+ declare const text_diffLines: typeof diffLines;
278
+ declare const text_diffLinesSimple: typeof diffLinesSimple;
279
+ declare const text_diffStats: typeof diffStats;
280
+ declare const text_escapeAll: typeof escapeAll;
281
+ declare const text_escapeString: typeof escapeString;
282
+ declare const text_extractHeadings: typeof extractHeadings;
283
+ declare const text_formatReadingTime: typeof formatReadingTime;
284
+ declare const text_generate: typeof generate;
285
+ declare const text_generateDiff: typeof generateDiff;
286
+ declare const text_generateHtmlTable: typeof generateHtmlTable;
287
+ declare const text_generateMarkdownTable: typeof generateMarkdownTable;
288
+ declare const text_generateParagraphs: typeof generateParagraphs;
289
+ declare const text_generateSentences: typeof generateSentences;
290
+ declare const text_generateWords: typeof generateWords;
291
+ declare const text_getAvailableFonts: typeof getAvailableFonts;
292
+ declare const text_getMorseForChar: typeof getMorseForChar;
293
+ declare const text_getMorseTiming: typeof getMorseTiming;
294
+ declare const text_htmlToMarkdown: typeof htmlToMarkdown;
295
+ declare const text_isValidMorse: typeof isValidMorse;
296
+ declare const text_markdownToHtml: typeof markdownToHtml;
297
+ declare const text_morseToText: typeof morseToText;
298
+ declare const text_numberToOrdinal: typeof numberToOrdinal;
299
+ declare const text_numberToRoman: typeof numberToRoman;
300
+ declare const text_numberToWords: typeof numberToWords;
301
+ declare const text_ordinalWords: typeof ordinalWords;
302
+ declare const text_parseDiff: typeof parseDiff;
303
+ declare const text_parseTableData: typeof parseTableData;
304
+ declare const text_readabilityScore: typeof readabilityScore;
305
+ declare const text_renderMarkdown: typeof renderMarkdown;
306
+ declare const text_romanToNumber: typeof romanToNumber;
307
+ declare const text_sentenceCount: typeof sentenceCount;
308
+ declare const text_slugify: typeof slugify;
309
+ declare const text_slugifyAll: typeof slugifyAll;
310
+ declare const text_syllableCount: typeof syllableCount;
311
+ declare const text_textToAscii: typeof textToAscii;
312
+ declare const text_textToMorse: typeof textToMorse;
313
+ declare const text_unescapeString: typeof unescapeString;
314
+ declare const text_wordFrequency: typeof wordFrequency;
315
+ declare namespace text {
316
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
317
+ }
318
+
319
+ export { generateWords as $, type AsciiFont as A, csvToHtml as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, csvToMarkdown as F, detectDelimiter as G, diffLines as H, diffLinesSimple as I, diffStats as J, escapeAll as K, LINE_OPS as L, MORSE_CODE as M, escapeString as N, extractHeadings as O, type ParsedDiff as P, formatReadingTime as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, generate as U, generateDiff as V, type WordCountResult as W, generateHtmlTable as X, generateMarkdownTable as Y, generateParagraphs as Z, generateSentences as _, type AsciiOptions as a, getAvailableFonts as a0, getMorseForChar as a1, getMorseTiming as a2, htmlToMarkdown as a3, isValidMorse as a4, markdownToHtml as a5, morseToText as a6, numberToOrdinal as a7, numberToRoman as a8, numberToWords as a9, ordinalWords as aa, parseDiff as ab, parseTableData as ac, readabilityScore as ad, renderMarkdown as ae, romanToNumber as af, sentenceCount as ag, slugify as ah, slugifyAll as ai, syllableCount as aj, textToAscii as ak, textToMorse as al, unescapeString as am, wordFrequency as an, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type TextAnalysis as q, addBorder as r, analyzeText as s, text as t, applyOp as u, applyOps as v, centerText as w, convertAll as x, convertCase as y, countWords as z };