@scanmate/merge 0.1.0 → 0.2.1
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/dist/src/document-merge/merge-documents.use-case.d.ts +2 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/source-reading/index.d.ts +1 -1
- package/dist/src/source-reading/merge-source.contract.d.ts +0 -9
- package/dist/src/source-reading/read-source.use-case.d.ts +2 -3
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScanmateSource } from '@scanmate/ink';
|
|
2
2
|
import type { MergeOptions, MergeResult } from './merge-result.contract.js';
|
|
3
3
|
/**
|
|
4
4
|
* Many files in, one PDF out: PDFs, images and rasters, in the order given,
|
|
@@ -14,5 +14,5 @@ import type { MergeOptions, MergeResult } from './merge-result.contract.js';
|
|
|
14
14
|
* becomes one document in upload order, and a pipeline's aligned or enhanced
|
|
15
15
|
* pages become one evidence file.
|
|
16
16
|
*/
|
|
17
|
-
export declare function mergeDocuments(sources: readonly
|
|
17
|
+
export declare function mergeDocuments(sources: readonly ScanmateSource[], options?: MergeOptions): Promise<MergeResult>;
|
|
18
18
|
//# sourceMappingURL=merge-documents.use-case.d.ts.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
export { mergeDocuments } from './document-merge/index.js';
|
|
23
23
|
export type { Embedding, MergedPage, MergeOptions, MergeResult } from './document-merge/index.js';
|
|
24
24
|
export { MergeSourceError } from './source-reading/index.js';
|
|
25
|
-
export type {
|
|
25
|
+
export type { SourceKind } from './source-reading/index.js';
|
|
26
26
|
export type { PageSize } from './page-placement/index.js';
|
|
27
27
|
export { MIN_RECORDED_DPI, PAPER, placeImage, resolveDpi } from './page-placement/index.js';
|
|
28
28
|
export type { Placement } from './page-placement/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Turning each thing handed to merge - a path, bytes, pixels - into a PDF, an image or a raster. */
|
|
2
2
|
export { MergeSourceError } from './merge-source.contract.js';
|
|
3
|
-
export type {
|
|
3
|
+
export type { SourceKind } from './merge-source.contract.js';
|
|
4
4
|
export { isPdf, readSource } from './read-source.use-case.js';
|
|
5
5
|
export type { ResolvedSource } from './read-source.use-case.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Raster } from '@scanmate/ink';
|
|
2
1
|
/**
|
|
3
2
|
* Anything that can become pages of the merged PDF.
|
|
4
3
|
*
|
|
@@ -10,14 +9,6 @@ import type { Raster } from '@scanmate/ink';
|
|
|
10
9
|
* is. When it also carries its encoded `image`, those bytes are embedded
|
|
11
10
|
* rather than encoding the raster again.
|
|
12
11
|
*/
|
|
13
|
-
export type MergeSource = string | URL | Uint8Array | ArrayBuffer | Raster | ImageWithResolution;
|
|
14
|
-
export interface ImageWithResolution {
|
|
15
|
-
raster: Raster;
|
|
16
|
-
/** Pixels per inch, which sets the page size; `null` or absent when unknown. */
|
|
17
|
-
dpi?: number | null;
|
|
18
|
-
/** The raster already encoded - PNG or JPEG bytes are embedded as they are. */
|
|
19
|
-
image?: Uint8Array | null;
|
|
20
|
-
}
|
|
21
12
|
/** What a source turned out to be. */
|
|
22
13
|
export type SourceKind = 'pdf' | 'image' | 'raster';
|
|
23
14
|
/** A source that could not be used, and which one it was. */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Raster } from '@scanmate/ink';
|
|
2
|
-
import type { MergeSource } from './merge-source.contract.js';
|
|
1
|
+
import type { Raster, ScanmateSource } from '@scanmate/ink';
|
|
3
2
|
/**
|
|
4
3
|
* A source resolved to what merging needs: its bytes and what they are, or its
|
|
5
4
|
* pixels. Content decides, never the file name - a scanner that saves a PDF as
|
|
@@ -18,6 +17,6 @@ export type ResolvedSource = {
|
|
|
18
17
|
dpi: number | null;
|
|
19
18
|
bytes: Uint8Array | null;
|
|
20
19
|
};
|
|
21
|
-
export declare function readSource(source:
|
|
20
|
+
export declare function readSource(source: ScanmateSource, index: number): Promise<ResolvedSource>;
|
|
22
21
|
export declare function isPdf(bytes: Uint8Array): boolean;
|
|
23
22
|
//# sourceMappingURL=read-source.use-case.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scanmate/merge",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Merge PDFs, images and rasters into one PDF: PDF pages copied as they are, JPEGs embedded without recompression, every page of a TIFF.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eduardo Russo",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@cantoo/pdf-lib": "^2.11.1",
|
|
44
|
-
"@scanmate/ink": "^0.1
|
|
44
|
+
"@scanmate/ink": "^0.2.1"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|