@thegrizzlylabs/react-native-genius-scan 5.17.0 → 6.0.0-beta01

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +4 -4
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/geniusscansdk/reactnative/RNGeniusScanModule.java +12 -10
  4. package/index.d.ts +7 -7
  5. package/index.js +1 -1
  6. package/ios/GSSDK/GSSDK.xcframework/Info.plist +5 -5
  7. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Assets.car +0 -0
  8. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/DeviceList.plist +0 -0
  9. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/Info.plist +0 -0
  10. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/PrivacyInfo.xcprivacy +34 -0
  11. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK +0 -0
  12. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKDefaultLogLevel.h +1 -1
  13. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditableFrame.h +0 -1
  14. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEnhancementConfiguration.h +0 -8
  15. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKError.h +7 -3
  16. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLog.h +1 -1
  17. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLogger.h +1 -1
  18. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKProcessingResult.h +0 -4
  19. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKReadabilityResult.h +1 -1
  20. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKRotation.h +5 -1
  21. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKScanFlowStructuredData.h +2 -2
  22. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKScanProcessor.h +0 -1
  23. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK-Swift.h +394 -310
  24. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK.h +0 -3
  25. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/UIImage+GSKUtils.h +8 -3
  26. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Info.plist +0 -0
  27. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.abi.json +19744 -17787
  28. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +302 -249
  29. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  30. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftinterface +302 -249
  31. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ar.lproj/GSSDK.stringsdict +0 -0
  32. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/da.lproj/GSSDK.stringsdict +0 -0
  33. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/de.lproj/GSSDK.stringsdict +0 -0
  34. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/es.lproj/GSSDK.stringsdict +0 -0
  35. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/fr.lproj/GSSDK.stringsdict +0 -0
  36. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/he.lproj/GSSDK.stringsdict +0 -0
  37. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/hu.lproj/GSSDK.stringsdict +0 -0
  38. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/it.lproj/GSSDK.stringsdict +0 -0
  39. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ja.lproj/GSSDK.stringsdict +0 -0
  40. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ko.lproj/GSSDK.stringsdict +0 -0
  41. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/nl.lproj/GSSDK.stringsdict +0 -0
  42. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/pl.lproj/GSSDK.stringsdict +0 -0
  43. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/pt-BR.lproj/GSSDK.stringsdict +0 -0
  44. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ru.lproj/GSSDK.stringsdict +0 -0
  45. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/sv.lproj/GSSDK.stringsdict +0 -0
  46. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/tr.lproj/GSSDK.stringsdict +0 -0
  47. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/vi.lproj/GSSDK.stringsdict +0 -0
  48. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/zh-Hans.lproj/GSSDK.stringsdict +0 -0
  49. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Assets.car +0 -0
  50. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/DeviceList.plist +0 -0
  51. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/Info.plist +0 -0
  52. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/PrivacyInfo.xcprivacy +34 -0
  53. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK +0 -0
  54. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKDefaultLogLevel.h +1 -1
  55. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditableFrame.h +0 -1
  56. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEnhancementConfiguration.h +0 -8
  57. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKError.h +7 -3
  58. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLog.h +1 -1
  59. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLogger.h +1 -1
  60. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKProcessingResult.h +0 -4
  61. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKReadabilityResult.h +1 -1
  62. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKRotation.h +5 -1
  63. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKScanFlowStructuredData.h +2 -2
  64. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKScanProcessor.h +0 -1
  65. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h +801 -633
  66. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK.h +0 -3
  67. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/UIImage+GSKUtils.h +8 -3
  68. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Info.plist +0 -0
  69. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +19744 -17787
  70. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +302 -249
  71. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  72. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +302 -249
  73. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +19744 -17787
  74. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +302 -249
  75. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  76. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +302 -249
  77. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ar.lproj/GSSDK.stringsdict +0 -0
  78. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/da.lproj/GSSDK.stringsdict +0 -0
  79. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/de.lproj/GSSDK.stringsdict +0 -0
  80. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/es.lproj/GSSDK.stringsdict +0 -0
  81. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/fr.lproj/GSSDK.stringsdict +0 -0
  82. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/he.lproj/GSSDK.stringsdict +0 -0
  83. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/hu.lproj/GSSDK.stringsdict +0 -0
  84. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/it.lproj/GSSDK.stringsdict +0 -0
  85. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ja.lproj/GSSDK.stringsdict +0 -0
  86. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ko.lproj/GSSDK.stringsdict +0 -0
  87. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/nl.lproj/GSSDK.stringsdict +0 -0
  88. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/pl.lproj/GSSDK.stringsdict +0 -0
  89. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/pt-BR.lproj/GSSDK.stringsdict +0 -0
  90. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ru.lproj/GSSDK.stringsdict +0 -0
  91. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/sv.lproj/GSSDK.stringsdict +0 -0
  92. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/tr.lproj/GSSDK.stringsdict +0 -0
  93. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/vi.lproj/GSSDK.stringsdict +0 -0
  94. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/zh-Hans.lproj/GSSDK.stringsdict +0 -0
  95. package/ios/RNGeniusScan.m +8 -8
  96. package/package.json +1 -1
  97. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditFrameView.h +0 -71
  98. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditFrameViewController.h +0 -62
  99. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKFilterType.h +0 -43
  100. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKView.h +0 -70
  101. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/png.h +0 -3358
  102. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/pngconf.h +0 -615
  103. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/pnglibconf.h +0 -233
  104. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditFrameView.h +0 -71
  105. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditFrameViewController.h +0 -62
  106. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKFilterType.h +0 -43
  107. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKView.h +0 -70
  108. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/png.h +0 -3358
  109. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/pngconf.h +0 -615
  110. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/pnglibconf.h +0 -233
@@ -281,9 +281,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
281
281
  #if __has_warning("-Watimport-in-framework-header")
282
282
  #pragma clang diagnostic ignored "-Watimport-in-framework-header"
283
283
  #endif
284
- @import AVFoundation;
285
284
  @import CoreFoundation;
286
- @import CoreGraphics;
287
285
  @import Dispatch;
288
286
  @import Foundation;
289
287
  @import ObjectiveC;
@@ -312,14 +310,6 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
312
310
 
313
311
  #if defined(__OBJC__)
314
312
 
315
- SWIFT_PROTOCOL("_TtP5GSSDK20CGImageRepresentable_")
316
- @protocol CGImageRepresentable
317
- - (CGImageRef _Nullable)CGImageRepresentation SWIFT_WARN_UNUSED_RESULT;
318
- @end
319
-
320
- @interface AVCapturePhoto (SWIFT_EXTENSION(GSSDK)) <CGImageRepresentable>
321
- @end
322
-
323
313
  @class NSString;
324
314
  /// Entry point of the SDK. Use this to initialize the SDK with your license key.
325
315
  SWIFT_CLASS("_TtC5GSSDK3GSK")
@@ -351,96 +341,218 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _No
351
341
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
352
342
  @end
353
343
 
354
- @class AVCaptureDevice;
355
- @class AVCaptureSession;
356
- enum GSKCameraSessionFlashStatus : NSInteger;
357
- enum GSKCameraSessionDocumentDetection : NSInteger;
358
- @class GSKCameraSessionConfiguration;
359
- SWIFT_CLASS("_TtC5GSSDK16GSKCameraSession")
360
- @interface GSKCameraSession : NSObject
361
- /// Minimum duration in <code>.aboutToTrigger</code> state before triggering the photo.
362
- /// This can be used to coordinate animations.
363
- SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) NSTimeInterval minDurationInAboutToTriggerForTrigger;)
364
- + (NSTimeInterval)minDurationInAboutToTriggerForTrigger SWIFT_WARN_UNUSED_RESULT;
365
- /// Public for legacy reasons, not to be used directly.
366
- @property (nonatomic, strong) AVCaptureDevice * _Nullable captureDevice;
367
- /// Public for legacy reasons, not to be used directly.
368
- @property (nonatomic, strong) AVCaptureSession * _Nullable captureSession;
369
- /// The flash mode. Default is .auto.
370
- @property (nonatomic) enum GSKCameraSessionFlashStatus flashStatus;
371
- /// Returns the current status of the document detection.
372
- /// This is a computed property that maps to the new activeDetectionMode property for backward compatibility.
373
- /// Observable.
374
- /// important:
375
- /// This property is deprecated. Use <code>activeDetectionMode</code> instead, which supports both document and readable
376
- /// code detection modes.
377
- @property (nonatomic) enum GSKCameraSessionDocumentDetection activeDocumentDetection SWIFT_DEPRECATED_MSG("Use activeDetectionMode instead");
378
- /// True for the duration of taking the photo and processing it. Observable.
379
- @property (nonatomic, readonly) BOOL isTakingPhoto;
380
- /// Returns false if flash isn’t supported on this device configuration.
381
- @property (nonatomic, readonly) BOOL supportsFlash;
382
- /// Public to be accessible from Objective-C, but should be private otherwise.
383
- @property (nonatomic, readonly, strong) dispatch_queue_t _Nullable captureSessionQueue;
384
- @property (nonatomic, readonly, strong) dispatch_queue_t _Nonnull takePhotoQueue;
385
- - (nonnull instancetype)initWithConfiguration:(GSKCameraSessionConfiguration * _Nonnull)configuration;
386
- - (void)pauseSession;
387
- - (void)resumeSession;
344
+ /// A barcode such as 1D barcodes or QR codes.
345
+ SWIFT_CLASS("_TtC5GSSDK10GSKBarcode")
346
+ @interface GSKBarcode : NSObject
388
347
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
389
348
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
390
349
  @end
391
350
 
392
- @class AVCaptureMetadataOutput;
393
- @class AVMetadataObject;
394
- @class AVCaptureConnection;
395
- @interface GSKCameraSession (SWIFT_EXTENSION(GSSDK)) <AVCaptureMetadataOutputObjectsDelegate>
396
- - (void)captureOutput:(AVCaptureMetadataOutput * _Nonnull)output didOutputMetadataObjects:(NSArray<AVMetadataObject *> * _Nonnull)metadataObjects fromConnection:(AVCaptureConnection * _Nonnull)connection;
351
+ @interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
352
+ - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
397
353
  @end
398
354
 
399
- @interface GSKCameraSession (SWIFT_EXTENSION(GSSDK))
400
- /// Manually take a photo
401
- /// If autoTriggerEnabled is true, the photo is taken automatically when the frame is detected.
402
- /// Otherwise, if you want to let the user manually trigger the photo, you can use this method.
403
- /// This method can be called even when activeDetectionMode is higlightAndTrigger and will force taking the
404
- /// photo.
405
- /// This method is thread-safe.
406
- /// IMPORTANT: Taking the photo will pause the session. You have to resume the session will <code>resumeSession</code> once
407
- /// you are done processing the result.
408
- - (void)takePhoto;
355
+ @interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
356
+ @property (nonatomic, readonly) NSUInteger hash;
357
+ @end
358
+
359
+ @class GSKBarcodeScanFlowConfiguration;
360
+ @class UIViewController;
361
+ @class GSKBarcodeScanFlowResult;
362
+ /// A flow for scanning barcodes and QR codes.
363
+ SWIFT_CLASS("_TtC5GSSDK18GSKBarcodeScanFlow")
364
+ @interface GSKBarcodeScanFlow : NSObject
365
+ /// Initializes a new barcode scan flow
366
+ /// \param configuration Configuration for the barcode scanning
367
+ ///
368
+ - (nonnull instancetype)initWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
369
+ /// Starts the barcode scanning flow by presenting a full-screen camera interface.
370
+ /// This method presents a camera view controller that continuously scans for barcodes and QR codes.
371
+ /// The scanning process respects the code types specified in the flow’s configuration.
372
+ /// The method uses Swift’s async/await pattern, suspending until either:
373
+ /// <ul>
374
+ /// <li>
375
+ /// A barcode is successfully detected (except in batch mode)
376
+ /// </li>
377
+ /// <li>
378
+ /// The user taps the done button (batch mode)
379
+ /// </li>
380
+ /// <li>
381
+ /// The user cancels the operation
382
+ /// </li>
383
+ /// <li>
384
+ /// An error occurs during setup or scanning
385
+ /// </li>
386
+ /// </ul>
387
+ /// The behavior varies based on the configuration’s isBatchModeEnabled:
388
+ /// <ul>
389
+ /// <li>
390
+ /// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
391
+ /// </li>
392
+ /// <li>
393
+ /// <code>true</code>: Collects unique codes over time until the user taps the done button
394
+ /// </li>
395
+ /// </ul>
396
+ /// Example usage:
397
+ /// \code
398
+ /// let flow = GSKBarcodeScanFlow()
399
+ /// do {
400
+ /// let result = try await flow.resultByStarting(fromViewController: self)
401
+ /// print("Scanned codes: \(result.barcodes.map { $0.value })")
402
+ /// } catch GSKBarcodeScanFlowError.userCancellation {
403
+ /// print("User canceled scanning")
404
+ /// } catch {
405
+ /// print("Scanning failed: \(error)")
406
+ /// }
407
+ ///
408
+ /// \endcodeimportant:
409
+ /// This method requires camera permissions. Ensure your app’s Info.plist includes
410
+ /// the <code>NSCameraUsageDescription</code> key with an appropriate description.
411
+ /// note:
412
+ /// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
413
+ /// for an immersive scanning experience.
414
+ /// \param viewController The view controller from which to present the camera interface.
415
+ /// This should typically be the currently visible view controller.
416
+ ///
417
+ ///
418
+ /// throws:
419
+ ///
420
+ /// <ul>
421
+ /// <li>
422
+ /// Typically throws a <code>GSKBarcodeScanFlowError</code>
423
+ /// </li>
424
+ /// </ul>
425
+ ///
426
+ /// returns:
427
+ /// A <code>GSKBarcodeScanFlowResult</code> containing the detected barcodes with their
428
+ /// decoded values and format types.
429
+ - (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nullable, NSError * _Nullable))completionHandler;
430
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
431
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
409
432
  @end
410
433
 
411
- @class AVCapturePhotoOutput;
412
- @class AVCaptureResolvedPhotoSettings;
413
- @interface GSKCameraSession (SWIFT_EXTENSION(GSSDK)) <AVCapturePhotoCaptureDelegate>
414
- - (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output willBeginCaptureForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
415
- - (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output willCapturePhotoForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
416
- - (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didCapturePhotoForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
417
- - (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didFinishProcessingPhoto:(AVCapturePhoto * _Nonnull)photo error:(NSError * _Nullable)error;
418
- - (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didFinishCaptureForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings error:(NSError * _Nullable)error;
434
+ @class NSError;
435
+ @interface GSKBarcodeScanFlow (SWIFT_EXTENSION(GSSDK))
436
+ /// Instantiates a <code>GSKBarcodeScanFlow</code> instance with the provided configuration.
437
+ /// This initializer is only available from Objective-C.
438
+ + (nonnull instancetype)barcodeScanFlowWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
439
+ /// Starts the barcode scanning flow.
440
+ /// @param viewController The view controller to present the barcode scanning interface from.
441
+ /// @param successBlock A completion block/closure that will be called on the main
442
+ /// thread upon successful completion of the scan flow. It receives a <code>GSKBarcodeScanFlowResult</code> object as
443
+ /// a parameter. This object gives you access to the scanned codes.
444
+ /// @param failureBlock A block/closure called if an error was encountered.
445
+ /// This method is only available from Objective-C.
446
+ - (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
419
447
  @end
420
448
 
421
- /// The configuration for a camera session.
422
- SWIFT_CLASS("_TtC5GSSDK29GSKCameraSessionConfiguration")
423
- @interface GSKCameraSessionConfiguration : NSObject
424
- /// note:
425
- /// Deprecated in favor of <code>init(detectionMode:)</code> which allows for more flexible detection modes.
426
- /// \param documentDetection The type of real-time document detection to apply.
449
+ @class UIColor;
450
+ /// Configuration for the UI barcode scanning flow
451
+ /// This class allows customization of which barcode and QR code formats should be detected
452
+ /// during the scanning process. By default, all supported formats are enabled.
453
+ SWIFT_CLASS("_TtC5GSSDK31GSKBarcodeScanFlowConfiguration")
454
+ @interface GSKBarcodeScanFlowConfiguration : NSObject
455
+ /// Whether batch mode is enabled for code detection.
456
+ /// This setting controls how codes are detected and when they are returned:
457
+ /// <ul>
458
+ /// <li>
459
+ /// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
460
+ /// </li>
461
+ /// <li>
462
+ /// <code>true</code>: Collect multiple codes over time before returning when user taps Done
463
+ /// </li>
464
+ /// </ul>
465
+ /// Example:
466
+ /// \code
467
+ /// // Standard mode - return codes immediately (default)
468
+ /// let standardConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: false)
427
469
  ///
428
- - (nonnull instancetype)initWithDocumentDetection:(enum GSKCameraSessionDocumentDetection)documentDetection OBJC_DESIGNATED_INITIALIZER SWIFT_DEPRECATED_MSG("Use init(detectionMode:) instead");
429
- /// A session configuration where the document detection is <code>.highlightAndAutoCapture</code>
430
- - (nonnull instancetype)init;
470
+ /// // Batch mode - collect codes over time
471
+ /// let batchConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: true)
472
+ ///
473
+ /// \endcode
474
+ @property (nonatomic) BOOL isBatchModeEnabled;
475
+ /// The highlight color used for the UI (overlay). Defaults
476
+ /// to <code>.green</code>. For good constrast, we recommend using a bright color.
477
+ @property (nonatomic, strong) UIColor * _Nonnull highlightColor;
478
+ /// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
479
+ /// default color will be used (blue on iOS, for example).
480
+ @property (nonatomic, strong) UIColor * _Nullable menuColor;
481
+ /// Creates a new barcode scan flow configuration with default values
482
+ - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
483
+ @end
484
+
485
+ @class NSDictionary;
486
+ @interface GSKBarcodeScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
487
+ /// Create a configuration from a dictionary.
488
+ /// This is used for interfacing with cross-platform plugins but shouldn’t
489
+ /// be used in native projects.
490
+ + (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
491
+ /// Create a configuration from JSON data.
492
+ /// This is used for interfacing with cross-platform plugins but shouldn’t
493
+ /// be used in native projects.
494
+ + (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
431
495
  @end
432
496
 
433
- /// The style of document detection to be used during a camera session.
434
- typedef SWIFT_ENUM(NSInteger, GSKCameraSessionDocumentDetection, open) {
435
- /// The session doesn’t attempt to detect documents.
436
- GSKCameraSessionDocumentDetectionNone = 0,
437
- /// The session detects documents and produces quadrangles
438
- /// to be used for highlighting the document in the video frames.
439
- GSKCameraSessionDocumentDetectionHighlight = 1,
440
- /// The session detects documents and snaps the photo when
441
- /// the detection is stable.
442
- GSKCameraSessionDocumentDetectionHighlightAndTrigger = 2,
497
+ /// Enum that defines various errors that can occur during a barcode scan flow.
498
+ typedef SWIFT_ENUM(NSInteger, GSKBarcodeScanFlowError, open) {
499
+ /// User has canceled the barcode scan flow
500
+ GSKBarcodeScanFlowUserCancelationError SWIFT_COMPILE_NAME("userCancellation") = 0,
501
+ /// A general error due to a bad configuration parameter
502
+ GSKBarcodeScanFlowConfigurationError SWIFT_COMPILE_NAME("configuration") = 1,
503
+ /// Camera permission was denied
504
+ GSKBarcodeScanFlowPermissionDeniedError SWIFT_COMPILE_NAME("permissionDenied") = 2,
505
+ /// Failed to initialize the barcode detector
506
+ GSKBarcodeScanFlowDetectorError SWIFT_COMPILE_NAME("detectorError") = 3,
443
507
  };
508
+ static NSString * _Nonnull const GSKBarcodeScanFlowErrorDomain = @"GSSDK.GSKBarcodeScanFlowError";
509
+
510
+ /// The result of a barcode scanning flow.
511
+ /// This class encapsulates the successful outcome of a barcode or QR code scanning session,
512
+ /// containing the detected barcode or QR code data.
513
+ SWIFT_CLASS("_TtC5GSSDK24GSKBarcodeScanFlowResult")
514
+ @interface GSKBarcodeScanFlowResult : NSObject
515
+ /// The detected barcodes containing their decoded values and types.
516
+ /// This property provides access to an array of detected codes, each containing
517
+ /// both the string content and format type (e.g., QR code, Code 128, EAN-13, etc.).
518
+ /// <ul>
519
+ /// <li>
520
+ /// For standard mode: Contains all codes detected in a single frame
521
+ /// </li>
522
+ /// <li>
523
+ /// For batch mode: Contains all codes collected over the scanning session
524
+ /// </li>
525
+ /// </ul>
526
+ @property (nonatomic, readonly, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
527
+ /// Creates a new barcode scan flow result.
528
+ /// \param barcodes The detected barcodes.
529
+ ///
530
+ - (nonnull instancetype)initWithBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes OBJC_DESIGNATED_INITIALIZER;
531
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
532
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
533
+ @end
534
+
535
+ @interface GSKBarcodeScanFlowResult (SWIFT_EXTENSION(GSSDK))
536
+ /// Returns a dictionary representation of the result
537
+ /// The dictionary contains:
538
+ /// <ul>
539
+ /// <li>
540
+ /// barcodes: An array of code dictionaries, each containing:
541
+ /// <ul>
542
+ /// <li>
543
+ /// value: The decoded string value
544
+ /// </li>
545
+ /// <li>
546
+ /// type: The code type as a string (e.g., “qr”, “code128”)
547
+ /// </li>
548
+ /// </ul>
549
+ /// </li>
550
+ /// </ul>
551
+ @property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
552
+ /// Returns a JSON representation of the result.
553
+ /// See <code>dictionary</code> for an explanation of the JSON data’s structure.
554
+ - (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
555
+ @end
444
556
 
445
557
  /// Represents an error raised by the camera session
446
558
  typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
@@ -455,59 +567,179 @@ typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
455
567
  GSKCameraSessionErrorWarnLockDevice = -1003,
456
568
  };
457
569
 
458
- typedef SWIFT_ENUM(NSInteger, GSKCameraSessionFlashStatus, open) {
459
- GSKCameraSessionFlashStatusAuto = 0,
460
- GSKCameraSessionFlashStatusOn = 1,
461
- GSKCameraSessionFlashStatusOff = 2,
462
- };
463
-
464
570
  @class NSCoder;
465
- @protocol UIViewControllerTransitionCoordinator;
466
571
  @class NSBundle;
467
- /// A ready-to-use camera interface for scanning documents.
572
+ /// A camera view controller to scan documents or barcodes.
573
+ /// Inherit from this view controller to create a custom scanning experience. Lay out the <code>cameraView</code> as desired:
574
+ /// By default, <code>cameraView</code> fills the entire screen. You can disable its resizing mask
575
+ /// (<code>cameraView.translateAutoresizingMaskIntoConstraints</code>) and use Auto Layout constraints.
576
+ /// note:
577
+ ///
578
+ /// When a photo of a document is taken, whether manually or automatically, the capture session is paused
579
+ /// and a delegate callback (<code>cameraViewController(_:didGenerateScan:)</code>) is called when the photo is ready.
580
+ /// In this callback, you can decide whether to exit the camera view controller (if you just need to scan a
581
+ /// single page), or keep scanning more images (to support a “batch scanning” flow). For the latter scenario,
582
+ /// you will need to resume the camera session (see <code>resume()</code>). You also need to “reveal” the shutter screen
583
+ /// (see <code>hideShutterView(animated:)</code>.
468
584
  SWIFT_CLASS("_TtC5GSSDK23GSKCameraViewController")
469
585
  @interface GSKCameraViewController : UIViewController
470
586
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
471
- - (nonnull instancetype)initWithCameraSession:(GSKCameraSession * _Nonnull)cameraSession OBJC_DESIGNATED_INITIALIZER;
472
- @property (nonatomic, readonly) BOOL prefersStatusBarHidden;
473
- - (void)loadView;
474
587
  - (void)viewDidLoad;
475
588
  - (void)viewWillAppear:(BOOL)animated;
476
589
  - (void)viewWillDisappear:(BOOL)animated;
477
- - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator> _Nonnull)coordinator;
590
+ /// Manually trigger a photo.
591
+ /// Use this to handle the user tapping on a “take photo” button, or your own
592
+ /// custom logic to take a photo.
593
+ - (void)takePhoto;
478
594
  - (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
479
595
  @end
480
596
 
481
- @class GSKView;
482
- @interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK)) <GSKViewDelegate>
483
- - (void)cameraView:(GSKView * _Nonnull)cameraView requestedFocusAtPoint:(CGPoint)focusPoint;
597
+ @interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
484
598
  @end
485
599
 
600
+ /// A document detection mode
601
+ /// When detecting a document, the camera controller can just highlight the document, or also
602
+ /// highlight and trigger the photo when the detection is stable enough.
603
+ typedef SWIFT_ENUM(NSInteger, DocumentDetectionMode, open) {
604
+ /// Visual highlighting only.
605
+ /// The camera will detect document edges and provide visual feedback by drawing
606
+ /// a document overlay, but will not automatically capture photos. Users must
607
+ /// manually trigger photo capture.
608
+ DocumentDetectionModeHighlightOnly = 0,
609
+ /// Highlighting with automatic capture.
610
+ /// Similar to <code>highlightOnly</code>, but the camera will automatically take a photo
611
+ /// when a stable document is detected for a sufficient duration. This provides
612
+ /// a hands-free scanning experience.
613
+ DocumentDetectionModeHighlightAndAutoCapture = 1,
614
+ };
615
+
486
616
  @interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
487
- /// Snap the photo
488
- - (void)takePhoto;
489
617
  @end
490
618
 
491
- @class GSKScan;
492
- @class GSKQuadrangle;
619
+ /// Constants indicating an interruption reason for the camera session.
620
+ typedef SWIFT_ENUM(NSInteger, InterruptionReason, open) {
621
+ /// An interruption caused by the app being sent to the background while using a camera.
622
+ InterruptionReasonVideoDeviceNotAvailableInBackground = 0,
623
+ /// An interruption caused by the audio hardware temporarily being made unavailable, for instance,
624
+ /// for a phone call, or alarm.
625
+ InterruptionReasonAudioDeviceInUseByAnotherClient = 1,
626
+ /// An interruption caused by the video device temporarily being made unavailable, for instance,
627
+ /// when stolen away by another app.
628
+ InterruptionReasonVideoDeviceInUseByAnotherClient = 2,
629
+ /// An interruption caused when the app is running in a multi-app layout, causing resource contention
630
+ /// and degraded recording quality of service. Given your present session configuration, the
631
+ /// session may only be run if your app occupies the full screen.
632
+ InterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps = 3,
633
+ /// An interruption caused by the video device temporarily being made unavailable due to system pressure,
634
+ /// such as thermal duress.
635
+ InterruptionReasonVideoDeviceNotAvailableDueToSystemPressure = 4,
636
+ InterruptionReasonUnknown = 5,
637
+ };
638
+
493
639
  @interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
494
- - (void)cameraSessionDidSetup:(GSKCameraSession * _Nonnull)cameraSession;
495
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession setupFailedWithError:(NSError * _Nonnull)error;
496
- - (void)cameraSessionWillSnapPhoto:(GSKCameraSession * _Nonnull)cameraSession;
497
- - (void)cameraSessionDidSnapPhoto:(GSKCameraSession * _Nonnull)cameraSession;
498
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession didFailToSnapPhotoWithError:(NSError * _Nonnull)error;
499
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession didGenerateScan:(GSKScan * _Nonnull)scan;
500
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession didEncounterFailureWithError:(NSError * _Nonnull)error;
501
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession didFailWithError:(NSError * _Nonnull)error;
502
- - (void)cameraSessionIsSearchingQuadrangle:(GSKCameraSession * _Nonnull)cameraSession;
503
- - (void)cameraSessionIsAboutToChooseQuadrangle:(GSKCameraSession * _Nonnull)cameraSession;
504
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession willAutoTriggerWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
505
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession didFindQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
506
- - (void)cameraSessionFailedToFindQuadrangle:(GSKCameraSession * _Nonnull)cameraSession;
507
- - (void)cameraSessionDidStart:(GSKCameraSession * _Nonnull)cameraSession;
508
- - (void)cameraSessionDidStop:(GSKCameraSession * _Nonnull)cameraSession;
509
- - (void)cameraSession:(GSKCameraSession * _Nonnull)cameraSession wasInterruptedWithReason:(enum AVCaptureSessionInterruptionReason)reason;
510
- - (void)cameraSessionInterruptionEnded:(GSKCameraSession * _Nonnull)cameraSession;
640
+ /// Factory method for a camera view controller with document detection.
641
+ /// This is only to be used from Objective-C. From Swift, prefer using <code>init(configuration:)</code> instead.
642
+ /// \param documentDetectionMode The document detection mode.
643
+ ///
644
+ /// \param documentOverlayColor The color of the document overlay.
645
+ ///
646
+ + (void)makeCameraViewControllerWithDocumentDetectionMode:(enum DocumentDetectionMode)documentDetectionMode documentOverlayColor:(UIColor * _Nonnull)documentOverlayColor completionHandler:(void (^ _Nonnull)(GSKCameraViewController * _Nullable, NSError * _Nullable))completionHandler;
647
+ @end
648
+
649
+ @class GSKQuadrangle;
650
+ @class GSKScan;
651
+ SWIFT_PROTOCOL("_TtP5GSSDK31GSKCameraViewControllerDelegate_")
652
+ @protocol GSKCameraViewControllerDelegate
653
+ @optional
654
+ /// The camera view controller failed with an error.
655
+ /// \param cameraViewController The camera view controller
656
+ ///
657
+ /// \param error The encountered error.
658
+ ///
659
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFailWithError:(NSError * _Nonnull)error;
660
+ /// The camera view controller encountered a non-fatal error.
661
+ /// \param cameraViewController The camera view controller
662
+ ///
663
+ /// \param error The encountered error.
664
+ ///
665
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didEncounterNonCriticalError:(NSError * _Nonnull)error;
666
+ /// The camera view controller started running
667
+ /// \param cameraViewController The camera view controller
668
+ ///
669
+ - (void)cameraViewControllerDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
670
+ /// The camera view controller stopped running
671
+ /// \param cameraViewController The camera view controller
672
+ ///
673
+ - (void)cameraViewControllerDidStop:(GSKCameraViewController * _Nonnull)cameraViewController;
674
+ /// The camera view controller was interrupted.
675
+ /// This can happen in various cases, including when the user goes to Split View mode on iPad.
676
+ /// \param cameraViewController The camera view controller
677
+ ///
678
+ /// \param reason The reason why the camera view controller was interrupted.
679
+ ///
680
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController wasInterruptedWithReason:(enum InterruptionReason)reason;
681
+ /// The camera view controller resumes after interruption
682
+ /// \param cameraViewController The camera view controller
683
+ ///
684
+ - (void)cameraViewControllerInterruptionDidEnd:(GSKCameraViewController * _Nonnull)cameraViewController;
685
+ /// The camera view controller is still looking for a quadrangle.
686
+ /// This is a general notification about the status of the search: we may or may not have identified
687
+ /// its edges. If you want to act on identified edges, listen to the <code>cameraViewController:didFindDocumentWithQuadrangle:</code>
688
+ /// delegate method.
689
+ /// <ul>
690
+ /// <li>
691
+ /// Parameters:
692
+ /// </li>
693
+ /// <li>
694
+ /// cameraViewController: The camera view controller
695
+ /// </li>
696
+ /// </ul>
697
+ - (void)cameraViewControllerIsSearchingForDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
698
+ /// The camera view controller identified a document in the last frame of the photo stream
699
+ /// \param cameraViewController The camera view controller
700
+ ///
701
+ /// \param quadrangle The quadrangle of the document that has been found.
702
+ ///
703
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindDocumentWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
704
+ /// The camera view controller couldn’t identify a document in the last frame of the photo stream.
705
+ /// This doesn’t mean that the camera view controller has stopped searching for documents or failed.
706
+ /// It just means no document has been identified. In this case, you want to clear any overlay.
707
+ /// \param cameraViewController The camera view controller
708
+ ///
709
+ - (void)cameraViewControllerFailedToFindDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
710
+ /// The camera view controller real-time document detection will soon take the photo of a quadrangle, but if the document
711
+ /// detection is not stable enough, the process can still be
712
+ /// cancelled.
713
+ /// It’s a good time to tell the user to remain stable.
714
+ /// Only called when the document detection is set to .highlightAndAutoCapture.
715
+ /// \param cameraViewController The camera view controller
716
+ ///
717
+ - (void)cameraViewControllerPhotoStabilizationDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
718
+ /// The camera view controller is going to automatically take a photo because the detection was stable enough.
719
+ /// The photo taking is underway and cannot be interrupted at this stage.
720
+ /// \param cameraViewController The camera view controller
721
+ ///
722
+ /// \param quadrangle The quadrangle of the document that will be photographed.
723
+ ///
724
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController willSnapPhotoWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
725
+ /// The camera view controller just took a photo, but it hasn’t been post-processed it yet
726
+ /// \param cameraViewController The camera view controller
727
+ ///
728
+ - (void)cameraViewControllerDidSnapPhoto:(GSKCameraViewController * _Nonnull)cameraViewController;
729
+ /// The camera view controller has finished processing the photo we just took.
730
+ /// \param cameraViewController The camera view controller
731
+ ///
732
+ /// \param scan The scan object that has been generated. The image contained in the scan object is the full,
733
+ /// unprocessed image in which the document was detected. Use <code>GSKScanProcessor</code> to process and
734
+ /// warp and enhance the scanned document.
735
+ ///
736
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didGenerateScan:(GSKScan * _Nonnull)scan;
737
+ /// Camera view controller has detected barcodes.
738
+ /// \param cameraViewController The camera view controller
739
+ ///
740
+ /// \param barcodes The detected barcodes
741
+ ///
742
+ - (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes;
511
743
  @end
512
744
 
513
745
  /// The type of document detected by the document finder.
@@ -629,6 +861,36 @@ SWIFT_PROTOCOL("_TtP5GSSDK25GSKDocumentImageProcessor_")
629
861
  - (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
630
862
  @end
631
863
 
864
+ @class UIImage;
865
+ @class UIView;
866
+ SWIFT_CLASS("_TtC5GSSDK26GSKEditFrameViewController")
867
+ @interface GSKEditFrameViewController : UIViewController
868
+ /// The image on which the quadrangle is overlaid.
869
+ @property (nonatomic, strong) UIImage * _Nonnull image;
870
+ @property (nonatomic, readonly, strong) UIView * _Nonnull frameView;
871
+ /// Used to set the quadrangle to display in the view controller, and to retrieve the new quadrangle edited by the user.
872
+ @property (nonatomic, strong) GSKQuadrangle * _Nonnull quadrangle;
873
+ /// Customize the color of the shade within the quadrangle.
874
+ @property (nonatomic, strong) UIColor * _Nonnull shadeColor SWIFT_DEPRECATED_MSG("Deprecated in favor of frameView.imageSelection.insideShadeColor.");
875
+ /// Customize the color of the shade outside the quadrangle.
876
+ @property (nonatomic, strong) UIColor * _Nonnull outsideShadeColor;
877
+ /// Customize the color of the line used to draw the quadrangle.
878
+ @property (nonatomic, strong) UIColor * _Nonnull lineColor;
879
+ /// Customize the width of the corner handles.
880
+ @property (nonatomic) CGFloat handleWidth;
881
+ /// Customize the magnifier center style shown while dragging corners.
882
+ @property (nonatomic) GSKMagnifierViewCenterStyle magnifierViewCenterStyle;
883
+ /// \param image The image on which to draw the quadrangle. This is typically the original photo from the camera.
884
+ ///
885
+ /// \param quadrangle The initial quadrangle to display.
886
+ ///
887
+ - (nonnull instancetype)initWithImage:(UIImage * _Nonnull)image quadrangle:(GSKQuadrangle * _Nonnull)quadrangle OBJC_DESIGNATED_INITIALIZER;
888
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
889
+ - (void)setQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle animated:(BOOL)animated;
890
+ - (void)viewDidLoad;
891
+ - (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
892
+ @end
893
+
632
894
  /// A configuration to specify the background cleaning to apply with GSKScanProcessor.
633
895
  SWIFT_CLASS("_TtC5GSSDK40GSKFilterBackgroundCleaningConfiguration")
634
896
  @interface GSKFilterBackgroundCleaningConfiguration : NSObject
@@ -794,6 +1056,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKFilterLig
794
1056
  - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
795
1057
  @end
796
1058
 
1059
+ typedef SWIFT_ENUM(NSInteger, GSKFlashStatus, open) {
1060
+ GSKFlashStatusAuto = 0,
1061
+ GSKFlashStatusOn = 1,
1062
+ GSKFlashStatusOff = 2,
1063
+ };
1064
+
797
1065
  enum GSKIntegrationFramework : NSInteger;
798
1066
  SWIFT_CLASS_NAMED("GSKIntegrationContext")
799
1067
  @interface GSKIntegrationContext : NSObject
@@ -928,186 +1196,6 @@ SWIFT_CLASS("_TtC5GSSDK10GSKPDFSize")
928
1196
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
929
1197
  @end
930
1198
 
931
- @class GSKReadableCodeFlowConfiguration;
932
- @class GSKReadableCodeFlowResult;
933
- /// A flow for scanning readable codes (barcodes, QR codes, etc.)
934
- SWIFT_CLASS("_TtC5GSSDK19GSKReadableCodeFlow")
935
- @interface GSKReadableCodeFlow : NSObject
936
- /// Initializes a new readable code flow
937
- /// \param configuration Configuration for the readable code scanning
938
- ///
939
- - (nonnull instancetype)initWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
940
- /// Starts the readable code scanning flow by presenting a full-screen camera interface.
941
- /// This method presents a camera view controller that continuously scans for barcodes and QR codes.
942
- /// The scanning process respects the code types specified in the flow’s configuration.
943
- /// The method uses Swift’s async/await pattern, suspending until either:
944
- /// <ul>
945
- /// <li>
946
- /// A readable code is successfully detected (except in batch mode)
947
- /// </li>
948
- /// <li>
949
- /// The user taps the done button (batch mode)
950
- /// </li>
951
- /// <li>
952
- /// The user cancels the operation
953
- /// </li>
954
- /// <li>
955
- /// An error occurs during setup or scanning
956
- /// </li>
957
- /// </ul>
958
- /// The behavior varies based on the configuration’s isBatchModeEnabled:
959
- /// <ul>
960
- /// <li>
961
- /// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
962
- /// </li>
963
- /// <li>
964
- /// <code>true</code>: Collects unique codes over time until the user taps the done button
965
- /// </li>
966
- /// </ul>
967
- /// Example usage:
968
- /// \code
969
- /// let flow = GSKReadableCodeFlow()
970
- /// do {
971
- /// let result = try await flow.resultByStarting(fromViewController: self)
972
- /// print("Scanned codes: \(result.readableCodes.map { $0.value })")
973
- /// } catch GSKReadableCodeFlowError.userCancellation {
974
- /// print("User canceled scanning")
975
- /// } catch {
976
- /// print("Scanning failed: \(error)")
977
- /// }
978
- ///
979
- /// \endcodeimportant:
980
- /// This method requires camera permissions. Ensure your app’s Info.plist includes
981
- /// the <code>NSCameraUsageDescription</code> key with an appropriate description.
982
- /// note:
983
- /// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
984
- /// for an immersive scanning experience.
985
- /// \param viewController The view controller from which to present the camera interface.
986
- /// This should typically be the currently visible view controller.
987
- ///
988
- ///
989
- /// throws:
990
- ///
991
- /// <ul>
992
- /// <li>
993
- /// Typically throws a <code>GSKReadableCodeFlowError</code>
994
- /// </li>
995
- /// </ul>
996
- ///
997
- /// returns:
998
- /// A <code>GSKReadableCodeFlowResult</code> containing the detected readable codes with their
999
- /// decoded values and format types.
1000
- - (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nullable, NSError * _Nullable))completionHandler;
1001
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1002
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1003
- @end
1004
-
1005
- @class NSError;
1006
- @interface GSKReadableCodeFlow (SWIFT_EXTENSION(GSSDK))
1007
- /// Instantiates a <code>GSKReadableCodeFlow</code> instance with the provided configuration.
1008
- /// This initializer is only available from Objective-C.
1009
- + (nonnull instancetype)readableCodeFlowWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
1010
- /// Starts the readable code scanning flow.
1011
- /// @param viewController The view controller to present the readable code scanning interface from.
1012
- /// @param successBlock A completion block/closure that will be called on the main
1013
- /// thread upon successful completion of the scan flow. It receives a <code>GSKReadableCodeFlowResult</code> object as
1014
- /// a parameter. This object gives you access to the scanned codes.
1015
- /// @param failureBlock A block/closure called if an error was encountered.
1016
- /// This method is only available from Objective-C.
1017
- - (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
1018
- @end
1019
-
1020
- @class UIColor;
1021
- /// Configuration for the UI readable code scanning flow
1022
- /// This class allows customization of which barcode and QR code formats should be detected
1023
- /// during the scanning process. By default, all supported formats are enabled.
1024
- SWIFT_CLASS("_TtC5GSSDK32GSKReadableCodeFlowConfiguration")
1025
- @interface GSKReadableCodeFlowConfiguration : NSObject
1026
- /// Whether batch mode is enabled for code detection.
1027
- /// This setting controls how codes are detected and when they are returned:
1028
- /// <ul>
1029
- /// <li>
1030
- /// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
1031
- /// </li>
1032
- /// <li>
1033
- /// <code>true</code>: Collect multiple codes over time before returning when user taps Done
1034
- /// </li>
1035
- /// </ul>
1036
- /// Example:
1037
- /// \code
1038
- /// // Standard mode - return codes immediately (default)
1039
- /// let standardConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: false)
1040
- ///
1041
- /// // Batch mode - collect codes over time
1042
- /// let batchConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: true)
1043
- ///
1044
- /// \endcode
1045
- @property (nonatomic) BOOL isBatchModeEnabled;
1046
- /// The highlight color used for the UI (overlay). Defaults
1047
- /// to <code>.green</code>. For good constrast, we recommend using a bright color.
1048
- @property (nonatomic, strong) UIColor * _Nonnull highlightColor;
1049
- /// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
1050
- /// default color will be used (blue on iOS, for example).
1051
- @property (nonatomic, strong) UIColor * _Nullable menuColor;
1052
- /// Creates a new readable code flow configuration with default values
1053
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1054
- @end
1055
-
1056
- @interface GSKReadableCodeFlowConfiguration (SWIFT_EXTENSION(GSSDK))
1057
- /// Create a configuration from a dictionary.
1058
- /// This is used for interfacing with cross-platform plugins but shouldn’t
1059
- /// be used in native projects.
1060
- + (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
1061
- /// Create a configuration from JSON data.
1062
- /// This is used for interfacing with cross-platform plugins but shouldn’t
1063
- /// be used in native projects.
1064
- + (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
1065
- @end
1066
-
1067
- /// Enum that defines various errors that can occur during a readable code flow.
1068
- typedef SWIFT_ENUM(NSInteger, GSKReadableCodeFlowError, open) {
1069
- /// User has canceled the readable code flow
1070
- GSKReadableCodeFlowUserCancelationError SWIFT_COMPILE_NAME("userCancellation") = 0,
1071
- /// A general error due to a bad configuration parameter
1072
- GSKReadableCodeFlowConfigurationError SWIFT_COMPILE_NAME("configuration") = 1,
1073
- /// Camera permission was denied
1074
- GSKReadableCodeFlowPermissionDeniedError SWIFT_COMPILE_NAME("permissionDenied") = 2,
1075
- /// Failed to initialize the barcode detector
1076
- GSKReadableCodeFlowDetectorError SWIFT_COMPILE_NAME("detectorError") = 3,
1077
- };
1078
- static NSString * _Nonnull const GSKReadableCodeFlowErrorDomain = @"GSSDK.GSKReadableCodeFlowError";
1079
-
1080
- /// The result of a readable code scanning flow
1081
- /// This class encapsulates the successful outcome of a readable code scanning session,
1082
- /// containing the detected barcode or QR code data.
1083
- SWIFT_CLASS("_TtC5GSSDK25GSKReadableCodeFlowResult")
1084
- @interface GSKReadableCodeFlowResult : NSObject
1085
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1086
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1087
- @end
1088
-
1089
- @interface GSKReadableCodeFlowResult (SWIFT_EXTENSION(GSSDK))
1090
- /// Returns a dictionary representation of the result
1091
- /// The dictionary contains:
1092
- /// <ul>
1093
- /// <li>
1094
- /// readableCodes: An array of code dictionaries, each containing:
1095
- /// <ul>
1096
- /// <li>
1097
- /// value: The decoded string value
1098
- /// </li>
1099
- /// <li>
1100
- /// type: The code type as a string (e.g., “qr”, “code128”)
1101
- /// </li>
1102
- /// </ul>
1103
- /// </li>
1104
- /// </ul>
1105
- @property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
1106
- /// Returns a JSON representation of the result.
1107
- /// See <code>dictionary</code> for an explanation of the JSON data’s structure.
1108
- - (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
1109
- @end
1110
-
1111
1199
  typedef SWIFT_ENUM(NSInteger, GSKReceiptCategory, open) {
1112
1200
  GSKReceiptCategoryGas = 0,
1113
1201
  GSKReceiptCategoryTransportation = 1,
@@ -1257,7 +1345,7 @@ typedef SWIFT_ENUM(NSInteger, GSKScanFlowError, open) {
1257
1345
  };
1258
1346
 
1259
1347
  /// The different possible filters for the scanner UI.
1260
- /// All cases match <code>GSKFilterType</code> values except <code>.automatic</code>.
1348
+ /// Each case maps to a predefined filter configuration except <code>.automatic</code>.
1261
1349
  typedef SWIFT_ENUM(NSInteger, GSKScanFlowFilterType, open) {
1262
1350
  GSKScanFlowFilterNone SWIFT_COMPILE_NAME("none") = 0,
1263
1351
  /// Automatic filter
@@ -1373,7 +1461,7 @@ SWIFT_CLASS("_TtC5GSSDK15GSKScanFlowScan")
1373
1461
  /// If OCR was performed, the recognized text.
1374
1462
  @property (nonatomic, strong) GSKScanFlowOCRResult * _Nullable ocrResult;
1375
1463
  /// If structured data extraction was performed, the structured data.
1376
- @property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable structuredDataResult;
1464
+ @property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable structuredData;
1377
1465
  - (nonnull instancetype)initWithOriginalFilePath:(NSString * _Nonnull)originalFilePath enhancedFilePath:(NSString * _Nonnull)enhancedFilePath OBJC_DESIGNATED_INITIALIZER;
1378
1466
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1379
1467
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@@ -1403,6 +1491,8 @@ SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
1403
1491
  /// Present if receipt extraction was requested and a receipt/invoice was
1404
1492
  /// successfully extracted, <code>nil</code> otherwise.
1405
1493
  @property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
1494
+ /// Present if barcode extraction was requested and codes were successfully extracted, empty otherwise.
1495
+ @property (nonatomic, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
1406
1496
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1407
1497
  @end
1408
1498
 
@@ -1571,12 +1661,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
1571
1661
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1572
1662
  @end
1573
1663
 
1574
- @interface GSKView (SWIFT_EXTENSION(GSSDK))
1575
- - (void)startSearchAnimation;
1576
- - (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
1577
- - (void)endSnapAnimation;
1578
- @end
1579
-
1580
1664
  SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")
1581
1665
  @interface GSSDKResources : NSObject
1582
1666
  SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSBundle * _Nonnull bundle;)