dynamsoft-barcode-reader-bundle 11.4.3000 → 11.6.2000

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 (35) hide show
  1. package/LEGAL.txt +128 -8
  2. package/LICENSE +1 -1
  3. package/README.html +26 -26
  4. package/README.md +26 -26
  5. package/dist/dbr.bundle.d.ts +1867 -1665
  6. package/dist/dbr.bundle.esm.js +2 -2
  7. package/dist/dbr.bundle.js +2 -2
  8. package/dist/dbr.bundle.mjs +2 -2
  9. package/dist/dbr.bundle.worker.js +2 -2
  10. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread-with-pdf.js +1 -0
  11. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread-with-pdf.wasm +0 -0
  12. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread-with-pdf.worker.js +6 -0
  13. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.js +1 -1
  14. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.wasm +0 -0
  15. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-with-pdf.js +1 -0
  16. package/dist/dynamsoft-barcode-reader-bundle-ml-simd-with-pdf.wasm +0 -0
  17. package/dist/dynamsoft-barcode-reader-bundle-ml-simd.js +1 -1
  18. package/dist/dynamsoft-barcode-reader-bundle-ml-simd.wasm +0 -0
  19. package/dist/dynamsoft-barcode-reader-bundle.js +1 -1
  20. package/dist/dynamsoft-barcode-reader-bundle.wasm +0 -0
  21. package/dist/models/Code128Decoder.data +0 -0
  22. package/dist/models/Code39ITFDecoder.data +0 -0
  23. package/dist/models/DataMatrixQRCodeDeblur.data +0 -0
  24. package/dist/models/DataMatrixQRCodeLocalization.data +0 -0
  25. package/dist/models/EAN13Decoder.data +0 -0
  26. package/dist/models/OneDDeblur.data +0 -0
  27. package/dist/models/OneDLocalization.data +0 -0
  28. package/dist/models/PDF417Deblur.data +0 -0
  29. package/dist/models/PDF417Localization.data +0 -0
  30. package/dist/templates/DBR-PresetTemplates.json +12 -1
  31. package/dist/ui/barcode-scanner.ui.xml +3 -3
  32. package/dist/ui/dce.mobile-native.ui.xml +222 -0
  33. package/package.json +79 -78
  34. package/samples.url +1 -1
  35. package/dist/parser-resources/MRTD.data +0 -1
@@ -3,8 +3,8 @@ declare enum EnumBufferOverflowProtectionMode {
3
3
  BOPM_BLOCK = 0,
4
4
  /** New images are appended at the end, and oldest images are pushed out from the beginning if the buffer is full.*/
5
5
  BOPM_UPDATE = 1
6
- }
7
-
6
+ }
7
+
8
8
  declare enum EnumCapturedResultItemType {
9
9
  CRIT_ORIGINAL_IMAGE = 1,
10
10
  CRIT_BARCODE = 2,
@@ -13,15 +13,15 @@ declare enum EnumCapturedResultItemType {
13
13
  CRIT_DESKEWED_IMAGE = 16,
14
14
  CRIT_PARSED_RESULT = 32,
15
15
  CRIT_ENHANCED_IMAGE = 64
16
- }
17
-
16
+ }
17
+
18
18
  declare enum EnumCornerType {
19
19
  CT_NORMAL_INTERSECTED = 0,
20
20
  CT_T_INTERSECTED = 1,
21
21
  CT_CROSS_INTERSECTED = 2,
22
22
  CT_NOT_INTERSECTED = 3
23
- }
24
-
23
+ }
24
+
25
25
  /**
26
26
  * `ErrorCode` enumerates the specific error codes that the SDK may return, providing a systematic way to identify and handle errors encountered during its operation.
27
27
  */
@@ -190,8 +190,8 @@ declare enum EnumErrorCode {
190
190
  EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND = -50058,
191
191
  /**[Code Parser] No license found.*/
192
192
  EC_CODE_PARSER_LICENSE_NOT_FOUND = -90012
193
- }
194
-
193
+ }
194
+
195
195
  declare enum EnumGrayscaleEnhancementMode {
196
196
  /**
197
197
  * Disables any grayscale image preprocessing. Selecting this mode skips the preprocessing step, passing the image through to subsequent operations without modification.
@@ -228,8 +228,8 @@ declare enum EnumGrayscaleEnhancementMode {
228
228
  * Placeholder value with no functional meaning.
229
229
  */
230
230
  GEM_END = -1
231
- }
232
-
231
+ }
232
+
233
233
  declare enum EnumGrayscaleTransformationMode {
234
234
  /**
235
235
  * Bypasses grayscale transformation, leaving the image in its current state without any modification to its grayscale values.
@@ -257,8 +257,8 @@ declare enum EnumGrayscaleTransformationMode {
257
257
  * Placeholder value with no functional meaning.
258
258
  */
259
259
  GTM_END = -1
260
- }
261
-
260
+ }
261
+
262
262
  declare enum EnumImagePixelFormat {
263
263
  /** Binary format representing images with two colors: 0 for black and 1 for white. */
264
264
  IPF_BINARY = 0,
@@ -292,34 +292,39 @@ declare enum EnumImagePixelFormat {
292
292
  IPF_NV12 = 14,
293
293
  /** Inverted binary format with 8 bits per pixel. */
294
294
  IPF_BINARY_8_INVERTED = 15
295
- }
296
-
295
+ }
296
+
297
297
  declare enum EnumImageTagType {
298
298
  /** Represents an image that has been sourced from a static file. */
299
299
  ITT_FILE_IMAGE = 0,
300
300
  /** Indicates that the image is a frame extracted from a video stream. */
301
301
  ITT_VIDEO_FRAME = 1
302
- }
303
-
302
+ }
303
+
304
304
  declare enum EnumPDFReadingMode {
305
- /** Outputs vector data found in the PDFs.*/
305
+ /**
306
+ * Deprecated. Covered by PDFRM_MULTIMODAL.
307
+ */
306
308
  PDFRM_VECTOR = 1,
307
- /** The default value.
308
- * Outputs raster data found in the PDFs.
309
- * Depending on the argument Resolution,
310
- * the SDK may rasterize the PDF pages.
311
- * Check the template for available argument settings.*/
309
+ /**
310
+ * Renders the entire page as a bitmap regardless of object type.
311
+ */
312
312
  PDFRM_RASTER = 2,
313
- PDFRM_REV = -2147483648
314
- }
315
-
313
+ /**
314
+ * Extracts multimodal information from a PDF, including vector graphics,
315
+ * text content, and embedded images, which can be used for subsequent
316
+ * tasks such as barcode reading, text recognition, and document analysis.
317
+ */
318
+ PDFRM_MULTIMODAL = 3
319
+ }
320
+
316
321
  declare enum EnumRasterDataSource {
317
322
  /** Specifies the target type for reading a PDF, where the SDK rasterizes the pages of the PDF into images. */
318
323
  RDS_RASTERIZED_PAGES = 0,
319
324
  /** Specifies the target type for reading a PDF, where the SDK extracts images from the PDF pages. */
320
325
  RDS_EXTRACTED_IMAGES = 1
321
- }
322
-
326
+ }
327
+
323
328
  declare enum EnumColourChannelUsageType {
324
329
  /**
325
330
  * Automatically determines how color channels are used.
@@ -351,8 +356,8 @@ declare enum EnumColourChannelUsageType {
351
356
  * This mode is useful for tasks where the blue component is of particular interest.
352
357
  */
353
358
  CCUT_RGB_B_CHANNEL_ONLY = 5
354
- }
355
-
359
+ }
360
+
356
361
  declare enum EnumCrossVerificationStatus {
357
362
  /** The cross verification has not been performed yet. */
358
363
  CVS_NOT_VERIFIED = 0,
@@ -360,8 +365,8 @@ declare enum EnumCrossVerificationStatus {
360
365
  CVS_PASSED = 1,
361
366
  /** The cross verification has failed. */
362
367
  CVS_FAILED = 2
363
- }
364
-
368
+ }
369
+
365
370
  declare const EnumIntermediateResultUnitType: {
366
371
  /** No intermediate result. */
367
372
  IRUT_NULL: bigint;
@@ -428,8 +433,8 @@ declare const EnumIntermediateResultUnitType: {
428
433
  /** A mask to select all types of intermediate results. */
429
434
  IRUT_ALL: bigint;
430
435
  };
431
- type EnumIntermediateResultUnitType = bigint;
432
-
436
+ type EnumIntermediateResultUnitType = bigint;
437
+
433
438
  declare enum EnumRegionObjectElementType {
434
439
  /** Corresponds to the `PredetectedRegionElement` subclass, representing areas within the image identified as potentially significant for further analysis before detailed processing. */
435
440
  ROET_PREDETECTED_REGION = 0,
@@ -453,8 +458,8 @@ declare enum EnumRegionObjectElementType {
453
458
  ROET_ENHANCED_IMAGE = 9,
454
459
  /** Corresponds to the `AuxiliaryRegionElement` subclass, representing auxiliary regions detected within the image. */
455
460
  ROET_AUXILIARY_REGION = 10
456
- }
457
-
461
+ }
462
+
458
463
  declare enum EnumSectionType {
459
464
  /** Indicates that no specific section type has been specified. */
460
465
  ST_NULL = 0,
@@ -474,8 +479,8 @@ declare enum EnumSectionType {
474
479
  ST_DOCUMENT_DESKEWING = 7,
475
480
  /** Corresponds to results generated in the "document enhancement" section. */
476
481
  ST_IMAGE_ENHANCEMENT = 8
477
- }
478
-
482
+ }
483
+
479
484
  declare enum EnumImageFileFormat {
480
485
  /** JPEG image format. */
481
486
  IFF_JPEG = 0,
@@ -485,13 +490,13 @@ declare enum EnumImageFileFormat {
485
490
  IFF_BMP = 2,
486
491
  /** PDF (Portable Document Format) format. */
487
492
  IFF_PDF = 3
488
- }
489
-
493
+ }
494
+
490
495
  declare enum EnumImageCaptureDistanceMode {
491
496
  ICDM_NEAR = 0,
492
497
  ICDM_FAR = 1
493
- }
494
-
498
+ }
499
+
495
500
  declare enum EnumModuleName {
496
501
  MN_DYNAMSOFT_CAPTURE_VISION_ROUTER = "cvr",
497
502
  MN_DYNAMSOFT_CORE = "core",
@@ -506,8 +511,28 @@ declare enum EnumModuleName {
506
511
  MN_DYNAMSOFT_CODE_PARSER = "dcp",
507
512
  MN_DYNAMSOFT_CAMERA_ENHANCER = "dce",
508
513
  MN_DYNAMSOFT_CAPTURE_VISION_STD = "std"
509
- }
510
-
514
+ }
515
+
516
+ /**
517
+ * Specifies how a numeric value should be interpreted relative to a reference dimension.
518
+ * * Used wherever a numeric parameter (e.g. spacing, ROI coordinates) can be expressed
519
+ * either as an absolute pixel count or as a proportion of a reference size.
520
+ */
521
+ declare enum EnumMeasureUnit {
522
+ MU_PIXEL = 0,// The value is an absolute pixel count.
523
+ MU_PERCENTAGE = 1
524
+ }
525
+
526
+ declare enum EnumWasmType {
527
+ BASELINE = "baseline",
528
+ ML = "ml",
529
+ ML_SIMD = "ml-simd",
530
+ ML_SIMD_PTHREAD = "ml-simd-pthread",
531
+ ML_SIMD_WITH_PDF = "ml-simd-with-pdf",
532
+ ML_SIMD_PTHREAD_WITH_PDF = "ml-simd-pthread-with-pdf",
533
+ AUTO = "auto"
534
+ }
535
+
511
536
  type WorkerAutoResources = {
512
537
  [key in EnumModuleName]?: {
513
538
  js?: boolean;
@@ -579,13 +604,12 @@ interface WasmVersions {
579
604
  interface MapController {
580
605
  [key: string]: ((body: any, taskID: number, instanceID?: number) => void);
581
606
  }
582
- type WasmType = "baseline" | "ml" | "ml-simd" | "ml-simd-pthread" | "auto";
583
607
  interface WasmLoadOptions {
584
- wasmType?: WasmType;
608
+ wasmType?: EnumWasmType;
585
609
  pthreadPoolSize?: number;
586
610
  }
587
- type MimeType = "image/png" | "image/jpeg" | "image/bmp";
588
-
611
+ type MimeType = "image/png" | "image/jpeg" | "image/bmp";
612
+
589
613
  interface CapturedResultItem {
590
614
  /** The type of the captured result item, indicating what kind of data it represents. */
591
615
  readonly type: EnumCapturedResultItemType;
@@ -595,15 +619,15 @@ interface CapturedResultItem {
595
619
  readonly targetROIDefName: string;
596
620
  /** The name of the task that generated the result. */
597
621
  readonly taskName: string;
598
- }
599
-
622
+ }
623
+
600
624
  interface ImageTag {
601
625
  /** The unique identifier of the image. */
602
626
  imageId: number;
603
627
  /** The type of the image. */
604
628
  type: EnumImageTagType;
605
- }
606
-
629
+ }
630
+
607
631
  interface DSImageData {
608
632
  /** The raw bytes of the image as a Uint8Array. */
609
633
  bytes: Uint8Array;
@@ -617,8 +641,8 @@ interface DSImageData {
617
641
  format: EnumImagePixelFormat;
618
642
  /** An optional tag associated with the image data. */
619
643
  imageTag?: ImageTag;
620
- }
621
-
644
+ }
645
+
622
646
  interface OriginalImageResultItem extends CapturedResultItem {
623
647
  /** The image data associated with this result item. */
624
648
  imageData: DSImageData;
@@ -628,27 +652,27 @@ interface OriginalImageResultItem extends CapturedResultItem {
628
652
  toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
629
653
  /** Converts the image data into a Blob object of a specified MIME type ('image/png' or 'image/jpeg'). */
630
654
  toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
631
- }
632
-
655
+ }
656
+
633
657
  interface Point {
634
658
  /** The x-coordinate of the point. */
635
659
  x: number;
636
660
  /** The y-coordinate of the point. */
637
661
  y: number;
638
- }
639
-
662
+ }
663
+
640
664
  interface Contour {
641
665
  /** An array of `Point` objects defining the vertices of the contour. */
642
666
  points: Array<Point>;
643
- }
644
-
667
+ }
668
+
645
669
  interface LineSegment {
646
670
  /** The starting point of the line segment. */
647
671
  startPoint: Point;
648
672
  /** The ending point of the line segment. */
649
673
  endPoint: Point;
650
- }
651
-
674
+ }
675
+
652
676
  interface Corner {
653
677
  /** The type of the corner, represented by the enumeration EnumCornerType. */
654
678
  type: EnumCornerType;
@@ -658,8 +682,8 @@ interface Corner {
658
682
  line1: LineSegment;
659
683
  /** The second line segment forming the corner. */
660
684
  line2: LineSegment;
661
- }
662
-
685
+ }
686
+
663
687
  interface Rect {
664
688
  /** The x-coordinate of the rectangle's top-left corner. */
665
689
  x: number;
@@ -671,8 +695,8 @@ interface Rect {
671
695
  height: number;
672
696
  /** [Optional] Indicates if the rectangle's measurements are in percentages. */
673
697
  isMeasuredInPercentage?: boolean;
674
- }
675
-
698
+ }
699
+
676
700
  interface Arc {
677
701
  /** The x-coordinate of the arc's center. */
678
702
  x: number;
@@ -684,13 +708,13 @@ interface Arc {
684
708
  startAngle: number;
685
709
  /** The ending angle of the arc, in radians. */
686
710
  endAngle: number;
687
- }
688
-
711
+ }
712
+
689
713
  interface Polygon {
690
714
  /** An array of `Point` objects defining the vertices of the polygon. */
691
715
  points: Array<Point>;
692
- }
693
-
716
+ }
717
+
694
718
  interface DSRect {
695
719
  /** The left coordinate of the rectangle. */
696
720
  left: number;
@@ -702,21 +726,21 @@ interface DSRect {
702
726
  bottom: number;
703
727
  /** Indicates if the rectangle's measurements are in percentages. */
704
728
  isMeasuredInPercentage?: boolean;
705
- }
706
-
729
+ }
730
+
707
731
  interface Edge {
708
732
  /** The starting corner of the edge. */
709
733
  startCorner: Corner;
710
734
  /** The ending corner of the edge. */
711
735
  endCorner: Corner;
712
- }
713
-
736
+ }
737
+
714
738
  interface FileImageTag extends ImageTag {
715
739
  filePath: string;
716
740
  pageNumber: number;
717
741
  totalPages: number;
718
- }
719
-
742
+ }
743
+
720
744
  interface ImageSourceErrorListener {
721
745
  /**
722
746
  * Called when an error is received from the image source.
@@ -726,14 +750,14 @@ interface ImageSourceErrorListener {
726
750
  * additional information about the error.
727
751
  */
728
752
  onErrorReceived: (errorCode: EnumErrorCode, errorMessage: string) => void;
729
- }
730
-
753
+ }
754
+
731
755
  interface PDFReadingParameter {
732
- mode: EnumPDFReadingMode;
733
- dpi: number;
734
- rasterDataSource: EnumRasterDataSource;
735
- }
736
-
756
+ mode?: EnumPDFReadingMode;
757
+ dpi?: number;
758
+ rasterDataSource?: EnumRasterDataSource;
759
+ }
760
+
737
761
  interface Quadrilateral {
738
762
  /** An array of four `Point` objects defining the vertices of the quadrilateral. */
739
763
  points: [Point, Point, Point, Point];
@@ -741,20 +765,20 @@ interface Quadrilateral {
741
765
  boundingRect?: DSRect;
742
766
  /** The area of the quadrilateral. */
743
767
  area?: number;
744
- }
745
-
768
+ }
769
+
746
770
  interface DSFile extends File {
747
771
  /** Downloads the file in memory to the local drive via the browser. */
748
772
  download: () => void;
749
- }
750
-
773
+ }
774
+
751
775
  interface Warning {
752
776
  /** A unique identifier for the warning message. */
753
777
  id: number;
754
778
  /** The textual description of the warning. */
755
779
  message: string;
756
- }
757
-
780
+ }
781
+
758
782
  interface IntermediateResultUnit {
759
783
  /** A unique identifier for the intermediate result unit. */
760
784
  hashId: string;
@@ -764,38 +788,38 @@ interface IntermediateResultUnit {
764
788
  originalImageTag: ImageTag;
765
789
  /** The type of the intermediate result unit, defined by the enumeration `EnumIntermediateResultUnitType`. */
766
790
  unitType: EnumIntermediateResultUnitType;
767
- }
768
-
791
+ }
792
+
769
793
  interface BinaryImageUnit extends IntermediateResultUnit {
770
794
  /** The image data for the binary image. */
771
795
  imageData: DSImageData;
772
- }
773
-
796
+ }
797
+
774
798
  interface ColourImageUnit extends IntermediateResultUnit {
775
799
  /** The image data for the colour image. */
776
800
  imageData: DSImageData;
777
- }
778
-
801
+ }
802
+
779
803
  interface ContoursUnit extends IntermediateResultUnit {
780
804
  /** An array of `Contour` objects, each representing a series of points that outline a shape within the image. */
781
805
  contours: Array<Contour>;
782
- }
783
-
806
+ }
807
+
784
808
  interface EnhancedGrayscaleImageUnit extends IntermediateResultUnit {
785
809
  /** The image data for the enhanced grayscale image. */
786
810
  imageData: DSImageData;
787
- }
788
-
811
+ }
812
+
789
813
  interface GrayscaleImageUnit extends IntermediateResultUnit {
790
814
  /** The image data for the grayscale image. */
791
815
  imageData: DSImageData;
792
- }
793
-
816
+ }
817
+
794
818
  interface IntermediateResult {
795
819
  /** An array of `IntermediateResultUnit` objects, each representing a different type of intermediate result. */
796
820
  intermediateResultUnits: Array<IntermediateResultUnit>;
797
- }
798
-
821
+ }
822
+
799
823
  interface IntermediateResultExtraInfo {
800
824
  /** The property indicates the name of the `TargetROIDef` object that generates the intermediate result. */
801
825
  targetROIDefName: string;
@@ -805,13 +829,13 @@ interface IntermediateResultExtraInfo {
805
829
  isSectionLevelResult: boolean;
806
830
  /** The type of section, if applicable, as defined by the enumeration `EnumSectionType`. */
807
831
  sectionType: EnumSectionType;
808
- }
809
-
832
+ }
833
+
810
834
  interface LineSegmentsUnit extends IntermediateResultUnit {
811
835
  /** An array of `LineSegment` objects, each representing a segment of a line detected within the image. */
812
836
  lineSegments: Array<LineSegment>;
813
- }
814
-
837
+ }
838
+
815
839
  interface RegionObjectElement {
816
840
  /** The location of the region object, represented as a quadrilateral. */
817
841
  location: Quadrilateral;
@@ -819,8 +843,8 @@ interface RegionObjectElement {
819
843
  referencedElement: RegionObjectElement;
820
844
  /** The type of the region object element, defined by the enumeration EnumRegionObjectElementType. */
821
845
  elementType: EnumRegionObjectElementType;
822
- }
823
-
846
+ }
847
+
824
848
  interface PredetectedRegionElement extends RegionObjectElement {
825
849
  /** The name of the detection mode used to detect this region element. */
826
850
  modeName: string;
@@ -828,28 +852,28 @@ interface PredetectedRegionElement extends RegionObjectElement {
828
852
  labelID: number;
829
853
  /** The name of the label associated with this region element. */
830
854
  labelName: string;
831
- }
832
-
855
+ }
856
+
833
857
  interface PredetectedRegionsUnit extends IntermediateResultUnit {
834
858
  /** An array of `PredetectedRegionElement` objects, each representing a pre-detected region detected within the image. */
835
859
  predetectedRegions: Array<PredetectedRegionElement>;
836
- }
837
-
860
+ }
861
+
838
862
  interface ScaledColourImageUnit extends IntermediateResultUnit {
839
863
  /** The image data for the scaled colour image. */
840
864
  imageData: DSImageData;
841
- }
842
-
865
+ }
866
+
843
867
  interface ShortLinesUnit extends IntermediateResultUnit {
844
868
  /** An array of `LineSegment` objects, each representing a short line detected within the image. */
845
869
  shortLines: Array<LineSegment>;
846
- }
847
-
870
+ }
871
+
848
872
  interface TextRemovedBinaryImageUnit extends IntermediateResultUnit {
849
873
  /** The image data for the text-removed binary image. */
850
874
  imageData: DSImageData;
851
- }
852
-
875
+ }
876
+
853
877
  interface TextureDetectionResultUnit extends IntermediateResultUnit {
854
878
  /** This value represents the detected horizontal distance in pixels between consecutive texture patterns, providing an indication of the texture's density and orientation within the image. */
855
879
  xSpacing: number;
@@ -858,35 +882,35 @@ interface TextureDetectionResultUnit extends IntermediateResultUnit {
858
882
  * It offers insights into the vertical density and alignment of the texture within the image, contributing to the understanding of the texture's characteristics and spatial distribution.
859
883
  */
860
884
  ySpacing: number;
861
- }
862
-
885
+ }
886
+
863
887
  interface TextureRemovedBinaryImageUnit extends IntermediateResultUnit {
864
888
  /** The image data for the texture-removed binary image. */
865
889
  imageData: DSImageData;
866
- }
867
-
890
+ }
891
+
868
892
  interface TextureRemovedGrayscaleImageUnit extends IntermediateResultUnit {
869
893
  /** The image data for the texture-removed grayscale image. */
870
894
  imageData: DSImageData;
871
- }
872
-
895
+ }
896
+
873
897
  interface TextZone {
874
898
  /** The location of the text zone. */
875
899
  location: Quadrilateral;
876
900
  /** The indices of the character contours. */
877
901
  charContoursIndices: Array<number>;
878
- }
879
-
902
+ }
903
+
880
904
  interface TextZonesUnit extends IntermediateResultUnit {
881
905
  /** An array of `TextZone` objects, each representing the geometric boundaries of a detected text zone within the image. */
882
906
  textZones: Array<TextZone>;
883
- }
884
-
907
+ }
908
+
885
909
  interface TransformedGrayscaleImageUnit extends IntermediateResultUnit {
886
910
  /** The image data for the transformed grayscale image. */
887
911
  imageData: DSImageData;
888
- }
889
-
912
+ }
913
+
890
914
  /**
891
915
  * The `ObservationParameters` interface represents an object used to configure intermediate result observation.
892
916
  */
@@ -924,8 +948,8 @@ interface ObservationParameters {
924
948
  * @returns Boolean indicating whether the task is observed.
925
949
  */
926
950
  isTaskObserved: (taskName: string) => boolean;
927
- }
928
-
951
+ }
952
+
929
953
  interface CapturedResultBase {
930
954
  /** Error code associated with the capture result. */
931
955
  readonly errorCode: number;
@@ -935,44 +959,36 @@ interface CapturedResultBase {
935
959
  readonly originalImageHashId: string;
936
960
  /** The tag associated with the original image. */
937
961
  readonly originalImageTag: ImageTag;
938
- }
939
-
962
+ }
963
+
940
964
  interface ErrorInfo {
941
965
  errorCode: EnumErrorCode;
942
966
  errorString: string;
943
- }
944
-
967
+ }
968
+
945
969
  interface AuxiliaryRegionElement extends RegionObjectElement {
946
970
  /** The name of this auxiliary region(e.g., "PortraitZone", "SignatureArea"). */
947
971
  name: string;
948
972
  /** The confidence level of this auxiliary region detection, typically in the range [0, 100] */
949
973
  confidence: number;
950
- }
951
-
952
- declare const mapAsyncDependency: {
953
- [key: string]: any;
954
- };
955
- declare const waitAsyncDependency: (depName: string | string[]) => Promise<void>;
956
- declare const doOrWaitAsyncDependency: (depName: string | string[], asyncFunc: () => Promise<void>) => Promise<void>;
974
+ }
975
+
957
976
  declare const imagePtrToUint8Array: (data: {
958
977
  ptr: number;
959
978
  length: number;
960
- }) => Promise<Uint8Array>;
979
+ }) => Promise<Uint8Array<ArrayBufferLike>>;
961
980
  declare const resolveDsImageData: (point: number) => Promise<DSImageData>;
962
981
  declare let worker: Worker;
963
982
  declare const getNextTaskID: () => number;
964
983
  declare const mapTaskCallBack: {
965
984
  [key: string]: (body: any) => void;
966
985
  };
967
- declare let onLog: (message: string) => void | undefined;
968
- declare const setOnLog: (value: typeof onLog) => void;
969
986
  declare let bDebug: boolean;
970
987
  declare const setBDebug: (value: boolean) => void;
971
988
  declare const innerVersions: InnerVersions;
972
989
  declare const mapPackageRegister: {
973
990
  [key: string]: any;
974
991
  };
975
- declare const workerAutoResources: WorkerAutoResources;
976
992
  declare class CoreModule {
977
993
  static get engineResourcePaths(): EngineResourcePaths;
978
994
  static set engineResourcePaths(value: EngineResourcePaths);
@@ -982,8 +998,7 @@ declare class CoreModule {
982
998
  static get bSupportIRTModule(): number;
983
999
  private static _versions;
984
1000
  static get versions(): any;
985
- static get _onLog(): (message: string) => void;
986
- static set _onLog(value: (message: string) => void);
1001
+ static _onLog: (message: string) => void;
987
1002
  static get _bDebug(): boolean;
988
1003
  static set _bDebug(value: boolean);
989
1004
  static _bundleEnv: "DCV" | "DBR";
@@ -991,14 +1006,14 @@ declare class CoreModule {
991
1006
  private static _wasmLoadOptions;
992
1007
  static get wasmLoadOptions(): WasmLoadOptions;
993
1008
  static set wasmLoadOptions(options: WasmLoadOptions);
994
- static loadedWasmType: Exclude<WasmType, "auto">;
1009
+ static loadedWasmType: Exclude<EnumWasmType, "auto">;
995
1010
  /**
996
1011
  * Initiates the loading process for the .wasm file(s) corresponding to the specified module(s).
997
1012
  * If a module relies on other modules, the other modules will be loaded as well.
998
1013
  *
999
1014
  * @returns A promise that resolves when the resources have been successfully released. It does not provide any value upon resolution.
1000
1015
  */
1001
- static isModuleLoaded(name?: string): boolean;
1016
+ static isModuleLoaded(): boolean;
1002
1017
  static loadWasm(): Promise<void>;
1003
1018
  /**
1004
1019
  * An event that fires during the loading of a WebAssembly module (.wasm).
@@ -1025,8 +1040,8 @@ declare class CoreModule {
1025
1040
  static enableLogging(): void;
1026
1041
  static disableLogging(): void;
1027
1042
  static cfd(count: number): Promise<void>;
1028
- }
1029
-
1043
+ }
1044
+
1030
1045
  declare abstract class ImageSourceAdapter {
1031
1046
  #private;
1032
1047
  /**
@@ -1145,8 +1160,8 @@ declare abstract class ImageSourceAdapter {
1145
1160
  * @returns The current buffer overflow protection mode.
1146
1161
  */
1147
1162
  getColourChannelUsageType(): EnumColourChannelUsageType;
1148
- }
1149
-
1163
+ }
1164
+
1150
1165
  /**
1151
1166
  * Judge if the input is an object(exclude array and function). If `null` or `undefined`, return `false`.
1152
1167
  * @param value
@@ -1224,12 +1239,12 @@ declare const isQuad: (value: any) => value is Quadrilateral;
1224
1239
  * @returns
1225
1240
  * @ignore
1226
1241
  */
1227
- declare const isRect: (value: any) => value is Rect;
1228
-
1242
+ declare const isRect: (value: any) => value is Rect;
1243
+
1229
1244
  declare const requestResource: (url: string, type: "text" | "blob" | "arraybuffer", callbacks?: {
1230
- loadstartCallback?: () => any;
1231
- progressCallback?: (pe: any) => any;
1232
- loadendCallback?: () => any;
1245
+ loadstartCallback?: (xhr: XMLHttpRequest) => any;
1246
+ progressCallback?: (pe: any, xhr: XMLHttpRequest) => any;
1247
+ loadendCallback?: (xhr: XMLHttpRequest) => any;
1233
1248
  }) => Promise<any>;
1234
1249
  declare const checkIsLink: (str: string) => boolean;
1235
1250
  declare const compareVersion: (strV1: string, strV2: string) => number;
@@ -1263,16 +1278,16 @@ declare const productNameMap: {
1263
1278
  readonly dwt: "dwt";
1264
1279
  readonly dbrBundle: "dynamsoft-barcode-reader-bundle";
1265
1280
  readonly dcvBundle: "dynamsoft-capture-vision-bundle";
1266
- };
1267
-
1268
- export { CoreModule, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumCrossVerificationStatus, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImageCaptureDistanceMode, EnumImageFileFormat, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumModuleName, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, ImageSourceAdapter, _saveToFile, _toBlob, _toCanvas, _toImage, bDebug, blobToDsImage, checkIsLink, compareVersion, createImageData, d, doOrWaitAsyncDependency, e, encodeBMP, getNextTaskID, handleEngineResourcePaths, imagePtrToUint8Array, innerVersions, isArc, isContour, isDSImageData, isDSRect, isDsImageKeyValue, isImageTag, isLineSegment, isObject, isOriginalDsImageData, isPoint, isPolygon, isQuad, isRect, isSimdSupported, mapAsyncDependency, mapPackageRegister, mapTaskCallBack, onLog, productNameMap, requestResource, resolveDsImageData, setBDebug, setOnLog, waitAsyncDependency, worker, workerAutoResources };
1269
- export type { Arc, AuxiliaryRegionElement, BinaryImageUnit, CapturedResultBase, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, Corner, DSFile, DSImageData, DSRect, DwtInfo, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, ErrorInfo, FileImageTag, GrayscaleImageUnit, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, MimeType, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, PathInfo, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, Quadrilateral, Rect, RegionObjectElement, ScaledColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZone, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmLoadOptions, WasmType, WasmVersions, WorkerAutoResources };
1270
-
1271
-
1272
-
1273
-
1274
-
1275
-
1281
+ };
1282
+
1283
+ export { CoreModule, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumCrossVerificationStatus, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImageCaptureDistanceMode, EnumImageFileFormat, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumMeasureUnit, EnumModuleName, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, EnumWasmType, ImageSourceAdapter, _saveToFile, _toBlob, _toCanvas, _toImage, bDebug, blobToDsImage, checkIsLink, compareVersion, createImageData, d, e, encodeBMP, getNextTaskID, handleEngineResourcePaths, imagePtrToUint8Array, innerVersions, isArc, isContour, isDSImageData, isDSRect, isDsImageKeyValue, isImageTag, isLineSegment, isObject, isOriginalDsImageData, isPoint, isPolygon, isQuad, isRect, isSimdSupported, mapPackageRegister, mapTaskCallBack, productNameMap, requestResource, resolveDsImageData, setBDebug, worker };
1284
+ export type { Arc, AuxiliaryRegionElement, BinaryImageUnit, CapturedResultBase, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, Corner, DSFile, DSImageData, DSRect, DwtInfo, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, ErrorInfo, FileImageTag, GrayscaleImageUnit, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, MimeType, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, PathInfo, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, Quadrilateral, Rect, RegionObjectElement, ScaledColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZone, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmLoadOptions, WasmVersions, WorkerAutoResources };
1285
+
1286
+
1287
+
1288
+
1289
+
1290
+
1276
1291
  interface CapturedResult extends CapturedResultBase {
1277
1292
  /** An array of `CapturedResultItem` objects representing the captured result items. */
1278
1293
  items: Array<CapturedResultItem>;
@@ -1284,8 +1299,8 @@ interface CapturedResult extends CapturedResultBase {
1284
1299
  processedDocumentResult?: ProcessedDocumentResult;
1285
1300
  /** The parsed results within the original image. */
1286
1301
  parsedResult?: ParsedResult;
1287
- }
1288
-
1302
+ }
1303
+
1289
1304
  declare class CapturedResultReceiver {
1290
1305
  /**
1291
1306
  * Event triggered when a generic captured result is available, occurring each time an image finishes its processing.
@@ -1303,8 +1318,8 @@ declare class CapturedResultReceiver {
1303
1318
  onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void;
1304
1319
  onProcessedDocumentResultReceived?: (result: ProcessedDocumentResult) => void;
1305
1320
  onParsedResultsReceived?: (result: ParsedResult) => void;
1306
- }
1307
-
1321
+ }
1322
+
1308
1323
  declare class BufferedItemsManager {
1309
1324
  private _cvr;
1310
1325
  constructor(cvr: any);
@@ -1323,8 +1338,8 @@ declare class BufferedItemsManager {
1323
1338
  * @return the buffered character items
1324
1339
  */
1325
1340
  getBufferedCharacterItemSet(): Promise<BufferedCharacterItemSet>;
1326
- }
1327
-
1341
+ }
1342
+
1328
1343
  declare class IntermediateResultReceiver {
1329
1344
  private _observedResultUnitTypes;
1330
1345
  private _observedTaskMap;
@@ -1367,8 +1382,8 @@ declare class IntermediateResultReceiver {
1367
1382
  onEnhancedImageReceived?: (result: EnhancedImageUnit, info: IntermediateResultExtraInfo) => void;
1368
1383
  onLogicLinesUnitReceived?: (result: LogicLinesUnit, info: IntermediateResultExtraInfo) => void;
1369
1384
  onLongLinesUnitReceived?: (result: LongLinesUnit, info: IntermediateResultExtraInfo) => void;
1370
- }
1371
-
1385
+ }
1386
+
1372
1387
  declare class IntermediateResultManager {
1373
1388
  private _cvr;
1374
1389
  private _irrRegistryState;
@@ -1391,8 +1406,8 @@ declare class IntermediateResultManager {
1391
1406
  * @returns A promise that resolves when the operation has successfully completed. It provides the original image upon resolution.
1392
1407
  */
1393
1408
  getOriginalImage(): DSImageData;
1394
- }
1395
-
1409
+ }
1410
+
1396
1411
  declare enum EnumImageSourceState {
1397
1412
  /**
1398
1413
  * Indicates that the buffer of the image source is currently empty.
@@ -1402,8 +1417,8 @@ declare enum EnumImageSourceState {
1402
1417
  * Signifies that the source for the image source has been depleted.
1403
1418
  */
1404
1419
  ISS_EXHAUSTED = 1
1405
- }
1406
-
1420
+ }
1421
+
1407
1422
  interface ImageSourceStateListener {
1408
1423
  /**
1409
1424
  * Event triggered whenever there is a change in the image source's state.
@@ -1411,8 +1426,8 @@ interface ImageSourceStateListener {
1411
1426
  * This enumeration defines various possible states of an image source.
1412
1427
  */
1413
1428
  onImageSourceStateReceived?: (status: EnumImageSourceState) => void;
1414
- }
1415
-
1429
+ }
1430
+
1416
1431
  interface SimplifiedCaptureVisionSettings {
1417
1432
  /**
1418
1433
  * Specifies weather to output the original image.
@@ -1430,6 +1445,10 @@ interface SimplifiedCaptureVisionSettings {
1430
1445
  * Specifies the timeout duration for processing an image, in milliseconds.
1431
1446
  */
1432
1447
  timeout: number;
1448
+ /**
1449
+ * Specifies the maximum number of parallel tasks that can be used for image capture and recognition.
1450
+ */
1451
+ maxParallelTasks: number;
1433
1452
  /**
1434
1453
  * Specifies the shortest time span, in milliseconds, that must elapse between two successive image captures. Opting for a higher interval decreases capture frequency, which can lower the system's processing load and conserve energy. On the other hand, a smaller interval value increases the frequency of image captures, enhancing the system's responsiveness.
1435
1454
  * @remarks Handling of Special Values:
@@ -1440,16 +1459,8 @@ interface SimplifiedCaptureVisionSettings {
1440
1459
  * Specifies the basic settings for the barcode reader module. It is of type `SimplifiedBarcodeReaderSettings`.
1441
1460
  */
1442
1461
  barcodeSettings: SimplifiedBarcodeReaderSettings;
1443
- /**
1444
- * Specifies the basic settings for the document normalizer module. It is of type `SimplifiedDocumentNormalizerSettings`.
1445
- */
1446
- documentSettings: SimplifiedDocumentNormalizerSettings;
1447
- /**
1448
- * Specifies the basic settings for the label recognizer module. It is of type `SimplifiedLabelRecognizerSettings`.
1449
- */
1450
- labelSettings: SimplifiedLabelRecognizerSettings;
1451
- }
1452
-
1462
+ }
1463
+
1453
1464
  interface CapturedResultFilter {
1454
1465
  onOriginalImageResultReceived?: (result: OriginalImageResultItem) => void;
1455
1466
  onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
@@ -1457,8 +1468,13 @@ interface CapturedResultFilter {
1457
1468
  onProcessedDocumentResultReceived?: (result: ProcessedDocumentResult) => void;
1458
1469
  onParsedResultsReceived?: (result: ParsedResult) => void;
1459
1470
  getFilteredResultItemTypes(): number;
1460
- }
1461
-
1471
+ }
1472
+
1473
+ type PDFOptions = {
1474
+ pages?: number[];
1475
+ dpi?: number;
1476
+ };
1477
+
1462
1478
  declare class CaptureVisionRouter {
1463
1479
  #private;
1464
1480
  static _onLog: (message: string) => void;
@@ -1494,7 +1510,6 @@ declare class CaptureVisionRouter {
1494
1510
  private _minImageCaptureInterval;
1495
1511
  private _averageProcessintTimeArray;
1496
1512
  private _averageFetchImageTimeArray;
1497
- private _currentSettings;
1498
1513
  private _averageTime;
1499
1514
  private _dynamsoft;
1500
1515
  private _enhancedFeaturesIrr;
@@ -1608,6 +1623,24 @@ declare class CaptureVisionRouter {
1608
1623
  * @returns A promise that resolves with a `CapturedResult` object which contains the derived information from the image processed.
1609
1624
  */
1610
1625
  capture(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement, templateName?: string): Promise<CapturedResult>;
1626
+ /**
1627
+ * Captures multiple pages from a PDF file and returns the extracted content for each specified page.
1628
+ *
1629
+ * This method processes a PDF document and extracts data from one or more pages using the
1630
+ * PDFRM_MULTIMODAL capture mode. The extracted content is returned as an array of results,
1631
+ * one per requested page.
1632
+ *
1633
+ * @param file - The PDF file to process. Can be provided as a Blob object or a file path string.
1634
+ * @param templateName - The name of the template to use for extraction.
1635
+ * @param options - Optional configuration parameters for the capture operation.
1636
+ * @param options.pages - An array of page numbers (0-indexed) to extract. If empty or omitted,
1637
+ * all pages in the document will be processed.
1638
+ * @param options.dpi - The DPI (dots per inch) resolution for rendering. Defaults to 300.
1639
+ *
1640
+ * @returns A Promise that resolves to an array of CapturedResult objects, where each object
1641
+ * corresponds to the extracted data from a single page in the order specified.
1642
+ */
1643
+ captureMultiPages(file: Blob | string, templateName?: string, options?: PDFOptions): Promise<CapturedResult[]>;
1611
1644
  private _captureDsimage;
1612
1645
  private _captureUrl;
1613
1646
  private _captureBase64;
@@ -1687,6 +1720,8 @@ declare class CaptureVisionRouter {
1687
1720
  models: string[];
1688
1721
  specss: string[];
1689
1722
  }>;
1723
+ static disposeCvrWasm(instanceID: number): void;
1724
+ static _fr4DisposeCvrWasm: FinalizationRegistry<number>;
1690
1725
  /**
1691
1726
  * Releases all resources used by the `CaptureVisionRouter` instance.
1692
1727
  *
@@ -1698,20 +1733,20 @@ declare class CaptureVisionRouter {
1698
1733
  */
1699
1734
  private _getInternalData;
1700
1735
  private _getWasmFilterState;
1701
- }
1702
-
1736
+ }
1737
+
1703
1738
  declare class CaptureVisionRouterModule {
1704
1739
  private static _version;
1705
1740
  /**
1706
1741
  * Returns the version of the CaptureVisionRouter module.
1707
1742
  */
1708
1743
  static getVersion(): string;
1709
- }
1710
-
1744
+ }
1745
+
1711
1746
  interface RawImageResultItem extends CapturedResultItem {
1712
1747
  imageData: DSImageData;
1713
- }
1714
-
1748
+ }
1749
+
1715
1750
  declare enum EnumPresetTemplate {
1716
1751
  /**
1717
1752
  * @brief Versatile function for barcode reading, document detection, or text recognition.
@@ -1805,19 +1840,19 @@ declare enum EnumPresetTemplate {
1805
1840
  * @brief Represents a text recognition mode focused on recognizing uppercase letters.
1806
1841
  */
1807
1842
  PT_RECOGNIZE_UPPERCASE_LETTERS = "RecognizeUppercaseLetters"
1808
- }
1809
-
1810
- export { CaptureVisionRouter, CaptureVisionRouterModule, CapturedResultReceiver, EnumImageSourceState, EnumPresetTemplate, IntermediateResultReceiver };
1811
- export type { CapturedResult, CapturedResultFilter, ImageSourceStateListener, RawImageResultItem, SimplifiedCaptureVisionSettings };
1812
-
1813
-
1843
+ }
1844
+
1845
+ export { CaptureVisionRouter, CaptureVisionRouterModule, CapturedResultReceiver, EnumImageSourceState, EnumPresetTemplate, IntermediateResultReceiver };
1846
+ export type { CapturedResult, CapturedResultFilter, ImageSourceStateListener, RawImageResultItem, SimplifiedCaptureVisionSettings };
1847
+
1848
+
1814
1849
  declare class BarcodeReaderModule {
1815
1850
  /**
1816
1851
  * Returns the version of the BarcodeReader module.
1817
1852
  */
1818
1853
  static getVersion(): string;
1819
- }
1820
-
1854
+ }
1855
+
1821
1856
  declare const EnumBarcodeFormat: {
1822
1857
  /**No barcode format in BarcodeFormat*/
1823
1858
  BF_NULL: bigint;
@@ -1920,8 +1955,8 @@ declare const EnumBarcodeFormat: {
1920
1955
  /**Telepen Numeric. A variation of the Telepen format optimized for encoding numeric data only.*/
1921
1956
  BF_TELEPEN_NUMERIC: bigint;
1922
1957
  };
1923
- type EnumBarcodeFormat = bigint;
1924
-
1958
+ type EnumBarcodeFormat = bigint;
1959
+
1925
1960
  declare enum EnumExtendedBarcodeResultType {
1926
1961
  /**Specifies the standard text. This means the barcode value. */
1927
1962
  EBRT_STANDARD_RESULT = 0,
@@ -1929,8 +1964,8 @@ declare enum EnumExtendedBarcodeResultType {
1929
1964
  EBRT_CANDIDATE_RESULT = 1,
1930
1965
  /**Specifies the partial text. This means part of the text result decoded from the barcode. */
1931
1966
  EBRT_PARTIAL_RESULT = 2
1932
- }
1933
-
1967
+ }
1968
+
1934
1969
  declare enum EnumQRCodeErrorCorrectionLevel {
1935
1970
  /** High error correction level, allowing for up to 30% data recovery. Suitable for environments where QR codes might be subject to significant damage. */
1936
1971
  QRECL_ERROR_CORRECTION_H = 0,
@@ -1940,8 +1975,8 @@ declare enum EnumQRCodeErrorCorrectionLevel {
1940
1975
  QRECL_ERROR_CORRECTION_M = 2,
1941
1976
  /** Medium-high error correction level, allowing for up to 25% data recovery. Designed for situations where some QR code damage might be expected. */
1942
1977
  QRECL_ERROR_CORRECTION_Q = 3
1943
- }
1944
-
1978
+ }
1979
+
1945
1980
  declare enum EnumLocalizationMode {
1946
1981
  /** Automatic localization mode selection; not yet implemented. */
1947
1982
  LM_AUTO = 1,
@@ -1969,8 +2004,8 @@ declare enum EnumLocalizationMode {
1969
2004
  LM_SKIP = 0,
1970
2005
  /** Placeholder value with no functional meaning. */
1971
2006
  LM_END = -1
1972
- }
1973
-
2007
+ }
2008
+
1974
2009
  declare enum EnumDeblurMode {
1975
2010
  /** Applies a direct binarization algorithm for generating the binary image. */
1976
2011
  DM_DIRECT_BINARIZATION = 1,
@@ -1998,11 +2033,11 @@ declare enum EnumDeblurMode {
1998
2033
  DM_SKIP = 0,
1999
2034
  /** Placeholder value with no functional meaning. */
2000
2035
  DM_END = -1
2001
- }
2002
-
2036
+ }
2037
+
2003
2038
  interface BarcodeDetails {
2004
- }
2005
-
2039
+ }
2040
+
2006
2041
  interface AztecDetails extends BarcodeDetails {
2007
2042
  /** Number of rows in the Aztec barcode. */
2008
2043
  rows: number;
@@ -2013,8 +2048,8 @@ interface AztecDetails extends BarcodeDetails {
2013
2048
  * while positive values represent full-range codes.
2014
2049
  */
2015
2050
  layerNumber: number;
2016
- }
2017
-
2051
+ }
2052
+
2018
2053
  /**
2019
2054
  * Represents the Extended Channel Interpretation (ECI) information within a barcode.
2020
2055
  *
@@ -2030,8 +2065,8 @@ interface ECISegment {
2030
2065
  startIndex: number;
2031
2066
  /** The length (in bytes) of this segment within the decoded barcode bytes. */
2032
2067
  length: number;
2033
- }
2034
-
2068
+ }
2069
+
2035
2070
  interface BarcodeResultItem extends CapturedResultItem {
2036
2071
  /** The format of the decoded barcode, as defined by `EnumBarcodeFormat`. */
2037
2072
  format: EnumBarcodeFormat;
@@ -2057,8 +2092,8 @@ interface BarcodeResultItem extends CapturedResultItem {
2057
2092
  isDPM: boolean;
2058
2093
  /** An array of ECI segments present in the barcode, if any. Each segment is represented by a `ECISegment` object. */
2059
2094
  eciSegments: Array<ECISegment>;
2060
- }
2061
-
2095
+ }
2096
+
2062
2097
  interface DataMatrixDetails extends BarcodeDetails {
2063
2098
  /** Number of rows in the Data Matrix barcode. */
2064
2099
  rows: number;
@@ -2070,15 +2105,15 @@ interface DataMatrixDetails extends BarcodeDetails {
2070
2105
  dataRegionColumns: number;
2071
2106
  /** Number of data regions in the barcode. */
2072
2107
  dataRegionNumber: number;
2073
- }
2074
-
2108
+ }
2109
+
2075
2110
  interface DecodedBarcodesResult extends CapturedResultBase {
2076
2111
  /**
2077
2112
  * An array of `BarcodeResultItem` objects, each representing a decoded barcode within the original image.
2078
2113
  */
2079
2114
  barcodeResultItems: Array<BarcodeResultItem>;
2080
- }
2081
-
2115
+ }
2116
+
2082
2117
  interface DecodedBarcodeElement extends RegionObjectElement {
2083
2118
  /** The format of the decoded barcode, as defined by `EnumBarcodeFormat`. */
2084
2119
  format: EnumBarcodeFormat;
@@ -2104,8 +2139,8 @@ interface DecodedBarcodeElement extends RegionObjectElement {
2104
2139
  extendedBarcodeResults: Array<ExtendedBarcodeResult>;
2105
2140
  /** An array of ECI segments present in the barcode, if any. Each segment is represented by a `ECISegment` object. */
2106
2141
  eciSegments: Array<ECISegment>;
2107
- }
2108
-
2142
+ }
2143
+
2109
2144
  interface ExtendedBarcodeResult extends DecodedBarcodeElement {
2110
2145
  /** Type of the extended barcode result. */
2111
2146
  extendedBarcodeResultType: EnumExtendedBarcodeResultType;
@@ -2115,8 +2150,8 @@ interface ExtendedBarcodeResult extends DecodedBarcodeElement {
2115
2150
  clarity: number;
2116
2151
  /** Image data sampled from the barcode. */
2117
2152
  samplingImage: DSImageData;
2118
- }
2119
-
2153
+ }
2154
+
2120
2155
  interface OneDCodeDetails extends BarcodeDetails {
2121
2156
  /** Start characters of the barcode in a byte array, used to identify the beginning of the barcode. */
2122
2157
  startCharsBytes: Array<number>;
@@ -2130,8 +2165,8 @@ interface OneDCodeDetails extends BarcodeDetails {
2130
2165
  middlePatternRange: number;
2131
2166
  /** Position range of the end pattern relative to the barcode's location. */
2132
2167
  endPatternRange: number;
2133
- }
2134
-
2168
+ }
2169
+
2135
2170
  interface PDF417Details extends BarcodeDetails {
2136
2171
  /** Number of rows in the PDF417 barcode. */
2137
2172
  rows: number;
@@ -2145,8 +2180,8 @@ interface PDF417Details extends BarcodeDetails {
2145
2180
  hasRightRowIndicator: boolean;
2146
2181
  /** The codewords array of the PDF417 Code. */
2147
2182
  codewords: Array<number>;
2148
- }
2149
-
2183
+ }
2184
+
2150
2185
  interface QRCodeDetails extends BarcodeDetails {
2151
2186
  /** Number of rows in the QR Code. */
2152
2187
  rows: number;
@@ -2170,8 +2205,8 @@ interface QRCodeDetails extends BarcodeDetails {
2170
2205
  dataMaskPattern: number;
2171
2206
  /** The codewords array of the QR Code. */
2172
2207
  codewords: Array<string>;
2173
- }
2174
-
2208
+ }
2209
+
2175
2210
  interface SimplifiedBarcodeReaderSettings {
2176
2211
  /** Specifies the barcode formats to be detected. */
2177
2212
  barcodeFormatIds: EnumBarcodeFormat;
@@ -2193,8 +2228,8 @@ interface SimplifiedBarcodeReaderSettings {
2193
2228
  barcodeTextRegExPattern: string;
2194
2229
  /** Threshold for reducing the size of large images to speed up processing. If the size of the image's shorter edge exceeds this threshold, the image may be downscaled to decrease processing time. The standard setting is 2300. */
2195
2230
  scaleDownThreshold: number;
2196
- }
2197
-
2231
+ }
2232
+
2198
2233
  /**
2199
2234
  * The `CandidateBarcodeZone` interface represents a candidate barcode zone.
2200
2235
  */
@@ -2203,25 +2238,25 @@ interface CandidateBarcodeZone {
2203
2238
  location: Quadrilateral;
2204
2239
  /** Possible formats of the localized barcode. */
2205
2240
  possibleFormats: EnumBarcodeFormat;
2206
- }
2207
-
2241
+ }
2242
+
2208
2243
  /**
2209
2244
  * The `CandidateBarcodeZonesUnit` interface extends the `IntermediateResultUnit` interface and represents a unit of candidate barcode zones.
2210
2245
  */
2211
2246
  interface CandidateBarcodeZonesUnit extends IntermediateResultUnit {
2212
2247
  /** Array of candidate barcode zones represented as quadrilaterals. */
2213
2248
  candidateBarcodeZones: Array<CandidateBarcodeZone>;
2214
- }
2215
-
2249
+ }
2250
+
2216
2251
  interface ComplementedBarcodeImageUnit extends IntermediateResultUnit {
2217
2252
  imageData: DSImageData;
2218
2253
  location: Quadrilateral;
2219
- }
2220
-
2254
+ }
2255
+
2221
2256
  interface DecodedBarcodesUnit extends IntermediateResultUnit {
2222
2257
  decodedBarcodes: Array<DecodedBarcodeElement>;
2223
- }
2224
-
2258
+ }
2259
+
2225
2260
  /**
2226
2261
  * The `DeformationResistedBarcode` interface represents a deformation-resisted barcode image.
2227
2262
  */
@@ -2232,16 +2267,16 @@ interface DeformationResistedBarcode {
2232
2267
  format: EnumBarcodeFormat;
2233
2268
  /** Location of the deformation-resisted barcode within the image. */
2234
2269
  location: Quadrilateral;
2235
- }
2236
-
2270
+ }
2271
+
2237
2272
  /**
2238
2273
  * The `DeformationResistedBarcodeImageUnit` interface extends the `IntermediateResultUnit` interface and represents a unit that holds the deformation-resisted barcode which includes the corresponding image data, its location, and the barcode format.
2239
2274
  */
2240
2275
  interface DeformationResistedBarcodeImageUnit extends IntermediateResultUnit {
2241
2276
  /** The deformation-resisted barcode. */
2242
2277
  deformationResistedBarcode: DeformationResistedBarcode;
2243
- }
2244
-
2278
+ }
2279
+
2245
2280
  interface LocalizedBarcodeElement extends RegionObjectElement {
2246
2281
  /** Possible formats of the localized barcode. */
2247
2282
  possibleFormats: EnumBarcodeFormat;
@@ -2253,22 +2288,22 @@ interface LocalizedBarcodeElement extends RegionObjectElement {
2253
2288
  moduleSize: number;
2254
2289
  /** A confidence score for the localized barcode detection. */
2255
2290
  confidence: number;
2256
- }
2257
-
2291
+ }
2292
+
2258
2293
  interface LocalizedBarcodesUnit extends IntermediateResultUnit {
2259
2294
  /** An array of `LocalizedBarcodeElement` objects, each representing a localized barcode. */
2260
2295
  localizedBarcodes: Array<LocalizedBarcodeElement>;
2261
- }
2262
-
2296
+ }
2297
+
2263
2298
  interface ScaledBarcodeImageUnit extends IntermediateResultUnit {
2264
2299
  /** Image data of the scaled barcode. */
2265
2300
  imageData: DSImageData;
2266
- }
2267
-
2268
- export { BarcodeReaderModule, EnumBarcodeFormat, EnumDeblurMode, EnumExtendedBarcodeResultType, EnumLocalizationMode, EnumQRCodeErrorCorrectionLevel };
2269
- export type { AztecDetails, BarcodeDetails, BarcodeResultItem, CandidateBarcodeZone, CandidateBarcodeZonesUnit, ComplementedBarcodeImageUnit, DataMatrixDetails, DecodedBarcodeElement, DecodedBarcodesResult, DecodedBarcodesUnit, DeformationResistedBarcode, DeformationResistedBarcodeImageUnit, ExtendedBarcodeResult, LocalizedBarcodeElement, LocalizedBarcodesUnit, OneDCodeDetails, PDF417Details, QRCodeDetails, ScaledBarcodeImageUnit, SimplifiedBarcodeReaderSettings };
2270
-
2271
-
2301
+ }
2302
+
2303
+ export { BarcodeReaderModule, EnumBarcodeFormat, EnumDeblurMode, EnumExtendedBarcodeResultType, EnumLocalizationMode, EnumQRCodeErrorCorrectionLevel };
2304
+ export type { AztecDetails, BarcodeDetails, BarcodeResultItem, CandidateBarcodeZone, CandidateBarcodeZonesUnit, ComplementedBarcodeImageUnit, DataMatrixDetails, DecodedBarcodeElement, DecodedBarcodesResult, DecodedBarcodesUnit, DeformationResistedBarcode, DeformationResistedBarcodeImageUnit, ExtendedBarcodeResult, LocalizedBarcodeElement, LocalizedBarcodesUnit, OneDCodeDetails, PDF417Details, QRCodeDetails, ScaledBarcodeImageUnit, SimplifiedBarcodeReaderSettings };
2305
+
2306
+
2272
2307
  interface ParsedResultItem extends CapturedResultItem {
2273
2308
  /**
2274
2309
  * The code type of the parsed result.
@@ -2313,8 +2348,8 @@ interface ParsedResultItem extends CapturedResultItem {
2313
2348
  * @returns The validation status of the specified field as an EnumValidationStatus value.
2314
2349
  */
2315
2350
  getFieldValidationStatus: (fieldName: string) => EnumValidationStatus;
2316
- }
2317
-
2351
+ }
2352
+
2318
2353
  declare class CodeParser {
2319
2354
  private _instanceID;
2320
2355
  /**
@@ -2357,8 +2392,8 @@ declare class CodeParser {
2357
2392
  * @returns A promise that resolves with a `ParsedResultItem` object which contains the parsed result.
2358
2393
  */
2359
2394
  parse(source: Uint8Array | string | Array<number>, taskSettingName?: string): Promise<ParsedResultItem>;
2360
- }
2361
-
2395
+ }
2396
+
2362
2397
  declare class CodeParserModule {
2363
2398
  /**
2364
2399
  * Returns the version of the CodeParser module.
@@ -2382,8 +2417,8 @@ declare class CodeParserModule {
2382
2417
  loaded: number;
2383
2418
  total: number;
2384
2419
  }) => void;
2385
- }
2386
-
2420
+ }
2421
+
2387
2422
  declare enum EnumMappingStatus {
2388
2423
  /**
2389
2424
  * Indicates that no mapping operation has been initiated.
@@ -2397,8 +2432,8 @@ declare enum EnumMappingStatus {
2397
2432
  * Indicates that the mapping operation failed to complete.
2398
2433
  */
2399
2434
  MS_FAILED = 2
2400
- }
2401
-
2435
+ }
2436
+
2402
2437
  declare enum EnumValidationStatus {
2403
2438
  /**
2404
2439
  * Indicates that no validation has been performed.
@@ -2412,8 +2447,8 @@ declare enum EnumValidationStatus {
2412
2447
  * Indicates that the validation process failed.
2413
2448
  */
2414
2449
  VS_FAILED = 2
2415
- }
2416
-
2450
+ }
2451
+
2417
2452
  declare enum EnumCodeType {
2418
2453
  CT_MRTD_TD1_ID = "MRTD_TD1_ID",
2419
2454
  CT_MRTD_TD2_ID = "MRTD_TD2_ID",
@@ -2427,26 +2462,26 @@ declare enum EnumCodeType {
2427
2462
  CT_AADHAAR = "AADHAAR",
2428
2463
  CT_VIN = "VIN",
2429
2464
  CT_GS1_AI = "GS1_AI"
2430
- }
2431
-
2465
+ }
2466
+
2432
2467
  interface ParsedResult extends CapturedResultBase {
2433
2468
  /**
2434
2469
  * An array of `ParsedResultItem` objects.
2435
2470
  */
2436
2471
  parsedResultItems: Array<ParsedResultItem>;
2437
- }
2438
-
2439
- export { CodeParser, CodeParserModule, EnumCodeType, EnumMappingStatus, EnumValidationStatus };
2440
- export type { ParsedResult, ParsedResultItem };
2441
-
2442
-
2472
+ }
2473
+
2474
+ export { CodeParser, CodeParserModule, EnumCodeType, EnumMappingStatus, EnumValidationStatus };
2475
+ export type { ParsedResult, ParsedResultItem };
2476
+
2477
+
2443
2478
  declare class DocumentNormalizerModule {
2444
2479
  /**
2445
2480
  * Returns the version of the DocumentNormalizer module.
2446
2481
  */
2447
2482
  static getVersion(): string;
2448
- }
2449
-
2483
+ }
2484
+
2450
2485
  /**
2451
2486
  * `EnumImageColourMode` determines the output colour mode of the normalized image.
2452
2487
  */
@@ -2457,8 +2492,8 @@ declare enum EnumImageColourMode {
2457
2492
  ICM_GRAYSCALE = 1,
2458
2493
  /** Output image in binary mode. */
2459
2494
  ICM_BINARY = 2
2460
- }
2461
-
2495
+ }
2496
+
2462
2497
  interface DetectedQuadResultItem extends CapturedResultItem {
2463
2498
  /** The location of the detected quadrilateral within the original image, represented as a quadrilateral shape. */
2464
2499
  location: Quadrilateral;
@@ -2466,8 +2501,8 @@ interface DetectedQuadResultItem extends CapturedResultItem {
2466
2501
  confidenceAsDocumentBoundary: number;
2467
2502
  /** Indicates whether the DetectedQuadResultItem has passed cross verification. */
2468
2503
  crossVerificationStatus: EnumCrossVerificationStatus;
2469
- }
2470
-
2504
+ }
2505
+
2471
2506
  interface DeskewedImageResultItem extends CapturedResultItem {
2472
2507
  /** The image data for the deskewed image result. */
2473
2508
  imageData: DSImageData;
@@ -2478,12 +2513,12 @@ interface DeskewedImageResultItem extends CapturedResultItem {
2478
2513
  toCanvas: () => HTMLCanvasElement;
2479
2514
  toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
2480
2515
  toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
2481
- }
2482
-
2516
+ }
2517
+
2483
2518
  interface EnhancedImageElement extends RegionObjectElement {
2484
2519
  imageData: DSImageData;
2485
- }
2486
-
2520
+ }
2521
+
2487
2522
  interface EnhancedImageResultItem extends CapturedResultItem {
2488
2523
  /** The image data for the enhanced image result. */
2489
2524
  imageData: DSImageData;
@@ -2493,54 +2528,54 @@ interface EnhancedImageResultItem extends CapturedResultItem {
2493
2528
  toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
2494
2529
  /** Converts the enhanced image data into a Blob object of a specified MIME type ('image/png' or 'image/jpeg'). */
2495
2530
  toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
2496
- }
2497
-
2531
+ }
2532
+
2498
2533
  interface EnhancedImageUnit extends IntermediateResultUnit {
2499
2534
  /** An array of `EnhancedImageElement` objects, each representing a piece of the original image after enhancement. */
2500
2535
  enhancedImage: EnhancedImageElement;
2501
- }
2502
-
2536
+ }
2537
+
2503
2538
  interface CandidateQuadEdgesUnit extends IntermediateResultUnit {
2504
2539
  /** An array of candidate edges that may form quadrilaterals, identified during image processing. */
2505
2540
  candidateQuadEdges: Array<Edge>;
2506
- }
2507
-
2541
+ }
2542
+
2508
2543
  interface CornersUnit extends IntermediateResultUnit {
2509
2544
  /** An array of detected corners within the image, identified during image processing. */
2510
2545
  corners: Array<Corner>;
2511
- }
2512
-
2546
+ }
2547
+
2513
2548
  interface DetectedQuadElement extends RegionObjectElement {
2514
2549
  /** A confidence score measuring the certainty that the detected quadrilateral represents the boundary of a document. */
2515
2550
  confidenceAsDocumentBoundary: number;
2516
- }
2517
-
2551
+ }
2552
+
2518
2553
  interface DetectedQuadsUnit extends IntermediateResultUnit {
2519
2554
  /** An array of `DetectedQuadElement` objects, each representing a potential document or area of interest within the image. */
2520
2555
  detectedQuads: Array<DetectedQuadElement>;
2521
- }
2522
-
2556
+ }
2557
+
2523
2558
  interface LongLinesUnit extends IntermediateResultUnit {
2524
2559
  /** An array of long line segments detected within the image. */
2525
2560
  longLines: Array<LineSegment>;
2526
- }
2527
-
2561
+ }
2562
+
2528
2563
  interface LogicLinesUnit extends IntermediateResultUnit {
2529
2564
  /** An array of logic line segments detected within the image. */
2530
2565
  logicLines: Array<LineSegment>;
2531
- }
2532
-
2566
+ }
2567
+
2533
2568
  interface DeskewedImageElement extends RegionObjectElement {
2534
2569
  /** A quadrilateral representing the four corners of the quadrilateral used to deskew the image. */
2535
2570
  sourceLocation: Quadrilateral;
2536
2571
  imageData: DSImageData;
2537
- }
2538
-
2572
+ }
2573
+
2539
2574
  interface DeskewedImageUnit extends IntermediateResultUnit {
2540
2575
  /** The `DeskewedImageElement` objects representing a piece of the original image after deskewing. */
2541
2576
  deskewedImage: DeskewedImageElement;
2542
- }
2543
-
2577
+ }
2578
+
2544
2579
  interface ProcessedDocumentResult extends CapturedResultBase {
2545
2580
  /** An array of `DetectedQuadResultItem` objects, each representing a quadrilateral after document detection. */
2546
2581
  detectedQuadResultItems: Array<DetectedQuadResultItem>;
@@ -2548,8 +2583,8 @@ interface ProcessedDocumentResult extends CapturedResultBase {
2548
2583
  deskewedImageResultItems: Array<DeskewedImageResultItem>;
2549
2584
  /** An array of `EnhancedImageResultItem` objects, each representing a piece of the original image after enhancement. */
2550
2585
  enhancedImageResultItems: Array<EnhancedImageResultItem>;
2551
- }
2552
-
2586
+ }
2587
+
2553
2588
  /**
2554
2589
  * The `SimplifiedDocumentNormalizerSettings` interface defines simplified settings for document detection and normalization.
2555
2590
  */
@@ -2575,12 +2610,21 @@ interface SimplifiedDocumentNormalizerSettings {
2575
2610
  minQuadrilateralAreaRatio: number;
2576
2611
  /** The number of documents expected to be detected.*/
2577
2612
  expectedDocumentsCount: number;
2578
- }
2579
-
2580
- export { DocumentNormalizerModule, EnumImageColourMode };
2581
- export type { CandidateQuadEdgesUnit, CornersUnit, DeskewedImageElement, DeskewedImageResultItem, DeskewedImageUnit, DetectedQuadElement, DetectedQuadResultItem, DetectedQuadsUnit, EnhancedImageElement, EnhancedImageResultItem, EnhancedImageUnit, LogicLinesUnit, LongLinesUnit, ProcessedDocumentResult, SimplifiedDocumentNormalizerSettings };
2582
-
2583
-
2613
+ }
2614
+
2615
+ export { DocumentNormalizerModule, EnumImageColourMode };
2616
+ export type { CandidateQuadEdgesUnit, CornersUnit, DeskewedImageElement, DeskewedImageResultItem, DeskewedImageUnit, DetectedQuadElement, DetectedQuadResultItem, DetectedQuadsUnit, EnhancedImageElement, EnhancedImageResultItem, EnhancedImageUnit, LogicLinesUnit, LongLinesUnit, ProcessedDocumentResult, SimplifiedDocumentNormalizerSettings };
2617
+
2618
+ declare class ImageProcessingModule {
2619
+ /**
2620
+ * Returns the version of the image processing module.
2621
+ */
2622
+ static getVersion(): string;
2623
+ }
2624
+
2625
+ export { ImageProcessingModule };
2626
+
2627
+
2584
2628
  declare class LabelRecognizerModule {
2585
2629
  #private;
2586
2630
  /**
@@ -2609,8 +2653,8 @@ declare class LabelRecognizerModule {
2609
2653
  * @param dataPath specifies the path to find the data file. If not specified, the default path points to the package “dynamsoft-capture-vision-data”.
2610
2654
  */
2611
2655
  static loadOverlappingCharsData(dataName: string, dataPath?: string): Promise<ErrorInfo>;
2612
- }
2613
-
2656
+ }
2657
+
2614
2658
  interface CharacterResult {
2615
2659
  /** The highest confidence character recognized. */
2616
2660
  characterH: string;
@@ -2626,8 +2670,8 @@ interface CharacterResult {
2626
2670
  characterLConfidence: number;
2627
2671
  /** The location of the recognized character within the image. */
2628
2672
  location: Quadrilateral;
2629
- }
2630
-
2673
+ }
2674
+
2631
2675
  interface TextLineResultItem extends CapturedResultItem {
2632
2676
  /** The recognized text of the line. */
2633
2677
  text: string;
@@ -2641,8 +2685,8 @@ interface TextLineResultItem extends CapturedResultItem {
2641
2685
  specificationName: string;
2642
2686
  /** The recognized raw text of the line. */
2643
2687
  rawText: string;
2644
- }
2645
-
2688
+ }
2689
+
2646
2690
  declare function filterVINResult(vinItem: TextLineResultItem): string;
2647
2691
  /**
2648
2692
  * check if the vin code is valid
@@ -2673,8 +2717,8 @@ declare const utilsFuncs: {
2673
2717
  checkValidMRP: typeof checkValidMRP;
2674
2718
  checkValidMRV: typeof checkValidMRV;
2675
2719
  checkValidIDCard: typeof checkValidIDCard;
2676
- };
2677
-
2720
+ };
2721
+
2678
2722
  /**
2679
2723
  * Enumerates the status of a raw text line.
2680
2724
  */
@@ -2685,22 +2729,22 @@ declare enum EnumRawTextLineStatus {
2685
2729
  RTLS_RECOGNITION_FAILED = 1,
2686
2730
  /** Successfully recognized. */
2687
2731
  RTLS_RECOGNITION_SUCCEEDED = 2
2688
- }
2689
-
2732
+ }
2733
+
2690
2734
  interface LocalizedTextLineElement extends RegionObjectElement {
2691
2735
  /** Quadrilaterals for each character in the text line. */
2692
2736
  characterQuads: Array<Quadrilateral>;
2693
2737
  /** The row number of the text line, starting from 1. */
2694
2738
  rowNumber: number;
2695
- }
2696
-
2739
+ }
2740
+
2697
2741
  interface LocalizedTextLinesUnit extends IntermediateResultUnit {
2698
2742
  /** An array of `LocalizedTextLineElement` objects, each representing a localized text line. */
2699
2743
  localizedTextLines: Array<LocalizedTextLineElement>;
2700
2744
  /** An array of `AuxiliaryRegionElement` objects, each representing an auxiliary region. */
2701
2745
  auxiliaryRegionElements: Array<AuxiliaryRegionElement>;
2702
- }
2703
-
2746
+ }
2747
+
2704
2748
  interface RecognizedTextLineElement extends RegionObjectElement {
2705
2749
  /** The recognized text of the line. */
2706
2750
  text: string;
@@ -2714,15 +2758,15 @@ interface RecognizedTextLineElement extends RegionObjectElement {
2714
2758
  specificationName: string;
2715
2759
  /** The recognized raw text of the line. */
2716
2760
  rawText: string;
2717
- }
2718
-
2761
+ }
2762
+
2719
2763
  interface RecognizedTextLinesResult extends CapturedResultBase {
2720
2764
  /**
2721
2765
  * An array of `TextLineResultItem` objects, each representing a recognized text line within the original image.
2722
2766
  */
2723
2767
  textLineResultItems: Array<TextLineResultItem>;
2724
- }
2725
-
2768
+ }
2769
+
2726
2770
  interface SimplifiedLabelRecognizerSettings {
2727
2771
  /** Name of the character model used for recognition. */
2728
2772
  characterModelName: string;
@@ -2735,31 +2779,34 @@ interface SimplifiedLabelRecognizerSettings {
2735
2779
  /**
2736
2780
  * Threshold for reducing the size of large images to speed up processing. If the size of the image's shorter edge exceeds this threshold, the image may be downscaled to decrease processing time. The standard setting is 2300. */
2737
2781
  scaleDownThreshold: number;
2738
- }
2739
-
2782
+ }
2783
+
2740
2784
  interface BufferedCharacterItem {
2741
2785
  /** The buffered character value. */
2742
2786
  character: string;
2743
2787
  /** The image data of the buffered character. */
2744
2788
  imageData: DSImageData;
2745
2789
  /** An array of features, each feature object contains feature id and value of the buffered character.*/
2746
- features: Map<number, number>;
2747
- }
2748
-
2790
+ features: Array<{
2791
+ id: number;
2792
+ value: number;
2793
+ }>;
2794
+ }
2795
+
2749
2796
  interface CharacterCluster {
2750
2797
  /** The character value of the cluster. */
2751
2798
  character: string;
2752
2799
  /** The mean of the cluster. */
2753
2800
  mean: BufferedCharacterItem;
2754
- }
2755
-
2801
+ }
2802
+
2756
2803
  interface BufferedCharacterItemSet {
2757
2804
  /** An array of BufferedCharacterItem. */
2758
2805
  items: Array<BufferedCharacterItem>;
2759
2806
  /** An array of CharacterCluster. */
2760
2807
  characterClusters: Array<CharacterCluster>;
2761
- }
2762
-
2808
+ }
2809
+
2763
2810
  /**
2764
2811
  * The `RawTextLine` represents a text line in an image. It can be in one of the following states:
2765
2812
  * - `TLS_LOCALIZED`: Localized but recognition not performed.
@@ -2781,27 +2828,27 @@ interface RawTextLine {
2781
2828
  location: Quadrilateral;
2782
2829
  /** The status of a raw text line.*/
2783
2830
  status: EnumRawTextLineStatus;
2784
- }
2785
-
2831
+ }
2832
+
2786
2833
  interface RawTextLinesUnit extends IntermediateResultUnit {
2787
2834
  /** An array of RawTextLine. */
2788
2835
  rawTextlines: Array<RawTextLine>;
2789
- }
2790
-
2836
+ }
2837
+
2791
2838
  interface RecognizedTextLinesUnit extends IntermediateResultUnit {
2792
2839
  recognizedTextLines: Array<RecognizedTextLineElement>;
2793
- }
2794
-
2795
- export { EnumRawTextLineStatus, LabelRecognizerModule, utilsFuncs };
2796
- export type { BufferedCharacterItem, BufferedCharacterItemSet, CharacterCluster, CharacterResult, LocalizedTextLineElement, LocalizedTextLinesUnit, RawTextLine, RawTextLinesUnit, RecognizedTextLineElement, RecognizedTextLinesResult, RecognizedTextLinesUnit, SimplifiedLabelRecognizerSettings, TextLineResultItem };
2797
-
2840
+ }
2841
+
2842
+ export { EnumRawTextLineStatus, LabelRecognizerModule, utilsFuncs };
2843
+ export type { BufferedCharacterItem, BufferedCharacterItemSet, CharacterCluster, CharacterResult, LocalizedTextLineElement, LocalizedTextLinesUnit, RawTextLine, RawTextLinesUnit, RecognizedTextLineElement, RecognizedTextLinesResult, RecognizedTextLinesUnit, SimplifiedLabelRecognizerSettings, TextLineResultItem };
2844
+
2798
2845
  declare class LicenseModule {
2799
2846
  /**
2800
2847
  * Returns the version of the License module.
2801
2848
  */
2802
2849
  static getVersion(): string;
2803
- }
2804
-
2850
+ }
2851
+
2805
2852
  declare class LicenseManager {
2806
2853
  private static setLicenseServer;
2807
2854
  static _pLoad: any;
@@ -2828,7 +2875,7 @@ declare class LicenseManager {
2828
2875
  */
2829
2876
  static initLicense(license: string, options?: {
2830
2877
  executeNow: boolean;
2831
- } | boolean): void | Promise<void>;
2878
+ } | boolean): Promise<void>;
2832
2879
  /**
2833
2880
  * The following methods should be called before `initLicense`.
2834
2881
  */
@@ -2841,8 +2888,8 @@ declare class LicenseManager {
2841
2888
  */
2842
2889
  static getDeviceUUID(): Promise<string>;
2843
2890
  static _e: boolean;
2844
- }
2845
-
2891
+ }
2892
+
2846
2893
  interface InitConfig {
2847
2894
  pk: string;
2848
2895
  dm: string;
@@ -2854,21 +2901,21 @@ interface InitConfig {
2854
2901
  ic?: any;
2855
2902
  mlo?: any;
2856
2903
  pv?: any;
2857
- }
2858
-
2859
- export { LicenseManager, LicenseModule };
2860
- export type { InitConfig };
2861
-
2862
-
2863
-
2864
-
2904
+ }
2905
+
2906
+ export { LicenseManager, LicenseModule };
2907
+ export type { InitConfig };
2908
+
2909
+
2910
+
2911
+
2865
2912
  declare class UtilityModule {
2866
2913
  /**
2867
2914
  * Returns the version of the Utility module.
2868
2915
  */
2869
2916
  static getVersion(): string;
2870
- }
2871
-
2917
+ }
2918
+
2872
2919
  type CEdge = [Point, Point];
2873
2920
  type CQuadrilateral = Quadrilateral & {
2874
2921
  area: number;
@@ -2889,8 +2936,8 @@ type CrossVerificationCriteria = {
2889
2936
  };
2890
2937
  type CapturedResultMap<T> = {
2891
2938
  [K in EnumCapturedResultItemType]?: T;
2892
- };
2893
-
2939
+ };
2940
+
2894
2941
  declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
2895
2942
  #private;
2896
2943
  constructor();
@@ -2997,8 +3044,8 @@ declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
2997
3044
  */
2998
3045
  getMaxOverlappingFrames(resultItemType: EnumCapturedResultItemType): number;
2999
3046
  latestOverlappingFilter(result: any): void;
3000
- }
3001
-
3047
+ }
3048
+
3002
3049
  declare class ImageIO {
3003
3050
  #private;
3004
3051
  /**
@@ -3035,7 +3082,7 @@ declare class ImageIO {
3035
3082
  *
3036
3083
  * @returns A promise that resolves with an object containing the image data as a Uint8Array and the file format.
3037
3084
  */
3038
- static saveToMemory(image: Blob, fileFormat: string): Promise<number>;
3085
+ static saveToMemory(image: Blob, fileFormat?: string): Promise<number>;
3039
3086
  /**
3040
3087
  * This method reads an image from a Base64-encoded string. The image format is automatically detected based on the content of the string.
3041
3088
  *
@@ -3052,9 +3099,9 @@ declare class ImageIO {
3052
3099
  *
3053
3100
  * @returns A promise that resolves with a Base64-encoded string representing the image.
3054
3101
  */
3055
- static saveToBase64String(image: Blob | DSImageData, fileFormat: string): Promise<string>;
3056
- }
3057
-
3102
+ static saveToBase64String(image: Blob | DSImageData, fileFormat?: string): Promise<string>;
3103
+ }
3104
+
3058
3105
  declare class ImageDrawer {
3059
3106
  /**
3060
3107
  * This method draws various shapes on an image, and save it in PNG format.
@@ -3069,8 +3116,8 @@ declare class ImageDrawer {
3069
3116
  * @returns A promise that resolves with the saved File object.
3070
3117
  */
3071
3118
  static drawOnImage(image: Blob | string | DSImageData, drawingItem: Array<Quadrilateral> | Quadrilateral | Array<LineSegment> | LineSegment | Array<Contour> | Contour | Array<Corner> | Corner | Array<Edge> | Edge, type: "quads" | "lines" | "contours" | "corners" | "edges", color?: number, thickness?: number, name?: string, download?: boolean): Promise<DSImageData>;
3072
- }
3073
-
3119
+ }
3120
+
3074
3121
  declare enum EnumFilterType {
3075
3122
  /**High-pass filter: Enhances edges and fine details by attenuating low-frequency components.*/
3076
3123
  FT_HIGH_PASS = 0,
@@ -3078,8 +3125,8 @@ declare enum EnumFilterType {
3078
3125
  FT_SHARPEN = 1,
3079
3126
  /**Smooth (blur) filter: Reduces noise and detail by averaging pixel values, creating a softening effect.*/
3080
3127
  FT_SMOOTH = 2
3081
- }
3082
-
3128
+ }
3129
+
3083
3130
  declare class ImageProcessor {
3084
3131
  /**
3085
3132
  * Crops an image using a rectangle or quadrilateral.
@@ -3146,29 +3193,142 @@ declare class ImageProcessor {
3146
3193
  * @returns A promise that resolves with the cropped and deskewed image data.
3147
3194
  */
3148
3195
  static cropAndDeskewImage(image: Blob | DSImageData, roi: Quadrilateral, dstWidth?: number, dstHeight?: number, padding?: number): Promise<DSImageData>;
3149
- }
3150
-
3151
- export { EnumFilterType, ImageDrawer, ImageIO, ImageProcessor, MultiFrameResultCrossFilter, UtilityModule };
3152
- export type { CBarcodeResultItem, CDecodedBarcodeElement, CEdge, CLocalizedBarcodeElement, CQuadrilateral, CapturedResultMap, CrossVerificationCriteria, resultItemTypeString };
3153
-
3154
-
3155
-
3156
-
3157
-
3158
-
3159
-
3160
-
3161
-
3162
-
3163
-
3164
-
3165
-
3166
-
3167
-
3168
-
3169
-
3170
-
3171
-
3196
+ }
3197
+
3198
+ /**
3199
+ * Strategy for the layout engine to organize quadrilaterals.
3200
+ */
3201
+ declare enum EnumLayoutPattern {
3202
+ LP_UNKNOWN = 0,// Algorithm automatically detects the best layout pattern.
3203
+ LP_LINES = 1,// Elements are organized into sequential lines (rows or columns).
3204
+ LP_MATRIX = 2
3205
+ }
3206
+
3207
+ /**
3208
+ * Configuration for a specific orientation axis.
3209
+ * Axis 0 is primary, axis 1 is secondary.
3210
+ */
3211
+ interface LayoutAxis {
3212
+ /** Expected number of elements along this axis. -1 means auto-detect. */
3213
+ elementCount: number;
3214
+ /** Whether the layout uses an offset / staggered pattern. */
3215
+ isStaggered: boolean;
3216
+ /** Target angle in [0, 180]. -1 means auto-detect. */
3217
+ angle: number;
3218
+ /** Whether equal spacing is enforced along this axis. */
3219
+ isEqualSpacing: boolean;
3220
+ /**
3221
+ * Spacing between elements along this axis.
3222
+ * -1 means auto-detect.
3223
+ */
3224
+ spacing: number;
3225
+ /** Interpretation of the spacing value. */
3226
+ spacingUnit: EnumMeasureUnit;
3227
+ }
3228
+
3229
+ /**
3230
+ * Input parameters to guide layout analysis.
3231
+ */
3232
+ interface LayoutAnalysisParameter {
3233
+ /** Desired layout pattern. LP_UNKNOWN means auto-detect. */
3234
+ pattern: EnumLayoutPattern;
3235
+ /** Configuration for primary and secondary axes. */
3236
+ axes: [LayoutAxis, LayoutAxis];
3237
+ /**
3238
+ * Width of the source image in pixels.
3239
+ * 0 means no boundary check.
3240
+ */
3241
+ inputImageWidth: number;
3242
+ /**
3243
+ * Height of the source image in pixels.
3244
+ * 0 means no boundary check.
3245
+ */
3246
+ inputImageHeight: number;
3247
+ }
3248
+
3249
+ /**
3250
+ * Origin of the element.
3251
+ */
3252
+ declare enum EnumLayoutElementSource {
3253
+ LES_NONE = 0,// No element exists at this logical grid position (used for alignment in non-uniform rows).
3254
+ LES_INPUT = 1,// Element is provided from the original input array.
3255
+ LES_INFERRED = 2
3256
+ }
3257
+
3258
+ /**
3259
+ * Represents an element in the analyzed layout.
3260
+ */
3261
+ interface LayoutElement {
3262
+ /** Geometric coordinates of the element. */
3263
+ quad: Quadrilateral;
3264
+ /** Origin of this element. */
3265
+ source: EnumLayoutElementSource;
3266
+ }
3267
+
3268
+ /**
3269
+ * Comprehensive results of layout analysis.
3270
+ */
3271
+ interface LayoutAnalysisResult {
3272
+ /** Newly generated quadrilaterals. */
3273
+ inferredQuads: Array<Quadrilateral>;
3274
+ /** Number of rows in the logical grid. */
3275
+ rowCount: number;
3276
+ /** Maximum number of columns across all rows. */
3277
+ colCount: number;
3278
+ /**
3279
+ * 2D layout grid.
3280
+ * In line mode, shorter rows can be padded with LES_NONE elements.
3281
+ */
3282
+ elements: Array<Array<LayoutElement>>;
3283
+ /** Actual layout pattern detected by the engine. */
3284
+ detectedPattern: EnumLayoutPattern;
3285
+ /**
3286
+ * Error information.
3287
+ * errorCode indicates the execution result.
3288
+ * errorString provides a human-readable description.
3289
+ * For successful execution, errorCode should be 0 and
3290
+ * errorString may be empty.
3291
+ */
3292
+ errorInfo: ErrorInfo;
3293
+ }
3294
+
3295
+ /**
3296
+ * High-performance layout analysis engine.
3297
+ */
3298
+ declare class LayoutAnalyzer {
3299
+ /**
3300
+ * Performs layout analysis on the input quadrilaterals.
3301
+ *
3302
+ * @param inputQuads Input quadrilaterals.
3303
+ * @param parameter Optional analysis constraints.
3304
+ * @returns A promise that resolves with the analysis result.
3305
+ */
3306
+ static analyze(inputQuads: Array<Quadrilateral>, parameter?: LayoutAnalysisParameter): Promise<LayoutAnalysisResult>;
3307
+ }
3308
+
3309
+ export { EnumFilterType, EnumLayoutElementSource, EnumLayoutPattern, ImageDrawer, ImageIO, ImageProcessor, LayoutAnalyzer, MultiFrameResultCrossFilter, UtilityModule };
3310
+ export type { CBarcodeResultItem, CDecodedBarcodeElement, CEdge, CLocalizedBarcodeElement, CQuadrilateral, CapturedResultMap, CrossVerificationCriteria, LayoutAnalysisParameter, LayoutAnalysisResult, LayoutAxis, LayoutElement, resultItemTypeString };
3311
+
3312
+
3313
+
3314
+
3315
+
3316
+
3317
+
3318
+
3319
+
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+
3326
+
3327
+
3328
+
3329
+
3330
+
3331
+
3172
3332
  declare enum EnumScanMode {
3173
3333
  SM_SINGLE = 0,
3174
3334
  SM_MULTI_UNIQUE = 1
@@ -3177,8 +3337,8 @@ declare enum EnumResultStatus {
3177
3337
  RS_SUCCESS = 0,
3178
3338
  RS_CANCELLED = 1,
3179
3339
  RS_FAILED = 2
3180
- }
3181
-
3340
+ }
3341
+
3182
3342
  type CacheKeys = "dceUI" | "dbsUI" | "presetTemplates" | "templateFile";
3183
3343
  type CameraSwitchControlMode = "hidden" | "listAll" | "toggleFrontBack";
3184
3344
  type PathConfig = {
@@ -3236,8 +3396,8 @@ interface BarcodeScannerConfig {
3236
3396
  cvRouter: CaptureVisionRouter;
3237
3397
  }) => void;
3238
3398
  onCameraOpenFailed?: (ex: Error) => void;
3239
- }
3240
-
3399
+ }
3400
+
3241
3401
  type ResultStatus = {
3242
3402
  code: EnumResultStatus;
3243
3403
  message: string;
@@ -3257,8 +3417,8 @@ interface UtilizedTemplateNames {
3257
3417
  single?: string;
3258
3418
  multi_unique?: string;
3259
3419
  image?: string;
3260
- }
3261
-
3420
+ }
3421
+
3262
3422
  declare class BarcodeScanner {
3263
3423
  #private;
3264
3424
  private _cameraEnhancer;
@@ -3270,1253 +3430,1295 @@ declare class BarcodeScanner {
3270
3430
  launch(): Promise<BarcodeScanResult>;
3271
3431
  decode(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement, templateName?: string): Promise<CapturedResult>;
3272
3432
  dispose(): void;
3273
- }
3274
-
3275
- export { BarcodeScanner, EnumResultStatus, EnumScanMode, isPathConfig };
3276
- export type { BarcodeScanResult, BarcodeScannerConfig, CacheKeys, ResultStatus, ToolbarButtonConfig, UtilizedTemplateNames };
3277
- interface CameraInfo extends InputDeviceInfo {
3278
- trackLabel: string;
3279
- capabilities: DMMoreMediaTrackCapabilities;
3280
- isFront: boolean;
3281
- }
3282
- interface DMMoreMediaTrackCapabilities extends MediaTrackCapabilities {
3283
- focusMode?: ('continuous' | 'single-shot' | 'manual')[];
3284
- focusDistance?: {
3285
- max?: number;
3286
- min: number;
3287
- };
3288
- zoom?: {
3289
- max: number;
3290
- min: number;
3291
- };
3292
- torch?: true;
3293
- }
3294
- type CameraZsFunc = (this: Camera, ...argArray: any[]) => void | any;
3295
- interface Camera {
3296
- /**
3297
- * The `opened` event is triggered when the camera `open()` from the `paused`/`closed`
3298
- * or when call `requestResolution()` and camera is `opened`.
3299
- */
3300
- addEventListener(type: 'opened', listener: (this: Camera) => void | any): void;
3301
- removeEventListener(type: 'opened', listener: (this: Camera) => void | any): void;
3302
- /** The `closed` event is triggered when camera is `closed`. */
3303
- addEventListener(type: 'closed', listener: (this: Camera) => void | any): void;
3304
- removeEventListener(type: 'closed', listener: (this: Camera) => void | any): void;
3305
- }
3306
- declare class Camera {
3307
- static _cameraNameMatcher: string[][];
3308
- static _mapDeviceInfo: {
3309
- [deviceId: string]: CameraInfo;
3310
- };
3311
- _coreShell: HTMLElement;
3312
- _video: HTMLVideoElement;
3313
- _coreInnerLayer: HTMLElement;
3314
- _coreOuterLayer: HTMLElement;
3315
- _regionBoxWrapper: HTMLElement;
3316
- _regionBoxMask: HTMLElement;
3317
- _regionBoxBorder: HTMLElement;
3318
- _objectFit: 'contain' | 'cover' | 'fill';
3319
- _uiInlineScript2Blob: boolean;
3320
- _uiInternalCss2Blob: boolean;
3321
- _uiInternalCss2ExistedSheet: boolean;
3322
- _ui?: HTMLElement;
3323
- _pOpen: Promise<void> & {
3324
- isPending: boolean;
3325
- resolve: () => void;
3326
- reject: () => void;
3327
- };
3328
- _getUserMediaTimeout: number;
3329
- _paused: boolean;
3330
- _shouldClose: boolean;
3331
- _cameraChangedWhenPaused: boolean;
3332
- _requestedCamera: CameraPreset | MediaTrackConstraints;
3333
- _requestedResolution: MediaTrackConstraints;
3334
- _regionBox: {
3335
- width?: number;
3336
- height?: number;
3337
- unit: 'view-size' | 'view-min';
3338
- center: {
3339
- x: number;
3340
- y: number;
3341
- };
3342
- maskStyle?: Partial<CSSStyleDeclaration>;
3343
- borderStyle?: Partial<CSSStyleDeclaration>;
3344
- innerUi?: Node | NodeList;
3345
- };
3346
- _eventListeners: {
3347
- [key: string]: Set<Function>;
3348
- };
3349
- static _delayBeforeEnumerateDevices: number;
3350
- static _delayBeforeGetUserMedia: number;
3351
- static _delayBeforeApplyConstraints: number;
3352
- static _countEnsureResolution: number;
3353
- static _videoPlayTimeout: number;
3354
- static _bReopenWhenChangeResolution: boolean;
3355
- static _arrConstructors: CameraZsFunc[];
3356
- static _arrOnOpen: CameraZsFunc[];
3357
- static _arrBeforeClose: CameraZsFunc[];
3358
- static _arrOnClose: CameraZsFunc[];
3359
- constructor();
3360
- _taskIdIOSResizeProblem: any;
3361
- _updateObjectFit(): void;
3362
- get video(): HTMLVideoElement;
3363
- get track(): MediaStreamTrack;
3364
- get objectFit(): "contain" | "cover" | "fill";
3365
- set objectFit(value: "contain" | "cover" | "fill");
3366
- /**
3367
- * While `ui` can accept various types during assignment, its value will always be an `HTMLElement` upon retrieval.
3368
- */
3369
- get ui(): HTMLElement;
3370
- /**
3371
- * Generally, the `value` can be an `HTMLElement`, `DocumentFragment` or a string of serialized html.
3372
- * This `ui` or one of its descendants, must have class `dm-camera-core-container`.
3373
- * If the `value` already contains the `coreShell`, `coreShell` does not move.
3374
- * Otherwise the `coreShell` of `DMCamera` is appended to the first element that has the class `dm-camera-core-container`.
3375
- *
3376
- * If `value` is a falsy value, `coreShell` is used as `ui`.
3377
- **/
3378
- set ui(value: HTMLElement | DocumentFragment | string | undefined);
3379
- get status(): CameraStatus;
3380
- get requestedCamera(): "back" | "front" | "macro-back" | "quick-back" | "customized-video" | MediaTrackConstraints;
3381
- get requestedResolution(): {
3382
- width: number;
3383
- height: number;
3384
- };
3385
- get currentCamera(): CameraInfo;
3386
- get currentResolution(): {
3387
- width: number;
3388
- height: number;
3389
- };
3390
- /** width 0 ~ 1, height 0 ~ 1, center.x -0.5 ~ 0.5, center.y -0.5 ~ 0.5 */
3391
- get regionBox(): {
3392
- width?: number;
3393
- height?: number;
3394
- unit: "view-size" | "view-min";
3395
- center: {
3396
- x: number;
3397
- y: number;
3398
- };
3399
- maskStyle?: Partial<CSSStyleDeclaration>;
3400
- borderStyle?: Partial<CSSStyleDeclaration>;
3401
- innerUi?: Node | NodeList;
3402
- };
3403
- onOpened: (camera: Camera) => void | any;
3404
- static hasCamera(): Promise<boolean>;
3405
- static hasMacroCamera(): Promise<boolean>;
3406
- static hasFrontCamera(): Promise<boolean>;
3407
- /**
3408
- * tips:
3409
- * Call getDeviceInfos() will ask for camera permission, then open camera and close internally.
3410
- * 2nd time open camera will be a lot faster.
3411
- **/
3412
- static getDeviceInfos(): Promise<Readonly<CameraInfo>[]>;
3413
- static _setCapabilities(deviceInfos: CameraInfo[]): Promise<void>;
3414
- /** `pause()` is an idempotent operation, you can call it repeatedly without error. */
3415
- pause(): Promise<void>;
3416
- /** `close()` is an idempotent operation, you can call it repeatedly without error. */
3417
- close(): Promise<void>;
3418
- /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3419
- requestCamera(cameraPreset: CameraPreset): Promise<void>;
3420
- /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3421
- requestCamera(deviceId: string): Promise<void>;
3422
- /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3423
- requestCamera(deviceInfo: CameraInfo): Promise<void>;
3424
- /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3425
- requestCamera(constraints: MediaTrackConstraints): Promise<void>;
3426
- /**
3427
- * If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally.
3428
- * @param notRequired Let browser choose use what camera.
3429
- * */
3430
- requestCamera(notRequired: null): Promise<void>;
3431
- /**
3432
- * If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally.
3433
- * @param resetToDefault Use SDK's dafault logic.
3434
- * */
3435
- requestCamera(resetToDefault: undefined): Promise<void>;
3436
- /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3437
- requestCamera(camera: string | CameraInfo | MediaTrackConstraints): Promise<void>;
3438
- requestResolution(width: number, height?: number): Promise<void>;
3439
- requestResolution(widthHeightPair: [number, number] | number[]): Promise<void>;
3440
- requestResolution(constraints: {
3441
- width?: ConstrainULong;
3442
- height?: ConstrainULong;
3443
- aspectRatio?: ConstrainDouble;
3444
- }): Promise<void>;
3445
- requestResolution(notRequired: null): Promise<void>;
3446
- requestResolution(resetToDefault: undefined): Promise<void>;
3447
- /**
3448
- * Similar to `camera.track.applyConstraints`,
3449
- * but auto add constraints of original camera and original resolution.
3450
- * Primarily used for advanced camera settings like focusDistance, zoom, colorTemperature.
3451
- * Don't directly change camera or resolution by this API,
3452
- * use `requestCamera` and `requestResolution` instead.
3453
- * Set camera or resolution using `applyConstraints` will result in undefined behavior.
3454
- */
3455
- applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
3456
- /**
3457
- * @param config
3458
- * `x`/`y`/`width`/`height` is normally `0 ~ video.videoWidth` or `0 ~ video.videoHeight`,
3459
- * same as [drawImage](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage).
3460
- * If values contain decimals, it will be rounded.
3461
- * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3462
- * The same logic applies to `height`.
3463
- */
3464
- getFrame(config?: {
3465
- x?: number;
3466
- y?: number;
3467
- width?: number;
3468
- height?: number;
3469
- reusedContext?: CanvasRenderingContext2D;
3470
- }): HTMLCanvasElement;
3471
- /**
3472
- * @param regionBox width 0 ~ 1, height 0 ~ 1, center.x -0.5 ~ 0.5, center.y -0.5 ~ 0.5
3473
- * TODO: support unit pixel
3474
- */
3475
- setRegionBox(regionBox: {
3476
- width?: number;
3477
- height?: number;
3478
- unit?: 'view-size' | 'view-min';
3479
- center?: {
3480
- x: number;
3481
- y: number;
3482
- };
3483
- maskStyle?: Partial<CSSStyleDeclaration>;
3484
- borderStyle?: Partial<CSSStyleDeclaration>;
3485
- innerUi?: Node | NodeList | DocumentFragment | Node[] | string;
3486
- }): void;
3487
- /**
3488
- * Add a canvas dynamically keep with the same size of the video resolution, as a overlay.
3489
- * You can remove it by `camera.video.parentElement.removeChild(thatCanvas)` or `thatCanvas.remove()`.
3490
- * When you add multiple canvases, you can also use `camera.video.parentElement` to control stack order.
3491
- */
3492
- addCanvas(): HTMLCanvasElement;
3493
- _updateCanvasSize(): void;
3494
- _callOpenedListeners(): void;
3495
- /**
3496
- * Convert video x/y to absolute left/top in `document.body`.
3497
- * So you can easily add a overlay with absolute position.
3498
- * Processing multiple points at once has higher performance than calling multiple times.
3499
- */
3500
- videoXY2AbsoluteLT(points: {
3501
- x: number;
3502
- y: number;
3503
- }[]): {
3504
- left: number;
3505
- top: number;
3506
- }[];
3507
- /**
3508
- * Convert video x/y to fixed left/top in `document.body`.
3509
- * So you can easily add a overlay with fixed position.
3510
- * Processing multiple points at once has higher performance than calling multiple times.
3511
- */
3512
- videoXY2FixedLT(points: {
3513
- x: number;
3514
- y: number;
3515
- }[]): {
3516
- left: number;
3517
- top: number;
3518
- }[];
3519
- /**
3520
- * @param isConsiderRegionBox Default is `false`. Only consider the visible area in the region box.
3521
- * @param rounded Default is `false`. Controls whether the result should be rounded.
3522
- * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3523
- * The same logic applies to `height`.
3524
- * @returns
3525
- * `x`/`width` is `0 ~ video.videoWidth`, `y`/`height` is `0 ~ video.videoHeight`.
3526
- */
3527
- getVisibleAreaInVideoXY(config?: {
3528
- isConsiderRegionBox?: boolean;
3529
- rounded?: boolean;
3530
- }): {
3531
- x: number;
3532
- y: number;
3533
- width: number;
3534
- height: number;
3535
- };
3536
- }
3537
- type CameraStatus = 'closed' | 'opening' | 'opened' | 'paused' | 'closing';
3538
- declare const ArrCameraPreset: readonly ["back", "front", "macro-back", "quick-back", "customized-video"];
3539
- type CameraPreset = typeof ArrCameraPreset[number];
3540
-
3541
-
3542
- interface Camera {
3543
- correctAdvancedConstraint(constraints?: MediaTrackConstraints): MediaTrackConstraints;
3544
- }
3545
-
3546
-
3547
- interface Camera {
3548
- _softZoom: {
3549
- zoom: number;
3550
- center: {
3551
- x: number;
3552
- y: number;
3553
- };
3554
- };
3555
- get softZoom(): {
3556
- zoom: number;
3557
- center: {
3558
- x: number;
3559
- y: number;
3560
- };
3561
- };
3562
- _isMirrored: boolean;
3563
- get isMirrored(): boolean;
3564
- set isMirrored(value: boolean);
3565
- maxZoom4GestureWheel: number;
3566
- _lastZoomTime: number;
3567
- _mapZoomTouchs: Map<number, {
3568
- x: number;
3569
- y: number;
3570
- }>;
3571
- _gestureZoomListener: EventListener;
3572
- get enableGestureZoom(): boolean;
3573
- set enableGestureZoom(value: boolean);
3574
- _wheelZoomListener: EventListener;
3575
- get enableWheelZoom(): boolean;
3576
- set enableWheelZoom(value: boolean);
3577
- getZoomRange(): {
3578
- min: number;
3579
- max: number;
3580
- } | undefined;
3581
- setZoom(zoom: number): Promise<void>;
3582
- /**
3583
- * Js software-level zoom.
3584
- * It does not rely on camera device and camera driver support for zoom.
3585
- * @param center
3586
- * zoomed camera center in orignal frame.
3587
- * `x`: -0.5 ~ 0.5, `y`: -0.5 ~ 0.5.
3588
- * @param limit
3589
- * limit `zoom` >= 1.
3590
- * limit the center point position according to `zoom`,
3591
- * so zoomed frame is inside video boundary;
3592
- */
3593
- setSoftZoom(zoom: number, config?: {
3594
- center?: {
3595
- x: number;
3596
- y: number;
3597
- };
3598
- limit?: boolean;
3599
- }): void;
3600
- _changeZoomByWheel(ev: WheelEvent): void;
3601
- _changeZoomByTouch(ev: TouchEvent): void;
3602
- /** The `zoom` event is triggered when zoom updated via a touch gesture or mouse wheel. */
3603
- addEventListener(type: 'zoom', listener: (this: Camera, softZoom?: {
3604
- zoom: number;
3605
- center: {
3606
- x: number;
3607
- y: number;
3608
- };
3609
- }) => void | any): void;
3610
- removeEventListener(type: 'zoom', listener: (this: Camera, softZoom?: {
3611
- zoom: number;
3612
- center: {
3613
- x: number;
3614
- y: number;
3615
- };
3616
- }) => void | any): void;
3617
- }
3618
-
3619
- interface AdvancedFocusParameters {
3620
- minFocusDistanceLimit?: number;
3621
- maxFocusDistanceLimit?: number;
3622
- firstStepWaitDuration?: number;
3623
- coarseStepWaitDuration?: number;
3624
- switchStepWaitDuration?: number;
3625
- fineStepWaitDuration?: number;
3626
- maxStepCount?: number;
3627
- /** value < 0 means no never */
3628
- backToContinousDuration?: number;
3629
- /** The focus width and height, 0 ~ 1, represents the ratio of the length to the `Math.min(video.videoWidth, video.videoHeight)` */
3630
- focusWH?: number;
3631
- /** From far to near, 0 ~ 1. The closer to 1, the more sensitive but more slow. */
3632
- coarseTuneRate?: number;
3633
- /**
3634
- * 0 ~ 1.
3635
- * When the correct focus is closer, the far focus contrast data is unreliable
3636
- * and requires a certain degree of error tolerance.
3637
- * When closer to 1, it will be more sensitive to contrast changes and may also cause the focus to be too far.
3638
- * When closer to 0, there will be more error tolerance,
3639
- * and it may also cause the focus to be too close and the process to be too slow.
3640
- **/
3641
- coarseTuneTolerance?: number;
3642
- /** From near to far, 1 ~ 1.xx. The closer to 1, the more sensitive but more slow. */
3643
- fineTuneRate?: number;
3644
- }
3645
- declare namespace Camera {
3646
- function _getImageContrast(data: Uint8Array | Uint8ClampedArray, width: number, height: number): number;
3647
- }
3648
- interface Camera {
3649
- _enableTapToFocus: false | 'simple' | 'experimental-advanced';
3650
- _isFocusing: boolean;
3651
- _tapToFocusListner: EventListener;
3652
- _simpleFocus(): Promise<void>;
3653
- _advancedFocusParameters: AdvancedFocusParameters;
3654
- _advancedFocusTaskId: number;
3655
- _advancedFocus(center?: {
3656
- x: number;
3657
- y: number;
3658
- }, width?: number, height?: number): Promise<void>;
3659
- get enableTapToFocus(): false | "simple" | "experimental-advanced";
3660
- set enableTapToFocus(value: false | 'simple' | 'experimental-advanced');
3661
- }
3662
-
3663
- interface AutoTorchParameters {
3664
- shortDelay: number;
3665
- longDelay: number;
3666
- shortLongDelaySwitchCount: number;
3667
- /** 0 ~ 255 */
3668
- grayThreshold: number;
3669
- maxDarkCount: number;
3670
- }
3671
-
3672
- interface Camera {
3673
- get isSupportTorch(): boolean;
3674
- _isTorchOn: boolean | undefined;
3675
- /** `undefined` means in auto torch mode */
3676
- get isTorchOn(): boolean | undefined;
3677
- turnOnTorch(): Promise<void>;
3678
- turnOffTorch(): Promise<void>;
3679
- _autoTorchParameters: AutoTorchParameters;
3680
- /**
3681
- * Detect how dark the picture and turn on torch automatically.
3682
- * After camera open, it may take a few seconds for picture to be ready.
3683
- * So it's suggested not to `turnAutoTorch()` immediately.
3684
- * Waiting for 3 seconds may bring a better user experience.
3685
- **/
3686
- turnAutoTorch(): void;
3687
- /** The auto torch logic detected that the image was too dark and turn on the torch. */
3688
- addEventListener(type: 'torchAutoOn', listener: (this: Camera) => void | any): void;
3689
- removeEventListener(type: 'torchAutoOn', listener: (this: Camera) => void | any): void;
3690
- }
3691
-
3692
-
3693
- interface Camera {
3694
- _shouldCloseWhenHide: boolean;
3695
- _isDuringCloseWhenHide: boolean;
3696
- _isOpenBeforeHide: boolean;
3697
- _maxReopenTry4CloseWhenHide: number;
3698
- get shouldCloseWhenHide(): boolean;
3699
- set shouldCloseWhenHide(value: boolean);
3700
- _closeWhenHide(): Promise<void>;
3701
- _closeWhenHideListener: EventListener;
3702
- }
3703
- declare namespace Camera {
3704
- function showFilePicker(inputOptions?: {
3705
- accept?: string;
3706
- multiple: boolean;
3707
- capture?: 'user' | 'environment' | '';
3708
- onchange?: (this: HTMLInputElement, ev: Event) => any;
3709
- }): Promise<File[]>;
3710
- function showFilePicker(inputOptions?: any): Promise<File[]>;
3711
- }
3712
-
3713
- /**
3714
- * Return `Element` if possible, otherwise return `DocumentFragment`.
3715
- */
3716
- declare const stringToHtml: (str: string, config?: {
3717
- inlineScript2Blob?: boolean;
3718
- internalCss2Blob: boolean;
3719
- insertInternalCss2ExistedSheet?: boolean;
3720
- }) => Node;
3721
-
3722
- declare class FramePipeline {
3723
- camera: Camera;
3724
- _ctx: CanvasRenderingContext2D;
3725
- _data: Uint8Array<ArrayBuffer>;
3726
- _dataTime: number;
3727
- _x: number;
3728
- _y: number;
3729
- _w: number;
3730
- _h: number;
3731
- _type: string;
3732
- maxTimeout: number;
3733
- _pipeTaskId: any;
3734
- isSaveOriginalRgba: boolean;
3735
- /**
3736
- * The `originalRgba` share `ArrayBuffer` with the `data` returned by `getData(..., type: 'rgba')`.
3737
- * So you should be careful when transferring `data` to other thread.
3738
- */
3739
- originalRgba: Uint8ClampedArray<ArrayBuffer>;
3740
- constructor(camera?: Camera);
3741
- _getData(): Uint8Array<ArrayBuffer>;
3742
- /**
3743
- * @param config
3744
- * Each parameter should be kept as stable as possible.
3745
- * If you need to switch between multiple parameters frequently, please create multiple `FramePipeline` instances.
3746
- *
3747
- * `x`, `y`, `width`, `height` will be rounded.
3748
- * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3749
- * The same logic applies to `height`.
3750
- */
3751
- getData(config?: {
3752
- x?: number;
3753
- y?: number;
3754
- width?: number;
3755
- height?: number;
3756
- type?: 'rgba' | 'gray';
3757
- }): Uint8Array;
3758
- }
3759
-
3760
- declare class Beep {
3761
- _stAudioFree: Set<unknown>;
3762
- _stAudioPlaying: Set<unknown>;
3763
- _timeLastPlay: number;
3764
- _bWarnedMaxTrack: boolean;
3765
- maxPlayingBeep: number;
3766
- beepSoundSource: string;
3767
- beep(): void;
3768
- }
3769
- /**
3770
- * The function will play the default beep sound.
3771
- * To play different beep sound, you need create another `Beep` instance.
3772
- **/
3773
- declare const beep: () => void;
3774
- declare const vibrate: (duration?: number) => void;
3775
-
3776
- declare const CameraEnhancerModule: {
3777
- getVersion(): string;
3778
- };
3779
- declare const CameraEnhancer: typeof Camera;
3780
- type CameraEnhancer = Camera;
3781
- declare const CameraView: typeof Camera;
3782
- type CameraView = Camera;
3783
- declare namespace Camera {
3784
- function createInstance(_?: any): Promise<CameraEnhancer>;
3785
- function testCameraAccess(): Promise<{
3786
- ok: boolean;
3787
- message?: string;
3788
- }>;
3789
- let defaultUIElementURL: string;
3790
- let onWarning: any;
3791
- }
3792
- interface Camera {
3793
- isCameraEnhancer: true;
3794
- disposed: boolean;
3795
- dispose(): void;
3796
- _cameraEnhancer: CameraEnhancer;
3797
- _cameraView: CameraView;
3798
- _dceLastDeviceId: any;
3799
- _dceLastResolution: any;
3800
- cameraOpenTimeout: any;
3801
- _bTryAnotherCameraWhenFailToOpen: boolean;
3802
- _bAutoSingleFrameModeWhenIosPwaFail: boolean;
3803
- _oriOpen(): Promise<void>;
3804
- open(): Promise<void | {
3805
- deviceId: string;
3806
- width: number;
3807
- height: number;
3808
- }>;
3809
- _oriUpdateCanvasSize(): void;
3810
- _oriAddCanvas(): HTMLCanvasElement;
3811
- getAllCameras(): Promise<{
3812
- deviceId: string;
3813
- label: string;
3814
- }[]>;
3815
- getAvailableResolutions(): Promise<{
3816
- width: number;
3817
- height: number;
3818
- }[]>;
3819
- getCameraState(): 'opening' | 'open' | 'closed';
3820
- getResolution(): {
3821
- width: number;
3822
- height: number;
3823
- };
3824
- getSelectedCamera(): {
3825
- deviceId: string;
3826
- label: string;
3827
- };
3828
- getVideoSettings(): MediaStreamConstraints;
3829
- _ifSaveLastUsedCamera: boolean;
3830
- get ifSaveLastUsedCamera(): boolean;
3831
- set ifSaveLastUsedCamera(value: boolean);
3832
- get ifSkipCameraInspection(): boolean;
3833
- set ifSkipCameraInspection(value: boolean);
3834
- isOpen(): boolean;
3835
- isPaused(): boolean;
3836
- resume(): Promise<void>;
3837
- selectCamera(device: string | {
3838
- deviceId: string;
3839
- label: string;
3840
- }): Promise<{
3841
- deviceId: string;
3842
- width: number;
3843
- height: number;
3844
- }>;
3845
- setResolution(resolution: {
3846
- width: number;
3847
- height: number;
3848
- }): Promise<{
3849
- deviceId: string;
3850
- width: number;
3851
- height: number;
3852
- }>;
3853
- updateVideoSettings(constraints: MediaStreamConstraints): Promise<void>;
3854
- _dceVideoSrc: string;
3855
- get videoSrc(): string;
3856
- set videoSrc(value: string | null);
3857
- _dceEnhancedFeatures: any;
3858
- _dceAutoZoomRange: {
3859
- min: number;
3860
- max: number;
3861
- };
3862
- disableEnhancedFeatures(feature: any): void;
3863
- enableEnhancedFeatures(feature: any): void;
3864
- getCameraSettings(): MediaTrackSettings;
3865
- getCapabilities(): MediaTrackCapabilities;
3866
- getColorTemperature(): number;
3867
- getExposureCompensation(): number;
3868
- getFrameRate(): number;
3869
- setColorTemperature(value: number): Promise<void>;
3870
- setExposureCompensation(value: number): Promise<void>;
3871
- setFrameRate(value: number): Promise<void>;
3872
- getZoomSettings(): {
3873
- factor: number;
3874
- };
3875
- _oriSetZoom(zoom: number): Promise<void>;
3876
- _dceZoom: number;
3877
- setZoom(settings: {
3878
- factor: number;
3879
- }): Promise<void>;
3880
- resetZoom(): void;
3881
- _dceFocusSettings: any;
3882
- getFocusSettings(): {
3883
- mode: string;
3884
- } | {
3885
- mode: 'manual';
3886
- distance: number;
3887
- } | {
3888
- mode: 'manual';
3889
- area: {
3890
- centerPoint: {
3891
- x: string;
3892
- y: string;
3893
- };
3894
- width?: string;
3895
- height?: string;
3896
- };
3897
- };
3898
- setFocus(settings: {
3899
- mode: string;
3900
- } | {
3901
- mode: 'manual';
3902
- distance: number;
3903
- } | {
3904
- mode: 'manual';
3905
- area: {
3906
- centerPoint: {
3907
- x: string;
3908
- y: string;
3909
- };
3910
- width?: string;
3911
- height?: string;
3912
- };
3913
- }): Promise<void>;
3914
- setAutoZoomRange(value: {
3915
- min: number;
3916
- max: number;
3917
- }): void;
3918
- getAutoZoomRange(): {
3919
- min: number;
3920
- max: number;
3921
- };
3922
- toggleMirroring(enable: boolean): void;
3923
- _framePipeline: FramePipeline;
3924
- fetchImage(): {
3925
- bytes: Uint8Array;
3926
- width: number;
3927
- height: number;
3928
- stride: number;
3929
- format: any;
3930
- toCanvas(): HTMLCanvasElement;
3931
- };
3932
- getImage(): {
3933
- bytes: Uint8Array;
3934
- width: number;
3935
- height: number;
3936
- stride: number;
3937
- format: any;
3938
- toCanvas(): HTMLCanvasElement;
3939
- };
3940
- _dceScanRegion: {
3941
- x: number;
3942
- y: number;
3943
- width: number;
3944
- height: number;
3945
- isMeasuredInPercentage?: boolean;
3946
- } | {
3947
- left: number;
3948
- top: number;
3949
- right: number;
3950
- bottom: number;
3951
- isMeasuredInPercentage?: boolean;
3952
- };
3953
- getScanRegion(): {
3954
- x: number;
3955
- y: number;
3956
- width: number;
3957
- height: number;
3958
- isMeasuredInPercentage?: boolean;
3959
- } | {
3960
- left: number;
3961
- top: number;
3962
- right: number;
3963
- bottom: number;
3964
- isMeasuredInPercentage?: boolean;
3965
- };
3966
- hasNextImageToFetch(): boolean;
3967
- isBufferEmpty(): boolean;
3968
- startFetching(): void;
3969
- _pixelFormat: number;
3970
- getPixelFormat(): number;
3971
- setPixelFormat(format: number): void;
3972
- _colourChannelUsageType: number;
3973
- setColourChannelUsageType(format: number): void;
3974
- getColourChannelUsageType(): number;
3975
- setScanRegion(region?: {
3976
- x: number;
3977
- y: number;
3978
- width: number;
3979
- height: number;
3980
- isMeasuredInPercentage?: boolean;
3981
- } | {
3982
- left: number;
3983
- top: number;
3984
- right: number;
3985
- bottom: number;
3986
- isMeasuredInPercentage?: boolean;
3987
- }): void;
3988
- stopFetching(): void;
3989
- takePhoto(listener: (dceFrame: {
3990
- bytes: Uint8Array;
3991
- width: number;
3992
- height: number;
3993
- stride: number;
3994
- format: any;
3995
- toCanvas(): HTMLCanvasElement;
3996
- }) => void): Promise<{
3997
- bytes: Uint8Array;
3998
- width: number;
3999
- height: number;
4000
- stride: number;
4001
- format: any;
4002
- toCanvas(): HTMLCanvasElement;
4003
- }>;
4004
- addImageToBuffer: any;
4005
- clearBuffer: any;
4006
- getBufferOverflowProtectionMode: any;
4007
- getImageCount: any;
4008
- getImageFetchInterval: any;
4009
- getMaxImageCount: any;
4010
- hasImage: any;
4011
- setBufferOverflowProtectionMode: any;
4012
- setErrorListener: any;
4013
- setImageFetchInterval: any;
4014
- setMaxImageCount: any;
4015
- setNextImageToReturn: any;
4016
- _dceSettingsBeforeSingleFrameMode: any;
4017
- _singleFrameMode: "disabled" | "camera" | "image";
4018
- _singleFrameModeClickCallback: any;
4019
- _singleFrameModeResultForDcv: DCEFrame;
4020
- _singleFrameModeCvs: HTMLCanvasElement;
4021
- get singleFrameMode(): "disabled" | "camera" | "image";
4022
- set singleFrameMode(value: "disabled" | "camera" | "image");
4023
- setCameraView(view: CameraView): void;
4024
- getCameraView(): CameraView;
4025
- getVideoEl(): HTMLVideoElement;
4026
- convertToPageCoordinates(point: {
4027
- x: number;
4028
- y: number;
4029
- }): {
4030
- x: number;
4031
- y: number;
4032
- };
4033
- convertToClientCoordinates(point: {
4034
- x: number;
4035
- y: number;
4036
- }): {
4037
- x: number;
4038
- y: number;
4039
- };
4040
- convertToScanRegionCoordinates(point: {
4041
- x: number;
4042
- y: number;
4043
- }): {
4044
- x: number;
4045
- y: number;
4046
- };
4047
- convertToContainCoordinates(point: {
4048
- x: number;
4049
- y: number;
4050
- }): {
4051
- x: number;
4052
- y: number;
4053
- };
4054
- _dceEventListeners: {
4055
- [key: string]: Set<Function>;
4056
- };
4057
- on(eventName: string, listener: Function): void;
4058
- off(eventName: string, listener: Function): void;
4059
- _dceMNIsBeepBarcode: boolean;
4060
- _dceMNIsVibrateBarcode: boolean;
4061
- getUIElement(): HTMLElement;
4062
- setUIElement(ui: HTMLDivElement | string): Promise<void>;
4063
- getVideoElement(): HTMLVideoElement;
4064
- setVideoFit(fit: 'contain' | 'cover' | 'fill'): void;
4065
- getVideoFit(): 'contain' | 'cover' | 'fill';
4066
- getVisibleRegionOfVideo(options?: {
4067
- inPixels?: boolean;
4068
- }): {
4069
- x: number;
4070
- y: number;
4071
- width: number;
4072
- height: number;
4073
- isMeasuredInPercentage?: boolean;
4074
- };
4075
- _dceRegionMaskStyle: {
4076
- lineWidth: number;
4077
- strokeStyle: string;
4078
- fillStyle: string;
4079
- };
4080
- setScanRegionMaskStyle(style: {
4081
- lineWidth: number;
4082
- strokeStyle: string;
4083
- fillStyle: string;
4084
- }): void;
4085
- getScanRegionMaskStyle(): {
4086
- lineWidth: number;
4087
- strokeStyle: string;
4088
- fillStyle: string;
4089
- };
4090
- _dceRegionMaskVisible: boolean;
4091
- setScanRegionMaskVisible(visible: boolean): void;
4092
- isScanRegionMaskVisible(): boolean;
4093
- setScanLaserVisible(visible: boolean): void;
4094
- isScanLaserVisible(): boolean;
4095
- setPowerByMessageVisible(visible: boolean): void;
4096
- isPowerByMessageVisible(): boolean;
4097
- _dceTipDuration: number;
4098
- _dceTipMessage: string;
4099
- getTipConfig(): TipConfig;
4100
- setTipConfig(tipConfig: TipConfig): void;
4101
- setTipVisible(visible: boolean): void;
4102
- isTipVisible(): boolean;
4103
- updateTipMessage(message: string): void;
4104
- _drawingLayers: DrawingLayer[];
4105
- createDrawingLayer(): DrawingLayer;
4106
- getDrawingLayer(id: number): DrawingLayer;
4107
- getAllDrawingLayers(): DrawingLayer[];
4108
- clearUserDefinedDrawingLayers(): void;
4109
- deleteUserDefinedDrawingLayer(id: number): void;
4110
- clearAllInnerDrawingItems(_?: boolean): void;
4111
- _capturedResultReceiver: any;
4112
- }
4113
- declare function _bufferToCanvas(uint8Array: Uint8Array, width: number, height: number, format: number): HTMLCanvasElement;
4114
- declare class Feedback {
4115
- static _beepInstance: Beep;
4116
- static beep(): void;
4117
- static get beepSoundSource(): string;
4118
- static set beepSoundSource(value: string);
4119
- static vibrate(): void;
4120
- static vibrateDuration: number;
4121
- }
4122
- declare const DrawingStyleManager: {
4123
- STYLE_BLUE_STROKE: any;
4124
- STYLE_GREEN_STROKE: any;
4125
- STYLE_ORANGE_STROKE: any;
4126
- STYLE_YELLOW_STROKE: any;
4127
- STYLE_BLUE_STROKE_FILL: any;
4128
- STYLE_GREEN_STROKE_FILL: any;
4129
- STYLE_ORANGE_STROKE_FILL: any;
4130
- STYLE_YELLOW_STROKE_FILL: any;
4131
- STYLE_BLUE_STROKE_TRANSPARENT: any;
4132
- STYLE_GREEN_STROKE_TRANSPARENT: any;
4133
- STYLE_ORANGE_STROKE_TRANSPARENT: any;
4134
- STYLE_YELLOW_STROKE_TRANSPARENT: any;
4135
- createDrawingStyle(style: any): any;
4136
- getDrawingStyle(id: any): any;
4137
- getAllDrawingStyles(): any[];
4138
- updateDrawingStyle(id: any, style: any): void;
4139
- };
4140
- declare class DrawingLayer {
4141
- _visible: boolean;
4142
- _dce: CameraView;
4143
- _ctx: CanvasRenderingContext2D;
4144
- _defaultStyle: any;
4145
- _drawingItems: DrawingItem[];
4146
- _mode: 'editor' | 'viewer';
4147
- _editorView: any;
4148
- _renderTask: any;
4149
- _newSelectedDrawingItems: DrawingItem[];
4150
- _newDeselectedDrawingItems: DrawingItem[];
4151
- _selectionChangedTask: any;
4152
- _onSelectionChanged: (newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void;
4153
- getId(): this;
4154
- isVisible(): boolean;
4155
- setVisible(value: boolean): void;
4156
- setDefaultStyle(drawingStyleId: any, _1?: any, _2?: any): void;
4157
- addDrawingItems(drawingItems: DrawingItem[]): void;
4158
- removeDrawingItems(drawingItems: DrawingItem[]): void;
4159
- setDrawingItems(drawingItems: DrawingItem[]): void;
4160
- getDrawingItems(filter?: (drawingItem: DrawingItem) => boolean): DrawingItem[];
4161
- hasDrawingItem(drawingItem: DrawingItem): boolean;
4162
- getSelectedDrawingItems(): any;
4163
- clearDrawingItems(): void;
4164
- _delayRenderAll(): void;
4165
- renderAll(): void;
4166
- getMode(): "editor" | "viewer";
4167
- setMode(mode: 'editor' | 'viewer'): Promise<void>;
4168
- _delaySelectionChanged(): void;
4169
- get onSelectionChanged(): (newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void;
4170
- set onSelectionChanged(value: (newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void);
4171
- }
4172
- /**
4173
- * Determines if a point is inside a quadrilateral.
4174
- * @param {number[]} point - [x, y] coordinates of the point.
4175
- * @param {number[][]} polygon - Array of points [[x0, y0], [x1, y1], [x2, y2], [x3, y3]].
4176
- * @returns {boolean} - True if the point is inside.
4177
- */
4178
- declare function _isPointInPolygon(point: number[], polygon: number[][]): boolean;
4179
- /**
4180
- * Calculates the shortest distance from a point to a line segment.
4181
- * @param {number[]} p - The point [x, y]
4182
- * @param {number[][]} segment - The segment [[x1, y1], [x2, y2]]
4183
- * @returns {number} The shortest distance
4184
- */
4185
- declare function _distToSegment(p: number[], segment: number[][]): number;
4186
- declare class DrawingItem {
4187
- coordinateBase: string;
4188
- drawingLayerId: any;
4189
- drawingStyleId: any;
4190
- mediaType: EnumDrawingItemMediaType;
4191
- _notes: Note[];
4192
- _bSelected: boolean;
4193
- _dceEventListeners: {
4194
- [key: string]: Set<Function>;
4195
- };
4196
- get _ps(): {
4197
- x: number;
4198
- y: number;
4199
- }[];
4200
- getState(): EnumDrawingItemState;
4201
- addNote(note: Note, replace?: boolean): void;
4202
- getNote(name: string): Note;
4203
- getNotes(): Note[];
4204
- hasNote(name: string): boolean;
4205
- updateNote(name: string, content: any, isMergeContent?: boolean): void;
4206
- deleteNote(name: string): void;
4207
- clearNotes(): void;
4208
- _delayRenderAll(): void;
4209
- _setSelected(value: boolean): void;
4210
- on(type: string, listener: Function): void;
4211
- off(type: string, listener: Function): void;
4212
- }
4213
- declare class LineDrawingItem extends DrawingItem {
4214
- line: {
4215
- startPoint: {
4216
- x: number;
4217
- y: number;
4218
- };
4219
- endPoint: {
4220
- x: number;
4221
- y: number;
4222
- };
4223
- };
4224
- get _ps(): {
4225
- x: number;
4226
- y: number;
4227
- }[];
4228
- constructor(line: {
4229
- startPoint: {
4230
- x: number;
4231
- y: number;
4232
- };
4233
- endPoint: {
4234
- x: number;
4235
- y: number;
4236
- };
4237
- }, drawingStyleId?: any);
4238
- getLine(): {
4239
- startPoint: {
4240
- x: number;
4241
- y: number;
4242
- };
4243
- endPoint: {
4244
- x: number;
4245
- y: number;
4246
- };
4247
- };
4248
- setLine(value: {
4249
- startPoint: {
4250
- x: number;
4251
- y: number;
4252
- };
4253
- endPoint: {
4254
- x: number;
4255
- y: number;
4256
- };
4257
- }): void;
4258
- }
4259
- declare class QuadDrawingItem extends DrawingItem {
4260
- quad: {
4261
- points: {
4262
- x: number;
4263
- y: number;
4264
- }[];
4265
- };
4266
- get _ps(): {
4267
- x: number;
4268
- y: number;
4269
- }[];
4270
- constructor(quad: {
4271
- points: {
4272
- x: number;
4273
- y: number;
4274
- }[];
4275
- }, drawingStyleId?: any);
4276
- getQuad(): {
4277
- points: {
4278
- x: number;
4279
- y: number;
4280
- }[];
4281
- };
4282
- setQuad(value: {
4283
- points: {
4284
- x: number;
4285
- y: number;
4286
- }[];
4287
- }): void;
4288
- }
4289
- declare class RectDrawingItem extends DrawingItem {
4290
- rect: {
4291
- x: number;
4292
- y: number;
4293
- width: number;
4294
- height: number;
4295
- };
4296
- get _ps(): {
4297
- x: number;
4298
- y: number;
4299
- }[];
4300
- constructor(rect: {
4301
- x: number;
4302
- y: number;
4303
- width: number;
4304
- height: number;
4305
- }, drawingStyleId?: any);
4306
- getRect(): {
4307
- x: number;
4308
- y: number;
4309
- width: number;
4310
- height: number;
4311
- };
4312
- setRect(value: {
4313
- x: number;
4314
- y: number;
4315
- width: number;
4316
- height: number;
4317
- }): void;
4318
- }
4319
- declare class TextDrawingItem extends DrawingItem {
4320
- text: string;
4321
- rect: {
4322
- x: number;
4323
- y: number;
4324
- width: number;
4325
- height: number;
4326
- };
4327
- get _ps(): {
4328
- x: number;
4329
- y: number;
4330
- }[];
4331
- constructor(text: string, rect: {
4332
- x: number;
4333
- y: number;
4334
- width: number;
4335
- height: number;
4336
- }, drawingStyleId?: any);
4337
- getText(): string;
4338
- setText(value: string): void;
4339
- getTextRect(): {
4340
- x: number;
4341
- y: number;
4342
- width: number;
4343
- height: number;
4344
- };
4345
- setTextRect(value: {
4346
- x: number;
4347
- y: number;
4348
- width: number;
4349
- height: number;
4350
- }): void;
4351
- }
4352
- declare class ImageDrawingItem extends DrawingItem {
4353
- image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
4354
- rect: {
4355
- x: number;
4356
- y: number;
4357
- width: number;
4358
- height: number;
4359
- };
4360
- maintainAspectRatio: boolean;
4361
- get _ps(): {
4362
- x: number;
4363
- y: number;
4364
- }[];
4365
- constructor(image: {
4366
- bytes: Uint8Array;
4367
- width: number;
4368
- height: number;
4369
- stride: number;
4370
- format: any;
4371
- } | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, rect: {
4372
- x: number;
4373
- y: number;
4374
- width: number;
4375
- height: number;
4376
- }, maintainAspectRatio: boolean, drawingStyleId?: any);
4377
- getImage(): HTMLVideoElement | HTMLCanvasElement | HTMLImageElement;
4378
- setImage(image: {
4379
- bytes: Uint8Array;
4380
- width: number;
4381
- height: number;
4382
- stride: number;
4383
- format: any;
4384
- } | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void;
4385
- getImageRect(): {
4386
- x: number;
4387
- y: number;
4388
- width: number;
4389
- height: number;
4390
- };
4391
- setImageRect(value: {
4392
- x: number;
4393
- y: number;
4394
- width: number;
4395
- height: number;
4396
- }): void;
4397
- }
4398
-
4399
- declare enum EnumDrawingItemMediaType {
4400
- /**
4401
- * Represents a rectangle, a basic geometric shape with four sides where opposite sides are equal in length and it has four right angles.
4402
- */
4403
- DIMT_RECTANGLE = 1,
4404
- /**
4405
- * Represents any four-sided figure. This includes squares, rectangles, rhombuses, and more general forms that do not necessarily have right angles or equal sides.
4406
- */
4407
- DIMT_QUADRILATERAL = 2,
4408
- /**
4409
- * Represents a text element. This allows for the inclusion of textual content as a distinct drawing item within the graphic representation.
4410
- */
4411
- DIMT_TEXT = 4,
4412
- /**
4413
- * Represents an image. This enables embedding bitmap images within the drawing context.
4414
- */
4415
- DIMT_IMAGE = 16,
4416
- /**
4417
- * Represents a line segment. This is the simplest form of a drawing item, defined by two endpoints and the straight path connecting them.
4418
- */
4419
- DIMT_LINE = 64
4420
- }
4421
- declare enum EnumDrawingItemState {
4422
- /**
4423
- * DIS_DEFAULT: The default state of a drawing item. This state indicates that the drawing item is in its normal, unselected state.
4424
- */
4425
- DIS_DEFAULT = 1,
4426
- /**
4427
- * DIS_SELECTED: Indicates that the drawing item is currently selected. This state can trigger different behaviors or visual styles, such as highlighting the item to show it is active or the focus of user interaction.
4428
- */
4429
- DIS_SELECTED = 2
4430
- }
4431
- declare enum EnumEnhancedFeatures {
4432
- /**
4433
- * Enables auto-focus on areas likely to contain barcodes, assisting in their identification and interpretation.
4434
- */
4435
- EF_ENHANCED_FOCUS = 4,
4436
- /**
4437
- * Facilitates automatic zooming in on areas likely to contain barcodes, aiding in their detection and decoding.
4438
- */
4439
- EF_AUTO_ZOOM = 16,
4440
- /**
4441
- * Allows users to tap on a specific item or area in the video feed to focus on, simplifying the interaction for selecting or highlighting important elements.
4442
- */
4443
- EF_TAP_TO_FOCUS = 64
4444
- }
4445
- declare enum EnumPixelFormat {
4446
- GREY = "grey",
4447
- GREY32 = "grey32",
4448
- RGBA = "rgba",
4449
- RBGA = "rbga",
4450
- GRBA = "grba",
4451
- GBRA = "gbra",
4452
- BRGA = "brga",
4453
- BGRA = "bgra"
4454
- }
4455
- interface Resolution {
4456
- width: number;
4457
- height: number;
4458
- }
4459
- interface DCEFrame {
4460
- bytes: Uint8Array;
4461
- width: number;
4462
- height: number;
4463
- stride: number;
4464
- format: any;
4465
- toCanvas(): HTMLCanvasElement;
4466
- }
4467
- interface DrawingStyle {
4468
- fillStyle?: string;
4469
- lineWidth?: number;
4470
- paintMode?: string;
4471
- strokeStyle?: string;
4472
- }
4473
- interface PlayCallbackInfo {
4474
- deviceId: string;
4475
- width: number;
4476
- height: number;
4477
- }
4478
- interface VideoDeviceInfo {
4479
- deviceId: string;
4480
- label: string;
4481
- }
4482
- interface VideoFrameTag {
4483
- /** The unique identifier of the image. */
4484
- imageId: number;
4485
- /** The type of the image. */
4486
- type: any;
4487
- /** Indicates whether the video frame is cropped. */
4488
- isCropped: boolean;
4489
- /** The region based on which the original frame was cropped. If `isCropped` is false, the region covers the entire original image. */
4490
- cropRegion: any;
4491
- /** The original width of the video frame before any cropping. */
4492
- originalWidth: number;
4493
- /** The original height of the video frame before any cropping. */
4494
- originalHeight: number;
4495
- /** The current width of the video frame after cropping. */
4496
- currentWidth: number;
4497
- /** The current height of the video frame after cropping. */
4498
- currentHeight: number;
4499
- /** The time spent acquiring the frame, in milliseconds. */
4500
- timeSpent: number;
4501
- /** The timestamp marking the completion of the frame acquisition. */
4502
- timeStamp: number;
4503
- }
4504
- interface TipConfig {
4505
- /** The top left point of the tip message box. */
4506
- topLeftPoint?: any;
4507
- /** The width of the tip message box. */
4508
- width?: number;
4509
- /** The display duration of the tip in milliseconds. */
4510
- duration: number;
4511
- /** The base coordinate system used (e.g., "view" or "image"). */
4512
- coordinateBase?: "view" | "image";
4513
- }
4514
- interface Note {
4515
- /** The name of the note. */
4516
- name: string;
4517
- /** The content of the note, can be of any type. */
4518
- content: any;
4519
- }
4520
-
4521
- export { Beep, Camera, CameraEnhancer, CameraEnhancerModule, CameraInfo, CameraPreset, CameraStatus, CameraView, CameraZsFunc, DCEFrame, DMMoreMediaTrackCapabilities, DrawingItem, DrawingLayer, DrawingStyle, DrawingStyleManager, EnumDrawingItemMediaType, EnumDrawingItemState, EnumEnhancedFeatures, EnumPixelFormat, Feedback, FramePipeline, ImageDrawingItem, LineDrawingItem, Note, PlayCallbackInfo, QuadDrawingItem, RectDrawingItem, Resolution, TextDrawingItem, TipConfig, VideoDeviceInfo, VideoFrameTag, _bufferToCanvas, _distToSegment, _isPointInPolygon, beep, stringToHtml, vibrate };
4522
-
3433
+ }
3434
+
3435
+ export { BarcodeScanner, EnumResultStatus, EnumScanMode, isPathConfig };
3436
+ export type { BarcodeScanResult, BarcodeScannerConfig, CacheKeys, ResultStatus, ToolbarButtonConfig, UtilizedTemplateNames };
3437
+ interface CameraInfo extends InputDeviceInfo {
3438
+ trackLabel: string;
3439
+ capabilities: DMMoreMediaTrackCapabilities;
3440
+ isFront: boolean;
3441
+ }
3442
+ interface DMMoreMediaTrackCapabilities extends MediaTrackCapabilities {
3443
+ focusMode?: ('continuous' | 'single-shot' | 'manual')[];
3444
+ focusDistance?: {
3445
+ max?: number;
3446
+ min: number;
3447
+ };
3448
+ zoom?: {
3449
+ max: number;
3450
+ min: number;
3451
+ };
3452
+ torch?: true;
3453
+ }
3454
+ type CameraZsFunc = (this: Camera, ...argArray: any[]) => void | any;
3455
+ interface Camera {
3456
+ /**
3457
+ * The `opened` event is triggered when the camera `open()` from the `paused`/`closed`
3458
+ * or when call `requestResolution()` and camera is `opened`.
3459
+ */
3460
+ addEventListener(type: 'opened', listener: (this: Camera) => void | any): void;
3461
+ removeEventListener(type: 'opened', listener: (this: Camera) => void | any): void;
3462
+ /** The `closed` event is triggered when camera is `closed`. */
3463
+ addEventListener(type: 'closed', listener: (this: Camera) => void | any): void;
3464
+ removeEventListener(type: 'closed', listener: (this: Camera) => void | any): void;
3465
+ }
3466
+ declare class Camera {
3467
+ static _cameraNameMatcher: string[][];
3468
+ static _currentOpenedCamera: Camera | null;
3469
+ static _mapDeviceInfo: {
3470
+ [deviceId: string]: CameraInfo;
3471
+ };
3472
+ _coreShell: HTMLElement;
3473
+ _video: HTMLVideoElement;
3474
+ _coreInnerLayer: HTMLElement;
3475
+ _coreOuterLayer: HTMLElement;
3476
+ _regionBoxWrapper?: HTMLElement | null;
3477
+ _regionBoxMask?: HTMLElement | null;
3478
+ _regionBoxBorder?: HTMLElement | null;
3479
+ _objectFit: 'contain' | 'cover' | 'fill';
3480
+ _uiInlineScript2Blob: boolean;
3481
+ _uiInternalCss2Blob: boolean;
3482
+ _uiInternalCss2ExistedSheet: boolean;
3483
+ _ui?: HTMLElement;
3484
+ _pOpen?: (Promise<void> & {
3485
+ isPending: boolean;
3486
+ resolve: () => void;
3487
+ reject: () => void;
3488
+ }) | null;
3489
+ _getUserMediaTimeout: number;
3490
+ _paused: boolean;
3491
+ _shouldClose: boolean;
3492
+ _cameraChangedWhenPaused: boolean;
3493
+ _requestedCamera: CameraPreset | MediaTrackConstraints | null;
3494
+ _requestedResolution: MediaTrackConstraints | null;
3495
+ _regionBox: {
3496
+ width?: number;
3497
+ height?: number;
3498
+ unit: 'view-size' | 'view-min';
3499
+ center: {
3500
+ x: number;
3501
+ y: number;
3502
+ };
3503
+ maskStyle?: Partial<CSSStyleDeclaration>;
3504
+ borderStyle?: Partial<CSSStyleDeclaration>;
3505
+ innerUi?: Node | NodeList;
3506
+ };
3507
+ _eventListeners: {
3508
+ [key: string]: Set<Function>;
3509
+ };
3510
+ static _delayBeforeEnumerateDevices: number;
3511
+ static _delayBeforeGetUserMedia: number;
3512
+ static _delayBeforeApplyConstraints: number;
3513
+ static _countEnsureResolution: number;
3514
+ static _videoPlayTimeout: number;
3515
+ static _bReopenWhenChangeResolution: boolean;
3516
+ _bTryAnotherCameraWhenFailToOpen: boolean;
3517
+ _constraints4Fallback: MediaTrackConstraints | true;
3518
+ static _arrConstructors: CameraZsFunc[];
3519
+ static _arrOnOpen: CameraZsFunc[];
3520
+ static _arrBeforeClose: CameraZsFunc[];
3521
+ static _arrOnClose: CameraZsFunc[];
3522
+ constructor();
3523
+ _taskIdIOSResizeProblem: any;
3524
+ _updateObjectFit(): void;
3525
+ get video(): HTMLVideoElement;
3526
+ get track(): MediaStreamTrack;
3527
+ get objectFit(): "contain" | "cover" | "fill";
3528
+ set objectFit(value: "contain" | "cover" | "fill");
3529
+ /**
3530
+ * While `ui` can accept various types during assignment, its value will always be an `HTMLElement` upon retrieval.
3531
+ */
3532
+ get ui(): HTMLElement;
3533
+ /**
3534
+ * Generally, the `value` can be an `HTMLElement`, `DocumentFragment` or a string of serialized html.
3535
+ * This `ui` or one of its descendants, must have class `dm-camera-core-container`.
3536
+ * If the `value` already contains the `coreShell`, `coreShell` does not move.
3537
+ * Otherwise the `coreShell` of `DMCamera` is appended to the first element that has the class `dm-camera-core-container`.
3538
+ *
3539
+ * If `value` is a falsy value, `coreShell` is used as `ui`.
3540
+ **/
3541
+ set ui(value: HTMLElement | DocumentFragment | string | undefined);
3542
+ /**
3543
+ * "closed" | "opening" | "opened" | "paused" | "closing"
3544
+ */
3545
+ get status(): CameraStatus;
3546
+ get requestedCamera(): "back" | "front" | "macro-back" | "quick-back" | "customized-video" | MediaTrackConstraints;
3547
+ get requestedResolution(): {
3548
+ width: number;
3549
+ height: number;
3550
+ };
3551
+ get currentCamera(): CameraInfo;
3552
+ get currentResolution(): {
3553
+ width: number;
3554
+ height: number;
3555
+ };
3556
+ /** width 0 ~ 1, height 0 ~ 1, center.x -0.5 ~ 0.5, center.y -0.5 ~ 0.5 */
3557
+ get regionBox(): {
3558
+ width?: number;
3559
+ height?: number;
3560
+ unit: "view-size" | "view-min";
3561
+ center: {
3562
+ x: number;
3563
+ y: number;
3564
+ };
3565
+ maskStyle?: Partial<CSSStyleDeclaration>;
3566
+ borderStyle?: Partial<CSSStyleDeclaration>;
3567
+ innerUi?: Node | NodeList;
3568
+ };
3569
+ onOpened?: (camera: Camera) => void | any;
3570
+ static hasCamera(): Promise<boolean>;
3571
+ static hasMacroCamera(): Promise<boolean>;
3572
+ static hasFrontCamera(): Promise<boolean>;
3573
+ /**
3574
+ * tips:
3575
+ * Call getDeviceInfos() will ask for camera permission, then open camera and close internally.
3576
+ * 2nd time open camera will be a lot faster.
3577
+ **/
3578
+ static getDeviceInfos(): Promise<Readonly<CameraInfo>[]>;
3579
+ static _setCapabilities(deviceInfos: CameraInfo[]): Promise<void>;
3580
+ /** `pause()` is an idempotent operation, you can call it repeatedly without error. */
3581
+ pause(): Promise<void>;
3582
+ /** `close()` is an idempotent operation, you can call it repeatedly without error. */
3583
+ close(): Promise<void>;
3584
+ /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3585
+ requestCamera(cameraPreset: CameraPreset): Promise<void>;
3586
+ /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3587
+ requestCamera(deviceId: string): Promise<void>;
3588
+ /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3589
+ requestCamera(deviceInfo: CameraInfo): Promise<void>;
3590
+ /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3591
+ requestCamera(constraints: MediaTrackConstraints): Promise<void>;
3592
+ /**
3593
+ * If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally.
3594
+ * @param notRequired Let browser choose use what camera.
3595
+ * */
3596
+ requestCamera(notRequired: null): Promise<void>;
3597
+ /**
3598
+ * If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally.
3599
+ * @param resetToDefault Use SDK's dafault logic.
3600
+ * */
3601
+ requestCamera(resetToDefault: undefined): Promise<void>;
3602
+ /** If call `requestCamera()` when the camera is `opened`, it will call `close()` then re`open()` Internally. */
3603
+ requestCamera(camera: string | CameraInfo | MediaTrackConstraints | null | undefined): Promise<void>;
3604
+ requestResolution(width: number, height?: number): Promise<void>;
3605
+ requestResolution(widthHeightPair: [number, number] | number[]): Promise<void>;
3606
+ requestResolution(constraints: {
3607
+ width?: ConstrainULong;
3608
+ height?: ConstrainULong;
3609
+ aspectRatio?: ConstrainDouble;
3610
+ }): Promise<void>;
3611
+ requestResolution(notRequired: null): Promise<void>;
3612
+ requestResolution(resetToDefault: undefined): Promise<void>;
3613
+ requestResolution(arg1: any, arg2?: any): Promise<void>;
3614
+ /**
3615
+ * Similar to `camera.track.applyConstraints`,
3616
+ * but auto add constraints of original camera and original resolution.
3617
+ * Primarily used for advanced camera settings like focusDistance, zoom, colorTemperature.
3618
+ * Don't directly change camera or resolution by this API,
3619
+ * use `requestCamera` and `requestResolution` instead.
3620
+ * Set camera or resolution using `applyConstraints` will result in undefined behavior.
3621
+ */
3622
+ applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
3623
+ /**
3624
+ * @param config
3625
+ * `x`/`y`/`width`/`height` is normally `0 ~ video.videoWidth` or `0 ~ video.videoHeight`,
3626
+ * same as [drawImage](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage).
3627
+ * If values contain decimals, it will be rounded.
3628
+ * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3629
+ * The same logic applies to `height`.
3630
+ */
3631
+ getFrame(config?: {
3632
+ x?: number;
3633
+ y?: number;
3634
+ width?: number;
3635
+ height?: number;
3636
+ reusedContext?: CanvasRenderingContext2D;
3637
+ }): HTMLCanvasElement;
3638
+ /**
3639
+ * @param regionBox width 0 ~ 1, height 0 ~ 1, center.x -0.5 ~ 0.5, center.y -0.5 ~ 0.5
3640
+ * TODO: support unit pixel
3641
+ */
3642
+ setRegionBox(regionBox: {
3643
+ width?: number;
3644
+ height?: number;
3645
+ unit?: 'view-size' | 'view-min';
3646
+ center?: {
3647
+ x: number;
3648
+ y: number;
3649
+ };
3650
+ maskStyle?: Partial<CSSStyleDeclaration>;
3651
+ borderStyle?: Partial<CSSStyleDeclaration>;
3652
+ innerUi?: Node | NodeList | DocumentFragment | Node[] | string;
3653
+ }): void;
3654
+ /**
3655
+ * Add a canvas dynamically keep with the same size of the video resolution, as a overlay.
3656
+ * You can remove it by `camera.video.parentElement.removeChild(thatCanvas)` or `thatCanvas.remove()`.
3657
+ * When you add multiple canvases, you can also use `camera.video.parentElement` to control stack order.
3658
+ */
3659
+ addCanvas(): HTMLCanvasElement;
3660
+ _updateCanvasSize(): void;
3661
+ _callOpenedListeners(): void;
3662
+ /**
3663
+ * Convert video x/y to absolute left/top in `document.body`.
3664
+ * So you can easily add a overlay with absolute position.
3665
+ * Processing multiple points at once has higher performance than calling multiple times.
3666
+ */
3667
+ videoXY2AbsoluteLT(points: {
3668
+ x: number;
3669
+ y: number;
3670
+ }[]): {
3671
+ left: number;
3672
+ top: number;
3673
+ }[];
3674
+ /**
3675
+ * Convert video x/y to fixed left/top in `document.body`.
3676
+ * So you can easily add a overlay with fixed position.
3677
+ * Processing multiple points at once has higher performance than calling multiple times.
3678
+ */
3679
+ videoXY2FixedLT(points: {
3680
+ x: number;
3681
+ y: number;
3682
+ }[]): {
3683
+ left: number;
3684
+ top: number;
3685
+ }[];
3686
+ /**
3687
+ * @param isConsiderRegionBox Default is `false`. Only consider the visible area in the region box.
3688
+ * @param rounded Default is `false`. Controls whether the result should be rounded.
3689
+ * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3690
+ * The same logic applies to `height`.
3691
+ * @returns
3692
+ * `x`/`width` is `0 ~ video.videoWidth`, `y`/`height` is `0 ~ video.videoHeight`.
3693
+ */
3694
+ getVisibleAreaInVideoXY(config?: {
3695
+ isConsiderRegionBox?: boolean;
3696
+ rounded?: boolean;
3697
+ }): {
3698
+ x: number;
3699
+ y: number;
3700
+ width: number;
3701
+ height: number;
3702
+ };
3703
+ }
3704
+ type CameraStatus = 'closed' | 'opening' | 'opened' | 'paused' | 'closing';
3705
+ declare const ArrCameraPreset: readonly ["back", "front", "macro-back", "quick-back", "customized-video"];
3706
+ type CameraPreset = typeof ArrCameraPreset[number];
3707
+
3708
+
3709
+ interface Camera {
3710
+ correctAdvancedConstraint(constraints?: MediaTrackConstraints): MediaTrackConstraints;
3711
+ }
3712
+
3713
+
3714
+ interface Camera {
3715
+ _softZoom: {
3716
+ zoom: number;
3717
+ center: {
3718
+ x: number;
3719
+ y: number;
3720
+ };
3721
+ };
3722
+ get softZoom(): {
3723
+ zoom: number;
3724
+ center: {
3725
+ x: number;
3726
+ y: number;
3727
+ };
3728
+ };
3729
+ _isMirrored: boolean;
3730
+ get isMirrored(): boolean;
3731
+ set isMirrored(value: boolean);
3732
+ maxZoom4GestureWheel: number;
3733
+ _lastZoomTime: number;
3734
+ _mapZoomTouchs: Map<number, {
3735
+ x: number;
3736
+ y: number;
3737
+ }>;
3738
+ _gestureZoomListener: ((this: HTMLElement, ev: TouchEvent) => any) | null;
3739
+ get enableGestureZoom(): boolean;
3740
+ set enableGestureZoom(value: boolean);
3741
+ _wheelZoomListener: ((this: HTMLElement, ev: WheelEvent) => any) | null;
3742
+ get enableWheelZoom(): boolean;
3743
+ set enableWheelZoom(value: boolean);
3744
+ getZoomRange(): {
3745
+ min: number;
3746
+ max: number;
3747
+ } | undefined;
3748
+ setZoom(zoom: number): Promise<void>;
3749
+ /**
3750
+ * Js software-level zoom.
3751
+ * It does not rely on camera device and camera driver support for zoom.
3752
+ * @param center
3753
+ * zoomed camera center in orignal frame.
3754
+ * `x`: -0.5 ~ 0.5, `y`: -0.5 ~ 0.5.
3755
+ * @param limit
3756
+ * limit `zoom` >= 1.
3757
+ * limit the center point position according to `zoom`,
3758
+ * so zoomed frame is inside video boundary;
3759
+ */
3760
+ setSoftZoom(zoom: number, config?: {
3761
+ center?: {
3762
+ x: number;
3763
+ y: number;
3764
+ };
3765
+ limit?: boolean;
3766
+ }): void;
3767
+ _changeZoomByWheel(ev: WheelEvent): void;
3768
+ _changeZoomByTouch(ev: TouchEvent): void;
3769
+ /** The `zoom` event is triggered when zoom updated via a touch gesture or mouse wheel. */
3770
+ addEventListener(type: 'zoom', listener: (this: Camera, softZoom: {
3771
+ zoom: number;
3772
+ center: {
3773
+ x: number;
3774
+ y: number;
3775
+ };
3776
+ }) => void | any): void;
3777
+ removeEventListener(type: 'zoom', listener: (this: Camera, softZoom: {
3778
+ zoom: number;
3779
+ center: {
3780
+ x: number;
3781
+ y: number;
3782
+ };
3783
+ }) => void | any): void;
3784
+ }
3785
+
3786
+ interface AdvancedFocusParameters {
3787
+ minFocusDistanceLimit: number;
3788
+ maxFocusDistanceLimit: number;
3789
+ firstStepWaitDuration: number;
3790
+ coarseStepWaitDuration: number;
3791
+ switchStepWaitDuration: number;
3792
+ fineStepWaitDuration: number;
3793
+ maxStepCount: number;
3794
+ /** value < 0 means no never */
3795
+ backToContinousDuration: number;
3796
+ /** The focus width and height, 0 ~ 1, represents the ratio of the length to the `Math.min(video.videoWidth, video.videoHeight)` */
3797
+ focusWH: number;
3798
+ /** From far to near, 0 ~ 1. The closer to 1, the more sensitive but more slow. */
3799
+ coarseTuneRate: number;
3800
+ /**
3801
+ * 0 ~ 1.
3802
+ * When the correct focus is closer, the far focus contrast data is unreliable
3803
+ * and requires a certain degree of error tolerance.
3804
+ * When closer to 1, it will be more sensitive to contrast changes and may also cause the focus to be too far.
3805
+ * When closer to 0, there will be more error tolerance,
3806
+ * and it may also cause the focus to be too close and the process to be too slow.
3807
+ **/
3808
+ coarseTuneTolerance: number;
3809
+ /** From near to far, 1 ~ 1.xx. The closer to 1, the more sensitive but more slow. */
3810
+ fineTuneRate: number;
3811
+ }
3812
+ declare namespace Camera {
3813
+ function _getImageContrast(data: Uint8Array | Uint8ClampedArray, width: number, height: number): number;
3814
+ }
3815
+ interface Camera {
3816
+ _enableTapToFocus: false | 'simple' | 'experimental-advanced';
3817
+ _isFocusing: boolean;
3818
+ _tapToFocusListner: ((this: HTMLElement, ev: PointerEvent) => any) | null;
3819
+ _simpleFocus(): Promise<void>;
3820
+ _advancedFocusParameters: AdvancedFocusParameters;
3821
+ _advancedFocusTaskId: number;
3822
+ _advancedFocus(center?: {
3823
+ x: number;
3824
+ y: number;
3825
+ }, width?: number, height?: number): Promise<void>;
3826
+ get enableTapToFocus(): false | "simple" | "experimental-advanced";
3827
+ set enableTapToFocus(value: false | 'simple' | 'experimental-advanced');
3828
+ }
3829
+
3830
+ interface AutoTorchParameters {
3831
+ shortDelay: number;
3832
+ longDelay: number;
3833
+ shortLongDelaySwitchCount: number;
3834
+ /** 0 ~ 255 */
3835
+ grayThreshold: number;
3836
+ maxDarkCount: number;
3837
+ }
3838
+
3839
+ interface Camera {
3840
+ get isSupportTorch(): boolean;
3841
+ _isTorchOn: boolean | undefined;
3842
+ /** `undefined` means in auto torch mode */
3843
+ get isTorchOn(): boolean | undefined;
3844
+ turnOnTorch(): Promise<void>;
3845
+ turnOffTorch(): Promise<void>;
3846
+ _autoTorchParameters: AutoTorchParameters;
3847
+ /**
3848
+ * Detect how dark the picture and turn on torch automatically.
3849
+ * After camera open, it may take a few seconds for picture to be ready.
3850
+ * So it's suggested not to `turnAutoTorch()` immediately.
3851
+ * Waiting for 3 seconds may bring a better user experience.
3852
+ **/
3853
+ turnAutoTorch(): void;
3854
+ /** The auto torch logic detected that the image was too dark and turn on the torch. */
3855
+ addEventListener(type: 'torchAutoOn', listener: (this: Camera) => void | any): void;
3856
+ removeEventListener(type: 'torchAutoOn', listener: (this: Camera) => void | any): void;
3857
+ }
3858
+
3859
+
3860
+ interface Camera {
3861
+ _shouldCloseWhenHide: boolean;
3862
+ _isDuringCloseWhenHide: boolean;
3863
+ _isOpenBeforeHide: boolean;
3864
+ _maxReopenTry4CloseWhenHide: number;
3865
+ get shouldCloseWhenHide(): boolean;
3866
+ set shouldCloseWhenHide(value: boolean);
3867
+ _closeWhenHide(): Promise<void>;
3868
+ _closeWhenHideListener: EventListener | null;
3869
+ _bindCloseWhenHide(): void;
3870
+ _unbindCloseWhenHide(): void;
3871
+ }
3872
+ declare namespace Camera {
3873
+ let _id4CloseWhenNotInDOM: number;
3874
+ let _stMSBNotInDOMCamera: Set<Camera>;
3875
+ }
3876
+ interface Camera {
3877
+ _id4CloseWhenNotInDOM: number;
3878
+ _shouldCloseWhenNotInDOM: boolean;
3879
+ _bClosedBecauseOfNotInDOM: boolean;
3880
+ /**
3881
+ * After turn on `shouldCloseWhenNotInDOM`:
3882
+ * 1. Once a camera insert into DOM, if the camera leave DOM, it auto close.
3883
+ * 2. Once a mediaStream-binded camera insert into DOM, or a already in DOM camera is opened,
3884
+ * we call this camera as A,
3885
+ * Other cameras who is not in DOM and created before A, will be closed.
3886
+ */
3887
+ get shouldCloseWhenNotInDOM(): boolean;
3888
+ set shouldCloseWhenNotInDOM(value: boolean);
3889
+ _updateMo4CloseWhenNotInDOM(): void;
3890
+ _mo4CloseWhenNotInDOM: MutationObserver | null;
3891
+ }
3892
+ declare namespace Camera {
3893
+ function showFilePicker(inputOptions?: {
3894
+ accept?: string;
3895
+ multiple: boolean;
3896
+ capture?: 'user' | 'environment' | '';
3897
+ onchange?: (this: HTMLInputElement, ev: Event) => any;
3898
+ }): Promise<File[]>;
3899
+ function showFilePicker(inputOptions?: any): Promise<File[]>;
3900
+ let filePicker2CanvasMaxWH: number;
3901
+ function showFilePicker2Canvas(inputOptions?: {
3902
+ accept?: string;
3903
+ multiple: boolean;
3904
+ capture?: 'user' | 'environment' | '';
3905
+ onchange?: (this: HTMLInputElement, ev: Event) => any;
3906
+ canvasMaxWH?: number;
3907
+ }): Promise<HTMLCanvasElement[]>;
3908
+ function showFilePicker2Canvas(inputOptions?: any): Promise<HTMLCanvasElement[]>;
3909
+ }
3910
+
3911
+ /**
3912
+ * Return `Element` if possible, otherwise return `DocumentFragment`.
3913
+ */
3914
+ declare const stringToHtml: (str: string, config?: {
3915
+ inlineScript2Blob?: boolean;
3916
+ internalCss2Blob: boolean;
3917
+ insertInternalCss2ExistedSheet?: boolean;
3918
+ }) => Node;
3919
+
3920
+ declare class FramePipeline {
3921
+ camera?: Camera;
3922
+ _ctx: CanvasRenderingContext2D;
3923
+ _data?: Uint8Array<ArrayBuffer> | null;
3924
+ _dataTime: number;
3925
+ _x?: number;
3926
+ _y?: number;
3927
+ _w?: number;
3928
+ _h?: number;
3929
+ _type?: 'rgba' | 'gray' | 'r' | 'g' | 'b';
3930
+ maxTimeout: number;
3931
+ _pipeTaskId: any;
3932
+ isSaveOriginalRgba: boolean;
3933
+ /**
3934
+ * The `originalRgba` share `ArrayBuffer` with the `data` returned by `getData(..., type: 'rgba')`.
3935
+ * So you should be careful when transferring `data` to other thread.
3936
+ */
3937
+ originalRgba?: Uint8ClampedArray<ArrayBuffer> | null;
3938
+ constructor(camera?: Camera);
3939
+ _getData(): Uint8Array<ArrayBuffer>;
3940
+ /**
3941
+ * @param config
3942
+ * Each parameter should be kept as stable as possible.
3943
+ * If you need to switch between multiple parameters frequently, please create multiple `FramePipeline` instances.
3944
+ *
3945
+ * `x`, `y`, `width`, `height` will be rounded.
3946
+ * Note that the round method takes the effect of `x` into account when rounding `width` to minimize the cumulative error.
3947
+ * The same logic applies to `height`.
3948
+ */
3949
+ getData(config?: {
3950
+ x?: number;
3951
+ y?: number;
3952
+ width?: number;
3953
+ height?: number;
3954
+ type?: 'rgba' | 'gray' | 'r' | 'g' | 'b';
3955
+ }): Uint8Array | null;
3956
+ }
3957
+
3958
+ declare class Beep {
3959
+ _stAudioFree: Set<HTMLAudioElement>;
3960
+ _stAudioPlaying: Set<HTMLAudioElement>;
3961
+ _timeLastPlay: number;
3962
+ _bWarnedMaxTrack: boolean;
3963
+ maxPlayingBeep: number;
3964
+ beepSoundSource: string;
3965
+ beep(): void;
3966
+ }
3967
+ /**
3968
+ * The function will play the default beep sound.
3969
+ * To play different beep sound, you need create another `Beep` instance.
3970
+ **/
3971
+ declare const beep: () => void;
3972
+ declare const vibrate: (duration?: number) => void;
3973
+
3974
+ declare const CameraEnhancerModule: {
3975
+ getVersion(): string;
3976
+ };
3977
+ declare const CameraEnhancer: typeof Camera;
3978
+ type CameraEnhancer = Camera;
3979
+ declare const CameraView: typeof Camera;
3980
+ type CameraView = Camera;
3981
+ declare namespace Camera {
3982
+ function createInstance(_?: any): Promise<CameraEnhancer>;
3983
+ function testCameraAccess(): Promise<{
3984
+ ok: boolean;
3985
+ message?: string;
3986
+ }>;
3987
+ let defaultUIElementURL: string;
3988
+ let onWarning: any;
3989
+ }
3990
+ interface Camera {
3991
+ isCameraEnhancer: true;
3992
+ disposed: boolean;
3993
+ dispose(): void;
3994
+ _cameraEnhancer: CameraEnhancer;
3995
+ _cameraView: CameraView;
3996
+ _dceLastDeviceId: any;
3997
+ _dceLastResolution: any;
3998
+ cameraOpenTimeout: any;
3999
+ _bAutoSingleFrameModeWhenIosPwaFail: boolean;
4000
+ _oriOpen(): Promise<void>;
4001
+ open(): Promise<void | {
4002
+ deviceId: string;
4003
+ width: number;
4004
+ height: number;
4005
+ }>;
4006
+ _oriUpdateCanvasSize(): void;
4007
+ _oriAddCanvas(): HTMLCanvasElement;
4008
+ getAllCameras(): Promise<{
4009
+ deviceId: string;
4010
+ label: string;
4011
+ }[]>;
4012
+ getAvailableResolutions(): Promise<{
4013
+ width: number;
4014
+ height: number;
4015
+ }[]>;
4016
+ getCameraState(): 'opening' | 'open' | 'closed';
4017
+ getResolution(): {
4018
+ width: number;
4019
+ height: number;
4020
+ };
4021
+ getSelectedCamera(): {
4022
+ deviceId: string;
4023
+ label: string;
4024
+ };
4025
+ getVideoSettings(): MediaStreamConstraints;
4026
+ _ifSaveLastUsedCamera: boolean;
4027
+ get ifSaveLastUsedCamera(): boolean;
4028
+ set ifSaveLastUsedCamera(value: boolean);
4029
+ get ifSkipCameraInspection(): boolean;
4030
+ set ifSkipCameraInspection(value: boolean);
4031
+ isOpen(): boolean;
4032
+ isPaused(): boolean;
4033
+ resume(): Promise<void>;
4034
+ selectCamera(device: string | {
4035
+ deviceId: string;
4036
+ label: string;
4037
+ }): Promise<{
4038
+ deviceId: string;
4039
+ width: number;
4040
+ height: number;
4041
+ }>;
4042
+ setResolution(resolution: {
4043
+ width: number;
4044
+ height: number;
4045
+ }): Promise<{
4046
+ deviceId: string;
4047
+ width: number;
4048
+ height: number;
4049
+ }>;
4050
+ updateVideoSettings(constraints: MediaStreamConstraints): Promise<void>;
4051
+ _dceVideoSrc: string;
4052
+ get videoSrc(): string;
4053
+ set videoSrc(value: string | null);
4054
+ _dceEnhancedFeatures: any;
4055
+ _dceAutoZoomRange: {
4056
+ min: number;
4057
+ max: number;
4058
+ };
4059
+ disableEnhancedFeatures(feature: any): void;
4060
+ enableEnhancedFeatures(feature: any): void;
4061
+ getCameraSettings(): MediaTrackSettings;
4062
+ getCapabilities(): MediaTrackCapabilities;
4063
+ getColorTemperature(): number;
4064
+ getExposureCompensation(): number;
4065
+ getFrameRate(): number;
4066
+ setColorTemperature(value: number): Promise<void>;
4067
+ setExposureCompensation(value: number): Promise<void>;
4068
+ setFrameRate(value: number): Promise<void>;
4069
+ getZoomSettings(): {
4070
+ factor: number;
4071
+ };
4072
+ _oriSetZoom(zoom: number): Promise<void>;
4073
+ _dceZoom: number;
4074
+ setZoom(settings: {
4075
+ factor: number;
4076
+ }): Promise<void>;
4077
+ resetZoom(): void;
4078
+ _dceFocusSettings: any;
4079
+ getFocusSettings(): {
4080
+ mode: string;
4081
+ } | {
4082
+ mode: 'manual';
4083
+ distance: number;
4084
+ } | {
4085
+ mode: 'manual';
4086
+ area: {
4087
+ centerPoint: {
4088
+ x: string;
4089
+ y: string;
4090
+ };
4091
+ width?: string;
4092
+ height?: string;
4093
+ };
4094
+ };
4095
+ setFocus(settings: {
4096
+ mode: string;
4097
+ } | {
4098
+ mode: 'manual';
4099
+ distance: number;
4100
+ } | {
4101
+ mode: 'manual';
4102
+ area: {
4103
+ centerPoint: {
4104
+ x: string;
4105
+ y: string;
4106
+ };
4107
+ width?: string;
4108
+ height?: string;
4109
+ };
4110
+ }): Promise<void>;
4111
+ setAutoZoomRange(value: {
4112
+ min: number;
4113
+ max: number;
4114
+ }): void;
4115
+ getAutoZoomRange(): {
4116
+ min: number;
4117
+ max: number;
4118
+ };
4119
+ toggleMirroring(enable: boolean): void;
4120
+ _framePipeline: FramePipeline;
4121
+ fetchImage(): {
4122
+ bytes: Uint8Array;
4123
+ width: number;
4124
+ height: number;
4125
+ stride: number;
4126
+ format: any;
4127
+ toCanvas(): HTMLCanvasElement;
4128
+ };
4129
+ getImage(): {
4130
+ bytes: Uint8Array;
4131
+ width: number;
4132
+ height: number;
4133
+ stride: number;
4134
+ format: any;
4135
+ toCanvas(): HTMLCanvasElement;
4136
+ };
4137
+ _dceScanRegion: {
4138
+ x: number;
4139
+ y: number;
4140
+ width: number;
4141
+ height: number;
4142
+ isMeasuredInPercentage?: boolean;
4143
+ } | {
4144
+ left: number;
4145
+ top: number;
4146
+ right: number;
4147
+ bottom: number;
4148
+ isMeasuredInPercentage?: boolean;
4149
+ };
4150
+ getScanRegion(): {
4151
+ x: number;
4152
+ y: number;
4153
+ width: number;
4154
+ height: number;
4155
+ isMeasuredInPercentage?: boolean;
4156
+ } | {
4157
+ left: number;
4158
+ top: number;
4159
+ right: number;
4160
+ bottom: number;
4161
+ isMeasuredInPercentage?: boolean;
4162
+ };
4163
+ hasNextImageToFetch(): boolean;
4164
+ isBufferEmpty(): boolean;
4165
+ startFetching(): void;
4166
+ _pixelFormat: number;
4167
+ getPixelFormat(): number;
4168
+ setPixelFormat(format: number): void;
4169
+ _colourChannelUsageType: number;
4170
+ setColourChannelUsageType(format: number): void;
4171
+ getColourChannelUsageType(): number;
4172
+ setScanRegion(region?: {
4173
+ x: number;
4174
+ y: number;
4175
+ width: number;
4176
+ height: number;
4177
+ isMeasuredInPercentage?: boolean;
4178
+ } | {
4179
+ left: number;
4180
+ top: number;
4181
+ right: number;
4182
+ bottom: number;
4183
+ isMeasuredInPercentage?: boolean;
4184
+ }): void;
4185
+ stopFetching(): void;
4186
+ takePhoto(listener: (dceFrame: {
4187
+ bytes: Uint8Array;
4188
+ width: number;
4189
+ height: number;
4190
+ stride: number;
4191
+ format: any;
4192
+ toCanvas(): HTMLCanvasElement;
4193
+ }) => void): Promise<{
4194
+ bytes: Uint8Array;
4195
+ width: number;
4196
+ height: number;
4197
+ stride: number;
4198
+ format: any;
4199
+ toCanvas(): HTMLCanvasElement;
4200
+ }>;
4201
+ addImageToBuffer: any;
4202
+ clearBuffer: any;
4203
+ getBufferOverflowProtectionMode: any;
4204
+ getImageCount: any;
4205
+ getImageFetchInterval: any;
4206
+ getMaxImageCount: any;
4207
+ hasImage: any;
4208
+ setBufferOverflowProtectionMode: any;
4209
+ setErrorListener: any;
4210
+ setImageFetchInterval: any;
4211
+ setMaxImageCount: any;
4212
+ setNextImageToReturn: any;
4213
+ _dceSettingsBeforeSingleFrameMode: any;
4214
+ _singleFrameMode: "disabled" | "camera" | "image";
4215
+ _singleFrameModeClickCallback: any;
4216
+ _singleFrameModeResultForDcv: DCEFrame | null;
4217
+ _singleFrameModeCvs: HTMLCanvasElement | null;
4218
+ _singleFrameModeUIAutoFitRO: ResizeObserver | undefined;
4219
+ get singleFrameMode(): "disabled" | "camera" | "image";
4220
+ set singleFrameMode(value: "disabled" | "camera" | "image");
4221
+ _singleFrameModeObjectFit: 'contain' | 'cover' | 'fill';
4222
+ _singleFrameModeUpdateObjectFit(): void;
4223
+ setCameraView(view: CameraView): void;
4224
+ getCameraView(): CameraView;
4225
+ getVideoEl(): HTMLVideoElement;
4226
+ convertToPageCoordinates(point: {
4227
+ x: number;
4228
+ y: number;
4229
+ }): {
4230
+ x: number;
4231
+ y: number;
4232
+ };
4233
+ convertToClientCoordinates(point: {
4234
+ x: number;
4235
+ y: number;
4236
+ }): {
4237
+ x: number;
4238
+ y: number;
4239
+ };
4240
+ convertToScanRegionCoordinates(point: {
4241
+ x: number;
4242
+ y: number;
4243
+ }): {
4244
+ x: number;
4245
+ y: number;
4246
+ };
4247
+ convertToContainCoordinates(point: {
4248
+ x: number;
4249
+ y: number;
4250
+ }): {
4251
+ x: number;
4252
+ y: number;
4253
+ };
4254
+ _dceEventListeners: {
4255
+ [key: string]: Set<Function>;
4256
+ };
4257
+ on(eventName: string, listener: Function): void;
4258
+ off(eventName: string, listener: Function): void;
4259
+ _dceMNIsBeepBarcode: boolean;
4260
+ _dceMNIsVibrateBarcode: boolean;
4261
+ getUIElement(): HTMLElement;
4262
+ setUIElement(ui: HTMLDivElement | string): Promise<void>;
4263
+ getVideoElement(): HTMLVideoElement;
4264
+ setVideoFit(fit: 'contain' | 'cover' | 'fill'): void;
4265
+ getVideoFit(): 'contain' | 'cover' | 'fill';
4266
+ getVisibleRegionOfVideo(options?: {
4267
+ inPixels?: boolean;
4268
+ }): {
4269
+ x: number;
4270
+ y: number;
4271
+ width: number;
4272
+ height: number;
4273
+ isMeasuredInPercentage?: boolean;
4274
+ };
4275
+ _dceRegionMaskStyle: {
4276
+ lineWidth: number;
4277
+ strokeStyle: string;
4278
+ fillStyle: string;
4279
+ };
4280
+ setScanRegionMaskStyle(style: {
4281
+ lineWidth: number;
4282
+ strokeStyle: string;
4283
+ fillStyle: string;
4284
+ }): void;
4285
+ getScanRegionMaskStyle(): {
4286
+ lineWidth: number;
4287
+ strokeStyle: string;
4288
+ fillStyle: string;
4289
+ };
4290
+ _dceRegionMaskVisible: boolean;
4291
+ setScanRegionMaskVisible(visible: boolean): void;
4292
+ isScanRegionMaskVisible(): boolean;
4293
+ setScanLaserVisible(visible: boolean): void;
4294
+ isScanLaserVisible(): boolean;
4295
+ setPowerByMessageVisible(visible: boolean): void;
4296
+ isPowerByMessageVisible(): boolean;
4297
+ _dceTipDuration: number;
4298
+ _dceTipMessage: string;
4299
+ getTipConfig(): TipConfig;
4300
+ setTipConfig(tipConfig: TipConfig): void;
4301
+ setTipVisible(visible: boolean): void;
4302
+ isTipVisible(): boolean;
4303
+ updateTipMessage(message: string): void;
4304
+ _drawingLayers: DrawingLayer[];
4305
+ createDrawingLayer(): DrawingLayer;
4306
+ getDrawingLayer(id: number): DrawingLayer;
4307
+ getAllDrawingLayers(): DrawingLayer[];
4308
+ clearUserDefinedDrawingLayers(): void;
4309
+ deleteUserDefinedDrawingLayer(id: number): void;
4310
+ clearAllInnerDrawingItems(_?: boolean): void;
4311
+ _capturedResultReceiver: any;
4312
+ }
4313
+ declare function _bufferToCanvas(uint8Array: Uint8Array, width: number, height: number, format: number): HTMLCanvasElement;
4314
+ declare class Feedback {
4315
+ static _beepInstance: Beep;
4316
+ static beep(): void;
4317
+ static get beepSoundSource(): string;
4318
+ static set beepSoundSource(value: string);
4319
+ static vibrate(): void;
4320
+ static vibrateDuration: number;
4321
+ }
4322
+ declare const DrawingStyleManager: {
4323
+ STYLE_BLUE_STROKE: any;
4324
+ STYLE_GREEN_STROKE: any;
4325
+ STYLE_ORANGE_STROKE: any;
4326
+ STYLE_YELLOW_STROKE: any;
4327
+ STYLE_BLUE_STROKE_FILL: any;
4328
+ STYLE_GREEN_STROKE_FILL: any;
4329
+ STYLE_ORANGE_STROKE_FILL: any;
4330
+ STYLE_YELLOW_STROKE_FILL: any;
4331
+ STYLE_BLUE_STROKE_TRANSPARENT: any;
4332
+ STYLE_GREEN_STROKE_TRANSPARENT: any;
4333
+ STYLE_ORANGE_STROKE_TRANSPARENT: any;
4334
+ STYLE_YELLOW_STROKE_TRANSPARENT: any;
4335
+ createDrawingStyle(style: any): any;
4336
+ getDrawingStyle(id: any): any;
4337
+ getAllDrawingStyles(): any[];
4338
+ updateDrawingStyle(id: any, style: any): void;
4339
+ };
4340
+ declare class DrawingLayer {
4341
+ _visible: boolean;
4342
+ _dce: CameraView;
4343
+ _ctx: CanvasRenderingContext2D;
4344
+ _defaultStyle: any;
4345
+ _drawingItems: DrawingItem[];
4346
+ _mode: 'editor' | 'viewer';
4347
+ _editorView: any;
4348
+ _extraEditorView: any;
4349
+ _renderTask: any;
4350
+ _newSelectedDrawingItems: DrawingItem[];
4351
+ _newDeselectedDrawingItems: DrawingItem[];
4352
+ _selectionChangedTask: any;
4353
+ _onSelectionChanged?: (newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void;
4354
+ getId(): this;
4355
+ isVisible(): boolean;
4356
+ setVisible(value: boolean): void;
4357
+ setDefaultStyle(drawingStyleId: any, _1?: any, _2?: any): void;
4358
+ addDrawingItems(drawingItems: DrawingItem[]): void;
4359
+ removeDrawingItems(drawingItems: DrawingItem[]): void;
4360
+ setDrawingItems(drawingItems: DrawingItem[]): void;
4361
+ getDrawingItems(filter?: (drawingItem: DrawingItem) => boolean): DrawingItem[];
4362
+ hasDrawingItem(drawingItem: DrawingItem): boolean;
4363
+ getSelectedDrawingItems(): any;
4364
+ clearDrawingItems(): void;
4365
+ _delayRenderAll(): void;
4366
+ renderAll(): void;
4367
+ getMode(): "editor" | "viewer";
4368
+ setMode(mode: 'editor' | 'viewer'): Promise<void>;
4369
+ _delaySelectionChanged(): void;
4370
+ get onSelectionChanged(): ((newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void) | undefined;
4371
+ set onSelectionChanged(value: ((newSelectedDrawingItems: DrawingItem[], newDeselectedDrawingItems: DrawingItem[]) => void) | undefined);
4372
+ }
4373
+ /**
4374
+ * Determines if a point is inside a quadrilateral.
4375
+ * @param {number[]} point - [x, y] coordinates of the point.
4376
+ * @param {number[][]} polygon - Array of points [[x0, y0], [x1, y1], [x2, y2], [x3, y3]].
4377
+ * @returns {boolean} - True if the point is inside.
4378
+ */
4379
+ declare function _isPointInPolygon(point: number[], polygon: number[][]): boolean;
4380
+ /**
4381
+ * Calculates the shortest distance from a point to a line segment.
4382
+ * @param {number[]} p - The point [x, y]
4383
+ * @param {number[][]} segment - The segment [[x1, y1], [x2, y2]]
4384
+ * @returns {number} The shortest distance
4385
+ */
4386
+ declare function _distToSegment(p: number[], segment: number[][]): number;
4387
+ declare class DrawingItem {
4388
+ coordinateBase: string;
4389
+ drawingLayerId: any;
4390
+ drawingStyleId: any;
4391
+ mediaType: EnumDrawingItemMediaType;
4392
+ _notes: Note[];
4393
+ _bSelected: boolean;
4394
+ _dceEventListeners: {
4395
+ [key: string]: Set<Function>;
4396
+ };
4397
+ get _ps(): {
4398
+ x: number;
4399
+ y: number;
4400
+ }[];
4401
+ getState(): EnumDrawingItemState;
4402
+ addNote(note: Note, replace?: boolean): void;
4403
+ getNote(name: string): Note | null;
4404
+ getNotes(): Note[];
4405
+ hasNote(name: string): boolean;
4406
+ updateNote(name: string, content: any, isMergeContent?: boolean): void;
4407
+ deleteNote(name: string): void;
4408
+ clearNotes(): void;
4409
+ _delayRenderAll(): void;
4410
+ _setSelected(value: boolean): void;
4411
+ on(type: string, listener: Function): void;
4412
+ off(type: string, listener: Function): void;
4413
+ }
4414
+ declare class LineDrawingItem extends DrawingItem {
4415
+ line: {
4416
+ startPoint: {
4417
+ x: number;
4418
+ y: number;
4419
+ };
4420
+ endPoint: {
4421
+ x: number;
4422
+ y: number;
4423
+ };
4424
+ };
4425
+ get _ps(): {
4426
+ x: number;
4427
+ y: number;
4428
+ }[];
4429
+ constructor(line: {
4430
+ startPoint: {
4431
+ x: number;
4432
+ y: number;
4433
+ };
4434
+ endPoint: {
4435
+ x: number;
4436
+ y: number;
4437
+ };
4438
+ }, drawingStyleId?: any);
4439
+ getLine(): {
4440
+ startPoint: {
4441
+ x: number;
4442
+ y: number;
4443
+ };
4444
+ endPoint: {
4445
+ x: number;
4446
+ y: number;
4447
+ };
4448
+ };
4449
+ setLine(value: {
4450
+ startPoint: {
4451
+ x: number;
4452
+ y: number;
4453
+ };
4454
+ endPoint: {
4455
+ x: number;
4456
+ y: number;
4457
+ };
4458
+ }): void;
4459
+ }
4460
+ declare class QuadDrawingItem extends DrawingItem {
4461
+ quad: {
4462
+ points: {
4463
+ x: number;
4464
+ y: number;
4465
+ }[];
4466
+ };
4467
+ get _ps(): {
4468
+ x: number;
4469
+ y: number;
4470
+ }[];
4471
+ constructor(quad: {
4472
+ points: {
4473
+ x: number;
4474
+ y: number;
4475
+ }[];
4476
+ }, drawingStyleId?: any);
4477
+ getQuad(): {
4478
+ points: {
4479
+ x: number;
4480
+ y: number;
4481
+ }[];
4482
+ };
4483
+ setQuad(value: {
4484
+ points: {
4485
+ x: number;
4486
+ y: number;
4487
+ }[];
4488
+ }): void;
4489
+ }
4490
+ declare class RectDrawingItem extends DrawingItem {
4491
+ rect: {
4492
+ x: number;
4493
+ y: number;
4494
+ width: number;
4495
+ height: number;
4496
+ };
4497
+ get _ps(): {
4498
+ x: number;
4499
+ y: number;
4500
+ }[];
4501
+ constructor(rect: {
4502
+ x: number;
4503
+ y: number;
4504
+ width: number;
4505
+ height: number;
4506
+ }, drawingStyleId?: any);
4507
+ getRect(): {
4508
+ x: number;
4509
+ y: number;
4510
+ width: number;
4511
+ height: number;
4512
+ };
4513
+ setRect(value: {
4514
+ x: number;
4515
+ y: number;
4516
+ width: number;
4517
+ height: number;
4518
+ }): void;
4519
+ }
4520
+ declare class TextDrawingItem extends DrawingItem {
4521
+ text: string;
4522
+ rect: {
4523
+ x: number;
4524
+ y: number;
4525
+ width: number;
4526
+ height: number;
4527
+ };
4528
+ get _ps(): {
4529
+ x: number;
4530
+ y: number;
4531
+ }[];
4532
+ constructor(text: string, rect: {
4533
+ x: number;
4534
+ y: number;
4535
+ width: number;
4536
+ height: number;
4537
+ }, drawingStyleId?: any);
4538
+ getText(): string;
4539
+ setText(value: string): void;
4540
+ getTextRect(): {
4541
+ x: number;
4542
+ y: number;
4543
+ width: number;
4544
+ height: number;
4545
+ };
4546
+ setTextRect(value: {
4547
+ x: number;
4548
+ y: number;
4549
+ width: number;
4550
+ height: number;
4551
+ }): void;
4552
+ }
4553
+ declare class ImageDrawingItem extends DrawingItem {
4554
+ image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
4555
+ rect: {
4556
+ x: number;
4557
+ y: number;
4558
+ width: number;
4559
+ height: number;
4560
+ };
4561
+ maintainAspectRatio: boolean;
4562
+ get _ps(): {
4563
+ x: number;
4564
+ y: number;
4565
+ }[];
4566
+ constructor(image: {
4567
+ bytes: Uint8Array;
4568
+ width: number;
4569
+ height: number;
4570
+ stride: number;
4571
+ format: any;
4572
+ } | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, rect: {
4573
+ x: number;
4574
+ y: number;
4575
+ width: number;
4576
+ height: number;
4577
+ }, maintainAspectRatio: boolean, drawingStyleId?: any);
4578
+ getImage(): HTMLVideoElement | HTMLCanvasElement | HTMLImageElement;
4579
+ setImage(image: {
4580
+ bytes: Uint8Array;
4581
+ width: number;
4582
+ height: number;
4583
+ stride: number;
4584
+ format: any;
4585
+ } | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void;
4586
+ getImageRect(): {
4587
+ x: number;
4588
+ y: number;
4589
+ width: number;
4590
+ height: number;
4591
+ };
4592
+ setImageRect(value: {
4593
+ x: number;
4594
+ y: number;
4595
+ width: number;
4596
+ height: number;
4597
+ }): void;
4598
+ }
4599
+
4600
+ declare enum EnumDrawingItemMediaType {
4601
+ /**
4602
+ * Represents a rectangle, a basic geometric shape with four sides where opposite sides are equal in length and it has four right angles.
4603
+ */
4604
+ DIMT_RECTANGLE = 1,
4605
+ /**
4606
+ * Represents any four-sided figure. This includes squares, rectangles, rhombuses, and more general forms that do not necessarily have right angles or equal sides.
4607
+ */
4608
+ DIMT_QUADRILATERAL = 2,
4609
+ /**
4610
+ * Represents a text element. This allows for the inclusion of textual content as a distinct drawing item within the graphic representation.
4611
+ */
4612
+ DIMT_TEXT = 4,
4613
+ /**
4614
+ * Represents an image. This enables embedding bitmap images within the drawing context.
4615
+ */
4616
+ DIMT_IMAGE = 16,
4617
+ /**
4618
+ * Represents a line segment. This is the simplest form of a drawing item, defined by two endpoints and the straight path connecting them.
4619
+ */
4620
+ DIMT_LINE = 64
4621
+ }
4622
+ declare enum EnumDrawingItemState {
4623
+ /**
4624
+ * DIS_DEFAULT: The default state of a drawing item. This state indicates that the drawing item is in its normal, unselected state.
4625
+ */
4626
+ DIS_DEFAULT = 1,
4627
+ /**
4628
+ * DIS_SELECTED: Indicates that the drawing item is currently selected. This state can trigger different behaviors or visual styles, such as highlighting the item to show it is active or the focus of user interaction.
4629
+ */
4630
+ DIS_SELECTED = 2
4631
+ }
4632
+ declare enum EnumEnhancedFeatures {
4633
+ /**
4634
+ * Enables auto-focus on areas likely to contain barcodes, assisting in their identification and interpretation.
4635
+ */
4636
+ EF_ENHANCED_FOCUS = 4,
4637
+ /**
4638
+ * Facilitates automatic zooming in on areas likely to contain barcodes, aiding in their detection and decoding.
4639
+ */
4640
+ EF_AUTO_ZOOM = 16,
4641
+ /**
4642
+ * Allows users to tap on a specific item or area in the video feed to focus on, simplifying the interaction for selecting or highlighting important elements.
4643
+ */
4644
+ EF_TAP_TO_FOCUS = 64
4645
+ }
4646
+ declare enum EnumPixelFormat {
4647
+ GREY = "grey",
4648
+ GREY32 = "grey32",
4649
+ RGBA = "rgba",
4650
+ RBGA = "rbga",
4651
+ GRBA = "grba",
4652
+ GBRA = "gbra",
4653
+ BRGA = "brga",
4654
+ BGRA = "bgra"
4655
+ }
4656
+ interface Resolution {
4657
+ width: number;
4658
+ height: number;
4659
+ }
4660
+ interface DCEFrame {
4661
+ bytes: Uint8Array;
4662
+ width: number;
4663
+ height: number;
4664
+ stride: number;
4665
+ format: any;
4666
+ toCanvas(): HTMLCanvasElement;
4667
+ }
4668
+ interface DrawingStyle {
4669
+ fillStyle?: string;
4670
+ lineWidth?: number;
4671
+ paintMode?: string;
4672
+ strokeStyle?: string;
4673
+ }
4674
+ interface PlayCallbackInfo {
4675
+ deviceId: string;
4676
+ width: number;
4677
+ height: number;
4678
+ }
4679
+ interface VideoDeviceInfo {
4680
+ deviceId: string;
4681
+ label: string;
4682
+ }
4683
+ interface VideoFrameTag {
4684
+ /** The unique identifier of the image. */
4685
+ imageId: number;
4686
+ /** The type of the image. */
4687
+ type: any;
4688
+ /** Indicates whether the video frame is cropped. */
4689
+ isCropped: boolean;
4690
+ /** The region based on which the original frame was cropped. If `isCropped` is false, the region covers the entire original image. */
4691
+ cropRegion: any;
4692
+ /** The original width of the video frame before any cropping. */
4693
+ originalWidth: number;
4694
+ /** The original height of the video frame before any cropping. */
4695
+ originalHeight: number;
4696
+ /** The current width of the video frame after cropping. */
4697
+ currentWidth: number;
4698
+ /** The current height of the video frame after cropping. */
4699
+ currentHeight: number;
4700
+ /** The time spent acquiring the frame, in milliseconds. */
4701
+ timeSpent: number;
4702
+ /** The timestamp marking the completion of the frame acquisition. */
4703
+ timeStamp: number;
4704
+ }
4705
+ interface TipConfig {
4706
+ /** The top left point of the tip message box. */
4707
+ topLeftPoint?: any;
4708
+ /** The width of the tip message box. */
4709
+ width?: number;
4710
+ /** The display duration of the tip in milliseconds. */
4711
+ duration: number;
4712
+ /** The base coordinate system used (e.g., "view" or "image"). */
4713
+ coordinateBase?: "view" | "image";
4714
+ }
4715
+ interface Note {
4716
+ /** The name of the note. */
4717
+ name: string;
4718
+ /** The content of the note, can be of any type. */
4719
+ content: any;
4720
+ }
4721
+
4722
+ export { Beep, Camera, CameraEnhancer, CameraEnhancerModule, CameraView, DrawingItem, DrawingLayer, DrawingStyleManager, EnumDrawingItemMediaType, EnumDrawingItemState, EnumEnhancedFeatures, EnumPixelFormat, Feedback, FramePipeline, ImageDrawingItem, LineDrawingItem, QuadDrawingItem, RectDrawingItem, TextDrawingItem, _bufferToCanvas, _distToSegment, _isPointInPolygon, beep, stringToHtml, vibrate };
4723
+ export type { CameraInfo, CameraPreset, CameraStatus, CameraZsFunc, DCEFrame, DMMoreMediaTrackCapabilities, DrawingStyle, Note, PlayCallbackInfo, Resolution, TipConfig, VideoDeviceInfo, VideoFrameTag };
4724
+