scanbot-web-sdk 7.0.0-dev.5 → 7.0.0-dev.7
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/@types/core/bridge/compiled/TiffTypes.d.ts +6 -6
- package/@types/core/worker/ScanbotSDK.Core.d.ts +2 -2
- package/@types/cropping-view.d.ts +1 -0
- package/@types/index.d.ts +1 -0
- package/@types/scanbot-sdk.d.ts +3 -3
- package/@types/service/storage/indexed-db/sb-indexed-db.d.ts +1 -0
- package/@types/service/storage/sb-storage.d.ts +16 -1
- package/@types/service/storage/utils/sb-storage-utils.d.ts +4 -3
- package/@types/ui2/configuration/document/DocumentScannerOutputSettings.d.ts +3 -3
- package/@types/ui2/configuration/native/PageData.d.ts +0 -5
- package/@types/ui2/document/model/sb-document.d.ts +5 -2
- package/@types/ui2/document/model/sb-page.d.ts +8 -3
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -0
- package/bundle/ScanbotSDK.min.js +4 -4
- package/bundle/ScanbotSDK.ui2.min.js +16 -16
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ Binarization behavior to apply when adding pages to a TIFF.
|
|
|
56
56
|
- `ENABLED`:
|
|
57
57
|
Binarize the image. Image will be stored as a 1-bit TIFF. If the input image is not black-and-white, a simple thresholding is applied.
|
|
58
58
|
- `ENABLED_IF_BINARIZATION_FILTER_SET`:
|
|
59
|
-
Same behavior as ENABLED if a binarization filter (
|
|
59
|
+
Same behavior as ENABLED if a binarization filter (TIFFGeneratorParameters.binarizationFilter) is set,
|
|
60
60
|
otherwise same behavior as DISABLED. This is the default.
|
|
61
61
|
*/
|
|
62
62
|
export type Binarization = "DISABLED" | "ENABLED" | "ENABLED_IF_BINARIZATION_FILTER_SET";
|
|
@@ -128,9 +128,9 @@ export declare class UserField extends PartiallyConstructible {
|
|
|
128
128
|
constructor(source?: DeepPartial<UserField>);
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
TIFF
|
|
131
|
+
TIFF generator parameters.
|
|
132
132
|
*/
|
|
133
|
-
export declare class
|
|
133
|
+
export declare class TiffGeneratorParameters extends PartiallyConstructible {
|
|
134
134
|
/**
|
|
135
135
|
Compression.
|
|
136
136
|
@defaultValue "LZW";
|
|
@@ -165,10 +165,10 @@ export declare class TiffWriterParameters extends PartiallyConstructible {
|
|
|
165
165
|
@defaultValue null;
|
|
166
166
|
*/
|
|
167
167
|
binarizationFilter: ParametricFilter | null;
|
|
168
|
-
/** @param source {@displayType `DeepPartial<
|
|
169
|
-
constructor(source?: DeepPartial<
|
|
168
|
+
/** @param source {@displayType `DeepPartial<TiffGeneratorParameters>`} */
|
|
169
|
+
constructor(source?: DeepPartial<TiffGeneratorParameters>);
|
|
170
170
|
}
|
|
171
|
-
export declare namespace
|
|
171
|
+
export declare namespace TiffGeneratorParameters {
|
|
172
172
|
/**
|
|
173
173
|
Default compression.
|
|
174
174
|
@defaultValue "LZW";
|
|
@@ -10,7 +10,7 @@ import type { Page } from "../bridge/compiled/OcrTypes";
|
|
|
10
10
|
import { type BarcodeDocumentFormat } from "../bridge/compiled/BarcodeDocumentTypes";
|
|
11
11
|
import { BarcodeScannerConfiguration, type BarcodeScannerResult } from "../bridge/compiled/BarcodeScannerTypes";
|
|
12
12
|
import { DocumentDataExtractorConfiguration, DocumentDataFrameExtractionParameters as GdrRecognitionParameters, type DocumentDataExtractionResult as GdrRecognitionResult } from "../bridge/compiled/DocumentDataExtractorTypes";
|
|
13
|
-
import { type Binarization,
|
|
13
|
+
import { type Binarization, TiffGeneratorParameters } from "../bridge/compiled/TiffTypes";
|
|
14
14
|
import type { RawImage, Point, DeepPartial } from "../bridge/common";
|
|
15
15
|
import type { GenericDocument } from "../bridge/compiled/GenericDocument";
|
|
16
16
|
/** Represents an object of type T residing in the WASM's memory. */
|
|
@@ -52,7 +52,7 @@ export declare const commands: {
|
|
|
52
52
|
beginPdf: (options: DeepPartial<PdfConfiguration>) => Promise<ObjectId<"PdfGenerationContext">>;
|
|
53
53
|
addPageToPdf: (pdfOperation: ObjectId<"PdfGenerationContext">, image: Image) => Promise<void>;
|
|
54
54
|
completePdf: (pdfOperation: ObjectId<"PdfGenerationContext">) => Promise<Uint8Array>;
|
|
55
|
-
beginTiff: (options: DeepPartial<
|
|
55
|
+
beginTiff: (options: DeepPartial<TiffGeneratorParameters>) => Promise<ObjectId<"TiffGenerationContext">>;
|
|
56
56
|
addPageToTiff: (tiffOperation: ObjectId<"TiffGenerationContext">, image: Image, binarization: Binarization) => Promise<unknown>;
|
|
57
57
|
completeTiff: (tiffOperation: ObjectId<"TiffGenerationContext">) => Promise<Uint8Array>;
|
|
58
58
|
createMRZScanner: (configuration: DeepPartial<MrzScannerConfiguration>) => Promise<ObjectId<"MRZScannerContext">>;
|
package/@types/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export { DocumentScannerUIResult } from "./ui2/configuration/document/DocumentSc
|
|
|
57
57
|
|
|
58
58
|
/** Storage-related exports */
|
|
59
59
|
export { SBStorage, SBStoreCroppedDetectionResult } from "./service/storage/sb-storage";
|
|
60
|
+
export { SBStorageUtils, } from "./service/storage/utils/sb-storage-utils";
|
|
60
61
|
export { SBStoreImage, SBStorePageImage, SBStoreImageType, SBStorageQuery } from "./service/storage/indexed-db/sb-indexed-db";
|
|
61
62
|
export { SBDocument } from "./ui2/document/model/sb-document";
|
|
62
63
|
export { SBPage, SBPageEditParams, SBPageCropData } from "./ui2/document/model/sb-page";
|
package/@types/scanbot-sdk.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { VinScannerViewConfiguration } from "./model/configuration/vin-scanner-v
|
|
|
20
20
|
import { ITextPatternScannerHandle } from "./interfaces/i-text-pattern-scanner-handle";
|
|
21
21
|
import DocumentQualityAnalyzer from "./service/document-quality-analyzer";
|
|
22
22
|
import ScanbotSDKUI from "./ui2/scanbot-sdk-ui";
|
|
23
|
-
import { Image, DeepPartial, RawImage, ObjectId, Point, DocumentScannerParameters, DocumentDetectionResult, CroppedDetectionResult, BarcodeScannerConfiguration, BarcodeDocumentFormat, DocumentQualityAnalyzerConfiguration, ImageRotation, ParametricFilter, PdfConfiguration,
|
|
23
|
+
import { Image, DeepPartial, RawImage, ObjectId, Point, DocumentScannerParameters, DocumentDetectionResult, CroppedDetectionResult, BarcodeScannerConfiguration, BarcodeDocumentFormat, DocumentQualityAnalyzerConfiguration, ImageRotation, ParametricFilter, PdfConfiguration, TiffGeneratorParameters, DocumentDataExtractorConfiguration } from "./core-types";
|
|
24
24
|
import * as Config from "./core-types";
|
|
25
25
|
import { DocumentDataExtractor } from "./service/document-data-extractor";
|
|
26
26
|
import { DocumentDataExtractorViewConfiguration } from "./model/configuration/document-data-extractor-view-configuration";
|
|
@@ -79,8 +79,8 @@ export default class ScanbotSDK {
|
|
|
79
79
|
getLicenseInfo(): Promise<LicenseInfo>;
|
|
80
80
|
/** @param options {@displayType `DeepPartial<PdfConfiguration>`} {@link PdfConfiguration}*/
|
|
81
81
|
beginPdf(options: DeepPartial<PdfConfiguration>): Promise<PdfGenerator>;
|
|
82
|
-
/** @param options {@displayType `DeepPartial<
|
|
83
|
-
beginTiff(options?: DeepPartial<
|
|
82
|
+
/** @param options {@displayType `DeepPartial<TiffGeneratorParameters>`} {@link TiffGeneratorParameters} */
|
|
83
|
+
beginTiff(options?: DeepPartial<TiffGeneratorParameters>): Promise<TiffGenerator>;
|
|
84
84
|
/** @param options {@displayType `DeepPartial<DocumentDataExtractorConfiguration>`} {@link DocumentDataExtractorConfiguration}*/
|
|
85
85
|
createDocumentDataExtractor(options: DeepPartial<DocumentDataExtractorConfiguration>): Promise<DocumentDataExtractor>;
|
|
86
86
|
imageToJpeg(image: Image, consumeImage?: ConsumeType): Promise<Uint8Array>;
|
|
@@ -4,12 +4,21 @@ import { SBDocument } from "../../ui2/document/model/sb-document";
|
|
|
4
4
|
import { SBPage } from "../../ui2/document/model/sb-page";
|
|
5
5
|
import { SBPageData } from "../../ui2/document/model/utils/sb-page-data";
|
|
6
6
|
import { SBDocumentData } from "../../ui2/document/model/utils/sb-document-data";
|
|
7
|
+
import { SBStorageUtils } from "./utils/sb-storage-utils";
|
|
7
8
|
export interface SBStoreCroppedDetectionResult extends CroppedDetectionResult {
|
|
8
9
|
id: number;
|
|
9
10
|
}
|
|
10
11
|
export declare class SBStorage {
|
|
12
|
+
readonly utils: SBStorageUtils;
|
|
11
13
|
private db;
|
|
14
|
+
/**
|
|
15
|
+
* Clears all data from storage. Retains the database itself, including indexing.
|
|
16
|
+
*/
|
|
12
17
|
clear(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* Clears all data from storage. Does not retain the database, clearing indexes.
|
|
21
|
+
* */
|
|
13
22
|
delete(): Promise<void>;
|
|
14
23
|
getCroppedDetectionResults(withImages?: boolean): Promise<SBStoreCroppedDetectionResult[]>;
|
|
15
24
|
getCroppedDetectionResult(id: number): Promise<SBStoreCroppedDetectionResult>;
|
|
@@ -23,11 +32,17 @@ export declare class SBStorage {
|
|
|
23
32
|
*/
|
|
24
33
|
storeCroppedDetectionResult(input: CroppedDetectionResult): Promise<number>;
|
|
25
34
|
getSBDocumentIds(): Promise<number[]>;
|
|
35
|
+
getSBDocumentData(id: number): Promise<SBDocumentData>;
|
|
36
|
+
/** @internal */
|
|
26
37
|
insertSBDocument(input: SBDocument): Promise<number>;
|
|
38
|
+
/** @internal */
|
|
27
39
|
deleteSBDocument(document: SBDocument | number): Promise<boolean>;
|
|
28
|
-
|
|
40
|
+
/** @internal */
|
|
29
41
|
insertSBPageImage(input: Image): Promise<number>;
|
|
30
42
|
getSBPageImage(id: number): Promise<Image>;
|
|
43
|
+
/** @internal */
|
|
31
44
|
deleteImageById(id: number): Promise<boolean>;
|
|
45
|
+
/** @internal */
|
|
32
46
|
deleteImages(page: SBPageData | SBPage): Promise<void>;
|
|
47
|
+
destroy(): void;
|
|
33
48
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare class SBStorageUtils {
|
|
2
2
|
/**
|
|
3
3
|
* The persist() method of the SBStorage interface requests permission to use persistent storage,
|
|
4
4
|
* and returns a Promise that resolves to true if permission is granted and bucket mode is persistent, and false otherwise.
|
|
5
5
|
* The browser may or may not honor the request, depending on browser-specific rules.
|
|
6
6
|
* For more details, see https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#does_browser-stored_data_persist
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
persist(): Promise<boolean>;
|
|
9
|
+
/** ©internal */
|
|
10
|
+
estimate(): Promise<boolean>;
|
|
10
11
|
}
|
|
@@ -29,9 +29,9 @@ export declare class DocumentScannerOutputSettings extends PartiallyConstructibl
|
|
|
29
29
|
*/
|
|
30
30
|
documentAnalysisMode: DocumentAnalysisMode;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
Determines the image filter to apply by default.
|
|
33
|
+
@defaultValue null;
|
|
34
|
+
*/
|
|
35
35
|
defaultFilter: ParametricFilter | null;
|
|
36
36
|
/** @param source {@displayType `DeepPartial<DocumentScannerOutputSettings>`} */
|
|
37
37
|
constructor(source?: DeepPartial<DocumentScannerOutputSettings>);
|
|
@@ -48,11 +48,6 @@ export declare class PageData extends PartiallyConstructible {
|
|
|
48
48
|
@defaultValue null;
|
|
49
49
|
*/
|
|
50
50
|
readonly documentImageId: number | null;
|
|
51
|
-
/**
|
|
52
|
-
The unique identifier of the unfiltered document image.
|
|
53
|
-
@defaultValue null;
|
|
54
|
-
*/
|
|
55
|
-
readonly unfilteredDocumentImageId: number | null;
|
|
56
51
|
/** @param source {@displayType `DeepPartial<PageData>`} */
|
|
57
52
|
constructor(source?: DeepPartial<PageData>);
|
|
58
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Point } from "../../configuration/utils";
|
|
2
2
|
import ScanbotSDK from "../../../scanbot-sdk";
|
|
3
|
-
import { CroppedDetectionResult, DeepPartial, PdfConfiguration,
|
|
3
|
+
import { CroppedDetectionResult, DeepPartial, PdfConfiguration, TiffGeneratorParameters } from "../../../core-types";
|
|
4
4
|
import { SBPage } from "./sb-page";
|
|
5
5
|
import { PageImageSource } from "../../configuration/native/PageImageSource";
|
|
6
6
|
import { DocumentQuality } from "../../configuration/DocumentQualityAnalyzerTypes";
|
|
@@ -34,6 +34,7 @@ export declare class SBDocument {
|
|
|
34
34
|
sdk(): ScanbotSDK;
|
|
35
35
|
get pageCount(): number;
|
|
36
36
|
pageAtIndex(position: number): SBPage;
|
|
37
|
+
movePage(from: number, to: number): Promise<void>;
|
|
37
38
|
static loadFromStorage(documentId: number): Promise<SBDocument>;
|
|
38
39
|
/** @internal */
|
|
39
40
|
static create(config: SBDocumentConfig): Promise<SBDocument>;
|
|
@@ -53,10 +54,12 @@ export declare class SBDocument {
|
|
|
53
54
|
convertToFinalVersion(): Promise<SBDocument>;
|
|
54
55
|
private insertRenderedBuffer;
|
|
55
56
|
createPdf(generatorOptions: DeepPartial<PdfConfiguration>): Promise<ArrayBuffer>;
|
|
56
|
-
createTiff(generatorOptions?: DeepPartial<
|
|
57
|
+
createTiff(generatorOptions?: DeepPartial<TiffGeneratorParameters>, pageOptions?: Omit<TiffPageOptions, "consumeImage">): Promise<ArrayBuffer>;
|
|
57
58
|
loadPdf(): Promise<ArrayBuffer>;
|
|
58
59
|
loadTiff(): Promise<ArrayBuffer>;
|
|
59
60
|
private loadBuffer;
|
|
60
61
|
private saveRenderedPdf;
|
|
61
62
|
private saveRenderedTiff;
|
|
63
|
+
deletePdf(): Promise<boolean>;
|
|
64
|
+
deleteTiff(): Promise<boolean>;
|
|
62
65
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ScanbotSDK from "../../../scanbot-sdk";
|
|
2
1
|
import { Image } from "../../../core/worker/ScanbotSDK.Core";
|
|
3
2
|
import { ParametricFilter } from "../../../core/bridge/compiled/ParametricFilters";
|
|
4
3
|
import { Point } from "../../../utils/dto/Point";
|
|
@@ -27,12 +26,18 @@ export declare class SBPage {
|
|
|
27
26
|
constructor(document: SBDocument, data: SBPageData);
|
|
28
27
|
private static readonly ROTATIONS;
|
|
29
28
|
private static readonly FULL_SIZE_POLYGON;
|
|
30
|
-
sdk
|
|
31
|
-
|
|
29
|
+
private sdk;
|
|
30
|
+
loadOriginalImage(): Promise<Image>;
|
|
31
|
+
loadDocumentImage(): Promise<Image | null>;
|
|
32
|
+
/** @internal */
|
|
32
33
|
getPolygon(): Point[];
|
|
34
|
+
/** @internal */
|
|
33
35
|
cropData(): Promise<SBPageCropData>;
|
|
34
36
|
private _finalImageUrl;
|
|
37
|
+
/** @internal */
|
|
35
38
|
finalRawImage(): Promise<RawImage>;
|
|
39
|
+
/** @internal */
|
|
36
40
|
finalImageUrl(): Promise<string>;
|
|
41
|
+
/** @internal */
|
|
37
42
|
invalidateImage(): Promise<void>;
|
|
38
43
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as Config from "./configuration";
|
|
2
2
|
import { BarcodeScannerUiResult } from "./configuration";
|
|
3
3
|
import { DocumentScannerUIResult } from "./configuration/document/DocumentScannerUIResult";
|
|
4
|
+
import { SBDocument } from "./document/model/sb-document";
|
|
4
5
|
export default class ScanbotSDKUI {
|
|
6
|
+
static SBDocument: typeof SBDocument;
|
|
5
7
|
static createDocumentScanner(config: Config.DocumentScanningFlow, documentId?: number): Promise<DocumentScannerUIResult | null>;
|
|
6
8
|
static createBarcodeScanner(config: Config.BarcodeScannerConfiguration): Promise<BarcodeScannerUiResult | null>;
|
|
7
9
|
private static createRoot;
|