@@ -6,44 +6,44 @@ declare global {
66 * Barcode Detection API. This list may change in the future.
77 * Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API
88 */
9- type BarcodeFormat = 'aztec'
10- | 'code_128'
11- | 'code_39'
12- | 'code_93'
13- | 'codabar'
14- | 'data_matrix'
15- | 'ean_13'
16- | 'ean_8'
17- | 'itf'
18- | 'pdf417'
19- | 'qr_code'
20- | 'upc_a'
21- | 'upc_e'
9+ type BarcodeFormat = 'aztec'
10+ | 'code_128'
11+ | 'code_39'
12+ | 'code_93'
13+ | 'codabar'
14+ | 'data_matrix'
15+ | 'ean_13'
16+ | 'ean_8'
17+ | 'itf'
18+ | 'pdf417'
19+ | 'qr_code'
20+ | 'upc_a'
21+ | 'upc_e'
2222 | 'unknown' ;
2323
2424 /**
2525 * The return type of the Barcode Detect API `detect` function that
2626 * describes a barcode that has been recognized by the API.
2727 */
2828 interface DetectedBarcode {
29- /**
29+ /**
3030 * A DOMRectReadOnly, which returns the dimensions of a rectangle
3131 * representing the extent of a detected barcode, aligned with the
32- * image
32+ * image
3333 */
3434 boundingBox : DOMRectReadOnly ;
3535
3636 /**
3737 * The x and y co-ordinates of the four corner points of the detected
3838 * barcode relative to the image, starting with the top left and working
3939 * clockwise. This may not be square due to perspective distortions
40- * within the image.
40+ * within the image.
4141 */
42- cornerPoints : Array < {
42+ cornerPoints : {
4343 x : number ,
4444 y : number ,
45- } > ;
46-
45+ } [ ] ;
46+
4747 /**
4848 * The detected barcode format
4949 */
@@ -59,8 +59,8 @@ declare global {
5959 * Options for describing how a BarcodeDetector should be initialised
6060 */
6161 interface BarcodeDetectorOptions {
62- /**
63- * Which formats the barcode detector should detect
62+ /**
63+ * Which formats the barcode detector should detect
6464 */
6565 formats : BarcodeFormat [ ] ;
6666 }
@@ -70,18 +70,18 @@ declare global {
7070 * detection of linear and two dimensional barcodes in images.
7171 */
7272 class BarcodeDetector {
73- /**
74- * Initialize a Barcode Detector instance
73+ /**
74+ * Initialize a Barcode Detector instance
7575 */
7676 constructor ( options ?: BarcodeDetectorOptions ) ;
7777
7878 /**
79- * Retrieve the formats that are supported by the detector
79+ * Retrieve the formats that are supported by the detector
8080 */
8181 static getSupportedFormats ( ) : Promise < BarcodeFormat [ ] > ;
8282
83- /**
84- * Attempt to detect barcodes from an image source
83+ /**
84+ * Attempt to detect barcodes from an image source
8585 */
8686 public detect ( source : ImageBitmapSource ) : Promise < DetectedBarcode [ ] > ;
8787 }
0 commit comments