scanbot-web-sdk 7.0.0-dev.5 → 7.0.0-dev.6

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 (34) hide show
  1. package/@types/cropping-view.d.ts +1 -0
  2. package/@types/index.d.ts +1 -0
  3. package/@types/service/storage/indexed-db/sb-indexed-db.d.ts +1 -0
  4. package/@types/service/storage/sb-storage.d.ts +16 -1
  5. package/@types/service/storage/utils/sb-storage-utils.d.ts +4 -3
  6. package/@types/ui2/configuration/document/DocumentScannerOutputSettings.d.ts +3 -3
  7. package/@types/ui2/configuration/native/PageData.d.ts +0 -5
  8. package/@types/ui2/document/model/sb-document.d.ts +3 -0
  9. package/@types/ui2/document/model/sb-page.d.ts +8 -3
  10. package/@types/ui2/scanbot-sdk-ui.d.ts +2 -0
  11. package/bundle/ScanbotSDK.min.js +4 -4
  12. package/bundle/ScanbotSDK.ui2.min.js +16 -16
  13. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  14. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  15. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  16. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  17. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  18. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  19. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  20. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  21. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  22. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  23. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  24. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  25. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  26. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  27. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  28. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  29. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  30. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  31. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  32. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  33. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  34. package/package.json +1 -1
@@ -51,6 +51,7 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
51
51
  private _configuration?;
52
52
  private onResizeCallback;
53
53
  private sdk;
54
+ private static readonly FULL_SIZE_POLYGON;
54
55
  constructor(props: any);
55
56
  /**
56
57
  * Public API functions
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";
@@ -57,4 +57,5 @@ export default class SBIndexedDB {
57
57
  generateUniqueToken(): string;
58
58
  taskMap: Map<any, any>;
59
59
  query<T>(query: SBStorageQuery): Promise<T>;
60
+ destroy(): void;
60
61
  }
@@ -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
- getSBDocument(id: number): Promise<SBDocumentData>;
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 default class SBStorageUtils {
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
- static persist(): Promise<boolean>;
9
- static estimate(): Promise<boolean>;
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
- Determines the image filter to apply by default.
33
- @defaultValue null;
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
  }
@@ -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>;
@@ -59,4 +60,6 @@ export declare class SBDocument {
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(): ScanbotSDK;
31
- getOriginalImage(): Promise<Image>;
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;