@vertesia/converters 0.76.0 → 0.78.0-dev-715074d
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/package.json +38 -33
- package/lib/esm/image.js +0 -57
- package/lib/esm/image.js.map +0 -1
- package/lib/esm/index.js +0 -5
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/mutool.js +0 -39
- package/lib/esm/mutool.js.map +0 -1
- package/lib/esm/pandoc.js +0 -40
- package/lib/esm/pandoc.js.map +0 -1
- package/lib/types/image.d.ts +0 -17
- package/lib/types/image.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -5
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/mutool.d.ts +0 -4
- package/lib/types/mutool.d.ts.map +0 -1
- package/lib/types/pandoc.d.ts +0 -7
- package/lib/types/pandoc.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"types": "./lib/types/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib",
|
|
9
|
-
"src"
|
|
10
|
-
],
|
|
11
|
-
"license": "Apache-2.0",
|
|
12
|
-
"exports": {
|
|
2
|
+
"name": "@vertesia/converters",
|
|
3
|
+
"version": "0.78.0-dev-715074d",
|
|
4
|
+
"description": "Image and content converters",
|
|
5
|
+
"type": "module",
|
|
13
6
|
"types": "./lib/types/index.d.ts",
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"build": "pnpm exec tsmod build --esm",
|
|
15
|
+
"clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"import": "./lib/esm/index.js",
|
|
20
|
+
"require": "./lib/cjs/index.js"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/tmp": "^0.2.6",
|
|
24
|
+
"ts-dual-module": "^0.6.3",
|
|
25
|
+
"typescript": "^5.0.2",
|
|
26
|
+
"vitest": "^3.0.9"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"sharp": "^0.33.5",
|
|
30
|
+
"tmp": "^0.2.4"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/vertesia/composableai.git",
|
|
35
|
+
"directory": "packages/converters"
|
|
36
|
+
},
|
|
37
|
+
"ts_dual_module": {
|
|
38
|
+
"outDir": "lib"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/lib/esm/image.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import sharp from "sharp";
|
|
2
|
-
export function createImageTransformer(input, opts) {
|
|
3
|
-
const isInputStream = !!input.pipe;
|
|
4
|
-
let sh = isInputStream ? input.pipe(sharp()) : sharp(input);
|
|
5
|
-
if (opts.max_hw) {
|
|
6
|
-
sh = sh.resize({
|
|
7
|
-
width: opts.max_hw,
|
|
8
|
-
height: opts.max_hw,
|
|
9
|
-
fit: sharp.fit.inside,
|
|
10
|
-
withoutEnlargement: true,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
if (opts.format) {
|
|
14
|
-
sh = sh.toFormat(opts.format);
|
|
15
|
-
}
|
|
16
|
-
return sh;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @param max_hw
|
|
20
|
-
* @param format
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export async function transformImage(input, output, opts) {
|
|
24
|
-
const sh = createImageTransformer(input, opts);
|
|
25
|
-
sh.pipe(output);
|
|
26
|
-
return new Promise((resolve, reject) => {
|
|
27
|
-
const handleError = (err) => {
|
|
28
|
-
console.error('Failed to transform', err);
|
|
29
|
-
try {
|
|
30
|
-
if (input.pipe && input.destroy) {
|
|
31
|
-
input.destroy();
|
|
32
|
-
}
|
|
33
|
-
if (output.destroy) {
|
|
34
|
-
output.destroy();
|
|
35
|
-
}
|
|
36
|
-
sh.destroy();
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
reject(err);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
output.on('error', handleError);
|
|
43
|
-
input.pipe && input.on && input.on('error', handleError);
|
|
44
|
-
output.on("finish", () => {
|
|
45
|
-
resolve(sh);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export function transformImageToBuffer(input, opts) {
|
|
50
|
-
const sh = createImageTransformer(input, opts);
|
|
51
|
-
return sh.toBuffer();
|
|
52
|
-
}
|
|
53
|
-
export async function transformImageToFile(input, output, opts) {
|
|
54
|
-
const sh = createImageTransformer(input, opts);
|
|
55
|
-
await sh.toFile(output);
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=image.js.map
|
package/lib/esm/image.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,UAAU,sBAAsB,CAAC,KAAqB,EAAE,IAAsB;IAChF,MAAM,aAAa,GAAG,CAAC,CAAE,KAA+B,CAAC,IAAI,CAAC;IAC9D,IAAI,EAAE,GAAG,aAAa,CAAC,CAAC,CAAE,KAA+B,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAY,CAAC,CAAC;IAC9F,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC;YACX,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM;YACrB,kBAAkB,EAAE,IAAI;SAC3B,CAAC,CAAC;IACP,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAqB,EAAE,MAA6B,EAAE,IAAsB;IAC7G,MAAM,EAAE,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;YAC1C,IAAI,CAAC;gBACD,IAAK,KAAa,CAAC,IAAI,IAAK,KAAa,CAAC,OAAO,EAAE,CAAC;oBAC/C,KAAa,CAAC,OAAO,EAAE,CAAC;gBAC7B,CAAC;gBACD,IAAK,MAAc,CAAC,OAAO,EAAE,CAAC;oBACzB,MAAc,CAAC,OAAO,EAAE,CAAC;gBAC9B,CAAC;gBACD,EAAE,CAAC,OAAO,EAAE,CAAC;YACjB,CAAC;oBAAS,CAAC;gBACP,MAAM,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC;QACL,CAAC,CAAA;QACD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC/B,KAAa,CAAC,IAAI,IAAK,KAAa,CAAC,EAAE,IAAK,KAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACpF,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrB,OAAO,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAqB,EAAE,IAAsB;IAChF,MAAM,EAAE,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAAqB,EAAE,MAAc,EAAE,IAAsB;IACpG,MAAM,EAAE,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
package/lib/esm/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { transformImage, transformImageToBuffer, transformImageToFile } from './image.js';
|
|
2
|
-
import { pdfFileToText, pdfToText, pdfToTextBuffer } from './mutool.js';
|
|
3
|
-
import { manyToMarkdown } from './pandoc.js';
|
|
4
|
-
export { manyToMarkdown, pdfFileToText, pdfToText, pdfToTextBuffer, transformImage, transformImageToBuffer, transformImageToFile };
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACH,cAAc,EACd,aAAa,EAAE,SAAS,EACxB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACvB,CAAC"}
|
package/lib/esm/mutool.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'child_process';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import { readFile } from "fs/promises";
|
|
4
|
-
import tmp from 'tmp';
|
|
5
|
-
tmp.setGracefulCleanup();
|
|
6
|
-
export function pdfFileToText(input, output) {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
const command = spawn("mutool", ["convert", "-o", output, input]);
|
|
9
|
-
command.on('exit', function (code) {
|
|
10
|
-
if (code) {
|
|
11
|
-
reject(new Error(`mutool exited with code ${code}`));
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
command.on('close', function (code) {
|
|
15
|
-
if (code) {
|
|
16
|
-
reject(new Error(`mutool exited with code ${code}`));
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return resolve(output);
|
|
20
|
-
}
|
|
21
|
-
;
|
|
22
|
-
});
|
|
23
|
-
command.on('error', (err) => {
|
|
24
|
-
reject(err);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
export function pdfToText(buffer) {
|
|
29
|
-
return pdfToTextBuffer(buffer).then((buffer) => buffer.toString('utf-8'));
|
|
30
|
-
}
|
|
31
|
-
export function pdfToTextBuffer(buffer) {
|
|
32
|
-
const inputFile = tmp.fileSync({ postfix: '.pdf' });
|
|
33
|
-
const targetFileName = tmp.tmpNameSync({ postfix: '.txt' });
|
|
34
|
-
fs.writeSync(inputFile.fd, buffer);
|
|
35
|
-
return pdfFileToText(inputFile.name, targetFileName).then(() => {
|
|
36
|
-
return readFile(targetFileName);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=mutool.js.map
|
package/lib/esm/mutool.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutool.js","sourceRoot":"","sources":["../../src/mutool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,GAAG,CAAC,kBAAkB,EAAE,CAAC;AAEzB,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAEnC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAElE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,IAAI;YAC7B,IAAI,IAAI,EAAE,CAAC;gBACP,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,CAAC;YACzD,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,IAAI;YAC9B,IAAI,IAAI,EAAE,CAAC;gBACP,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACJ,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC;YAAA,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AAEP,CAAC;AACD,MAAM,UAAU,SAAS,CAAC,MAAc;IACpC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9E,CAAC;AACD,MAAM,UAAU,eAAe,CAAC,MAAc;IAC1C,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,GAAG,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAE5D,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAEnC,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAC3D,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/lib/esm/pandoc.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'child_process';
|
|
2
|
-
import { PassThrough } from 'stream';
|
|
3
|
-
export function manyToMarkdownFromBuffer(buffer, fromFormat) {
|
|
4
|
-
const input = new PassThrough();
|
|
5
|
-
input.end(buffer);
|
|
6
|
-
return manyToMarkdown(input, fromFormat);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Requires pandoc to be installed on the system.
|
|
10
|
-
* @param fromFormat is the format of the input buffer.
|
|
11
|
-
*/
|
|
12
|
-
export function manyToMarkdown(input, fromFormat) {
|
|
13
|
-
return new Promise((resolve, reject) => {
|
|
14
|
-
let result = [];
|
|
15
|
-
const command = spawn("pandoc", ["-t", "markdown", '-f', fromFormat], {
|
|
16
|
-
stdio: 'pipe',
|
|
17
|
-
});
|
|
18
|
-
input.pipe(command.stdin);
|
|
19
|
-
command.stdout.on('data', function (data) {
|
|
20
|
-
result.push(data.toString());
|
|
21
|
-
});
|
|
22
|
-
command.on('exit', function (code) {
|
|
23
|
-
if (code) {
|
|
24
|
-
reject(new Error(`pandoc exited with code ${code}`));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
command.on('close', function (code) {
|
|
28
|
-
if (code) {
|
|
29
|
-
reject(new Error(`pandoc exited with code ${code}`));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
resolve(result.join(''));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
command.on('error', (err) => {
|
|
36
|
-
reject(err);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=pandoc.js.map
|
package/lib/esm/pandoc.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pandoc.js","sourceRoot":"","sources":["../../src/pandoc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,UAAU,wBAAwB,CAAC,MAAc,EAAE,UAAkB;IACzE,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;IAChC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,OAAO,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAE3C,CAAC;AACD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAA4B,EAAE,UAAkB;IAE7E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,MAAM,GAAa,EAAE,CAAC;QAE1B,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE;YACpE,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE1B,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,IAAY;YAC9C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,IAAI;YAC/B,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,CAAC;YACvD,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,IAAI;YAChC,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAC1B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IAEL,CAAC,CAAC,CAAC;AAEL,CAAC"}
|
package/lib/types/image.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import sharp from "sharp";
|
|
2
|
-
export interface TransformOptions {
|
|
3
|
-
max_hw?: number;
|
|
4
|
-
format?: keyof sharp.FormatEnum;
|
|
5
|
-
}
|
|
6
|
-
type SharpInputType = Buffer | ArrayBuffer | Uint8Array | Uint8ClampedArray | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | string | NodeJS.ReadableStream;
|
|
7
|
-
export declare function createImageTransformer(input: SharpInputType, opts: TransformOptions): sharp.Sharp;
|
|
8
|
-
/**
|
|
9
|
-
* @param max_hw
|
|
10
|
-
* @param format
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare function transformImage(input: SharpInputType, output: NodeJS.WritableStream, opts: TransformOptions): Promise<sharp.Sharp>;
|
|
14
|
-
export declare function transformImageToBuffer(input: SharpInputType, opts: TransformOptions): Promise<Buffer>;
|
|
15
|
-
export declare function transformImageToFile(input: SharpInputType, output: string, opts: TransformOptions): Promise<void>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=image.d.ts.map
|
package/lib/types/image.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,UAAU,CAAA;CAClC;AAED,KAAK,cAAc,GAAG,MAAM,GACtB,WAAW,GACX,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,WAAW,GACX,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,MAAM,CAAC,cAAc,CAAA;AAC3B,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,eAenF;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAyBvI;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGrG;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
|
package/lib/types/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { transformImage, transformImageToBuffer, transformImageToFile } from './image.js';
|
|
2
|
-
import { pdfFileToText, pdfToText, pdfToTextBuffer } from './mutool.js';
|
|
3
|
-
import { manyToMarkdown } from './pandoc.js';
|
|
4
|
-
export { manyToMarkdown, pdfFileToText, pdfToText, pdfToTextBuffer, transformImage, transformImageToBuffer, transformImageToFile };
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACH,cAAc,EACd,aAAa,EAAE,SAAS,EACxB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACvB,CAAC"}
|
package/lib/types/mutool.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutool.d.ts","sourceRoot":"","sources":["../../src/mutool.ts"],"names":[],"mappings":"AAMA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAyB1D;AACD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;AACD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/D"}
|
package/lib/types/pandoc.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function manyToMarkdownFromBuffer(buffer: Buffer, fromFormat: string): Promise<string>;
|
|
2
|
-
/**
|
|
3
|
-
* Requires pandoc to be installed on the system.
|
|
4
|
-
* @param fromFormat is the format of the input buffer.
|
|
5
|
-
*/
|
|
6
|
-
export declare function manyToMarkdown(input: NodeJS.ReadableStream, fromFormat: string): Promise<string>;
|
|
7
|
-
//# sourceMappingURL=pandoc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pandoc.d.ts","sourceRoot":"","sources":["../../src/pandoc.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK5F;AACD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgChG"}
|