convertit 1.0.0 → 1.0.2
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.
- package/CHANGELOG.md +7 -0
- package/README.md +98 -82
- package/dist/converters/excel-styles.d.ts.map +1 -1
- package/dist/converters/excel.d.ts.map +1 -1
- package/dist/converters/image.d.ts.map +1 -1
- package/dist/converters/pdf.d.ts.map +1 -1
- package/dist/converters/text.d.ts +4 -4
- package/dist/converters/text.d.ts.map +1 -1
- package/dist/index.js +122 -123
- package/dist/transformers/index.d.ts +3 -3
- package/dist/transformers/index.d.ts.map +1 -1
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,12 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
10
|
#### Core Features
|
|
11
|
+
|
|
11
12
|
- **File Conversion**: Support for PDF, Word (DOCX), Excel (XLSX), CSV, HTML, JSON, XML, Markdown, and image formats
|
|
12
13
|
- **Builder Pattern**: Fluent API for chaining conversion operations
|
|
13
14
|
- **Batch Processing**: Convert multiple files with configurable concurrency
|
|
14
15
|
- **Progress Tracking**: Monitor conversion progress with callbacks
|
|
15
16
|
|
|
16
17
|
#### Excel Conditional Formatting (NEW)
|
|
18
|
+
|
|
17
19
|
- **Row Styles**: Color entire rows based on conditions
|
|
18
20
|
- Even/odd row styling (zebra stripes)
|
|
19
21
|
- Column value conditions (equal, greater than, less than, etc.)
|
|
@@ -34,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
36
|
- Icon sets
|
|
35
37
|
|
|
36
38
|
#### Template Engine (NEW)
|
|
39
|
+
|
|
37
40
|
- Simple yet powerful template processing
|
|
38
41
|
- Variable substitution with dot notation
|
|
39
42
|
- Conditionals (`#if`, `#unless`, `#else`)
|
|
@@ -48,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
48
51
|
- `json`, `join`, `length`, `default`
|
|
49
52
|
|
|
50
53
|
#### Transformers
|
|
54
|
+
|
|
51
55
|
- **Watermark**: Add text watermarks to PDFs
|
|
52
56
|
- **Encryption**: Password protect PDF files
|
|
53
57
|
- **Compression**: Reduce file sizes
|
|
@@ -58,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
58
62
|
- **Rotation**: Rotate PDF pages
|
|
59
63
|
|
|
60
64
|
#### Developer Experience
|
|
65
|
+
|
|
61
66
|
- **ESLint**: Code linting with TypeScript support
|
|
62
67
|
- **Husky**: Git hooks for pre-commit and pre-push
|
|
63
68
|
- **lint-staged**: Run linters on staged files
|
|
@@ -65,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
65
70
|
- **TypeScript**: Full type definitions for all APIs
|
|
66
71
|
|
|
67
72
|
#### Utilities
|
|
73
|
+
|
|
68
74
|
- File format detection and validation
|
|
69
75
|
- MIME type utilities
|
|
70
76
|
- Color parsing and conversion
|
|
@@ -73,6 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
73
79
|
- Async utilities (delay, retry, timeout)
|
|
74
80
|
|
|
75
81
|
### Technical Details
|
|
82
|
+
|
|
76
83
|
- Built with Bun for fast development
|
|
77
84
|
- ESM and CJS dual module support
|
|
78
85
|
- Comprehensive test coverage
|
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# convertit
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/convertit"><img src="https://img.shields.io/npm/v/convertit.svg" alt="npm version"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/convertit"><img src="https://img.shields.io/npm/dm/convertit.svg" alt="npm downloads"></a>
|
|
6
|
+
<a href="https://github.com/suraj-9849/convertit"><img src="https://img.shields.io/github/stars/suraj-9849/convertit.svg?style=social" alt="GitHub stars"></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
3
9
|
<p align="center">
|
|
4
10
|
<strong>A powerful, type-safe file conversion library for Node.js and Bun</strong>
|
|
5
11
|
</p>
|
|
@@ -71,7 +77,8 @@ const base64 = await convertit.from(data).toPdf().toBase64();
|
|
|
71
77
|
import convertit from 'convertit';
|
|
72
78
|
|
|
73
79
|
// Convert JSON to PDF with options
|
|
74
|
-
const buffer = await convertit
|
|
80
|
+
const buffer = await convertit
|
|
81
|
+
.from(jsonData)
|
|
75
82
|
.toPdf({ pageSize: 'A4', orientation: 'landscape' })
|
|
76
83
|
.withWatermark({ text: 'DRAFT', opacity: 0.3 })
|
|
77
84
|
.withCompression({ level: 'medium' })
|
|
@@ -94,7 +101,8 @@ const salesData = [
|
|
|
94
101
|
];
|
|
95
102
|
|
|
96
103
|
// Create Excel with conditional row colors
|
|
97
|
-
const excel = await convertit
|
|
104
|
+
const excel = await convertit
|
|
105
|
+
.from(salesData)
|
|
98
106
|
.toExcel({
|
|
99
107
|
sheetName: 'Sales Report',
|
|
100
108
|
rowStyles: [
|
|
@@ -130,7 +138,7 @@ const excel = await convertit.from(salesData)
|
|
|
130
138
|
{
|
|
131
139
|
condition: {
|
|
132
140
|
type: 'expression',
|
|
133
|
-
expression:
|
|
141
|
+
expression: row => row.status === 'Deficit',
|
|
134
142
|
},
|
|
135
143
|
style: StylePresets.negativeHighlight,
|
|
136
144
|
},
|
|
@@ -141,46 +149,49 @@ const excel = await convertit.from(salesData)
|
|
|
141
149
|
|
|
142
150
|
### Row Style Conditions
|
|
143
151
|
|
|
144
|
-
| Condition Type | Description
|
|
145
|
-
|
|
146
|
-
| `even`
|
|
147
|
-
| `odd`
|
|
148
|
-
| `columnValue`
|
|
149
|
-
| `expression`
|
|
152
|
+
| Condition Type | Description | Example |
|
|
153
|
+
| -------------- | ------------------------ | ------------------------------------------------------------------------ |
|
|
154
|
+
| `even` | Style even-numbered rows | `{ type: 'even' }` |
|
|
155
|
+
| `odd` | Style odd-numbered rows | `{ type: 'odd' }` |
|
|
156
|
+
| `columnValue` | Based on column value | `{ type: 'columnValue', column: 'amount', operator: 'equal', value: 0 }` |
|
|
157
|
+
| `expression` | Custom JavaScript logic | `{ type: 'expression', expression: (row) => row.amount < 0 }` |
|
|
150
158
|
|
|
151
159
|
### Cell Styles
|
|
152
160
|
|
|
153
161
|
Style specific cells, columns, or ranges:
|
|
154
162
|
|
|
155
163
|
```typescript
|
|
156
|
-
await convertit
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
await convertit
|
|
165
|
+
.from(data)
|
|
166
|
+
.toExcel({
|
|
167
|
+
cellStyles: [
|
|
168
|
+
// Style entire column
|
|
169
|
+
{
|
|
170
|
+
target: 'D', // Column D (amount)
|
|
171
|
+
style: {
|
|
172
|
+
numFmt: '$#,##0.00',
|
|
173
|
+
alignment: { horizontal: 'right' },
|
|
174
|
+
},
|
|
164
175
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
// Style header row
|
|
177
|
+
{
|
|
178
|
+
target: 'A1:F1',
|
|
179
|
+
style: {
|
|
180
|
+
font: { bold: true, color: '#FFFFFF' },
|
|
181
|
+
fill: { color: '#1976D2' },
|
|
182
|
+
},
|
|
172
183
|
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
// Style specific cell
|
|
185
|
+
{
|
|
186
|
+
target: 'A10',
|
|
187
|
+
style: {
|
|
188
|
+
font: { bold: true, size: 14 },
|
|
189
|
+
border: { bottom: { style: 'thick' } },
|
|
190
|
+
},
|
|
180
191
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
],
|
|
193
|
+
})
|
|
194
|
+
.toFile('styled-cells.xlsx');
|
|
184
195
|
```
|
|
185
196
|
|
|
186
197
|
### Style Presets
|
|
@@ -191,13 +202,13 @@ Use built-in presets for common styling scenarios:
|
|
|
191
202
|
import { StylePresets } from 'convertit';
|
|
192
203
|
|
|
193
204
|
// Available presets:
|
|
194
|
-
StylePresets.positiveHighlight
|
|
195
|
-
StylePresets.negativeHighlight
|
|
196
|
-
StylePresets.warningHighlight
|
|
197
|
-
StylePresets.headerStyle
|
|
198
|
-
StylePresets.totalRow
|
|
199
|
-
StylePresets.currencyFormat
|
|
200
|
-
StylePresets.percentFormat
|
|
205
|
+
StylePresets.positiveHighlight; // Green background
|
|
206
|
+
StylePresets.negativeHighlight; // Red background
|
|
207
|
+
StylePresets.warningHighlight; // Yellow/amber background
|
|
208
|
+
StylePresets.headerStyle; // Bold white text on blue
|
|
209
|
+
StylePresets.totalRow; // Bold with top border
|
|
210
|
+
StylePresets.currencyFormat; // Currency number format
|
|
211
|
+
StylePresets.percentFormat; // Percentage format
|
|
201
212
|
```
|
|
202
213
|
|
|
203
214
|
### Native Excel Conditional Formatting
|
|
@@ -205,33 +216,37 @@ StylePresets.percentFormat // Percentage format
|
|
|
205
216
|
Apply Excel's built-in conditional formatting rules:
|
|
206
217
|
|
|
207
218
|
```typescript
|
|
208
|
-
await convertit
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
219
|
+
await convertit
|
|
220
|
+
.from(data)
|
|
221
|
+
.toExcel({
|
|
222
|
+
conditionalFormatting: [
|
|
223
|
+
// Data bars
|
|
224
|
+
{
|
|
225
|
+
type: 'dataBar',
|
|
226
|
+
ref: 'D2:D100',
|
|
227
|
+
rules: { color: '4CAF50' },
|
|
228
|
+
},
|
|
229
|
+
// Color scale (heat map)
|
|
230
|
+
{
|
|
231
|
+
type: 'colorScale',
|
|
232
|
+
ref: 'E2:E100',
|
|
233
|
+
rules: { color: 'F44336' },
|
|
234
|
+
},
|
|
235
|
+
// Icon sets
|
|
236
|
+
{
|
|
237
|
+
type: 'iconSet',
|
|
238
|
+
ref: 'F2:F100',
|
|
239
|
+
rules: { iconSet: '3TrafficLights' },
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
})
|
|
243
|
+
.toFile('conditional-formatting.xlsx');
|
|
230
244
|
```
|
|
231
245
|
|
|
232
246
|
## Supported Conversions
|
|
233
247
|
|
|
234
248
|
### Documents
|
|
249
|
+
|
|
235
250
|
- **PDF**: Create PDFs from text, JSON, arrays, or other data
|
|
236
251
|
- **Word (DOCX)**: Generate Word documents with formatting
|
|
237
252
|
- **HTML**: Convert to HTML with templates and styling
|
|
@@ -239,14 +254,17 @@ await convertit.from(data).toExcel({
|
|
|
239
254
|
- **Plain Text**: Extract or convert to plain text
|
|
240
255
|
|
|
241
256
|
### Spreadsheets
|
|
257
|
+
|
|
242
258
|
- **Excel (XLSX)**: Create spreadsheets with multiple sheets, formulas, conditional formatting, and styling
|
|
243
259
|
- **CSV**: Generate CSV with custom delimiters
|
|
244
260
|
|
|
245
261
|
### Data Formats
|
|
262
|
+
|
|
246
263
|
- **JSON**: Convert to/from JSON
|
|
247
264
|
- **XML**: Generate XML from data
|
|
248
265
|
|
|
249
266
|
### Images
|
|
267
|
+
|
|
250
268
|
- **PNG, JPG, JPEG, WebP, GIF, BMP, TIFF**: Convert between image formats
|
|
251
269
|
- **Resize, crop, rotate, and apply filters**
|
|
252
270
|
|
|
@@ -305,23 +323,23 @@ toFile(path: string): Promise<string>
|
|
|
305
323
|
|
|
306
324
|
```typescript
|
|
307
325
|
const data = [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
326
|
+
{ name: 'Suraj', email: 'surajlohit42@example.com', salary: 85000 },
|
|
327
|
+
{ name: 'Sathya', email: 'sathya@example.com', salary: 95000 },
|
|
328
|
+
{ name: 'Karthik', email: 'karthik@example.com', salary: 79000 },
|
|
329
|
+
{ name: 'Charan', email: 'charan@example.com', salary: 91000 },
|
|
330
|
+
{ name: 'Sid', email: 'sid@example.com', salary: 75000 },
|
|
331
|
+
{ name: 'pruthvi', email: 'pruthvi@example.com', salary: 95000 },
|
|
332
|
+
{ name: 'Ayushman', email: 'ayushman@example.com', salary: 95000 },
|
|
314
333
|
];
|
|
315
334
|
|
|
316
|
-
const buffer = await convertit
|
|
335
|
+
const buffer = await convertit
|
|
336
|
+
.from(data)
|
|
317
337
|
.toExcel({
|
|
318
338
|
sheetName: 'Employees',
|
|
319
339
|
autoFilter: true,
|
|
320
340
|
freezePane: { row: 1 },
|
|
321
341
|
autoWidth: true,
|
|
322
|
-
rowStyles: [
|
|
323
|
-
{ condition: { type: 'even' }, style: { fill: { color: '#F5F5F5' } } },
|
|
324
|
-
],
|
|
342
|
+
rowStyles: [{ condition: { type: 'even' }, style: { fill: { color: '#F5F5F5' } } }],
|
|
325
343
|
cellStyles: [
|
|
326
344
|
{
|
|
327
345
|
target: 'C', // Salary column
|
|
@@ -335,7 +353,8 @@ const buffer = await convertit.from(data)
|
|
|
335
353
|
### Create PDF with Headers and Footers
|
|
336
354
|
|
|
337
355
|
```typescript
|
|
338
|
-
const buffer = await convertit
|
|
356
|
+
const buffer = await convertit
|
|
357
|
+
.from(content)
|
|
339
358
|
.toPdf({
|
|
340
359
|
pageSize: 'A4',
|
|
341
360
|
margins: { top: 72, bottom: 72, left: 72, right: 72 },
|
|
@@ -355,7 +374,8 @@ const buffer = await convertit.from(content)
|
|
|
355
374
|
### Add Watermark to PDF
|
|
356
375
|
|
|
357
376
|
```typescript
|
|
358
|
-
const watermarkedPdf = await convertit
|
|
377
|
+
const watermarkedPdf = await convertit
|
|
378
|
+
.from(pdfBuffer)
|
|
359
379
|
.toPdf()
|
|
360
380
|
.withWatermark({
|
|
361
381
|
text: 'CONFIDENTIAL',
|
|
@@ -384,12 +404,7 @@ console.log(`Converted ${result.successCount}/${result.totalFiles} files`);
|
|
|
384
404
|
For advanced use cases, use converters directly:
|
|
385
405
|
|
|
386
406
|
```typescript
|
|
387
|
-
import {
|
|
388
|
-
PDFManipulator,
|
|
389
|
-
ExcelUtils,
|
|
390
|
-
ExcelStyleEngine,
|
|
391
|
-
ImageUtils
|
|
392
|
-
} from 'convertit';
|
|
407
|
+
import { PDFManipulator, ExcelUtils, ExcelStyleEngine, ImageUtils } from 'convertit';
|
|
393
408
|
|
|
394
409
|
// PDF manipulation
|
|
395
410
|
const pageCount = await PDFManipulator.getPageCount(pdfBuffer);
|
|
@@ -495,9 +510,10 @@ bun run typecheck
|
|
|
495
510
|
## Contributing
|
|
496
511
|
|
|
497
512
|
Contributions are welcome! This project uses:
|
|
513
|
+
|
|
498
514
|
- ESLint for linting
|
|
499
515
|
- Husky for git hooks
|
|
500
516
|
- lint-staged for pre-commit checks
|
|
501
517
|
- GitHub Actions for CI/CD
|
|
502
518
|
|
|
503
|
-
Please ensure your PR passes all checks before submitting.
|
|
519
|
+
Please ensure your PR passes all checks before submitting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"excel-styles.d.ts","sourceRoot":"","sources":["../../src/converters/excel-styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EAEZ,SAAS,EACT,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAEvB,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,IAAI,CAAQ;gBAER,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE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AC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"excel.d.ts","sourceRoot":"","sources":["../../src/converters/excel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAIjG,qBAAa,cAAe,SAAQ,aAAa;;IAK/C,wBAAwB,IAAI,UAAU,EAAE;IAIlC,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;YAwBlE,eAAe;YAgCf,gBAAgB;YA2BhB,gBAAgB;YAmChB,WAAW;IAqGzB,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,eAAe;CAgBxB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;WACU,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IAkBjD;;OAEG;WACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAmBrE;;OAEG;WACU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAM3D;;OAEG;WACU,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B/E;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/converters/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EA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M,EACb,KAAK,GAAE,MAAY,EACnB,MAAM,GAAE,MAAY,GACnB,OAAO,CAAC,MAAM,CAAC;IAIlB;;OAEG;WACU,KAAK,CAChB,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,GAAE,YAAY,GAAG,UAAyB,GAClD,OAAO,CAAC,MAAM,CAAC;CAgEnB;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../src/converters/pdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,UAAU,EAGX,MAAM,eAAe,CAAC;AAIvB,qBAAa,YAAa,SAAQ,aAAa;;IAK7C,wBAAwB,IAAI,UAAU,EAAE;IAIlC,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IA6BhF,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../src/converters/pdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,UAAU,EAGX,MAAM,eAAe,CAAC;AAIvB,qBAAa,YAAa,SAAQ,aAAa;;IAK7C,wBAAwB,IAAI,UAAU,EAAE;IAIlC,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IA6BhF,OAAO,CAAC,WAAW;YAOL,cAAc;YAwFd,eAAe;YAoBf,gBAAgB;YAUhB,mBAAmB;YAkDnB,gBAAgB;IAU9B,OAAO,CAAC,SAAS;IAmDjB,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,SAAS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"}
|
|
@@ -6,19 +6,19 @@ import type { InputDataType, ConvertFileOptions, FileFormat } from '../core/type
|
|
|
6
6
|
export declare class TextConverter extends BaseConverter {
|
|
7
7
|
constructor();
|
|
8
8
|
getSupportedInputFormats(): FileFormat[];
|
|
9
|
-
convert(data: InputDataType,
|
|
9
|
+
convert(data: InputDataType, _options: ConvertFileOptions): Promise<Buffer>;
|
|
10
10
|
private arrayToText;
|
|
11
11
|
private objectToText;
|
|
12
12
|
}
|
|
13
13
|
export declare class JSONConverter extends BaseConverter {
|
|
14
14
|
constructor();
|
|
15
15
|
getSupportedInputFormats(): FileFormat[];
|
|
16
|
-
convert(data: InputDataType,
|
|
16
|
+
convert(data: InputDataType, _options: ConvertFileOptions): Promise<Buffer>;
|
|
17
17
|
}
|
|
18
18
|
export declare class XMLConverter extends BaseConverter {
|
|
19
19
|
constructor();
|
|
20
20
|
getSupportedInputFormats(): FileFormat[];
|
|
21
|
-
convert(data: InputDataType,
|
|
21
|
+
convert(data: InputDataType, _options: ConvertFileOptions): Promise<Buffer>;
|
|
22
22
|
private objectToXml;
|
|
23
23
|
private escapeXml;
|
|
24
24
|
private sanitizeTagName;
|
|
@@ -26,7 +26,7 @@ export declare class XMLConverter extends BaseConverter {
|
|
|
26
26
|
export declare class MarkdownConverter extends BaseConverter {
|
|
27
27
|
constructor();
|
|
28
28
|
getSupportedInputFormats(): FileFormat[];
|
|
29
|
-
convert(data: InputDataType,
|
|
29
|
+
convert(data: InputDataType, _options: ConvertFileOptions): Promise<Buffer>;
|
|
30
30
|
private convertToMarkdown;
|
|
31
31
|
private htmlToMarkdown;
|
|
32
32
|
private arrayToMarkdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/converters/text.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE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