diff --git a/package-lock.json b/package-lock.json index b13a7358..b8e8364d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -130,6 +130,7 @@ "integrity": "sha512-250HTVd/W/KdMygoqaedisvNbHbpbQTN2Hy/8ZYGm1nAqE0Fx7sGss4l0nDg33STxEdDhtVRoL2fIaaiukKseA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -1016,7 +1017,6 @@ "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", "dev": true, - "license": "MIT", "engines": { "node": "20 || >=22" } @@ -1265,6 +1265,7 @@ "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -1639,7 +1640,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1653,7 +1653,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1681,7 +1680,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1737,7 +1735,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openharmony" @@ -1779,7 +1776,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1902,6 +1898,7 @@ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", @@ -2087,6 +2084,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2544,6 +2542,7 @@ "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@chevrotain/cst-dts-gen": "11.0.3", "@chevrotain/gast": "11.0.3", @@ -3131,6 +3130,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -7095,6 +7095,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7474,7 +7475,7 @@ }, "packages/barcode-scanning": { "name": "@capacitor-mlkit/barcode-scanning", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7485,6 +7486,7 @@ "url": "https://opencollective.com/capawesome" } ], + "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "8.0.0", @@ -7524,7 +7526,7 @@ }, "packages/document-scanner": { "name": "@capacitor-mlkit/document-scanner", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7574,7 +7576,7 @@ }, "packages/face-detection": { "name": "@capacitor-mlkit/face-detection", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7624,7 +7626,7 @@ }, "packages/face-mesh-detection": { "name": "@capacitor-mlkit/face-mesh-detection", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7674,7 +7676,7 @@ }, "packages/selfie-segmentation": { "name": "@capacitor-mlkit/selfie-segmentation", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7724,7 +7726,7 @@ }, "packages/subject-segmentation": { "name": "@capacitor-mlkit/subject-segmentation", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", @@ -7774,7 +7776,7 @@ }, "packages/translation": { "name": "@capacitor-mlkit/translation", - "version": "7.0.0", + "version": "8.0.0", "funding": [ { "type": "github", diff --git a/packages/barcode-scanning/.gitignore b/packages/barcode-scanning/.gitignore index 70ccbf71..ad2a563f 100644 --- a/packages/barcode-scanning/.gitignore +++ b/packages/barcode-scanning/.gitignore @@ -1,5 +1,4 @@ # node files -dist node_modules # iOS files diff --git a/packages/barcode-scanning/README.md b/packages/barcode-scanning/README.md index dc4077f8..9ee55515 100644 --- a/packages/barcode-scanning/README.md +++ b/packages/barcode-scanning/README.md @@ -308,6 +308,8 @@ If you can't see the camera view, make sure all elements in the DOM are not visi * [`startScan(...)`](#startscan) * [`stopScan()`](#stopscan) +* [`pauseScan()`](#pausescan) +* [`resumeScan()`](#resumescan) * [`readBarcodesFromImage(...)`](#readbarcodesfromimage) * [`scan(...)`](#scan) * [`isSupported()`](#issupported) @@ -368,6 +370,32 @@ Stop scanning for barcodes. -------------------- +### pauseScan() + +```typescript +pauseScan() => Promise +``` + +Pause scanning for barcodes. + +**Since:** 8.1.0 + +-------------------- + + +### resumeScan() + +```typescript +resumeScan() => Promise +``` + +Resume scanning for barcodes. + +**Since:** 8.1.0 + +-------------------- + + ### readBarcodesFromImage(...) ```typescript diff --git a/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScanner.java b/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScanner.java index 6ccdc256..70bcd552 100644 --- a/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScanner.java +++ b/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScanner.java @@ -80,6 +80,8 @@ public class BarcodeScanner implements ImageAnalysis.Analyzer { private boolean isTorchEnabled = false; + private boolean isPaused = false; + public BarcodeScanner(BarcodeScannerPlugin plugin) { this.plugin = plugin; } @@ -177,9 +179,54 @@ public void stopScan() { } barcodeScannerInstance = null; scanSettings = null; + isPaused = false; barcodeRawValueVotes.clear(); } + /** + * Must run on UI thread. + */ + public void pauseScan() { + isPaused = true; + if (processCameraProvider != null) { + processCameraProvider.unbindAll(); + } + } + + /** + * Must run on UI thread. + */ + public void resumeScan() { + if (!isPaused || scanSettings == null || processCameraProvider == null) { + return; + } + + isPaused = false; + + try { + ImageAnalysis imageAnalysis = new ImageAnalysis.Builder() + .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) + .setTargetResolution(scanSettings.resolution) + .build(); + imageAnalysis.setAnalyzer(ContextCompat.getMainExecutor(plugin.getContext()), this); + + CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(scanSettings.lensFacing).build(); + + Preview preview = new Preview.Builder().build(); + if (previewView != null) { + preview.setSurfaceProvider(previewView.getSurfaceProvider()); + } + + camera = processCameraProvider.bindToLifecycle((LifecycleOwner) plugin.getContext(), cameraSelector, preview, imageAnalysis); + + if (isTorchEnabled && camera != null) { + camera.getCameraControl().enableTorch(true); + } + } catch (Exception exception) { + handleScanError(exception); + } + } + public void readBarcodesFromImage(String path, ScanSettings scanSettings, ReadBarcodesFromImageResultCallback callback) throws Exception { InputImage inputImage; @@ -354,6 +401,11 @@ public boolean isCameraActive() { @Override public void analyze(@NonNull ImageProxy imageProxy) { + if (isPaused) { + imageProxy.close(); + return; + } + @SuppressLint("UnsafeOptInUsageError") Image image = imageProxy.getImage(); diff --git a/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScannerPlugin.java b/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScannerPlugin.java index 2dfa02dd..a58dc586 100644 --- a/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScannerPlugin.java +++ b/packages/barcode-scanning/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/barcodescanning/BarcodeScannerPlugin.java @@ -122,6 +122,34 @@ public void stopScan(PluginCall call) { } } + @PluginMethod + public void pauseScan(PluginCall call) { + try { + getActivity() + .runOnUiThread(() -> { + implementation.pauseScan(); + call.resolve(); + }); + } catch (Exception exception) { + Logger.error(TAG, exception.getMessage(), exception); + call.reject(exception.getMessage()); + } + } + + @PluginMethod + public void resumeScan(PluginCall call) { + try { + getActivity() + .runOnUiThread(() -> { + implementation.resumeScan(); + call.resolve(); + }); + } catch (Exception exception) { + Logger.error(TAG, exception.getMessage(), exception); + call.reject(exception.getMessage()); + } + } + @PluginMethod public void readBarcodesFromImage(PluginCall call) { try { diff --git a/packages/barcode-scanning/dist/docs.json b/packages/barcode-scanning/dist/docs.json new file mode 100644 index 00000000..1a1d612e --- /dev/null +++ b/packages/barcode-scanning/dist/docs.json @@ -0,0 +1,2809 @@ +{ + "api": { + "name": "BarcodeScannerPlugin", + "slug": "barcodescannerplugin", + "docs": "", + "tags": [], + "methods": [ + { + "name": "startScan", + "signature": "(options?: StartScanOptions | undefined) => Promise", + "parameters": [ + { + "name": "options", + "docs": "", + "type": "StartScanOptions | undefined" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Start scanning for barcodes.", + "complexTypes": [ + "StartScanOptions" + ], + "slug": "startscan" + }, + { + "name": "stopScan", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Stop scanning for barcodes.", + "complexTypes": [], + "slug": "stopscan" + }, + { + "name": "pauseScan", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "8.1.0" + } + ], + "docs": "Pause scanning for barcodes.", + "complexTypes": [], + "slug": "pausescan" + }, + { + "name": "resumeScan", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "8.1.0" + } + ], + "docs": "Resume scanning for barcodes.", + "complexTypes": [], + "slug": "resumescan" + }, + { + "name": "readBarcodesFromImage", + "signature": "(options: ReadBarcodesFromImageOptions) => Promise", + "parameters": [ + { + "name": "options", + "docs": "", + "type": "ReadBarcodesFromImageOptions" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Read barcodes from an image.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "ReadBarcodesFromImageResult", + "ReadBarcodesFromImageOptions" + ], + "slug": "readbarcodesfromimage" + }, + { + "name": "scan", + "signature": "(options?: ScanOptions | undefined) => Promise", + "parameters": [ + { + "name": "options", + "docs": "", + "type": "ScanOptions | undefined" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + }, + { + "name": "experimental", + "text": "This method is experimental and may change in the future." + } + ], + "docs": "Scan a barcode with a ready-to-use interface without WebView customization.\n\nOn **Android**, this method is only available on devices with Google Play Services\ninstalled. Therefore, no camera permission is required.\n\n**Attention:** Before using this method on *Android*, first check if the Google Barcode Scanner module is available\nby using `isGoogleBarcodeScannerModuleAvailable()`.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "ScanResult", + "ScanOptions" + ], + "slug": "scan" + }, + { + "name": "isSupported", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Returns whether or not the barcode scanner is supported.", + "complexTypes": [ + "IsSupportedResult" + ], + "slug": "issupported" + }, + { + "name": "enableTorch", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "7.2.0" + } + ], + "docs": "Enable camera's torch (flash) during a scan session.\n\nOnly available on Android and iOS.", + "complexTypes": [], + "slug": "enabletorch" + }, + { + "name": "disableTorch", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "7.2.0" + } + ], + "docs": "Disable camera's torch (flash) during a scan session.\n\nOnly available on Android and iOS.", + "complexTypes": [], + "slug": "disabletorch" + }, + { + "name": "toggleTorch", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "7.2.0" + } + ], + "docs": "Toggle camera's torch (flash) during a scan session.\n\nOnly available on Android and iOS.", + "complexTypes": [], + "slug": "toggletorch" + }, + { + "name": "isTorchEnabled", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "7.2.0" + } + ], + "docs": "Returns whether or not the camera's torch (flash) is enabled.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "IsTorchEnabledResult" + ], + "slug": "istorchenabled" + }, + { + "name": "isTorchAvailable", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "7.2.0" + } + ], + "docs": "Returns whether or not the camera's torch (flash) is available.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "IsTorchAvailableResult" + ], + "slug": "istorchavailable" + }, + { + "name": "setZoomRatio", + "signature": "(options: SetZoomRatioOptions) => Promise", + "parameters": [ + { + "name": "options", + "docs": "", + "type": "SetZoomRatioOptions" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.4.0" + } + ], + "docs": "Set the zoom ratio of the camera.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "SetZoomRatioOptions" + ], + "slug": "setzoomratio" + }, + { + "name": "getZoomRatio", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.4.0" + } + ], + "docs": "Get the zoom ratio of the camera.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "GetZoomRatioResult" + ], + "slug": "getzoomratio" + }, + { + "name": "getMinZoomRatio", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.4.0" + } + ], + "docs": "Get the minimum zoom ratio of the camera.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "GetMinZoomRatioResult" + ], + "slug": "getminzoomratio" + }, + { + "name": "getMaxZoomRatio", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.4.0" + } + ], + "docs": "Get the maximum zoom ratio of the camera.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "GetMaxZoomRatioResult" + ], + "slug": "getmaxzoomratio" + }, + { + "name": "openSettings", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Open the settings of the app so that the user can grant the camera permission.\n\nOnly available on Android and iOS.", + "complexTypes": [], + "slug": "opensettings" + }, + { + "name": "isGoogleBarcodeScannerModuleAvailable", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.1.0" + } + ], + "docs": "Check if the Google Barcode Scanner module is available.\n\nIf the Google Barcode Scanner module is not available, you can install it by using `installGoogleBarcodeScannerModule()`.\n\nOnly available on Android.", + "complexTypes": [ + "IsGoogleBarcodeScannerModuleAvailableResult" + ], + "slug": "isgooglebarcodescannermoduleavailable" + }, + { + "name": "installGoogleBarcodeScannerModule", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.1.0" + } + ], + "docs": "Install the Google Barcode Scanner module.\n\n**Attention**: This only starts the installation.\nThe `googleBarcodeScannerModuleInstallProgress` event listener will\nnotify you when the installation is complete.\n\nOnly available on Android.", + "complexTypes": [], + "slug": "installgooglebarcodescannermodule" + }, + { + "name": "checkPermissions", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Check camera permission.", + "complexTypes": [ + "PermissionStatus" + ], + "slug": "checkpermissions" + }, + { + "name": "requestPermissions", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Request camera permission.", + "complexTypes": [ + "PermissionStatus" + ], + "slug": "requestpermissions" + }, + { + "name": "addListener", + "signature": "(eventName: 'barcodesScanned', listenerFunc: (event: BarcodesScannedEvent) => void) => Promise", + "parameters": [ + { + "name": "eventName", + "docs": "", + "type": "'barcodesScanned'" + }, + { + "name": "listenerFunc", + "docs": "", + "type": "(event: BarcodesScannedEvent) => void" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "6.2.0" + } + ], + "docs": "Called when barcodes are scanned.", + "complexTypes": [ + "PluginListenerHandle", + "BarcodesScannedEvent" + ], + "slug": "addlistenerbarcodesscanned-" + }, + { + "name": "addListener", + "signature": "(eventName: 'scanError', listenerFunc: (event: ScanErrorEvent) => void) => Promise", + "parameters": [ + { + "name": "eventName", + "docs": "", + "type": "'scanError'" + }, + { + "name": "listenerFunc", + "docs": "", + "type": "(event: ScanErrorEvent) => void" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Called when an error occurs during the scan.\n\nAvailable on Android and iOS.", + "complexTypes": [ + "PluginListenerHandle", + "ScanErrorEvent" + ], + "slug": "addlistenerscanerror-" + }, + { + "name": "addListener", + "signature": "(eventName: 'googleBarcodeScannerModuleInstallProgress', listenerFunc: (event: GoogleBarcodeScannerModuleInstallProgressEvent) => void) => Promise", + "parameters": [ + { + "name": "eventName", + "docs": "", + "type": "'googleBarcodeScannerModuleInstallProgress'" + }, + { + "name": "listenerFunc", + "docs": "", + "type": "(event: GoogleBarcodeScannerModuleInstallProgressEvent) => void" + } + ], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "5.1.0" + } + ], + "docs": "Called when the Google Barcode Scanner module is installed.\n\nAvailable on Android.", + "complexTypes": [ + "PluginListenerHandle", + "GoogleBarcodeScannerModuleInstallProgressEvent" + ], + "slug": "addlistenergooglebarcodescannermoduleinstallprogress-" + }, + { + "name": "removeAllListeners", + "signature": "() => Promise", + "parameters": [], + "returns": "Promise", + "tags": [ + { + "name": "since", + "text": "0.0.1" + } + ], + "docs": "Remove all listeners for this plugin.", + "complexTypes": [], + "slug": "removealllisteners" + } + ], + "properties": [] + }, + "interfaces": [ + { + "name": "StartScanOptions", + "slug": "startscanoptions", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "formats", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Improve the speed of the barcode scanner by configuring\nthe barcode formats to scan for.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "BarcodeFormat" + ], + "type": "BarcodeFormat[] | undefined" + }, + { + "name": "lensFacing", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Configure the camera (front or back) to use.", + "complexTypes": [ + "LensFacing" + ], + "type": "LensFacing" + }, + { + "name": "resolution", + "tags": [ + { + "text": "7.0.0", + "name": "since" + }, + { + "text": "Resolution['1280x720']", + "name": "default" + } + ], + "docs": "Configure the resolution of the captured image that is used for barcode scanning.\n\nIf the resolution is not supported by the device, the closest supported resolution will be used.\n\nOnly available on Android and iOS.", + "complexTypes": [ + "Resolution" + ], + "type": "Resolution" + }, + { + "name": "enableMultitaskingCameraAccess", + "tags": [ + { + "text": "7.5.0", + "name": "since" + }, + { + "text": "false", + "name": "default" + } + ], + "docs": "Allow camera usage on iPad while in multitasking mode.\n\nOnly available on iOS (16.0+).", + "complexTypes": [], + "type": "boolean | undefined" + }, + { + "name": "videoElement", + "tags": [ + { + "text": "7.1.0", + "name": "since" + } + ], + "docs": "The HTML video element to use for the camera preview.\n\nOnly available on web.", + "complexTypes": [ + "HTMLVideoElement" + ], + "type": "HTMLVideoElement" + } + ] + }, + { + "name": "ReadBarcodesFromImageResult", + "slug": "readbarcodesfromimageresult", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "barcodes", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "The detected barcodes.", + "complexTypes": [ + "Barcode" + ], + "type": "Barcode[]" + } + ] + }, + { + "name": "Barcode", + "slug": "barcode", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "bytes", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "[67, 97, 112, 97, 99, 105, 116, 111, 114, 74, 83]", + "name": "example" + } + ], + "docs": "Raw bytes as it was encoded in the barcode.", + "complexTypes": [], + "type": "number[] | undefined" + }, + { + "name": "calendarEvent", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Calendar event info.", + "complexTypes": [ + "BarcodeCalendarEvent" + ], + "type": "BarcodeCalendarEvent" + }, + { + "name": "contactInfo", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Person's or organization's business card.", + "complexTypes": [ + "BarcodeContactInfo" + ], + "type": "BarcodeContactInfo" + }, + { + "name": "cornerPoints", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "[[34, 33], [264, 32], [263, 263], [33, 263]]", + "name": "example" + }, + { + "text": "This property is experimental and may change in the future.", + "name": "experimental" + } + ], + "docs": "The four corner points of the barcode in clockwise\norder starting with top-left.\n\nThis property is currently only supported by the `startScan(...)` method.", + "complexTypes": [], + "type": "[[number, number], [number, number], [number, number], [number, number]] | undefined" + }, + { + "name": "displayValue", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "\"CapacitorJS\"", + "name": "example" + } + ], + "docs": "The barcode value in a human readable format.", + "complexTypes": [], + "type": "string" + }, + { + "name": "driverLicense", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Driver license or ID card.", + "complexTypes": [ + "BarcodeDriverLicense" + ], + "type": "BarcodeDriverLicense" + }, + { + "name": "email", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "An email message from a 'MAILTO:'.", + "complexTypes": [ + "BarcodeEmail" + ], + "type": "BarcodeEmail" + }, + { + "name": "format", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "\"QR_CODE\"", + "name": "example" + } + ], + "docs": "The barcode format.", + "complexTypes": [ + "BarcodeFormat" + ], + "type": "BarcodeFormat" + }, + { + "name": "geoPoint", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "GPS coordinates from a 'GEO:'.", + "complexTypes": [ + "BarcodeGeoPoint" + ], + "type": "BarcodeGeoPoint" + }, + { + "name": "phone", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Phone number info.", + "complexTypes": [ + "BarcodePhone" + ], + "type": "BarcodePhone" + }, + { + "name": "rawValue", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "\"CapacitorJS\"", + "name": "example" + } + ], + "docs": "The barcode value in a machine readable format.\n\nThis value is only available if the barcode is encoded\nin the UTF-8 character set. Otherwise, the `bytes` property\nshould be used.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "sms", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "A sms message from a 'SMS:'.", + "complexTypes": [ + "BarcodeSms" + ], + "type": "BarcodeSms" + }, + { + "name": "urlBookmark", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "A URL and title from a 'MEBKM:'.", + "complexTypes": [ + "BarcodeUrlBookmark" + ], + "type": "BarcodeUrlBookmark" + }, + { + "name": "valueType", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "\"TEXT\"", + "name": "example" + } + ], + "docs": "The barcode value type.", + "complexTypes": [ + "BarcodeValueType" + ], + "type": "BarcodeValueType" + }, + { + "name": "wifi", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "A wifi network parameters from a 'WIFI:'.", + "complexTypes": [ + "BarcodeWifi" + ], + "type": "BarcodeWifi" + } + ] + }, + { + "name": "BarcodeCalendarEvent", + "slug": "barcodecalendarevent", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "description", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The event description.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "end", + "tags": [ + { + "text": "7.0.0", + "name": "since" + }, + { + "text": "\"2022-12-31T23:59:59.999Z\"", + "name": "example" + } + ], + "docs": "The event end date as ISO 8601 string.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "location", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The event location.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "organizer", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The event organizer.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "start", + "tags": [ + { + "text": "7.0.0", + "name": "since" + }, + { + "text": "\"2022-01-01T00:00:00.000Z\"", + "name": "example" + } + ], + "docs": "The event start date as ISO 8601 string.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "status", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The event status.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "summary", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The event summary.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "BarcodeContactInfo", + "slug": "barcodecontactinfo", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "addresses", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's addresses.", + "complexTypes": [ + "Address" + ], + "type": "Address[] | undefined" + }, + { + "name": "emails", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's emails.", + "complexTypes": [ + "BarcodeEmail" + ], + "type": "BarcodeEmail[] | undefined" + }, + { + "name": "personName", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's name.", + "complexTypes": [ + "PersonName" + ], + "type": "PersonName" + }, + { + "name": "organization", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's organization.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "phones", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's phones.", + "complexTypes": [ + "BarcodePhone" + ], + "type": "BarcodePhone[] | undefined" + }, + { + "name": "title", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's title.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "urls", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The contact's urls.", + "complexTypes": [], + "type": "string[] | undefined" + } + ] + }, + { + "name": "Address", + "slug": "address", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "addressLines", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Formatted address, multiple lines when appropriate.", + "complexTypes": [], + "type": "string[] | undefined" + }, + { + "name": "type", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Address type.", + "complexTypes": [ + "AddressType" + ], + "type": "AddressType" + } + ] + }, + { + "name": "BarcodeEmail", + "slug": "barcodeemail", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "address", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The email address.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "body", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The email body.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "subject", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The email subject.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "type", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The email address type.", + "complexTypes": [ + "EmailFormatType" + ], + "type": "EmailFormatType" + } + ] + }, + { + "name": "PersonName", + "slug": "personname", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "first", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "First name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "formattedName", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The formatted name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "last", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Last name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "middle", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Middle name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "prefix", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Name prefix.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "pronunciation", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Text string to be set as the kana name in the phonebook. Used for Japanese contacts.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "suffix", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Name suffix.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "BarcodePhone", + "slug": "barcodephone", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "number", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The phone number.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "type", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The phone number type.", + "complexTypes": [ + "PhoneFormatType" + ], + "type": "PhoneFormatType" + } + ] + }, + { + "name": "BarcodeDriverLicense", + "slug": "barcodedriverlicense", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "addressCity", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "City of holder's address.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "addressState", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "State of holder's address.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "addressStreet", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Street of holder's address.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "addressZip", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Postal code of holder's address.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "birthDate", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Birthdate of the holder.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "documentType", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "\"DL\" for driver's licenses, \"ID\" for ID cards.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "expiryDate", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Expiration date of the license.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "firstName", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Holder's first name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "gender", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Holder's gender.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "issueDate", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Issue date of the license.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "issuingCountry", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "ISO 3166-1 alpha-3 code in which DL/ID was issued.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "lastName", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Holder's last name.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "licenseNumber", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Driver license ID number.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "middleName", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Holder's middle name.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "BarcodeGeoPoint", + "slug": "barcodegeopoint", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "latitude", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Latitude.", + "complexTypes": [], + "type": "number | undefined" + }, + { + "name": "longitude", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Longitude.", + "complexTypes": [], + "type": "number | undefined" + } + ] + }, + { + "name": "BarcodeSms", + "slug": "barcodesms", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "phoneNumber", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The phone number of the sms.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "message", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The message content of the sms.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "BarcodeUrlBookmark", + "slug": "barcodeurlbookmark", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "url", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The URL of the bookmark.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "title", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "The title of the bookmark.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "BarcodeWifi", + "slug": "barcodewifi", + "docs": "", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "encryptionType", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Encryption type of the WI-FI.", + "complexTypes": [ + "WifiEncryptionType" + ], + "type": "WifiEncryptionType" + }, + { + "name": "password", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "Password of the WI-FI.", + "complexTypes": [], + "type": "string | undefined" + }, + { + "name": "ssid", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "SSID of the WI-FI.", + "complexTypes": [], + "type": "string | undefined" + } + ] + }, + { + "name": "ReadBarcodesFromImageOptions", + "slug": "readbarcodesfromimageoptions", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "formats", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Improve the speed of the barcode scanner by configuring\nthe barcode formats to scan for.", + "complexTypes": [ + "BarcodeFormat" + ], + "type": "BarcodeFormat[] | undefined" + }, + { + "name": "path", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "The local path to the image file.", + "complexTypes": [], + "type": "string" + } + ] + }, + { + "name": "ScanResult", + "slug": "scanresult", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "barcodes", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "The detected barcodes.", + "complexTypes": [ + "Barcode" + ], + "type": "Barcode[]" + } + ] + }, + { + "name": "ScanOptions", + "slug": "scanoptions", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "formats", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Improve the speed of the barcode scanner by configuring\nthe barcode formats to scan for.", + "complexTypes": [ + "BarcodeFormat" + ], + "type": "BarcodeFormat[] | undefined" + }, + { + "name": "autoZoom", + "tags": [ + { + "text": "7.4.0", + "name": "since" + } + ], + "docs": "Toggle the auto zoom feature.", + "complexTypes": [], + "type": "boolean | undefined" + } + ] + }, + { + "name": "IsSupportedResult", + "slug": "issupportedresult", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "supported", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "true", + "name": "example" + } + ], + "docs": "Whether or not the barcode scanner is supported by checking if the device has a camera.", + "complexTypes": [], + "type": "boolean" + } + ] + }, + { + "name": "IsTorchEnabledResult", + "slug": "istorchenabledresult", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "enabled", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "true", + "name": "example" + } + ], + "docs": "Whether or not the torch is enabled.", + "complexTypes": [], + "type": "boolean" + } + ] + }, + { + "name": "IsTorchAvailableResult", + "slug": "istorchavailableresult", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "available", + "tags": [ + { + "text": "0.0.1", + "name": "since" + }, + { + "text": "true", + "name": "example" + } + ], + "docs": "Whether or not the torch is available.", + "complexTypes": [], + "type": "boolean" + } + ] + }, + { + "name": "SetZoomRatioOptions", + "slug": "setzoomratiooptions", + "docs": "", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "zoomRatio", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "docs": "The zoom ratio to set.", + "complexTypes": [], + "type": "number" + } + ] + }, + { + "name": "GetZoomRatioResult", + "slug": "getzoomratioresult", + "docs": "", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "zoomRatio", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "docs": "The zoom ratio.", + "complexTypes": [], + "type": "number" + } + ] + }, + { + "name": "GetMinZoomRatioResult", + "slug": "getminzoomratioresult", + "docs": "", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "zoomRatio", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "docs": "The minimum zoom ratio.", + "complexTypes": [], + "type": "number" + } + ] + }, + { + "name": "GetMaxZoomRatioResult", + "slug": "getmaxzoomratioresult", + "docs": "", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "zoomRatio", + "tags": [ + { + "text": "5.4.0", + "name": "since" + } + ], + "docs": "The maximum zoom ratio.", + "complexTypes": [], + "type": "number" + } + ] + }, + { + "name": "IsGoogleBarcodeScannerModuleAvailableResult", + "slug": "isgooglebarcodescannermoduleavailableresult", + "docs": "", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "available", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "Whether or not the Google Barcode Scanner module is available.", + "complexTypes": [], + "type": "boolean" + } + ] + }, + { + "name": "PermissionStatus", + "slug": "permissionstatus", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "camera", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "", + "complexTypes": [ + "CameraPermissionState" + ], + "type": "CameraPermissionState" + } + ] + }, + { + "name": "PluginListenerHandle", + "slug": "pluginlistenerhandle", + "docs": "", + "tags": [], + "methods": [], + "properties": [ + { + "name": "remove", + "tags": [], + "docs": "", + "complexTypes": [], + "type": "() => Promise" + } + ] + }, + { + "name": "BarcodesScannedEvent", + "slug": "barcodesscannedevent", + "docs": "", + "tags": [ + { + "text": "6.2.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "barcodes", + "tags": [ + { + "text": "6.2.0", + "name": "since" + } + ], + "docs": "The detected barcodes.", + "complexTypes": [ + "Barcode" + ], + "type": "Barcode[]" + } + ] + }, + { + "name": "ScanErrorEvent", + "slug": "scanerrorevent", + "docs": "", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "message", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "The error message.", + "complexTypes": [], + "type": "string" + } + ] + }, + { + "name": "GoogleBarcodeScannerModuleInstallProgressEvent", + "slug": "googlebarcodescannermoduleinstallprogressevent", + "docs": "", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "methods": [], + "properties": [ + { + "name": "state", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "The current state of the installation.", + "complexTypes": [ + "GoogleBarcodeScannerModuleInstallState" + ], + "type": "GoogleBarcodeScannerModuleInstallState" + }, + { + "name": "progress", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "The progress of the installation in percent between 0 and 100.", + "complexTypes": [], + "type": "number | undefined" + } + ] + } + ], + "enums": [ + { + "name": "BarcodeFormat", + "slug": "barcodeformat", + "members": [ + { + "name": "Aztec", + "value": "'AZTEC'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Codabar", + "value": "'CODABAR'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Code39", + "value": "'CODE_39'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Code93", + "value": "'CODE_93'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Code128", + "value": "'CODE_128'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "DataMatrix", + "value": "'DATA_MATRIX'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Ean8", + "value": "'EAN_8'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Ean13", + "value": "'EAN_13'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Itf", + "value": "'ITF'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "Pdf417", + "value": "'PDF_417'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "QrCode", + "value": "'QR_CODE'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "UpcA", + "value": "'UPC_A'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + }, + { + "name": "UpcE", + "value": "'UPC_E'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "Only available on Android and iOS." + } + ] + }, + { + "name": "LensFacing", + "slug": "lensfacing", + "members": [ + { + "name": "Front", + "value": "'FRONT'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Back", + "value": "'BACK'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "Resolution", + "slug": "resolution", + "members": [ + { + "name": "'640x480'", + "value": "0", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "'1280x720'", + "value": "1", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "'1920x1080'", + "value": "2", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "'3840x2160'", + "value": "3", + "tags": [ + { + "text": "7.2.0", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "AddressType", + "slug": "addresstype", + "members": [ + { + "name": "HOME", + "value": "0", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "UNKNOWN", + "value": "1", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "WORK", + "value": "2", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "EmailFormatType", + "slug": "emailformattype", + "members": [ + { + "name": "HOME", + "value": "0", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "UNKNOWN", + "value": "1", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "WORK", + "value": "2", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "PhoneFormatType", + "slug": "phoneformattype", + "members": [ + { + "name": "FAX", + "value": "0", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "HOME", + "value": "1", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "MOBILE", + "value": "2", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "UNKNOWN", + "value": "3", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "WORK", + "value": "4", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "BarcodeValueType", + "slug": "barcodevaluetype", + "members": [ + { + "name": "CalendarEvent", + "value": "'CALENDAR_EVENT'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "ContactInfo", + "value": "'CONTACT_INFO'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "DriversLicense", + "value": "'DRIVERS_LICENSE'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Email", + "value": "'EMAIL'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Geo", + "value": "'GEO'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Isbn", + "value": "'ISBN'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Phone", + "value": "'PHONE'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Product", + "value": "'PRODUCT'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Sms", + "value": "'SMS'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Text", + "value": "'TEXT'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Url", + "value": "'URL'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Wifi", + "value": "'WIFI'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "Unknown", + "value": "'UNKNOWN'", + "tags": [ + { + "text": "0.0.1", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "WifiEncryptionType", + "slug": "wifiencryptiontype", + "members": [ + { + "name": "OPEN", + "value": "1", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "WEP", + "value": "2", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "WPA", + "value": "3", + "tags": [ + { + "text": "7.0.0", + "name": "since" + } + ], + "docs": "" + } + ] + }, + { + "name": "GoogleBarcodeScannerModuleInstallState", + "slug": "googlebarcodescannermoduleinstallstate", + "members": [ + { + "name": "UNKNOWN", + "value": "0", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "PENDING", + "value": "1", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "DOWNLOADING", + "value": "2", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "CANCELED", + "value": "3", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "COMPLETED", + "value": "4", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "FAILED", + "value": "5", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "INSTALLING", + "value": "6", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + }, + { + "name": "DOWNLOAD_PAUSED", + "value": "7", + "tags": [ + { + "text": "5.1.0", + "name": "since" + } + ], + "docs": "" + } + ] + } + ], + "typeAliases": [ + { + "name": "CameraPermissionState", + "slug": "camerapermissionstate", + "docs": "", + "types": [ + { + "text": "PermissionState", + "complexTypes": [ + "PermissionState" + ] + }, + { + "text": "'limited'", + "complexTypes": [] + } + ] + }, + { + "name": "PermissionState", + "slug": "permissionstate", + "docs": "", + "types": [ + { + "text": "'prompt'", + "complexTypes": [] + }, + { + "text": "'prompt-with-rationale'", + "complexTypes": [] + }, + { + "text": "'granted'", + "complexTypes": [] + }, + { + "text": "'denied'", + "complexTypes": [] + } + ] + } + ], + "pluginConfigs": [] +} \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/definitions.d.ts b/packages/barcode-scanning/dist/esm/definitions.d.ts new file mode 100644 index 00000000..c3c475a3 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/definitions.d.ts @@ -0,0 +1,1240 @@ +import type { PermissionState, PluginListenerHandle } from '@capacitor/core'; +export interface BarcodeScannerPlugin { + /** + * Start scanning for barcodes. + * + * @since 0.0.1 + */ + startScan(options?: StartScanOptions): Promise; + /** + * Stop scanning for barcodes. + * + * @since 0.0.1 + */ + stopScan(): Promise; + /** + * Pause scanning for barcodes. + * + * @since 8.1.0 + */ + pauseScan(): Promise; + /** + * Resume scanning for barcodes. + * + * @since 8.1.0 + */ + resumeScan(): Promise; + /** + * Read barcodes from an image. + * + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + readBarcodesFromImage(options: ReadBarcodesFromImageOptions): Promise; + /** + * Scan a barcode with a ready-to-use interface without WebView customization. + * + * On **Android**, this method is only available on devices with Google Play Services + * installed. Therefore, no camera permission is required. + * + * **Attention:** Before using this method on *Android*, first check if the Google Barcode Scanner module is available + * by using `isGoogleBarcodeScannerModuleAvailable()`. + * + * Only available on Android and iOS. + * + * @since 0.0.1 + * @experimental This method is experimental and may change in the future. + */ + scan(options?: ScanOptions): Promise; + /** + * Returns whether or not the barcode scanner is supported. + * + * @since 0.0.1 + */ + isSupported(): Promise; + /** + * Enable camera's torch (flash) during a scan session. + * + * Only available on Android and iOS. + * + * @since 7.2.0 + */ + enableTorch(): Promise; + /** + * Disable camera's torch (flash) during a scan session. + * + * Only available on Android and iOS. + * + * @since 7.2.0 + */ + disableTorch(): Promise; + /** + * Toggle camera's torch (flash) during a scan session. + * + * Only available on Android and iOS. + * + * @since 7.2.0 + */ + toggleTorch(): Promise; + /** + * Returns whether or not the camera's torch (flash) is enabled. + * + * Only available on Android and iOS. + * + * @since 7.2.0 + */ + isTorchEnabled(): Promise; + /** + * Returns whether or not the camera's torch (flash) is available. + * + * Only available on Android and iOS. + * + * @since 7.2.0 + */ + isTorchAvailable(): Promise; + /** + * Set the zoom ratio of the camera. + * + * Only available on Android and iOS. + * + * @since 5.4.0 + */ + setZoomRatio(options: SetZoomRatioOptions): Promise; + /** + * Get the zoom ratio of the camera. + * + * Only available on Android and iOS. + * + * @since 5.4.0 + */ + getZoomRatio(): Promise; + /** + * Get the minimum zoom ratio of the camera. + * + * Only available on Android and iOS. + * + * @since 5.4.0 + */ + getMinZoomRatio(): Promise; + /** + * Get the maximum zoom ratio of the camera. + * + * Only available on Android and iOS. + * + * @since 5.4.0 + */ + getMaxZoomRatio(): Promise; + /** + * Open the settings of the app so that the user can grant the camera permission. + * + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + openSettings(): Promise; + /** + * Check if the Google Barcode Scanner module is available. + * + * If the Google Barcode Scanner module is not available, you can install it by using `installGoogleBarcodeScannerModule()`. + * + * Only available on Android. + * + * @since 5.1.0 + */ + isGoogleBarcodeScannerModuleAvailable(): Promise; + /** + * Install the Google Barcode Scanner module. + * + * **Attention**: This only starts the installation. + * The `googleBarcodeScannerModuleInstallProgress` event listener will + * notify you when the installation is complete. + * + * Only available on Android. + * + * @since 5.1.0 + */ + installGoogleBarcodeScannerModule(): Promise; + /** + * Check camera permission. + * + * @since 0.0.1 + */ + checkPermissions(): Promise; + /** + * Request camera permission. + * + * @since 0.0.1 + */ + requestPermissions(): Promise; + /** + * Called when barcodes are scanned. + * + * @since 6.2.0 + */ + addListener(eventName: 'barcodesScanned', listenerFunc: (event: BarcodesScannedEvent) => void): Promise; + /** + * Called when an error occurs during the scan. + * + * Available on Android and iOS. + * + * @since 0.0.1 + */ + addListener(eventName: 'scanError', listenerFunc: (event: ScanErrorEvent) => void): Promise; + /** + * Called when the Google Barcode Scanner module is installed. + * + * Available on Android. + * + * @since 5.1.0 + */ + addListener(eventName: 'googleBarcodeScannerModuleInstallProgress', listenerFunc: (event: GoogleBarcodeScannerModuleInstallProgressEvent) => void): Promise; + /** + * Remove all listeners for this plugin. + * + * @since 0.0.1 + */ + removeAllListeners(): Promise; +} +/** + * @since 0.0.1 + */ +export interface StartScanOptions { + /** + * Improve the speed of the barcode scanner by configuring + * the barcode formats to scan for. + * + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + formats?: BarcodeFormat[]; + /** + * Configure the camera (front or back) to use. + * + * @since 0.0.1 + */ + lensFacing?: LensFacing; + /** + * Configure the resolution of the captured image that is used for barcode scanning. + * + * If the resolution is not supported by the device, the closest supported resolution will be used. + * + * Only available on Android and iOS. + * + * @since 7.0.0 + * @default Resolution['1280x720'] + */ + resolution?: Resolution; + /** + * Allow camera usage on iPad while in multitasking mode. + * + * Only available on iOS (16.0+). + * + * @since 7.5.0 + * @default false + */ + enableMultitaskingCameraAccess?: boolean; + /** + * The HTML video element to use for the camera preview. + * + * Only available on web. + * + * @since 7.1.0 + */ + videoElement?: HTMLVideoElement; +} +/** + * @since 0.0.1 + */ +export interface ReadBarcodesFromImageOptions { + /** + * Improve the speed of the barcode scanner by configuring + * the barcode formats to scan for. + * + * @since 0.0.1 + */ + formats?: BarcodeFormat[]; + /** + * The local path to the image file. + * + * @since 0.0.1 + */ + path: string; +} +/** + * @since 0.0.1 + */ +export interface ReadBarcodesFromImageResult { + /** + * The detected barcodes. + * + * @since 0.0.1 + */ + barcodes: Barcode[]; +} +/** + * @since 0.0.1 + */ +export interface ScanOptions { + /** + * Improve the speed of the barcode scanner by configuring + * the barcode formats to scan for. + * + * @since 0.0.1 + */ + formats?: BarcodeFormat[]; + /** + * Toggle the auto zoom feature. + * + * @since 7.4.0 + */ + autoZoom?: boolean; +} +/** + * @since 0.0.1 + */ +export interface ScanResult { + /** + * The detected barcodes. + * + * @since 0.0.1 + */ + barcodes: Barcode[]; +} +/** + * @since 0.0.1 + */ +export interface IsSupportedResult { + /** + * Whether or not the barcode scanner is supported by checking if the device has a camera. + * + * @since 0.0.1 + * @example true + */ + supported: boolean; +} +/** + * @since 0.0.1 + */ +export interface IsTorchEnabledResult { + /** + * Whether or not the torch is enabled. + * + * @since 0.0.1 + * @example true + */ + enabled: boolean; +} +/** + * @since 0.0.1 + */ +export interface IsTorchAvailableResult { + /** + * Whether or not the torch is available. + * + * @since 0.0.1 + * @example true + */ + available: boolean; +} +/** + * @since 5.4.0 + */ +export interface SetZoomRatioOptions { + /** + * The zoom ratio to set. + * + * @since 5.4.0 + */ + zoomRatio: number; +} +/** + * @since 5.4.0 + */ +export interface GetZoomRatioResult { + /** + * The zoom ratio. + * + * @since 5.4.0 + */ + zoomRatio: number; +} +/** + * @since 5.4.0 + */ +export interface GetMinZoomRatioResult { + /** + * The minimum zoom ratio. + * + * @since 5.4.0 + */ + zoomRatio: number; +} +/** + * @since 5.4.0 + */ +export interface GetMaxZoomRatioResult { + /** + * The maximum zoom ratio. + * + * @since 5.4.0 + */ + zoomRatio: number; +} +/** + * @since 5.1.0 + */ +export interface IsGoogleBarcodeScannerModuleAvailableResult { + /** + * Whether or not the Google Barcode Scanner module is available. + * + * @since 5.1.0 + */ + available: boolean; +} +/** + * @since 0.0.1 + */ +export type CameraPermissionState = PermissionState | 'limited'; +/** + * @since 0.0.1 + */ +export interface PermissionStatus { + /** + * @since 0.0.1 + */ + camera: CameraPermissionState; +} +/** + * @since 0.0.1 + */ +export interface BarcodeScannedEvent { + /** + * A detected barcode. + * + * @since 0.0.1 + */ + barcode: Barcode; +} +/** + * @since 6.2.0 + */ +export interface BarcodesScannedEvent { + /** + * The detected barcodes. + * + * @since 6.2.0 + */ + barcodes: Barcode[]; +} +/** + * @since 0.0.1 + */ +export interface ScanErrorEvent { + /** + * The error message. + * + * @since 0.0.1 + */ + message: string; +} +/** + * @since 5.1.0 + */ +export interface GoogleBarcodeScannerModuleInstallProgressEvent { + /** + * The current state of the installation. + * + * @since 5.1.0 + */ + state: GoogleBarcodeScannerModuleInstallState; + /** + * The progress of the installation in percent between 0 and 100. + * + * @since 5.1.0 + */ + progress?: number; +} +/** + * @since 0.0.1 + */ +export interface Barcode { + /** + * Raw bytes as it was encoded in the barcode. + * + * @since 0.0.1 + * @example [67, 97, 112, 97, 99, 105, 116, 111, 114, 74, 83] + */ + bytes?: number[]; + /** + * Calendar event info. + * + * @since 7.0.0 + */ + calendarEvent?: BarcodeCalendarEvent; + /** + * Person's or organization's business card. + * + * @since 7.0.0 + */ + contactInfo?: BarcodeContactInfo; + /** + * The four corner points of the barcode in clockwise + * order starting with top-left. + * + * This property is currently only supported by the `startScan(...)` method. + * + * @since 0.0.1 + * @example [[34, 33], [264, 32], [263, 263], [33, 263]] + * @experimental This property is experimental and may change in the future. + */ + cornerPoints?: [ + [ + number, + number + ], + [ + number, + number + ], + [ + number, + number + ], + [ + number, + number + ] + ]; + /** + * The barcode value in a human readable format. + * + * @since 0.0.1 + * @example "CapacitorJS" + */ + displayValue: string; + /** + * Driver license or ID card. + * + * @since 7.0.0 + */ + driverLicense?: BarcodeDriverLicense; + /** + * An email message from a 'MAILTO:'. + * + * @since 7.0.0 + */ + email?: BarcodeEmail; + /** + * The barcode format. + * + * @since 0.0.1 + * @example "QR_CODE" + */ + format: BarcodeFormat; + /** + * GPS coordinates from a 'GEO:'. + * + * @since 7.0.0 + */ + geoPoint?: BarcodeGeoPoint; + /** + * Phone number info. + * + * @since 7.0.0 + */ + phone?: BarcodePhone; + /** + * The barcode value in a machine readable format. + * + * This value is only available if the barcode is encoded + * in the UTF-8 character set. Otherwise, the `bytes` property + * should be used. + * + * @since 0.0.1 + * @example "CapacitorJS" + */ + rawValue?: string; + /** + * A sms message from a 'SMS:'. + * + * @since 7.0.0 + */ + sms?: BarcodeSms; + /** + * A URL and title from a 'MEBKM:'. + * + * @since 7.0.0 + */ + urlBookmark?: BarcodeUrlBookmark; + /** + * The barcode value type. + * + * @since 0.0.1 + * @example "TEXT" + */ + valueType: BarcodeValueType; + /** + * A wifi network parameters from a 'WIFI:'. + * + * @since 7.0.0 + */ + wifi?: BarcodeWifi; +} +/** + * @since 7.0.0 + */ +export interface BarcodeCalendarEvent { + /** + * The event description. + * + * @since 7.0.0 + */ + description?: string; + /** + * The event end date as ISO 8601 string. + * + * @since 7.0.0 + * @example "2022-12-31T23:59:59.999Z" + */ + end?: string; + /** + * The event location. + * + * @since 7.0.0 + */ + location?: string; + /** + * The event organizer. + * + * @since 7.0.0 + */ + organizer?: string; + /** + * The event start date as ISO 8601 string. + * + * @since 7.0.0 + * @example "2022-01-01T00:00:00.000Z" + */ + start?: string; + /** + * The event status. + * + * @since 7.0.0 + */ + status?: string; + /** + * The event summary. + * + * @since 7.0.0 + */ + summary?: string; +} +/** + * @since 7.0.0 + */ +export interface BarcodeContactInfo { + /** + * The contact's addresses. + * + * @since 7.0.0 + */ + addresses?: Address[]; + /** + * The contact's emails. + * + * @since 7.0.0 + */ + emails?: BarcodeEmail[]; + /** + * The contact's name. + * + * @since 7.0.0 + */ + personName?: PersonName; + /** + * The contact's organization. + * + * @since 7.0.0 + */ + organization?: string; + /** + * The contact's phones. + * + * @since 7.0.0 + */ + phones?: BarcodePhone[]; + /** + * The contact's title. + * + * @since 7.0.0 + */ + title?: string; + /** + * The contact's urls. + * + * @since 7.0.0 + */ + urls?: string[]; +} +/** + * @since 7.0.0 + */ +export interface Address { + /** + * Formatted address, multiple lines when appropriate. + * + * @since 7.0.0 + */ + addressLines?: string[]; + /** + * Address type. + * + * @since 7.0.0 + */ + type?: AddressType; +} +/** + * @since 7.0.0 + */ +export interface BarcodeDriverLicense { + /** + * City of holder's address. + * + * @since 7.0.0 + */ + addressCity?: string; + /** + * State of holder's address. + * + * @since 7.0.0 + */ + addressState?: string; + /** + * Street of holder's address. + * + * @since 7.0.0 + */ + addressStreet?: string; + /** + * Postal code of holder's address. + * + * @since 7.0.0 + */ + addressZip?: string; + /** + * Birthdate of the holder. + * + * @since 7.0.0 + */ + birthDate?: string; + /** + * "DL" for driver's licenses, "ID" for ID cards. + * + * @since 7.0.0 + */ + documentType?: string; + /** + * Expiration date of the license. + * + * @since 7.0.0 + */ + expiryDate?: string; + /** + * Holder's first name. + * + * @since 7.0.0 + */ + firstName?: string; + /** + * Holder's gender. + * + * @since 7.0.0 + */ + gender?: string; + /** + * Issue date of the license. + * + * @since 7.0.0 + */ + issueDate?: string; + /** + * ISO 3166-1 alpha-3 code in which DL/ID was issued. + * + * @since 7.0.0 + */ + issuingCountry?: string; + /** + * Holder's last name. + * + * @since 7.0.0 + */ + lastName?: string; + /** + * Driver license ID number. + * + * @since 7.0.0 + */ + licenseNumber?: string; + /** + * Holder's middle name. + * + * @since 7.0.0 + */ + middleName?: string; +} +/** + * @since 7.0.0 + */ +export interface BarcodeEmail { + /** + * The email address. + * + * @since 7.0.0 + */ + address?: string; + /** + * The email body. + * + * @since 7.0.0 + */ + body?: string; + /** + * The email subject. + * + * @since 7.0.0 + */ + subject?: string; + /** + * The email address type. + * + * @since 7.0.0 + */ + type: EmailFormatType; +} +/** + * @since 7.0.0 + */ +export interface BarcodeGeoPoint { + /** + * Latitude. + * + * @since 7.0.0 + */ + latitude?: number; + /** + * Longitude. + * + * @since 7.0.0 + */ + longitude?: number; +} +/** + * @since 7.0.0 + */ +export interface BarcodePhone { + /** + * The phone number. + * + * @since 7.0.0 + */ + number?: string; + /** + * The phone number type. + * + * @since 7.0.0 + */ + type?: PhoneFormatType; +} +/** + * @since 7.0.0 + */ +export interface PersonName { + /** + * First name. + * + * @since 7.0.0 + */ + first?: string; + /** + * The formatted name. + * + * @since 7.0.0 + */ + formattedName?: string; + /** + * Last name. + * + * @since 7.0.0 + */ + last?: string; + /** + * Middle name. + * + * @since 7.0.0 + */ + middle?: string; + /** + * Name prefix. + * + * @since 7.0.0 + */ + prefix?: string; + /** + * Text string to be set as the kana name in the phonebook. Used for Japanese contacts. + * + * @since 7.0.0 + */ + pronunciation?: string; + /** + * Name suffix. + * + * @since 7.0.0 + */ + suffix?: string; +} +/** + * @since 7.0.0 + */ +export interface BarcodeSms { + /** + * The phone number of the sms. + * + * @since 7.0.0 + */ + phoneNumber?: string; + /** + * The message content of the sms. + * + * @since 7.0.0 + */ + message?: string; +} +/** + * @since 7.0.0 + */ +export interface BarcodeUrlBookmark { + /** + * The URL of the bookmark. + * + * @since 7.0.0 + */ + url?: string; + /** + * The title of the bookmark. + * + * @since 7.0.0 + */ + title?: string; +} +/** + * @since 7.0.0 + */ +export interface BarcodeWifi { + /** + * Encryption type of the WI-FI. + * + * @since 7.0.0 + */ + encryptionType: WifiEncryptionType; + /** + * Password of the WI-FI. + * + * @since 7.0.0 + */ + password?: string; + /** + * SSID of the WI-FI. + * + * @since 7.0.0 + */ + ssid?: string; +} +/** + * @since 0.0.1 + */ +export declare enum BarcodeFormat { + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Aztec = "AZTEC", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Codabar = "CODABAR", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Code39 = "CODE_39", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Code93 = "CODE_93", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Code128 = "CODE_128", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + DataMatrix = "DATA_MATRIX", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Ean8 = "EAN_8", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Ean13 = "EAN_13", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Itf = "ITF", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + Pdf417 = "PDF_417", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + QrCode = "QR_CODE", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + UpcA = "UPC_A", + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + UpcE = "UPC_E" +} +/** + * @since 0.0.1 + */ +export declare enum BarcodeValueType { + /** + * @since 0.0.1 + */ + CalendarEvent = "CALENDAR_EVENT", + /** + * @since 0.0.1 + */ + ContactInfo = "CONTACT_INFO", + /** + * @since 0.0.1 + */ + DriversLicense = "DRIVERS_LICENSE", + /** + * @since 0.0.1 + */ + Email = "EMAIL", + /** + * @since 0.0.1 + */ + Geo = "GEO", + /** + * @since 0.0.1 + */ + Isbn = "ISBN", + /** + * @since 0.0.1 + */ + Phone = "PHONE", + /** + * @since 0.0.1 + */ + Product = "PRODUCT", + /** + * @since 0.0.1 + */ + Sms = "SMS", + /** + * @since 0.0.1 + */ + Text = "TEXT", + /** + * @since 0.0.1 + */ + Url = "URL", + /** + * @since 0.0.1 + */ + Wifi = "WIFI", + /** + * @since 0.0.1 + */ + Unknown = "UNKNOWN" +} +/** + * @since 7.0.0 + */ +export declare enum Resolution { + /** + * @since 7.0.0 + */ + '640x480' = 0, + /** + * @since 7.0.0 + */ + '1280x720' = 1, + /** + * @since 7.0.0 + */ + '1920x1080' = 2, + /** + * @since 7.2.0 + */ + '3840x2160' = 3 +} +/** + * @since 0.0.1 + */ +export declare enum LensFacing { + /** + * @since 0.0.1 + */ + Front = "FRONT", + /** + * @since 0.0.1 + */ + Back = "BACK" +} +/** + * @since 5.1.0 + */ +export declare enum GoogleBarcodeScannerModuleInstallState { + /** + * @since 5.1.0 + */ + UNKNOWN = 0, + /** + * @since 5.1.0 + */ + PENDING = 1, + /** + * @since 5.1.0 + */ + DOWNLOADING = 2, + /** + * @since 5.1.0 + */ + CANCELED = 3, + /** + * @since 5.1.0 + */ + COMPLETED = 4, + /** + * @since 5.1.0 + */ + FAILED = 5, + /** + * @since 5.1.0 + */ + INSTALLING = 6, + /** + * @since 5.1.0 + */ + DOWNLOAD_PAUSED = 7 +} +/** + * @since 7.0.0 + */ +export declare enum AddressType { + /** + * @since 7.0.0 + */ + HOME = 0, + /** + * @since 7.0.0 + */ + UNKNOWN = 1, + /** + * @since 7.0.0 + */ + WORK = 2 +} +/** + * @since 7.0.0 + */ +export declare enum EmailFormatType { + /** + * @since 7.0.0 + */ + HOME = 0, + /** + * @since 7.0.0 + */ + UNKNOWN = 1, + /** + * @since 7.0.0 + */ + WORK = 2 +} +/** + * @since 7.0.0 + */ +export declare enum PhoneFormatType { + /** + * @since 7.0.0 + */ + FAX = 0, + /** + * @since 7.0.0 + */ + HOME = 1, + /** + * @since 7.0.0 + */ + MOBILE = 2, + /** + * @since 7.0.0 + */ + UNKNOWN = 3, + /** + * @since 7.0.0 + */ + WORK = 4 +} +/** + * @since 7.0.0 + */ +export declare enum WifiEncryptionType { + /** + * @since 7.0.0 + */ + OPEN = 1, + /** + * @since 7.0.0 + */ + WEP = 2, + /** + * @since 7.0.0 + */ + WPA = 3 +} diff --git a/packages/barcode-scanning/dist/esm/definitions.js b/packages/barcode-scanning/dist/esm/definitions.js new file mode 100644 index 00000000..bd71eca1 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/definitions.js @@ -0,0 +1,297 @@ +/** + * @since 0.0.1 + */ +export var BarcodeFormat; +(function (BarcodeFormat) { + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Aztec"] = "AZTEC"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Codabar"] = "CODABAR"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code39"] = "CODE_39"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code93"] = "CODE_93"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code128"] = "CODE_128"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["DataMatrix"] = "DATA_MATRIX"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean8"] = "EAN_8"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean13"] = "EAN_13"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Itf"] = "ITF"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Pdf417"] = "PDF_417"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["QrCode"] = "QR_CODE"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcA"] = "UPC_A"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcE"] = "UPC_E"; +})(BarcodeFormat || (BarcodeFormat = {})); +/** + * @since 0.0.1 + */ +export var BarcodeValueType; +(function (BarcodeValueType) { + /** + * @since 0.0.1 + */ + BarcodeValueType["CalendarEvent"] = "CALENDAR_EVENT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["ContactInfo"] = "CONTACT_INFO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["DriversLicense"] = "DRIVERS_LICENSE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Email"] = "EMAIL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Geo"] = "GEO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Isbn"] = "ISBN"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Phone"] = "PHONE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Product"] = "PRODUCT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Sms"] = "SMS"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Text"] = "TEXT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Url"] = "URL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Wifi"] = "WIFI"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Unknown"] = "UNKNOWN"; +})(BarcodeValueType || (BarcodeValueType = {})); +/** + * @since 7.0.0 + */ +export var Resolution; +(function (Resolution) { + /** + * @since 7.0.0 + */ + Resolution[Resolution["640x480"] = 0] = "640x480"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1280x720"] = 1] = "1280x720"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1920x1080"] = 2] = "1920x1080"; + /** + * @since 7.2.0 + */ + Resolution[Resolution["3840x2160"] = 3] = "3840x2160"; +})(Resolution || (Resolution = {})); +/** + * @since 0.0.1 + */ +export var LensFacing; +(function (LensFacing) { + /** + * @since 0.0.1 + */ + LensFacing["Front"] = "FRONT"; + /** + * @since 0.0.1 + */ + LensFacing["Back"] = "BACK"; +})(LensFacing || (LensFacing = {})); +/** + * @since 5.1.0 + */ +export var GoogleBarcodeScannerModuleInstallState; +(function (GoogleBarcodeScannerModuleInstallState) { + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["UNKNOWN"] = 0] = "UNKNOWN"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["PENDING"] = 1] = "PENDING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOADING"] = 2] = "DOWNLOADING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["CANCELED"] = 3] = "CANCELED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["COMPLETED"] = 4] = "COMPLETED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["FAILED"] = 5] = "FAILED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["INSTALLING"] = 6] = "INSTALLING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOAD_PAUSED"] = 7] = "DOWNLOAD_PAUSED"; +})(GoogleBarcodeScannerModuleInstallState || (GoogleBarcodeScannerModuleInstallState = {})); +/** + * @since 7.0.0 + */ +export var AddressType; +(function (AddressType) { + /** + * @since 7.0.0 + */ + AddressType[AddressType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["WORK"] = 2] = "WORK"; +})(AddressType || (AddressType = {})); +/** + * @since 7.0.0 + */ +export var EmailFormatType; +(function (EmailFormatType) { + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["WORK"] = 2] = "WORK"; +})(EmailFormatType || (EmailFormatType = {})); +/** + * @since 7.0.0 + */ +export var PhoneFormatType; +(function (PhoneFormatType) { + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["FAX"] = 0] = "FAX"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["HOME"] = 1] = "HOME"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["MOBILE"] = 2] = "MOBILE"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["UNKNOWN"] = 3] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["WORK"] = 4] = "WORK"; +})(PhoneFormatType || (PhoneFormatType = {})); +/** + * @since 7.0.0 + */ +export var WifiEncryptionType; +(function (WifiEncryptionType) { + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["OPEN"] = 1] = "OPEN"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WEP"] = 2] = "WEP"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WPA"] = 3] = "WPA"; +})(WifiEncryptionType || (WifiEncryptionType = {})); +//# sourceMappingURL=definitions.js.map \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/definitions.js.map b/packages/barcode-scanning/dist/esm/definitions.js.map new file mode 100644 index 00000000..7b63ca9f --- /dev/null +++ b/packages/barcode-scanning/dist/esm/definitions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA49BA;;GAEG;AACH,MAAM,CAAN,IAAY,aA+EX;AA/ED,WAAY,aAAa;IACvB;;;;OAIG;IACH,gCAAe,CAAA;IACf;;;;OAIG;IACH,oCAAmB,CAAA;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P;;OAEG;IACH,yDAAO,CAAA;AACT,CAAC,EAbW,kBAAkB,KAAlB,kBAAkB,QAa7B","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\nexport interface BarcodeScannerPlugin {\n /**\n * Start scanning for barcodes.\n *\n * @since 0.0.1\n */\n startScan(options?: StartScanOptions): Promise;\n /**\n * Stop scanning for barcodes.\n *\n * @since 0.0.1\n */\n stopScan(): Promise;\n /**\n * Pause scanning for barcodes.\n *\n * @since 8.1.0\n */\n pauseScan(): Promise;\n /**\n * Resume scanning for barcodes.\n *\n * @since 8.1.0\n */\n resumeScan(): Promise;\n /**\n * Read barcodes from an image.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n readBarcodesFromImage(\n options: ReadBarcodesFromImageOptions,\n ): Promise;\n /**\n * Scan a barcode with a ready-to-use interface without WebView customization.\n *\n * On **Android**, this method is only available on devices with Google Play Services\n * installed. Therefore, no camera permission is required.\n *\n * **Attention:** Before using this method on *Android*, first check if the Google Barcode Scanner module is available\n * by using `isGoogleBarcodeScannerModuleAvailable()`.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n * @experimental This method is experimental and may change in the future.\n */\n scan(options?: ScanOptions): Promise;\n /**\n * Returns whether or not the barcode scanner is supported.\n *\n * @since 0.0.1\n */\n isSupported(): Promise;\n /**\n * Enable camera's torch (flash) during a scan session.\n *\n * Only available on Android and iOS.\n *\n * @since 7.2.0\n */\n enableTorch(): Promise;\n /**\n * Disable camera's torch (flash) during a scan session.\n *\n * Only available on Android and iOS.\n *\n * @since 7.2.0\n */\n disableTorch(): Promise;\n /**\n * Toggle camera's torch (flash) during a scan session.\n *\n * Only available on Android and iOS.\n *\n * @since 7.2.0\n */\n toggleTorch(): Promise;\n /**\n * Returns whether or not the camera's torch (flash) is enabled.\n *\n * Only available on Android and iOS.\n *\n * @since 7.2.0\n */\n isTorchEnabled(): Promise;\n /**\n * Returns whether or not the camera's torch (flash) is available.\n *\n * Only available on Android and iOS.\n *\n * @since 7.2.0\n */\n isTorchAvailable(): Promise;\n /**\n * Set the zoom ratio of the camera.\n *\n * Only available on Android and iOS.\n *\n * @since 5.4.0\n */\n setZoomRatio(options: SetZoomRatioOptions): Promise;\n /**\n * Get the zoom ratio of the camera.\n *\n * Only available on Android and iOS.\n *\n * @since 5.4.0\n */\n getZoomRatio(): Promise;\n /**\n * Get the minimum zoom ratio of the camera.\n *\n * Only available on Android and iOS.\n *\n * @since 5.4.0\n */\n getMinZoomRatio(): Promise;\n /**\n * Get the maximum zoom ratio of the camera.\n *\n * Only available on Android and iOS.\n *\n * @since 5.4.0\n */\n getMaxZoomRatio(): Promise;\n /**\n * Open the settings of the app so that the user can grant the camera permission.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n openSettings(): Promise;\n /**\n * Check if the Google Barcode Scanner module is available.\n *\n * If the Google Barcode Scanner module is not available, you can install it by using `installGoogleBarcodeScannerModule()`.\n *\n * Only available on Android.\n *\n * @since 5.1.0\n */\n isGoogleBarcodeScannerModuleAvailable(): Promise;\n /**\n * Install the Google Barcode Scanner module.\n *\n * **Attention**: This only starts the installation.\n * The `googleBarcodeScannerModuleInstallProgress` event listener will\n * notify you when the installation is complete.\n *\n * Only available on Android.\n *\n * @since 5.1.0\n */\n installGoogleBarcodeScannerModule(): Promise;\n /**\n * Check camera permission.\n *\n * @since 0.0.1\n */\n checkPermissions(): Promise;\n /**\n * Request camera permission.\n *\n * @since 0.0.1\n */\n requestPermissions(): Promise;\n /**\n * Called when barcodes are scanned.\n *\n * @since 6.2.0\n */\n addListener(\n eventName: 'barcodesScanned',\n listenerFunc: (event: BarcodesScannedEvent) => void,\n ): Promise;\n /**\n * Called when an error occurs during the scan.\n *\n * Available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'scanError',\n listenerFunc: (event: ScanErrorEvent) => void,\n ): Promise;\n /**\n * Called when the Google Barcode Scanner module is installed.\n *\n * Available on Android.\n *\n * @since 5.1.0\n */\n addListener(\n eventName: 'googleBarcodeScannerModuleInstallProgress',\n listenerFunc: (\n event: GoogleBarcodeScannerModuleInstallProgressEvent,\n ) => void,\n ): Promise;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 0.0.1\n */\n removeAllListeners(): Promise;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface StartScanOptions {\n /**\n * Improve the speed of the barcode scanner by configuring\n * the barcode formats to scan for.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n formats?: BarcodeFormat[];\n /**\n * Configure the camera (front or back) to use.\n *\n * @since 0.0.1\n */\n lensFacing?: LensFacing;\n /**\n * Configure the resolution of the captured image that is used for barcode scanning.\n *\n * If the resolution is not supported by the device, the closest supported resolution will be used.\n *\n * Only available on Android and iOS.\n *\n * @since 7.0.0\n * @default Resolution['1280x720']\n */\n resolution?: Resolution;\n /**\n * Allow camera usage on iPad while in multitasking mode.\n *\n * Only available on iOS (16.0+).\n *\n * @since 7.5.0\n * @default false\n */\n enableMultitaskingCameraAccess?: boolean;\n /**\n * The HTML video element to use for the camera preview.\n *\n * Only available on web.\n *\n * @since 7.1.0\n */\n videoElement?: HTMLVideoElement;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ReadBarcodesFromImageOptions {\n /**\n * Improve the speed of the barcode scanner by configuring\n * the barcode formats to scan for.\n *\n * @since 0.0.1\n */\n formats?: BarcodeFormat[];\n /**\n * The local path to the image file.\n *\n * @since 0.0.1\n */\n path: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ReadBarcodesFromImageResult {\n /**\n * The detected barcodes.\n *\n * @since 0.0.1\n */\n barcodes: Barcode[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ScanOptions {\n /**\n * Improve the speed of the barcode scanner by configuring\n * the barcode formats to scan for.\n *\n * @since 0.0.1\n */\n formats?: BarcodeFormat[];\n /**\n * Toggle the auto zoom feature.\n *\n * @since 7.4.0\n */\n autoZoom?: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ScanResult {\n /**\n * The detected barcodes.\n *\n * @since 0.0.1\n */\n barcodes: Barcode[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsSupportedResult {\n /**\n * Whether or not the barcode scanner is supported by checking if the device has a camera.\n *\n * @since 0.0.1\n * @example true\n */\n supported: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsTorchEnabledResult {\n /**\n * Whether or not the torch is enabled.\n *\n * @since 0.0.1\n * @example true\n */\n enabled: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsTorchAvailableResult {\n /**\n * Whether or not the torch is available.\n *\n * @since 0.0.1\n * @example true\n */\n available: boolean;\n}\n\n/**\n * @since 5.4.0\n */\nexport interface SetZoomRatioOptions {\n /**\n * The zoom ratio to set.\n *\n * @since 5.4.0\n */\n zoomRatio: number;\n}\n\n/**\n * @since 5.4.0\n */\nexport interface GetZoomRatioResult {\n /**\n * The zoom ratio.\n *\n * @since 5.4.0\n */\n zoomRatio: number;\n}\n\n/**\n * @since 5.4.0\n */\nexport interface GetMinZoomRatioResult {\n /**\n * The minimum zoom ratio.\n *\n * @since 5.4.0\n */\n zoomRatio: number;\n}\n\n/**\n * @since 5.4.0\n */\nexport interface GetMaxZoomRatioResult {\n /**\n * The maximum zoom ratio.\n *\n * @since 5.4.0\n */\n zoomRatio: number;\n}\n\n/**\n * @since 5.1.0\n */\nexport interface IsGoogleBarcodeScannerModuleAvailableResult {\n /**\n * Whether or not the Google Barcode Scanner module is available.\n *\n * @since 5.1.0\n */\n available: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport type CameraPermissionState = PermissionState | 'limited';\n\n/**\n * @since 0.0.1\n */\nexport interface PermissionStatus {\n /**\n * @since 0.0.1\n */\n camera: CameraPermissionState;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface BarcodeScannedEvent {\n /**\n * A detected barcode.\n *\n * @since 0.0.1\n */\n barcode: Barcode;\n}\n\n/**\n * @since 6.2.0\n */\nexport interface BarcodesScannedEvent {\n /**\n * The detected barcodes.\n *\n * @since 6.2.0\n */\n barcodes: Barcode[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ScanErrorEvent {\n /**\n * The error message.\n *\n * @since 0.0.1\n */\n message: string;\n}\n\n/**\n * @since 5.1.0\n */\nexport interface GoogleBarcodeScannerModuleInstallProgressEvent {\n /**\n * The current state of the installation.\n *\n * @since 5.1.0\n */\n state: GoogleBarcodeScannerModuleInstallState;\n /**\n * The progress of the installation in percent between 0 and 100.\n *\n * @since 5.1.0\n */\n progress?: number;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Barcode {\n /**\n * Raw bytes as it was encoded in the barcode.\n *\n * @since 0.0.1\n * @example [67, 97, 112, 97, 99, 105, 116, 111, 114, 74, 83]\n */\n bytes?: number[];\n /**\n * Calendar event info.\n *\n * @since 7.0.0\n */\n calendarEvent?: BarcodeCalendarEvent;\n /**\n * Person's or organization's business card.\n *\n * @since 7.0.0\n */\n contactInfo?: BarcodeContactInfo;\n /**\n * The four corner points of the barcode in clockwise\n * order starting with top-left.\n *\n * This property is currently only supported by the `startScan(...)` method.\n *\n * @since 0.0.1\n * @example [[34, 33], [264, 32], [263, 263], [33, 263]]\n * @experimental This property is experimental and may change in the future.\n */\n cornerPoints?: [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n ];\n /**\n * The barcode value in a human readable format.\n *\n * @since 0.0.1\n * @example \"CapacitorJS\"\n */\n displayValue: string;\n /**\n * Driver license or ID card.\n *\n * @since 7.0.0\n */\n driverLicense?: BarcodeDriverLicense;\n /**\n * An email message from a 'MAILTO:'.\n *\n * @since 7.0.0\n */\n email?: BarcodeEmail;\n /**\n * The barcode format.\n *\n * @since 0.0.1\n * @example \"QR_CODE\"\n */\n format: BarcodeFormat;\n /**\n * GPS coordinates from a 'GEO:'.\n *\n * @since 7.0.0\n */\n geoPoint?: BarcodeGeoPoint;\n /**\n * Phone number info.\n *\n * @since 7.0.0\n */\n phone?: BarcodePhone;\n /**\n * The barcode value in a machine readable format.\n *\n * This value is only available if the barcode is encoded\n * in the UTF-8 character set. Otherwise, the `bytes` property\n * should be used.\n *\n * @since 0.0.1\n * @example \"CapacitorJS\"\n */\n rawValue?: string;\n /**\n * A sms message from a 'SMS:'.\n *\n * @since 7.0.0\n */\n sms?: BarcodeSms;\n /**\n * A URL and title from a 'MEBKM:'.\n *\n * @since 7.0.0\n */\n urlBookmark?: BarcodeUrlBookmark;\n /**\n * The barcode value type.\n *\n * @since 0.0.1\n * @example \"TEXT\"\n */\n valueType: BarcodeValueType;\n /**\n * A wifi network parameters from a 'WIFI:'.\n *\n * @since 7.0.0\n */\n wifi?: BarcodeWifi;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeCalendarEvent {\n /**\n * The event description.\n *\n * @since 7.0.0\n */\n description?: string;\n /**\n * The event end date as ISO 8601 string.\n *\n * @since 7.0.0\n * @example \"2022-12-31T23:59:59.999Z\"\n */\n end?: string;\n /**\n * The event location.\n *\n * @since 7.0.0\n */\n location?: string;\n /**\n * The event organizer.\n *\n * @since 7.0.0\n */\n organizer?: string;\n /**\n * The event start date as ISO 8601 string.\n *\n * @since 7.0.0\n * @example \"2022-01-01T00:00:00.000Z\"\n */\n start?: string;\n /**\n * The event status.\n *\n * @since 7.0.0\n */\n status?: string;\n /**\n * The event summary.\n *\n * @since 7.0.0\n */\n summary?: string;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeContactInfo {\n /**\n * The contact's addresses.\n *\n * @since 7.0.0\n */\n addresses?: Address[];\n /**\n * The contact's emails.\n *\n * @since 7.0.0\n */\n emails?: BarcodeEmail[];\n /**\n * The contact's name.\n *\n * @since 7.0.0\n */\n personName?: PersonName;\n /**\n * The contact's organization.\n *\n * @since 7.0.0\n */\n organization?: string;\n /**\n * The contact's phones.\n *\n * @since 7.0.0\n */\n phones?: BarcodePhone[];\n /**\n * The contact's title.\n *\n * @since 7.0.0\n */\n title?: string;\n /**\n * The contact's urls.\n *\n * @since 7.0.0\n */\n urls?: string[];\n}\n\n/**\n * @since 7.0.0\n */\nexport interface Address {\n /**\n * Formatted address, multiple lines when appropriate.\n *\n * @since 7.0.0\n */\n addressLines?: string[];\n /**\n * Address type.\n *\n * @since 7.0.0\n */\n type?: AddressType;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeDriverLicense {\n /**\n * City of holder's address.\n *\n * @since 7.0.0\n */\n addressCity?: string;\n /**\n * State of holder's address.\n *\n * @since 7.0.0\n */\n addressState?: string;\n /**\n * Street of holder's address.\n *\n * @since 7.0.0\n */\n addressStreet?: string;\n /**\n * Postal code of holder's address.\n *\n * @since 7.0.0\n */\n addressZip?: string;\n /**\n * Birthdate of the holder.\n *\n * @since 7.0.0\n */\n birthDate?: string;\n /**\n * \"DL\" for driver's licenses, \"ID\" for ID cards.\n *\n * @since 7.0.0\n */\n documentType?: string;\n /**\n * Expiration date of the license.\n *\n * @since 7.0.0\n */\n expiryDate?: string;\n /**\n * Holder's first name.\n *\n * @since 7.0.0\n */\n firstName?: string;\n /**\n * Holder's gender.\n *\n * @since 7.0.0\n */\n gender?: string;\n\n /**\n * Issue date of the license.\n *\n * @since 7.0.0\n */\n issueDate?: string;\n /**\n * ISO 3166-1 alpha-3 code in which DL/ID was issued.\n *\n * @since 7.0.0\n */\n issuingCountry?: string;\n /**\n * Holder's last name.\n *\n * @since 7.0.0\n */\n lastName?: string;\n /**\n * Driver license ID number.\n *\n * @since 7.0.0\n */\n licenseNumber?: string;\n /**\n * Holder's middle name.\n *\n * @since 7.0.0\n */\n middleName?: string;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeEmail {\n /**\n * The email address.\n *\n * @since 7.0.0\n */\n address?: string;\n /**\n * The email body.\n *\n * @since 7.0.0\n */\n body?: string;\n /**\n * The email subject.\n *\n * @since 7.0.0\n */\n subject?: string;\n /**\n * The email address type.\n *\n * @since 7.0.0\n */\n type: EmailFormatType;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeGeoPoint {\n /**\n * Latitude.\n *\n * @since 7.0.0\n */\n latitude?: number;\n /**\n * Longitude.\n *\n * @since 7.0.0\n */\n longitude?: number;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodePhone {\n /**\n * The phone number.\n *\n * @since 7.0.0\n */\n number?: string;\n /**\n * The phone number type.\n *\n * @since 7.0.0\n */\n type?: PhoneFormatType;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface PersonName {\n /**\n * First name.\n *\n * @since 7.0.0\n */\n first?: string;\n /**\n * The formatted name.\n *\n * @since 7.0.0\n */\n formattedName?: string;\n /**\n * Last name.\n *\n * @since 7.0.0\n */\n last?: string;\n /**\n * Middle name.\n *\n * @since 7.0.0\n */\n middle?: string;\n /**\n * Name prefix.\n *\n * @since 7.0.0\n */\n prefix?: string;\n /**\n * Text string to be set as the kana name in the phonebook. Used for Japanese contacts.\n *\n * @since 7.0.0\n */\n pronunciation?: string;\n /**\n * Name suffix.\n *\n * @since 7.0.0\n */\n suffix?: string;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeSms {\n /**\n * The phone number of the sms.\n *\n * @since 7.0.0\n */\n phoneNumber?: string;\n /**\n * The message content of the sms.\n *\n * @since 7.0.0\n */\n message?: string;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeUrlBookmark {\n /**\n * The URL of the bookmark.\n *\n * @since 7.0.0\n */\n url?: string;\n /**\n * The title of the bookmark.\n *\n * @since 7.0.0\n */\n title?: string;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface BarcodeWifi {\n /**\n * Encryption type of the WI-FI.\n *\n * @since 7.0.0\n */\n encryptionType: WifiEncryptionType;\n /**\n * Password of the WI-FI.\n *\n * @since 7.0.0\n */\n password?: string;\n /**\n * SSID of the WI-FI.\n *\n * @since 7.0.0\n */\n ssid?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport enum BarcodeFormat {\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Aztec = 'AZTEC',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Codabar = 'CODABAR',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Code39 = 'CODE_39',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Code93 = 'CODE_93',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Code128 = 'CODE_128',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n DataMatrix = 'DATA_MATRIX',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Ean8 = 'EAN_8',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Ean13 = 'EAN_13',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Itf = 'ITF',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n Pdf417 = 'PDF_417',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n QrCode = 'QR_CODE',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n UpcA = 'UPC_A',\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n UpcE = 'UPC_E',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum BarcodeValueType {\n /**\n * @since 0.0.1\n */\n CalendarEvent = 'CALENDAR_EVENT',\n /**\n * @since 0.0.1\n */\n ContactInfo = 'CONTACT_INFO',\n /**\n * @since 0.0.1\n */\n DriversLicense = 'DRIVERS_LICENSE',\n /**\n * @since 0.0.1\n */\n Email = 'EMAIL',\n /**\n * @since 0.0.1\n */\n Geo = 'GEO',\n /**\n * @since 0.0.1\n */\n Isbn = 'ISBN',\n /**\n * @since 0.0.1\n */\n Phone = 'PHONE',\n /**\n * @since 0.0.1\n */\n Product = 'PRODUCT',\n /**\n * @since 0.0.1\n */\n Sms = 'SMS',\n /**\n * @since 0.0.1\n */\n Text = 'TEXT',\n /**\n * @since 0.0.1\n */\n Url = 'URL',\n /**\n * @since 0.0.1\n */\n Wifi = 'WIFI',\n /**\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n}\n\n/**\n * @since 7.0.0\n */\nexport enum Resolution {\n /**\n * @since 7.0.0\n */\n '640x480' = 0,\n /**\n * @since 7.0.0\n */\n '1280x720' = 1,\n /**\n * @since 7.0.0\n */\n '1920x1080' = 2,\n /**\n * @since 7.2.0\n */\n '3840x2160' = 3,\n}\n\n/**\n * @since 0.0.1\n */\nexport enum LensFacing {\n /**\n * @since 0.0.1\n */\n Front = 'FRONT',\n /**\n * @since 0.0.1\n */\n Back = 'BACK',\n}\n\n/**\n * @since 5.1.0\n */\nexport enum GoogleBarcodeScannerModuleInstallState {\n /**\n * @since 5.1.0\n */\n UNKNOWN = 0,\n /**\n * @since 5.1.0\n */\n PENDING = 1,\n /**\n * @since 5.1.0\n */\n DOWNLOADING = 2,\n /**\n * @since 5.1.0\n */\n CANCELED = 3,\n /**\n * @since 5.1.0\n */\n COMPLETED = 4,\n /**\n * @since 5.1.0\n */\n FAILED = 5,\n /**\n * @since 5.1.0\n */\n INSTALLING = 6,\n /**\n * @since 5.1.0\n */\n DOWNLOAD_PAUSED = 7,\n}\n\n/**\n * @since 7.0.0\n */\nexport enum AddressType {\n /**\n * @since 7.0.0\n */\n HOME = 0,\n /**\n * @since 7.0.0\n */\n UNKNOWN = 1,\n /**\n * @since 7.0.0\n */\n WORK = 2,\n}\n\n/**\n * @since 7.0.0\n */\nexport enum EmailFormatType {\n /**\n * @since 7.0.0\n */\n HOME = 0,\n /**\n * @since 7.0.0\n */\n UNKNOWN = 1,\n /**\n * @since 7.0.0\n */\n WORK = 2,\n}\n\n/**\n * @since 7.0.0\n */\nexport enum PhoneFormatType {\n /**\n * @since 7.0.0\n */\n FAX = 0,\n /**\n * @since 7.0.0\n */\n HOME = 1,\n /**\n * @since 7.0.0\n */\n MOBILE = 2,\n /**\n * @since 7.0.0\n */\n UNKNOWN = 3,\n /**\n * @since 7.0.0\n */\n WORK = 4,\n}\n\n/**\n * @since 7.0.0\n */\nexport enum WifiEncryptionType {\n /**\n * @since 7.0.0\n */\n OPEN = 1,\n /**\n * @since 7.0.0\n */\n WEP = 2,\n /**\n * @since 7.0.0\n */\n WPA = 3,\n}\n"]} \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/index.d.ts b/packages/barcode-scanning/dist/esm/index.d.ts new file mode 100644 index 00000000..9b1957ea --- /dev/null +++ b/packages/barcode-scanning/dist/esm/index.d.ts @@ -0,0 +1,4 @@ +import type { BarcodeScannerPlugin } from './definitions'; +declare const BarcodeScanner: BarcodeScannerPlugin; +export * from './definitions'; +export { BarcodeScanner }; diff --git a/packages/barcode-scanning/dist/esm/index.js b/packages/barcode-scanning/dist/esm/index.js new file mode 100644 index 00000000..7344bd14 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/index.js @@ -0,0 +1,7 @@ +import { registerPlugin } from '@capacitor/core'; +var BarcodeScanner = registerPlugin('BarcodeScanner', { + web: function () { return import('./web').then(function (m) { return new m.BarcodeScannerWeb(); }); }, +}); +export * from './definitions'; +export { BarcodeScanner }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/index.js.map b/packages/barcode-scanning/dist/esm/index.js.map new file mode 100644 index 00000000..657b5476 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,IAAM,cAAc,GAAG,cAAc,CAAuB,gBAAgB,EAAE;IAC5E,GAAG,EAAE,cAAM,OAAA,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,CAAC,iBAAiB,EAAE,EAAzB,CAAyB,CAAC,EAApD,CAAoD;CAChE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { BarcodeScannerPlugin } from './definitions';\n\nconst BarcodeScanner = registerPlugin('BarcodeScanner', {\n web: () => import('./web').then(m => new m.BarcodeScannerWeb()),\n});\n\nexport * from './definitions';\nexport { BarcodeScanner };\n"]} \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/web.d.ts b/packages/barcode-scanning/dist/esm/web.d.ts new file mode 100644 index 00000000..3c2007f9 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/web.d.ts @@ -0,0 +1,36 @@ +import { WebPlugin } from '@capacitor/core'; +import type { BarcodeScannerPlugin, GetMaxZoomRatioResult, GetMinZoomRatioResult, GetZoomRatioResult, IsGoogleBarcodeScannerModuleAvailableResult, IsSupportedResult, PermissionStatus, ReadBarcodesFromImageOptions, ReadBarcodesFromImageResult, ScanResult, SetZoomRatioOptions, StartScanOptions, IsTorchEnabledResult, IsTorchAvailableResult } from './definitions'; +declare global { + const BarcodeDetector: typeof import('./barcode-detector').BarcodeDetector; +} +export declare class BarcodeScannerWeb extends WebPlugin implements BarcodeScannerPlugin { + private readonly _isSupported; + private readonly errorVideoElementMissing; + private readonly eventBarcodesScanned; + private intervalId; + private stream; + private videoElement; + startScan(options?: StartScanOptions): Promise; + stopScan(): Promise; + pauseScan(): Promise; + resumeScan(): Promise; + readBarcodesFromImage(_options: ReadBarcodesFromImageOptions): Promise; + scan(): Promise; + isSupported(): Promise; + enableTorch(): Promise; + disableTorch(): Promise; + toggleTorch(): Promise; + isTorchEnabled(): Promise; + isTorchAvailable(): Promise; + setZoomRatio(_options: SetZoomRatioOptions): Promise; + getZoomRatio(): Promise; + getMinZoomRatio(): Promise; + getMaxZoomRatio(): Promise; + openSettings(): Promise; + isGoogleBarcodeScannerModuleAvailable(): Promise; + installGoogleBarcodeScannerModule(): Promise; + checkPermissions(): Promise; + requestPermissions(): Promise; + private createUnimplementedException; + private handleScannedBarcodes; +} diff --git a/packages/barcode-scanning/dist/esm/web.js b/packages/barcode-scanning/dist/esm/web.js new file mode 100644 index 00000000..4b3655fa --- /dev/null +++ b/packages/barcode-scanning/dist/esm/web.js @@ -0,0 +1,376 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +import { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core'; +import { BarcodeValueType, LensFacing } from './definitions'; +var BarcodeScannerWeb = /** @class */ (function (_super) { + __extends(BarcodeScannerWeb, _super); + function BarcodeScannerWeb() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._isSupported = 'BarcodeDetector' in window; + _this.errorVideoElementMissing = 'videoElement must be provided.'; + _this.eventBarcodesScanned = 'barcodesScanned'; + return _this; + } + BarcodeScannerWeb.prototype.startScan = function (options) { + return __awaiter(this, void 0, void 0, function () { + var _a, barcodeDetector; + var _this = this; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (!(options === null || options === void 0 ? void 0 : options.videoElement)) { + throw new Error(this.errorVideoElementMissing); + } + this.videoElement = options.videoElement; + _a = this; + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ + video: { + facingMode: { + ideal: (options === null || options === void 0 ? void 0 : options.lensFacing) === LensFacing.Front ? 'user' : 'environment', + }, + }, + audio: false, + })]; + case 1: + _a.stream = _b.sent(); + options.videoElement.srcObject = this.stream; + return [4 /*yield*/, options.videoElement.play()]; + case 2: + _b.sent(); + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!options.videoElement) { + return [2 /*return*/]; + } + return [4 /*yield*/, barcodeDetector.detect(options.videoElement)]; + case 1: + barcodes = _a.sent(); + if (barcodes.length === 0) { + return [2 /*return*/]; + } + else { + this.handleScannedBarcodes(barcodes); + } + return [2 /*return*/]; + } + }); + }); }, 500); + return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.stopScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + if (this.stream) { + this.stream.getTracks().forEach(function (track) { return track.stop(); }); + this.stream = undefined; + } + if (this.videoElement) { + this.videoElement.srcObject = null; + this.videoElement = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.pauseScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.resumeScan = function () { + return __awaiter(this, void 0, void 0, function () { + var barcodeDetector; + var _this = this; + return __generator(this, function (_a) { + if (!this.videoElement) { + throw new Error(this.errorVideoElementMissing); + } + if (!this.stream) { + throw new Error('Scan was not started. Call startScan() first.'); + } + if (this.intervalId) { + return [2 /*return*/]; + } + if (!('BarcodeDetector' in window)) { + throw new CapacitorException('BarcodeDetector Web API is not available in this browser.', ExceptionCode.Unavailable); + } + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.videoElement) + return [2 /*return*/]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, barcodeDetector.detect(this.videoElement)]; + case 2: + barcodes = _a.sent(); + if (barcodes.length > 0) { + this.handleScannedBarcodes(barcodes); + } + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + console.error('Barcode detection failed', err_1); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); }, 300); + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.readBarcodesFromImage = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.scan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isSupported = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { supported: this._isSupported }]; + }); + }); + }; + BarcodeScannerWeb.prototype.enableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.disableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.toggleTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchEnabled = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { available: false }]; + }); + }); + }; + BarcodeScannerWeb.prototype.setZoomRatio = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMinZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMaxZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.openSettings = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isGoogleBarcodeScannerModuleAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.installGoogleBarcodeScannerModule = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.checkPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var result, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.permissions.query({ + name: 'camera', + })]; + case 1: + result = _a.sent(); + return [2 /*return*/, { + camera: result.state, + }]; + case 2: + error_1 = _a.sent(); + return [2 /*return*/, { + camera: 'prompt', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.requestPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var stream, error_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ video: true })]; + case 1: + stream = _a.sent(); + stream.getTracks().forEach(function (track) { return track.stop(); }); + return [2 /*return*/, { + camera: 'granted', + }]; + case 2: + error_2 = _a.sent(); + return [2 /*return*/, { + camera: 'denied', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.createUnimplementedException = function () { + return new CapacitorException('This method is not implemented on web.', ExceptionCode.Unimplemented); + }; + BarcodeScannerWeb.prototype.handleScannedBarcodes = function (barcodes) { + var result = { + barcodes: barcodes.map(function (barcode) { return ({ + cornerPoints: [ + [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y], + [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y], + [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y], + [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y], + ], + displayValue: barcode.rawValue, + rawValue: barcode.rawValue, + format: barcode.format.toUpperCase(), + valueType: BarcodeValueType.Unknown, + }); }), + }; + this.notifyListeners(this.eventBarcodesScanned, result); + }; + return BarcodeScannerWeb; +}(WebPlugin)); +export { BarcodeScannerWeb }; +//# sourceMappingURL=web.js.map \ No newline at end of file diff --git a/packages/barcode-scanning/dist/esm/web.js.map b/packages/barcode-scanning/dist/esm/web.js.map new file mode 100644 index 00000000..da3caf50 --- /dev/null +++ b/packages/barcode-scanning/dist/esm/web.js.map @@ -0,0 +1 @@ +{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyB7D;IACU,qCAAS;IADnB;;QAImB,kBAAY,GAAG,iBAAiB,IAAI,MAAM,CAAC;QAC3C,8BAAwB,GAAG,gCAAgC,CAAC;QAC5D,0BAAoB,GAAG,iBAAiB,CAAC;;IAsN5D,CAAC;IAhNO,qCAAS,GAAf,UAAgB,OAA0B;;;;;;;wBACxC,IAAI,CAAC,IAA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in } from '@capacitor/core';\n\nimport type { DetectedBarcode } from './barcode-detector';\nimport { BarcodeValueType, LensFacing } from './definitions';\nimport type {\n BarcodeFormat,\n BarcodesScannedEvent,\n BarcodeScannerPlugin,\n GetMaxZoomRatioResult,\n GetMinZoomRatioResult,\n GetZoomRatioResult,\n IsGoogleBarcodeScannerModuleAvailableResult,\n IsSupportedResult,\n PermissionStatus,\n ReadBarcodesFromImageOptions,\n ReadBarcodesFromImageResult,\n ScanResult,\n SetZoomRatioOptions,\n StartScanOptions,\n IsTorchEnabledResult,\n IsTorchAvailableResult,\n} from './definitions';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n const BarcodeDetector: typeof import('./barcode-detector').BarcodeDetector;\n}\n\nexport class BarcodeScannerWeb\n extends WebPlugin\n implements BarcodeScannerPlugin\n{\n private readonly _isSupported = 'BarcodeDetector' in window;\n private readonly errorVideoElementMissing = 'videoElement must be provided.';\n private readonly eventBarcodesScanned = 'barcodesScanned';\n\n private intervalId: number | undefined;\n private stream: MediaStream | undefined;\n private videoElement: HTMLVideoElement | undefined;\n\n async startScan(options?: StartScanOptions): Promise {\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (!options?.videoElement) {\n throw new Error(this.errorVideoElementMissing);\n }\n this.videoElement = options.videoElement;\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n facingMode: {\n ideal:\n options?.lensFacing === LensFacing.Front ? 'user' : 'environment',\n },\n },\n audio: false,\n });\n options.videoElement.srcObject = this.stream;\n await options.videoElement.play();\n const barcodeDetector = new BarcodeDetector();\n this.intervalId = window.setInterval(async () => {\n if (!options.videoElement) {\n return;\n }\n const barcodes = await barcodeDetector.detect(options.videoElement);\n if (barcodes.length === 0) {\n return;\n } else {\n this.handleScannedBarcodes(barcodes);\n }\n }, 500);\n }\n\n async stopScan(): Promise {\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n if (this.stream) {\n this.stream.getTracks().forEach(track => track.stop());\n this.stream = undefined;\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n this.videoElement = undefined;\n }\n }\n\n async pauseScan(): Promise {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n }\n\n async resumeScan(): Promise {\n if (!this.videoElement) {\n throw new Error(this.errorVideoElementMissing);\n }\n if (!this.stream) {\n throw new Error('Scan was not started. Call startScan() first.');\n }\n if (this.intervalId) {\n return;\n }\n\n if (!('BarcodeDetector' in window)) {\n throw new CapacitorException(\n 'BarcodeDetector Web API is not available in this browser.',\n ExceptionCode.Unavailable,\n );\n }\n\n const barcodeDetector = new BarcodeDetector();\n\n this.intervalId = window.setInterval(async () => {\n if (!this.videoElement) return;\n\n try {\n const barcodes = await barcodeDetector.detect(this.videoElement);\n\n if (barcodes.length > 0) {\n this.handleScannedBarcodes(barcodes);\n }\n } catch (err) {\n console.error('Barcode detection failed', err);\n }\n }, 300);\n }\n\n async readBarcodesFromImage(\n _options: ReadBarcodesFromImageOptions,\n ): Promise {\n throw this.createUnimplementedException();\n }\n\n async scan(): Promise {\n throw this.createUnimplementedException();\n }\n\n async isSupported(): Promise {\n return { supported: this._isSupported };\n }\n\n async enableTorch(): Promise {\n throw this.createUnimplementedException();\n }\n\n async disableTorch(): Promise {\n throw this.createUnimplementedException();\n }\n\n async toggleTorch(): Promise {\n throw this.createUnimplementedException();\n }\n\n async isTorchEnabled(): Promise {\n throw this.createUnimplementedException();\n }\n\n async isTorchAvailable(): Promise {\n return { available: false };\n }\n\n async setZoomRatio(_options: SetZoomRatioOptions): Promise {\n throw this.createUnimplementedException();\n }\n\n async getZoomRatio(): Promise {\n throw this.createUnimplementedException();\n }\n\n async getMinZoomRatio(): Promise {\n throw this.createUnimplementedException();\n }\n\n async getMaxZoomRatio(): Promise {\n throw this.createUnimplementedException();\n }\n\n async openSettings(): Promise {\n throw this.createUnimplementedException();\n }\n\n async isGoogleBarcodeScannerModuleAvailable(): Promise {\n throw this.createUnimplementedException();\n }\n\n async installGoogleBarcodeScannerModule(): Promise {\n throw this.createUnimplementedException();\n }\n\n async checkPermissions(): Promise {\n try {\n const result = await navigator.permissions.query({\n name: 'camera' as any,\n });\n return {\n camera: result.state,\n };\n } catch (error) {\n return {\n camera: 'prompt',\n };\n }\n }\n\n async requestPermissions(): Promise {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n stream.getTracks().forEach(track => track.stop());\n return {\n camera: 'granted',\n };\n } catch (error) {\n return {\n camera: 'denied',\n };\n }\n }\n\n private createUnimplementedException(): CapacitorException {\n return new CapacitorException(\n 'This method is not implemented on web.',\n ExceptionCode.Unimplemented,\n );\n }\n\n private handleScannedBarcodes(barcodes: DetectedBarcode[]): void {\n const result: BarcodesScannedEvent = {\n barcodes: barcodes.map(barcode => ({\n cornerPoints: [\n [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y],\n [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y],\n [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y],\n [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y],\n ],\n displayValue: barcode.rawValue,\n rawValue: barcode.rawValue,\n format: barcode.format.toUpperCase() as BarcodeFormat,\n valueType: BarcodeValueType.Unknown,\n })),\n };\n this.notifyListeners(this.eventBarcodesScanned, result);\n }\n}\n"]} \ No newline at end of file diff --git a/packages/barcode-scanning/dist/plugin.cjs.js b/packages/barcode-scanning/dist/plugin.cjs.js new file mode 100644 index 00000000..20c432f9 --- /dev/null +++ b/packages/barcode-scanning/dist/plugin.cjs.js @@ -0,0 +1,685 @@ +'use strict'; + +var core = require('@capacitor/core'); + +/** + * @since 0.0.1 + */ +exports.BarcodeFormat = void 0; +(function (BarcodeFormat) { + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Aztec"] = "AZTEC"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Codabar"] = "CODABAR"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code39"] = "CODE_39"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code93"] = "CODE_93"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code128"] = "CODE_128"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["DataMatrix"] = "DATA_MATRIX"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean8"] = "EAN_8"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean13"] = "EAN_13"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Itf"] = "ITF"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Pdf417"] = "PDF_417"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["QrCode"] = "QR_CODE"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcA"] = "UPC_A"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcE"] = "UPC_E"; +})(exports.BarcodeFormat || (exports.BarcodeFormat = {})); +/** + * @since 0.0.1 + */ +exports.BarcodeValueType = void 0; +(function (BarcodeValueType) { + /** + * @since 0.0.1 + */ + BarcodeValueType["CalendarEvent"] = "CALENDAR_EVENT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["ContactInfo"] = "CONTACT_INFO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["DriversLicense"] = "DRIVERS_LICENSE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Email"] = "EMAIL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Geo"] = "GEO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Isbn"] = "ISBN"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Phone"] = "PHONE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Product"] = "PRODUCT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Sms"] = "SMS"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Text"] = "TEXT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Url"] = "URL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Wifi"] = "WIFI"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Unknown"] = "UNKNOWN"; +})(exports.BarcodeValueType || (exports.BarcodeValueType = {})); +/** + * @since 7.0.0 + */ +exports.Resolution = void 0; +(function (Resolution) { + /** + * @since 7.0.0 + */ + Resolution[Resolution["640x480"] = 0] = "640x480"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1280x720"] = 1] = "1280x720"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1920x1080"] = 2] = "1920x1080"; + /** + * @since 7.2.0 + */ + Resolution[Resolution["3840x2160"] = 3] = "3840x2160"; +})(exports.Resolution || (exports.Resolution = {})); +/** + * @since 0.0.1 + */ +exports.LensFacing = void 0; +(function (LensFacing) { + /** + * @since 0.0.1 + */ + LensFacing["Front"] = "FRONT"; + /** + * @since 0.0.1 + */ + LensFacing["Back"] = "BACK"; +})(exports.LensFacing || (exports.LensFacing = {})); +/** + * @since 5.1.0 + */ +exports.GoogleBarcodeScannerModuleInstallState = void 0; +(function (GoogleBarcodeScannerModuleInstallState) { + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["UNKNOWN"] = 0] = "UNKNOWN"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["PENDING"] = 1] = "PENDING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOADING"] = 2] = "DOWNLOADING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["CANCELED"] = 3] = "CANCELED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["COMPLETED"] = 4] = "COMPLETED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["FAILED"] = 5] = "FAILED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["INSTALLING"] = 6] = "INSTALLING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOAD_PAUSED"] = 7] = "DOWNLOAD_PAUSED"; +})(exports.GoogleBarcodeScannerModuleInstallState || (exports.GoogleBarcodeScannerModuleInstallState = {})); +/** + * @since 7.0.0 + */ +exports.AddressType = void 0; +(function (AddressType) { + /** + * @since 7.0.0 + */ + AddressType[AddressType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["WORK"] = 2] = "WORK"; +})(exports.AddressType || (exports.AddressType = {})); +/** + * @since 7.0.0 + */ +exports.EmailFormatType = void 0; +(function (EmailFormatType) { + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["WORK"] = 2] = "WORK"; +})(exports.EmailFormatType || (exports.EmailFormatType = {})); +/** + * @since 7.0.0 + */ +exports.PhoneFormatType = void 0; +(function (PhoneFormatType) { + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["FAX"] = 0] = "FAX"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["HOME"] = 1] = "HOME"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["MOBILE"] = 2] = "MOBILE"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["UNKNOWN"] = 3] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["WORK"] = 4] = "WORK"; +})(exports.PhoneFormatType || (exports.PhoneFormatType = {})); +/** + * @since 7.0.0 + */ +exports.WifiEncryptionType = void 0; +(function (WifiEncryptionType) { + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["OPEN"] = 1] = "OPEN"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WEP"] = 2] = "WEP"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WPA"] = 3] = "WPA"; +})(exports.WifiEncryptionType || (exports.WifiEncryptionType = {})); + +var BarcodeScanner = core.registerPlugin('BarcodeScanner', { + web: function () { return Promise.resolve().then(function () { return web; }).then(function (m) { return new m.BarcodeScannerWeb(); }); }, +}); + +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var BarcodeScannerWeb = /** @class */ (function (_super) { + __extends(BarcodeScannerWeb, _super); + function BarcodeScannerWeb() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._isSupported = 'BarcodeDetector' in window; + _this.errorVideoElementMissing = 'videoElement must be provided.'; + _this.eventBarcodesScanned = 'barcodesScanned'; + return _this; + } + BarcodeScannerWeb.prototype.startScan = function (options) { + return __awaiter(this, void 0, void 0, function () { + var _a, barcodeDetector; + var _this = this; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (!(options === null || options === void 0 ? void 0 : options.videoElement)) { + throw new Error(this.errorVideoElementMissing); + } + this.videoElement = options.videoElement; + _a = this; + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ + video: { + facingMode: { + ideal: (options === null || options === void 0 ? void 0 : options.lensFacing) === exports.LensFacing.Front ? 'user' : 'environment', + }, + }, + audio: false, + })]; + case 1: + _a.stream = _b.sent(); + options.videoElement.srcObject = this.stream; + return [4 /*yield*/, options.videoElement.play()]; + case 2: + _b.sent(); + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!options.videoElement) { + return [2 /*return*/]; + } + return [4 /*yield*/, barcodeDetector.detect(options.videoElement)]; + case 1: + barcodes = _a.sent(); + if (barcodes.length === 0) { + return [2 /*return*/]; + } + else { + this.handleScannedBarcodes(barcodes); + } + return [2 /*return*/]; + } + }); + }); }, 500); + return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.stopScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + if (this.stream) { + this.stream.getTracks().forEach(function (track) { return track.stop(); }); + this.stream = undefined; + } + if (this.videoElement) { + this.videoElement.srcObject = null; + this.videoElement = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.pauseScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.resumeScan = function () { + return __awaiter(this, void 0, void 0, function () { + var barcodeDetector; + var _this = this; + return __generator(this, function (_a) { + if (!this.videoElement) { + throw new Error(this.errorVideoElementMissing); + } + if (!this.stream) { + throw new Error('Scan was not started. Call startScan() first.'); + } + if (this.intervalId) { + return [2 /*return*/]; + } + if (!('BarcodeDetector' in window)) { + throw new core.CapacitorException('BarcodeDetector Web API is not available in this browser.', core.ExceptionCode.Unavailable); + } + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.videoElement) + return [2 /*return*/]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, barcodeDetector.detect(this.videoElement)]; + case 2: + barcodes = _a.sent(); + if (barcodes.length > 0) { + this.handleScannedBarcodes(barcodes); + } + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + console.error('Barcode detection failed', err_1); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); }, 300); + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.readBarcodesFromImage = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.scan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isSupported = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { supported: this._isSupported }]; + }); + }); + }; + BarcodeScannerWeb.prototype.enableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.disableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.toggleTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchEnabled = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { available: false }]; + }); + }); + }; + BarcodeScannerWeb.prototype.setZoomRatio = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMinZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMaxZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.openSettings = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isGoogleBarcodeScannerModuleAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.installGoogleBarcodeScannerModule = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.checkPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.permissions.query({ + name: 'camera', + })]; + case 1: + result = _a.sent(); + return [2 /*return*/, { + camera: result.state, + }]; + case 2: + _a.sent(); + return [2 /*return*/, { + camera: 'prompt', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.requestPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var stream; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ video: true })]; + case 1: + stream = _a.sent(); + stream.getTracks().forEach(function (track) { return track.stop(); }); + return [2 /*return*/, { + camera: 'granted', + }]; + case 2: + _a.sent(); + return [2 /*return*/, { + camera: 'denied', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.createUnimplementedException = function () { + return new core.CapacitorException('This method is not implemented on web.', core.ExceptionCode.Unimplemented); + }; + BarcodeScannerWeb.prototype.handleScannedBarcodes = function (barcodes) { + var result = { + barcodes: barcodes.map(function (barcode) { return ({ + cornerPoints: [ + [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y], + [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y], + [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y], + [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y], + ], + displayValue: barcode.rawValue, + rawValue: barcode.rawValue, + format: barcode.format.toUpperCase(), + valueType: exports.BarcodeValueType.Unknown, + }); }), + }; + this.notifyListeners(this.eventBarcodesScanned, result); + }; + return BarcodeScannerWeb; +}(core.WebPlugin)); + +var web = /*#__PURE__*/Object.freeze({ + __proto__: null, + BarcodeScannerWeb: BarcodeScannerWeb +}); + +exports.BarcodeScanner = BarcodeScanner; +//# sourceMappingURL=plugin.cjs.js.map diff --git a/packages/barcode-scanning/dist/plugin.cjs.js.map b/packages/barcode-scanning/dist/plugin.cjs.js.map new file mode 100644 index 00000000..7074f5fd --- /dev/null +++ b/packages/barcode-scanning/dist/plugin.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var BarcodeFormat;\n(function (BarcodeFormat) {\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Aztec\"] = \"AZTEC\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Codabar\"] = \"CODABAR\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code39\"] = \"CODE_39\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code93\"] = \"CODE_93\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code128\"] = \"CODE_128\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"DataMatrix\"] = \"DATA_MATRIX\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Ean8\"] = \"EAN_8\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Ean13\"] = \"EAN_13\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Itf\"] = \"ITF\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Pdf417\"] = \"PDF_417\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"QrCode\"] = \"QR_CODE\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"UpcA\"] = \"UPC_A\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"UpcE\"] = \"UPC_E\";\n})(BarcodeFormat || (BarcodeFormat = {}));\n/**\n * @since 0.0.1\n */\nexport var BarcodeValueType;\n(function (BarcodeValueType) {\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"CalendarEvent\"] = \"CALENDAR_EVENT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"ContactInfo\"] = \"CONTACT_INFO\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"DriversLicense\"] = \"DRIVERS_LICENSE\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Email\"] = \"EMAIL\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Geo\"] = \"GEO\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Isbn\"] = \"ISBN\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Phone\"] = \"PHONE\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Product\"] = \"PRODUCT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Sms\"] = \"SMS\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Text\"] = \"TEXT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Url\"] = \"URL\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Wifi\"] = \"WIFI\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Unknown\"] = \"UNKNOWN\";\n})(BarcodeValueType || (BarcodeValueType = {}));\n/**\n * @since 7.0.0\n */\nexport var Resolution;\n(function (Resolution) {\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"640x480\"] = 0] = \"640x480\";\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"1280x720\"] = 1] = \"1280x720\";\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"1920x1080\"] = 2] = \"1920x1080\";\n /**\n * @since 7.2.0\n */\n Resolution[Resolution[\"3840x2160\"] = 3] = \"3840x2160\";\n})(Resolution || (Resolution = {}));\n/**\n * @since 0.0.1\n */\nexport var LensFacing;\n(function (LensFacing) {\n /**\n * @since 0.0.1\n */\n LensFacing[\"Front\"] = \"FRONT\";\n /**\n * @since 0.0.1\n */\n LensFacing[\"Back\"] = \"BACK\";\n})(LensFacing || (LensFacing = {}));\n/**\n * @since 5.1.0\n */\nexport var GoogleBarcodeScannerModuleInstallState;\n(function (GoogleBarcodeScannerModuleInstallState) {\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"PENDING\"] = 1] = \"PENDING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"DOWNLOADING\"] = 2] = \"DOWNLOADING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"CANCELED\"] = 3] = \"CANCELED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"COMPLETED\"] = 4] = \"COMPLETED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"FAILED\"] = 5] = \"FAILED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"INSTALLING\"] = 6] = \"INSTALLING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"DOWNLOAD_PAUSED\"] = 7] = \"DOWNLOAD_PAUSED\";\n})(GoogleBarcodeScannerModuleInstallState || (GoogleBarcodeScannerModuleInstallState = {}));\n/**\n * @since 7.0.0\n */\nexport var AddressType;\n(function (AddressType) {\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"HOME\"] = 0] = \"HOME\";\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"UNKNOWN\"] = 1] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"WORK\"] = 2] = \"WORK\";\n})(AddressType || (AddressType = {}));\n/**\n * @since 7.0.0\n */\nexport var EmailFormatType;\n(function (EmailFormatType) {\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"HOME\"] = 0] = \"HOME\";\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"UNKNOWN\"] = 1] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"WORK\"] = 2] = \"WORK\";\n})(EmailFormatType || (EmailFormatType = {}));\n/**\n * @since 7.0.0\n */\nexport var PhoneFormatType;\n(function (PhoneFormatType) {\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"FAX\"] = 0] = \"FAX\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"HOME\"] = 1] = \"HOME\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"MOBILE\"] = 2] = \"MOBILE\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"UNKNOWN\"] = 3] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"WORK\"] = 4] = \"WORK\";\n})(PhoneFormatType || (PhoneFormatType = {}));\n/**\n * @since 7.0.0\n */\nexport var WifiEncryptionType;\n(function (WifiEncryptionType) {\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"OPEN\"] = 1] = \"OPEN\";\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"WEP\"] = 2] = \"WEP\";\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"WPA\"] = 3] = \"WPA\";\n})(WifiEncryptionType || (WifiEncryptionType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nvar BarcodeScanner = registerPlugin('BarcodeScanner', {\n web: function () { return import('./web').then(function (m) { return new m.BarcodeScannerWeb(); }); },\n});\nexport * from './definitions';\nexport { BarcodeScanner };\n//# sourceMappingURL=index.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';\nimport { BarcodeValueType, LensFacing } from './definitions';\nvar BarcodeScannerWeb = /** @class */ (function (_super) {\n __extends(BarcodeScannerWeb, _super);\n function BarcodeScannerWeb() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._isSupported = 'BarcodeDetector' in window;\n _this.errorVideoElementMissing = 'videoElement must be provided.';\n _this.eventBarcodesScanned = 'barcodesScanned';\n return _this;\n }\n BarcodeScannerWeb.prototype.startScan = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, barcodeDetector;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (!(options === null || options === void 0 ? void 0 : options.videoElement)) {\n throw new Error(this.errorVideoElementMissing);\n }\n this.videoElement = options.videoElement;\n _a = this;\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({\n video: {\n facingMode: {\n ideal: (options === null || options === void 0 ? void 0 : options.lensFacing) === LensFacing.Front ? 'user' : 'environment',\n },\n },\n audio: false,\n })];\n case 1:\n _a.stream = _b.sent();\n options.videoElement.srcObject = this.stream;\n return [4 /*yield*/, options.videoElement.play()];\n case 2:\n _b.sent();\n barcodeDetector = new BarcodeDetector();\n this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () {\n var barcodes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!options.videoElement) {\n return [2 /*return*/];\n }\n return [4 /*yield*/, barcodeDetector.detect(options.videoElement)];\n case 1:\n barcodes = _a.sent();\n if (barcodes.length === 0) {\n return [2 /*return*/];\n }\n else {\n this.handleScannedBarcodes(barcodes);\n }\n return [2 /*return*/];\n }\n });\n }); }, 500);\n return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.stopScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n if (this.stream) {\n this.stream.getTracks().forEach(function (track) { return track.stop(); });\n this.stream = undefined;\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n this.videoElement = undefined;\n }\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.pauseScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.resumeScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n var barcodeDetector;\n var _this = this;\n return __generator(this, function (_a) {\n if (!this.videoElement) {\n throw new Error(this.errorVideoElementMissing);\n }\n if (!this.stream) {\n throw new Error('Scan was not started. Call startScan() first.');\n }\n if (this.intervalId) {\n return [2 /*return*/];\n }\n if (!('BarcodeDetector' in window)) {\n throw new CapacitorException('BarcodeDetector Web API is not available in this browser.', ExceptionCode.Unavailable);\n }\n barcodeDetector = new BarcodeDetector();\n this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () {\n var barcodes, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.videoElement)\n return [2 /*return*/];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, barcodeDetector.detect(this.videoElement)];\n case 2:\n barcodes = _a.sent();\n if (barcodes.length > 0) {\n this.handleScannedBarcodes(barcodes);\n }\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n console.error('Barcode detection failed', err_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n }); }, 300);\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.readBarcodesFromImage = function (_options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.scan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isSupported = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, { supported: this._isSupported }];\n });\n });\n };\n BarcodeScannerWeb.prototype.enableTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.disableTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.toggleTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isTorchEnabled = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isTorchAvailable = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, { available: false }];\n });\n });\n };\n BarcodeScannerWeb.prototype.setZoomRatio = function (_options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getMinZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getMaxZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.openSettings = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isGoogleBarcodeScannerModuleAvailable = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.installGoogleBarcodeScannerModule = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.checkPermissions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var result, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, navigator.permissions.query({\n name: 'camera',\n })];\n case 1:\n result = _a.sent();\n return [2 /*return*/, {\n camera: result.state,\n }];\n case 2:\n error_1 = _a.sent();\n return [2 /*return*/, {\n camera: 'prompt',\n }];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.requestPermissions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var stream, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ video: true })];\n case 1:\n stream = _a.sent();\n stream.getTracks().forEach(function (track) { return track.stop(); });\n return [2 /*return*/, {\n camera: 'granted',\n }];\n case 2:\n error_2 = _a.sent();\n return [2 /*return*/, {\n camera: 'denied',\n }];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.createUnimplementedException = function () {\n return new CapacitorException('This method is not implemented on web.', ExceptionCode.Unimplemented);\n };\n BarcodeScannerWeb.prototype.handleScannedBarcodes = function (barcodes) {\n var result = {\n barcodes: barcodes.map(function (barcode) { return ({\n cornerPoints: [\n [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y],\n [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y],\n [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y],\n [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y],\n ],\n displayValue: barcode.rawValue,\n rawValue: barcode.rawValue,\n format: barcode.format.toUpperCase(),\n valueType: BarcodeValueType.Unknown,\n }); }),\n };\n this.notifyListeners(this.eventBarcodesScanned, result);\n };\n return BarcodeScannerWeb;\n}(WebPlugin));\nexport { BarcodeScannerWeb };\n//# sourceMappingURL=web.js.map"],"names":["BarcodeFormat","BarcodeValueType","Resolution","LensFacing","GoogleBarcodeScannerModuleInstallState","AddressType","EmailFormatType","PhoneFormatType","WifiEncryptionType","registerPlugin","this","CapacitorException","ExceptionCode","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,aAAa,EAAE;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO;AACpC;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS;AACxC;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC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C,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1E,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1E,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1E,iBAAiB;AACjB,gBAAgB,YAAY,EAAE,OAAO,CAAC,QAAQ;AAC9C,gBAAgB,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAC1C,gBAAgB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;AACpD,gBAAgB,SAAS,EAAEX,wBAAgB,CAAC,OAAO;AACnD,aAAa,EAAE,CAAC,CAAC,CAAC;AAClB,SAAS;AACT,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;AAC/D,IAAI,CAAC;AACL,IAAI,OAAO,iBAAiB;AAC5B,CAAC,CAACY,cAAS,CAAC,CAAC;;;;;;;;;"} \ No newline at end of file diff --git a/packages/barcode-scanning/dist/plugin.js b/packages/barcode-scanning/dist/plugin.js new file mode 100644 index 00000000..dc953ea2 --- /dev/null +++ b/packages/barcode-scanning/dist/plugin.js @@ -0,0 +1,688 @@ +var capacitorBarcodeScanner = (function (exports, core) { + 'use strict'; + + /** + * @since 0.0.1 + */ + exports.BarcodeFormat = void 0; + (function (BarcodeFormat) { + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Aztec"] = "AZTEC"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Codabar"] = "CODABAR"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code39"] = "CODE_39"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code93"] = "CODE_93"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Code128"] = "CODE_128"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["DataMatrix"] = "DATA_MATRIX"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean8"] = "EAN_8"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Ean13"] = "EAN_13"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Itf"] = "ITF"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["Pdf417"] = "PDF_417"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["QrCode"] = "QR_CODE"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcA"] = "UPC_A"; + /** + * Only available on Android and iOS. + * + * @since 0.0.1 + */ + BarcodeFormat["UpcE"] = "UPC_E"; + })(exports.BarcodeFormat || (exports.BarcodeFormat = {})); + /** + * @since 0.0.1 + */ + exports.BarcodeValueType = void 0; + (function (BarcodeValueType) { + /** + * @since 0.0.1 + */ + BarcodeValueType["CalendarEvent"] = "CALENDAR_EVENT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["ContactInfo"] = "CONTACT_INFO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["DriversLicense"] = "DRIVERS_LICENSE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Email"] = "EMAIL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Geo"] = "GEO"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Isbn"] = "ISBN"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Phone"] = "PHONE"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Product"] = "PRODUCT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Sms"] = "SMS"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Text"] = "TEXT"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Url"] = "URL"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Wifi"] = "WIFI"; + /** + * @since 0.0.1 + */ + BarcodeValueType["Unknown"] = "UNKNOWN"; + })(exports.BarcodeValueType || (exports.BarcodeValueType = {})); + /** + * @since 7.0.0 + */ + exports.Resolution = void 0; + (function (Resolution) { + /** + * @since 7.0.0 + */ + Resolution[Resolution["640x480"] = 0] = "640x480"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1280x720"] = 1] = "1280x720"; + /** + * @since 7.0.0 + */ + Resolution[Resolution["1920x1080"] = 2] = "1920x1080"; + /** + * @since 7.2.0 + */ + Resolution[Resolution["3840x2160"] = 3] = "3840x2160"; + })(exports.Resolution || (exports.Resolution = {})); + /** + * @since 0.0.1 + */ + exports.LensFacing = void 0; + (function (LensFacing) { + /** + * @since 0.0.1 + */ + LensFacing["Front"] = "FRONT"; + /** + * @since 0.0.1 + */ + LensFacing["Back"] = "BACK"; + })(exports.LensFacing || (exports.LensFacing = {})); + /** + * @since 5.1.0 + */ + exports.GoogleBarcodeScannerModuleInstallState = void 0; + (function (GoogleBarcodeScannerModuleInstallState) { + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["UNKNOWN"] = 0] = "UNKNOWN"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["PENDING"] = 1] = "PENDING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOADING"] = 2] = "DOWNLOADING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["CANCELED"] = 3] = "CANCELED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["COMPLETED"] = 4] = "COMPLETED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["FAILED"] = 5] = "FAILED"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["INSTALLING"] = 6] = "INSTALLING"; + /** + * @since 5.1.0 + */ + GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState["DOWNLOAD_PAUSED"] = 7] = "DOWNLOAD_PAUSED"; + })(exports.GoogleBarcodeScannerModuleInstallState || (exports.GoogleBarcodeScannerModuleInstallState = {})); + /** + * @since 7.0.0 + */ + exports.AddressType = void 0; + (function (AddressType) { + /** + * @since 7.0.0 + */ + AddressType[AddressType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + AddressType[AddressType["WORK"] = 2] = "WORK"; + })(exports.AddressType || (exports.AddressType = {})); + /** + * @since 7.0.0 + */ + exports.EmailFormatType = void 0; + (function (EmailFormatType) { + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["HOME"] = 0] = "HOME"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["UNKNOWN"] = 1] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + EmailFormatType[EmailFormatType["WORK"] = 2] = "WORK"; + })(exports.EmailFormatType || (exports.EmailFormatType = {})); + /** + * @since 7.0.0 + */ + exports.PhoneFormatType = void 0; + (function (PhoneFormatType) { + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["FAX"] = 0] = "FAX"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["HOME"] = 1] = "HOME"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["MOBILE"] = 2] = "MOBILE"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["UNKNOWN"] = 3] = "UNKNOWN"; + /** + * @since 7.0.0 + */ + PhoneFormatType[PhoneFormatType["WORK"] = 4] = "WORK"; + })(exports.PhoneFormatType || (exports.PhoneFormatType = {})); + /** + * @since 7.0.0 + */ + exports.WifiEncryptionType = void 0; + (function (WifiEncryptionType) { + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["OPEN"] = 1] = "OPEN"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WEP"] = 2] = "WEP"; + /** + * @since 7.0.0 + */ + WifiEncryptionType[WifiEncryptionType["WPA"] = 3] = "WPA"; + })(exports.WifiEncryptionType || (exports.WifiEncryptionType = {})); + + var BarcodeScanner = core.registerPlugin('BarcodeScanner', { + web: function () { return Promise.resolve().then(function () { return web; }).then(function (m) { return new m.BarcodeScannerWeb(); }); }, + }); + + var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = (undefined && undefined.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var BarcodeScannerWeb = /** @class */ (function (_super) { + __extends(BarcodeScannerWeb, _super); + function BarcodeScannerWeb() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._isSupported = 'BarcodeDetector' in window; + _this.errorVideoElementMissing = 'videoElement must be provided.'; + _this.eventBarcodesScanned = 'barcodesScanned'; + return _this; + } + BarcodeScannerWeb.prototype.startScan = function (options) { + return __awaiter(this, void 0, void 0, function () { + var _a, barcodeDetector; + var _this = this; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (!(options === null || options === void 0 ? void 0 : options.videoElement)) { + throw new Error(this.errorVideoElementMissing); + } + this.videoElement = options.videoElement; + _a = this; + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ + video: { + facingMode: { + ideal: (options === null || options === void 0 ? void 0 : options.lensFacing) === exports.LensFacing.Front ? 'user' : 'environment', + }, + }, + audio: false, + })]; + case 1: + _a.stream = _b.sent(); + options.videoElement.srcObject = this.stream; + return [4 /*yield*/, options.videoElement.play()]; + case 2: + _b.sent(); + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!options.videoElement) { + return [2 /*return*/]; + } + return [4 /*yield*/, barcodeDetector.detect(options.videoElement)]; + case 1: + barcodes = _a.sent(); + if (barcodes.length === 0) { + return [2 /*return*/]; + } + else { + this.handleScannedBarcodes(barcodes); + } + return [2 /*return*/]; + } + }); + }); }, 500); + return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.stopScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!this._isSupported) { + throw this.createUnimplementedException(); + } + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + if (this.stream) { + this.stream.getTracks().forEach(function (track) { return track.stop(); }); + this.stream = undefined; + } + if (this.videoElement) { + this.videoElement.srcObject = null; + this.videoElement = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.pauseScan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.resumeScan = function () { + return __awaiter(this, void 0, void 0, function () { + var barcodeDetector; + var _this = this; + return __generator(this, function (_a) { + if (!this.videoElement) { + throw new Error(this.errorVideoElementMissing); + } + if (!this.stream) { + throw new Error('Scan was not started. Call startScan() first.'); + } + if (this.intervalId) { + return [2 /*return*/]; + } + if (!('BarcodeDetector' in window)) { + throw new core.CapacitorException('BarcodeDetector Web API is not available in this browser.', core.ExceptionCode.Unavailable); + } + barcodeDetector = new BarcodeDetector(); + this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var barcodes, err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.videoElement) + return [2 /*return*/]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, barcodeDetector.detect(this.videoElement)]; + case 2: + barcodes = _a.sent(); + if (barcodes.length > 0) { + this.handleScannedBarcodes(barcodes); + } + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + console.error('Barcode detection failed', err_1); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); }, 300); + return [2 /*return*/]; + }); + }); + }; + BarcodeScannerWeb.prototype.readBarcodesFromImage = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.scan = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isSupported = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { supported: this._isSupported }]; + }); + }); + }; + BarcodeScannerWeb.prototype.enableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.disableTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.toggleTorch = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchEnabled = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isTorchAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, { available: false }]; + }); + }); + }; + BarcodeScannerWeb.prototype.setZoomRatio = function (_options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMinZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.getMaxZoomRatio = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.openSettings = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.isGoogleBarcodeScannerModuleAvailable = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.installGoogleBarcodeScannerModule = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + throw this.createUnimplementedException(); + }); + }); + }; + BarcodeScannerWeb.prototype.checkPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.permissions.query({ + name: 'camera', + })]; + case 1: + result = _a.sent(); + return [2 /*return*/, { + camera: result.state, + }]; + case 2: + _a.sent(); + return [2 /*return*/, { + camera: 'prompt', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.requestPermissions = function () { + return __awaiter(this, void 0, void 0, function () { + var stream; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ video: true })]; + case 1: + stream = _a.sent(); + stream.getTracks().forEach(function (track) { return track.stop(); }); + return [2 /*return*/, { + camera: 'granted', + }]; + case 2: + _a.sent(); + return [2 /*return*/, { + camera: 'denied', + }]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + BarcodeScannerWeb.prototype.createUnimplementedException = function () { + return new core.CapacitorException('This method is not implemented on web.', core.ExceptionCode.Unimplemented); + }; + BarcodeScannerWeb.prototype.handleScannedBarcodes = function (barcodes) { + var result = { + barcodes: barcodes.map(function (barcode) { return ({ + cornerPoints: [ + [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y], + [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y], + [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y], + [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y], + ], + displayValue: barcode.rawValue, + rawValue: barcode.rawValue, + format: barcode.format.toUpperCase(), + valueType: exports.BarcodeValueType.Unknown, + }); }), + }; + this.notifyListeners(this.eventBarcodesScanned, result); + }; + return BarcodeScannerWeb; + }(core.WebPlugin)); + + var web = /*#__PURE__*/Object.freeze({ + __proto__: null, + BarcodeScannerWeb: BarcodeScannerWeb + }); + + exports.BarcodeScanner = BarcodeScanner; + + return exports; + +})({}, capacitorExports); +//# sourceMappingURL=plugin.js.map diff --git a/packages/barcode-scanning/dist/plugin.js.map b/packages/barcode-scanning/dist/plugin.js.map new file mode 100644 index 00000000..67f18ea0 --- /dev/null +++ b/packages/barcode-scanning/dist/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var BarcodeFormat;\n(function (BarcodeFormat) {\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Aztec\"] = \"AZTEC\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Codabar\"] = \"CODABAR\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code39\"] = \"CODE_39\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code93\"] = \"CODE_93\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Code128\"] = \"CODE_128\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"DataMatrix\"] = \"DATA_MATRIX\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Ean8\"] = \"EAN_8\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Ean13\"] = \"EAN_13\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Itf\"] = \"ITF\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"Pdf417\"] = \"PDF_417\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"QrCode\"] = \"QR_CODE\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"UpcA\"] = \"UPC_A\";\n /**\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n BarcodeFormat[\"UpcE\"] = \"UPC_E\";\n})(BarcodeFormat || (BarcodeFormat = {}));\n/**\n * @since 0.0.1\n */\nexport var BarcodeValueType;\n(function (BarcodeValueType) {\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"CalendarEvent\"] = \"CALENDAR_EVENT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"ContactInfo\"] = \"CONTACT_INFO\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"DriversLicense\"] = \"DRIVERS_LICENSE\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Email\"] = \"EMAIL\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Geo\"] = \"GEO\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Isbn\"] = \"ISBN\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Phone\"] = \"PHONE\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Product\"] = \"PRODUCT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Sms\"] = \"SMS\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Text\"] = \"TEXT\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Url\"] = \"URL\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Wifi\"] = \"WIFI\";\n /**\n * @since 0.0.1\n */\n BarcodeValueType[\"Unknown\"] = \"UNKNOWN\";\n})(BarcodeValueType || (BarcodeValueType = {}));\n/**\n * @since 7.0.0\n */\nexport var Resolution;\n(function (Resolution) {\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"640x480\"] = 0] = \"640x480\";\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"1280x720\"] = 1] = \"1280x720\";\n /**\n * @since 7.0.0\n */\n Resolution[Resolution[\"1920x1080\"] = 2] = \"1920x1080\";\n /**\n * @since 7.2.0\n */\n Resolution[Resolution[\"3840x2160\"] = 3] = \"3840x2160\";\n})(Resolution || (Resolution = {}));\n/**\n * @since 0.0.1\n */\nexport var LensFacing;\n(function (LensFacing) {\n /**\n * @since 0.0.1\n */\n LensFacing[\"Front\"] = \"FRONT\";\n /**\n * @since 0.0.1\n */\n LensFacing[\"Back\"] = \"BACK\";\n})(LensFacing || (LensFacing = {}));\n/**\n * @since 5.1.0\n */\nexport var GoogleBarcodeScannerModuleInstallState;\n(function (GoogleBarcodeScannerModuleInstallState) {\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"PENDING\"] = 1] = \"PENDING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"DOWNLOADING\"] = 2] = \"DOWNLOADING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"CANCELED\"] = 3] = \"CANCELED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"COMPLETED\"] = 4] = \"COMPLETED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"FAILED\"] = 5] = \"FAILED\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"INSTALLING\"] = 6] = \"INSTALLING\";\n /**\n * @since 5.1.0\n */\n GoogleBarcodeScannerModuleInstallState[GoogleBarcodeScannerModuleInstallState[\"DOWNLOAD_PAUSED\"] = 7] = \"DOWNLOAD_PAUSED\";\n})(GoogleBarcodeScannerModuleInstallState || (GoogleBarcodeScannerModuleInstallState = {}));\n/**\n * @since 7.0.0\n */\nexport var AddressType;\n(function (AddressType) {\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"HOME\"] = 0] = \"HOME\";\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"UNKNOWN\"] = 1] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n AddressType[AddressType[\"WORK\"] = 2] = \"WORK\";\n})(AddressType || (AddressType = {}));\n/**\n * @since 7.0.0\n */\nexport var EmailFormatType;\n(function (EmailFormatType) {\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"HOME\"] = 0] = \"HOME\";\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"UNKNOWN\"] = 1] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n EmailFormatType[EmailFormatType[\"WORK\"] = 2] = \"WORK\";\n})(EmailFormatType || (EmailFormatType = {}));\n/**\n * @since 7.0.0\n */\nexport var PhoneFormatType;\n(function (PhoneFormatType) {\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"FAX\"] = 0] = \"FAX\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"HOME\"] = 1] = \"HOME\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"MOBILE\"] = 2] = \"MOBILE\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"UNKNOWN\"] = 3] = \"UNKNOWN\";\n /**\n * @since 7.0.0\n */\n PhoneFormatType[PhoneFormatType[\"WORK\"] = 4] = \"WORK\";\n})(PhoneFormatType || (PhoneFormatType = {}));\n/**\n * @since 7.0.0\n */\nexport var WifiEncryptionType;\n(function (WifiEncryptionType) {\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"OPEN\"] = 1] = \"OPEN\";\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"WEP\"] = 2] = \"WEP\";\n /**\n * @since 7.0.0\n */\n WifiEncryptionType[WifiEncryptionType[\"WPA\"] = 3] = \"WPA\";\n})(WifiEncryptionType || (WifiEncryptionType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nvar BarcodeScanner = registerPlugin('BarcodeScanner', {\n web: function () { return import('./web').then(function (m) { return new m.BarcodeScannerWeb(); }); },\n});\nexport * from './definitions';\nexport { BarcodeScanner };\n//# sourceMappingURL=index.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';\nimport { BarcodeValueType, LensFacing } from './definitions';\nvar BarcodeScannerWeb = /** @class */ (function (_super) {\n __extends(BarcodeScannerWeb, _super);\n function BarcodeScannerWeb() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._isSupported = 'BarcodeDetector' in window;\n _this.errorVideoElementMissing = 'videoElement must be provided.';\n _this.eventBarcodesScanned = 'barcodesScanned';\n return _this;\n }\n BarcodeScannerWeb.prototype.startScan = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, barcodeDetector;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (!(options === null || options === void 0 ? void 0 : options.videoElement)) {\n throw new Error(this.errorVideoElementMissing);\n }\n this.videoElement = options.videoElement;\n _a = this;\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({\n video: {\n facingMode: {\n ideal: (options === null || options === void 0 ? void 0 : options.lensFacing) === LensFacing.Front ? 'user' : 'environment',\n },\n },\n audio: false,\n })];\n case 1:\n _a.stream = _b.sent();\n options.videoElement.srcObject = this.stream;\n return [4 /*yield*/, options.videoElement.play()];\n case 2:\n _b.sent();\n barcodeDetector = new BarcodeDetector();\n this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () {\n var barcodes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!options.videoElement) {\n return [2 /*return*/];\n }\n return [4 /*yield*/, barcodeDetector.detect(options.videoElement)];\n case 1:\n barcodes = _a.sent();\n if (barcodes.length === 0) {\n return [2 /*return*/];\n }\n else {\n this.handleScannedBarcodes(barcodes);\n }\n return [2 /*return*/];\n }\n });\n }); }, 500);\n return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.stopScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (!this._isSupported) {\n throw this.createUnimplementedException();\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n if (this.stream) {\n this.stream.getTracks().forEach(function (track) { return track.stop(); });\n this.stream = undefined;\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n this.videoElement = undefined;\n }\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.pauseScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.resumeScan = function () {\n return __awaiter(this, void 0, void 0, function () {\n var barcodeDetector;\n var _this = this;\n return __generator(this, function (_a) {\n if (!this.videoElement) {\n throw new Error(this.errorVideoElementMissing);\n }\n if (!this.stream) {\n throw new Error('Scan was not started. Call startScan() first.');\n }\n if (this.intervalId) {\n return [2 /*return*/];\n }\n if (!('BarcodeDetector' in window)) {\n throw new CapacitorException('BarcodeDetector Web API is not available in this browser.', ExceptionCode.Unavailable);\n }\n barcodeDetector = new BarcodeDetector();\n this.intervalId = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () {\n var barcodes, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.videoElement)\n return [2 /*return*/];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, barcodeDetector.detect(this.videoElement)];\n case 2:\n barcodes = _a.sent();\n if (barcodes.length > 0) {\n this.handleScannedBarcodes(barcodes);\n }\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n console.error('Barcode detection failed', err_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n }); }, 300);\n return [2 /*return*/];\n });\n });\n };\n BarcodeScannerWeb.prototype.readBarcodesFromImage = function (_options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.scan = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isSupported = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, { supported: this._isSupported }];\n });\n });\n };\n BarcodeScannerWeb.prototype.enableTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.disableTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.toggleTorch = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isTorchEnabled = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isTorchAvailable = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, { available: false }];\n });\n });\n };\n BarcodeScannerWeb.prototype.setZoomRatio = function (_options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getMinZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.getMaxZoomRatio = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.openSettings = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.isGoogleBarcodeScannerModuleAvailable = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.installGoogleBarcodeScannerModule = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw this.createUnimplementedException();\n });\n });\n };\n BarcodeScannerWeb.prototype.checkPermissions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var result, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, navigator.permissions.query({\n name: 'camera',\n })];\n case 1:\n result = _a.sent();\n return [2 /*return*/, {\n camera: result.state,\n }];\n case 2:\n error_1 = _a.sent();\n return [2 /*return*/, {\n camera: 'prompt',\n }];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.requestPermissions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var stream, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ video: true })];\n case 1:\n stream = _a.sent();\n stream.getTracks().forEach(function (track) { return track.stop(); });\n return [2 /*return*/, {\n camera: 'granted',\n }];\n case 2:\n error_2 = _a.sent();\n return [2 /*return*/, {\n camera: 'denied',\n }];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n BarcodeScannerWeb.prototype.createUnimplementedException = function () {\n return new CapacitorException('This method is not implemented on web.', ExceptionCode.Unimplemented);\n };\n BarcodeScannerWeb.prototype.handleScannedBarcodes = function (barcodes) {\n var result = {\n barcodes: barcodes.map(function (barcode) { return ({\n cornerPoints: [\n [barcode.cornerPoints[0].x, barcode.cornerPoints[0].y],\n [barcode.cornerPoints[1].x, barcode.cornerPoints[1].y],\n [barcode.cornerPoints[2].x, barcode.cornerPoints[2].y],\n [barcode.cornerPoints[3].x, barcode.cornerPoints[3].y],\n ],\n displayValue: barcode.rawValue,\n rawValue: barcode.rawValue,\n format: barcode.format.toUpperCase(),\n valueType: BarcodeValueType.Unknown,\n }); }),\n };\n this.notifyListeners(this.eventBarcodesScanned, result);\n };\n return BarcodeScannerWeb;\n}(WebPlugin));\nexport { BarcodeScannerWeb };\n//# sourceMappingURL=web.js.map"],"names":["BarcodeFormat","BarcodeValueType","Resolution","LensFacing","GoogleBarcodeScannerModuleInstallState","AddressType","EmailFormatType","PhoneFormatType","WifiEncryptionType","registerPlugin","this","CapacitorException","ExceptionCode","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO;IACpC;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS;IACxC;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,SAAS;IACvC;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC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YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,iBAAiB;IACjB,gBAAgB,YAAY,EAAE,OAAO,CAAC,QAAQ;IAC9C,gBAAgB,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1C,gBAAgB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;IACpD,gBAAgB,SAAS,EAAEX,wBAAgB,CAAC,OAAO;IACnD,aAAa,EAAE,CAAC,CAAC,CAAC;IAClB,SAAS;IACT,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC/D,IAAI,CAAC;IACL,IAAI,OAAO,iBAAiB;IAC5B,CAAC,CAACY,cAAS,CAAC,CAAC;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/barcode-scanning/ios/Plugin/BarcodeScanner.swift b/packages/barcode-scanning/ios/Plugin/BarcodeScanner.swift index 50a7716c..78120bd9 100644 --- a/packages/barcode-scanning/ios/Plugin/BarcodeScanner.swift +++ b/packages/barcode-scanning/ios/Plugin/BarcodeScanner.swift @@ -54,6 +54,26 @@ typealias MLKitBarcodeScanner = MLKitBarcodeScanning.BarcodeScanner self.barcodeRawValueVotes.removeAll() } + @objc public func pauseScan() { + DispatchQueue.main.async { + if let session = self.cameraView?.getCaptureSession() { + if session.isRunning { + session.stopRunning() + } + } + } + } + + @objc public func resumeScan() { + DispatchQueue.main.async { + if let session = self.cameraView?.getCaptureSession() { + if !session.isRunning { + session.startRunning() + } + } + } + } + @objc public func readBarcodesFromImage(imageUrl: URL, settings: ScanSettings, completion: @escaping ([Barcode]?, String?) -> Void) { let image = UIImage.init(contentsOfFile: imageUrl.path) guard let image = image else { diff --git a/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.m b/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.m index 5c5a1e13..e4b8fd37 100644 --- a/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.m +++ b/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.m @@ -6,6 +6,8 @@ CAP_PLUGIN(BarcodeScannerPlugin, "BarcodeScanner", CAP_PLUGIN_METHOD(startScan, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(stopScan, CAPPluginReturnPromise); + CAP_PLUGIN_METHOD(pauseScan, CAPPluginReturnPromise); + CAP_PLUGIN_METHOD(resumeScan, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(readBarcodesFromImage, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(scan, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(isSupported, CAPPluginReturnPromise); diff --git a/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.swift b/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.swift index 4a4e7fdb..4caa5a84 100644 --- a/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.swift +++ b/packages/barcode-scanning/ios/Plugin/BarcodeScannerPlugin.swift @@ -68,6 +68,16 @@ public class BarcodeScannerPlugin: CAPPlugin { call.resolve() } + @objc func pauseScan(_ call: CAPPluginCall) { + self.implementation?.pauseScan() + call.resolve() + } + + @objc func resumeScan(_ call: CAPPluginCall) { + self.implementation?.resumeScan() + call.resolve() + } + @objc func readBarcodesFromImage(_ call: CAPPluginCall) { let formatsOption = call.getArray("formats") as? [String] let formats = BarcodeScannerHelper.convertStringsToBarcodeScannerFormats(formatsOption ?? []) diff --git a/packages/barcode-scanning/ios/Plugin/BarcodeScannerView.swift b/packages/barcode-scanning/ios/Plugin/BarcodeScannerView.swift index e33df52b..be28d9db 100644 --- a/packages/barcode-scanning/ios/Plugin/BarcodeScannerView.swift +++ b/packages/barcode-scanning/ios/Plugin/BarcodeScannerView.swift @@ -215,6 +215,10 @@ public protocol BarcodeScannerViewDelegate { return self.captureDevice } + public func getCaptureSession() -> AVCaptureSession? { + return self.captureSession + } + private func configureCaptureDevice(_ device: AVCaptureDevice) { do { try device.lockForConfiguration() diff --git a/packages/barcode-scanning/package.json b/packages/barcode-scanning/package.json index 9ffbfe35..1723cd45 100644 --- a/packages/barcode-scanning/package.json +++ b/packages/barcode-scanning/package.json @@ -53,7 +53,8 @@ "clean": "rimraf ./dist", "watch": "tsc --watch", "ios:pod:install": "cd ios && pod install --repo-update && cd ..", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "postinstall": "npx patch-package" }, "devDependencies": { "@capacitor/android": "8.0.0", diff --git a/packages/barcode-scanning/src/definitions.ts b/packages/barcode-scanning/src/definitions.ts index 3ebe7e89..a0568b39 100644 --- a/packages/barcode-scanning/src/definitions.ts +++ b/packages/barcode-scanning/src/definitions.ts @@ -13,6 +13,18 @@ export interface BarcodeScannerPlugin { * @since 0.0.1 */ stopScan(): Promise; + /** + * Pause scanning for barcodes. + * + * @since 8.1.0 + */ + pauseScan(): Promise; + /** + * Resume scanning for barcodes. + * + * @since 8.1.0 + */ + resumeScan(): Promise; /** * Read barcodes from an image. * diff --git a/packages/barcode-scanning/src/web.ts b/packages/barcode-scanning/src/web.ts index ad6617b9..73105c56 100644 --- a/packages/barcode-scanning/src/web.ts +++ b/packages/barcode-scanning/src/web.ts @@ -89,6 +89,48 @@ export class BarcodeScannerWeb } } + async pauseScan(): Promise { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = undefined; + } + } + + async resumeScan(): Promise { + if (!this.videoElement) { + throw new Error(this.errorVideoElementMissing); + } + if (!this.stream) { + throw new Error('Scan was not started. Call startScan() first.'); + } + if (this.intervalId) { + return; + } + + if (!('BarcodeDetector' in window)) { + throw new CapacitorException( + 'BarcodeDetector Web API is not available in this browser.', + ExceptionCode.Unavailable, + ); + } + + const barcodeDetector = new BarcodeDetector(); + + this.intervalId = window.setInterval(async () => { + if (!this.videoElement) return; + + try { + const barcodes = await barcodeDetector.detect(this.videoElement); + + if (barcodes.length > 0) { + this.handleScannedBarcodes(barcodes); + } + } catch (err) { + console.error('Barcode detection failed', err); + } + }, 300); + } + async readBarcodesFromImage( _options: ReadBarcodesFromImageOptions, ): Promise { diff --git a/packages/barcode-scanning/tsconfig.json b/packages/barcode-scanning/tsconfig.json index f2e88e6a..a465a052 100644 --- a/packages/barcode-scanning/tsconfig.json +++ b/packages/barcode-scanning/tsconfig.json @@ -14,7 +14,6 @@ "pretty": true, "sourceMap": true, "strict": true, - "target": "es2017" }, "files": ["src/index.ts"] }