@thegrizzlylabs/react-native-genius-scan 5.0.0-beta7 → 5.0.0-beta9

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 (40) hide show
  1. package/README.md +11 -2
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/geniusscansdk/reactnative/RNGeniusScanModule.java +0 -7
  4. package/index.js +0 -7
  5. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK +0 -0
  6. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK_GSSDKObjC.bundle/backbone.tflite +0 -0
  7. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK_GSSDKObjC.bundle/head_classif.tflite +0 -0
  8. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKCore.h +0 -19
  9. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLicenseKeyChecker.h +24 -0
  10. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK-Swift.h +64 -27
  11. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK.h +1 -0
  12. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Info.plist +0 -0
  13. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.abi.json +2725 -2367
  14. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +57 -36
  15. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  16. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftinterface +57 -36
  17. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
  18. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/backbone.tflite +0 -0
  19. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/head_classif.tflite +0 -0
  20. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK +0 -0
  21. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK_GSSDKObjC.bundle/backbone.tflite +0 -0
  22. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK_GSSDKObjC.bundle/head_classif.tflite +0 -0
  23. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKCore.h +0 -19
  24. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLicenseKeyChecker.h +24 -0
  25. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h +128 -54
  26. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK.h +1 -0
  27. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Info.plist +0 -0
  28. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +2725 -2367
  29. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +57 -36
  30. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  31. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +57 -36
  32. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +2725 -2367
  33. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +57 -36
  34. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  35. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +57 -36
  36. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
  37. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/backbone.tflite +0 -0
  38. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/head_classif.tflite +0 -0
  39. package/ios/RNGeniusScan.m +0 -11
  40. package/package.json +1 -1
@@ -24,25 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
24
24
  */
25
25
  @interface GSK : NSObject
26
26
 
27
- /**
28
- Must be called first with a valid license key to enable the SDK.
29
-
30
- This method returns an error if the SDK isn't initialized properly. In addition, all other SDK methods that return errors will report an error if there
31
- is a problem with the license key, and you must handle them to ensure you provide a good "degraded" experience.
32
- For instance, you can prompt the user to update the application to use the scanning feature in case they use a version of the application with an expired license key.
33
-
34
- This method is deprecated in favor of `setLicenseKey:autoRefresh:`.
35
-
36
- @warning *Important* This method must be called before any use of the SDK methods.
37
-
38
- @param licenseKey The license key
39
- @param error On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information.
40
- You may specify nil for this parameter if you do not want the error information.
41
-
42
- @return YES if the SDK was initialized successfully, NO if an error occured.
43
- */
44
- + (BOOL)initWithLicenseKey:(NSString *)licenseKey error:(NSError * _Nullable *)error __deprecated_msg("-setLicenseKey:autoRefresh: instead.");
45
-
46
27
  /// Sets the Genius Scan SDK license key with auto-refresh enabled.
47
28
  ///
48
29
  /// See `setLicenseKey:autoRefresh:`
@@ -0,0 +1,24 @@
1
+ //
2
+ // GSKLicenseKeyChecker.h
3
+ // GSSDK
4
+ //
5
+ // Created by Bruno Virlet on 15/03/2024.
6
+ // Copyright © 2024 The Grizzly Labs. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @interface GSKLicenseKeyChecker : NSObject
14
+
15
+ + (BOOL)checkLicenseWithError:(NSError *__autoreleasing _Nullable * _Nullable)error;
16
+
17
+ #if DEBUG
18
+ /// Enables simulating an invalid license in the tests.
19
+ @property (nonatomic, class, assign) BOOL simulateInvalid;
20
+ #endif
21
+
22
+ @end
23
+
24
+ NS_ASSUME_NONNULL_END
@@ -419,7 +419,7 @@ SWIFT_CLASS("_TtC5GSSDK12GSKOCRResult")
419
419
  @property (nonatomic, readonly, copy) NSString * _Nonnull text;
420
420
  /// The recognized text, as a structured text layout.
421
421
  @property (nonatomic, readonly, strong) GSKTextLayout * _Nonnull textLayout;
422
- - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout OBJC_DESIGNATED_INITIALIZER;
422
+ - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout;
423
423
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
424
424
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
425
425
  @end
@@ -637,6 +637,10 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
637
637
  @end
638
638
 
639
639
 
640
+ @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
641
+ - (BOOL)validate:(NSError * _Nullable * _Nullable)error;
642
+ @end
643
+
640
644
 
641
645
 
642
646
  @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
@@ -647,10 +651,6 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
647
651
  @end
648
652
 
649
653
 
650
- @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
651
- - (BOOL)validate:(NSError * _Nullable * _Nullable)error;
652
- @end
653
-
654
654
  /// Enum that defines various errors that can occur during a scan flow.
655
655
  typedef SWIFT_ENUM(NSInteger, GSKScanFlowError, open) {
656
656
  /// User has canceled the scan flow
@@ -744,7 +744,6 @@ SWIFT_CLASS("_TtC5GSSDK17GSKScanFlowResult")
744
744
 
745
745
 
746
746
  @interface GSKScanFlowResult (SWIFT_EXTENSION(GSSDK))
747
- @property (nonatomic, readonly, copy) NSURL * _Nullable pdfURL SWIFT_DEPRECATED_MSG("Use multiPageDocumentURL instead");
748
747
  /// A dictionary representation of the result.
749
748
  /// Convenient for interfacing with React Native, probably no reason to
750
749
  /// use it with native code.
@@ -783,29 +782,29 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowSource, open) {
783
782
  GSKScanFlowSourceLibrary = 2,
784
783
  };
785
784
 
786
- @class GSKScanFlowStructuredDataResultBankDetails;
787
- @class GSKScanFlowStructuredDataResultContact;
788
- @class GSKScanFlowStructuredDataResultReceipt;
785
+ @class GSKStructuredDataBankDetails;
786
+ @class GSKStructuredDataContact;
787
+ @class GSKStructuredDataReceipt;
789
788
 
790
789
  /// The result of a structured data extraction.
791
790
  SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
792
791
  @interface GSKScanFlowStructuredDataResult : NSObject
793
792
  /// Present if bank details extraction was requested, <code>nil</code> otherwise.
794
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultBankDetails * _Nullable bankDetails;
793
+ @property (nonatomic, strong) GSKStructuredDataBankDetails * _Nullable bankDetails;
795
794
  /// Present if business card contact extraction was requested and a contact was
796
795
  /// succcessfully extracted, <code>nil</code> otherwise.
797
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultContact * _Nullable businessCardContact;
796
+ @property (nonatomic, strong) GSKStructuredDataContact * _Nullable businessCardContact;
798
797
  /// Present if receipt extraction was requested and a receipt/invoice was
799
798
  /// succcessfully extracted, <code>nil</code> otherwise.
800
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultReceipt * _Nullable receipt;
799
+ @property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
801
800
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
802
801
  @end
803
802
 
804
803
 
805
804
 
806
805
  /// Address data extracted from a business card document through OCR.
807
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
808
- @interface GSKScanFlowStructuredDataResultAddress : NSObject
806
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataAddress")
807
+ @interface GSKStructuredDataAddress : NSObject
809
808
  /// The city component of the address.
810
809
  @property (nonatomic, readonly, copy) NSString * _Nullable city;
811
810
  /// The postal/zip code component of the address.
@@ -823,30 +822,31 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
823
822
 
824
823
 
825
824
  /// The bank details extracted from a document through OCR.
826
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultBankDetails")
827
- @interface GSKScanFlowStructuredDataResultBankDetails : NSObject
825
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataBankDetails")
826
+ @interface GSKStructuredDataBankDetails : NSObject
828
827
  /// The IBAN if successfully extracted, otherwise is <code>nil</code>.
829
828
  @property (nonatomic, copy) NSString * _Nullable iban;
830
829
  /// The BIC code if successfully extracted, otherwise is <code>nil</code>.
831
830
  @property (nonatomic, copy) NSString * _Nullable bic;
832
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
831
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
832
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
833
833
  @end
834
834
 
835
835
 
836
- @class GSKScanFlowStructuredDataResultPhoneNumber;
836
+ @class GSKStructuredDataPhoneNumber;
837
837
  @class CNContact;
838
838
 
839
839
  /// Contact data extracted from a business card document through OCR.
840
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
841
- @interface GSKScanFlowStructuredDataResultContact : NSObject
840
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataContact")
841
+ @interface GSKStructuredDataContact : NSObject
842
842
  /// Any name that appears on the business card. Contains the full name, including all components.
843
843
  @property (nonatomic, readonly, copy) NSString * _Nullable name;
844
844
  /// Any organization that appears on the business card.
845
845
  @property (nonatomic, readonly, copy) NSString * _Nullable organization;
846
846
  /// Any address that appears on the business card.
847
- @property (nonatomic, readonly, strong) GSKScanFlowStructuredDataResultAddress * _Nullable address;
847
+ @property (nonatomic, readonly, strong) GSKStructuredDataAddress * _Nullable address;
848
848
  /// The phone numbers that appear on the business card.
849
- @property (nonatomic, readonly, copy) NSArray<GSKScanFlowStructuredDataResultPhoneNumber *> * _Nonnull phoneNumbers;
849
+ @property (nonatomic, readonly, copy) NSArray<GSKStructuredDataPhoneNumber *> * _Nonnull phoneNumbers;
850
850
  /// The links/URLs that appear on the business card.
851
851
  @property (nonatomic, readonly, copy) NSArray<NSURL *> * _Nonnull links;
852
852
  /// The email addresses that appear on the business card.
@@ -859,9 +859,46 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
859
859
 
860
860
 
861
861
 
862
+ /// Class that enables structured data to be extracted from
863
+ /// scanned documents.
864
+ SWIFT_CLASS("_TtC5GSSDK26GSKStructuredDataExtractor")
865
+ @interface GSKStructuredDataExtractor : NSObject
866
+ - (nonnull instancetype)init;
867
+ @end
868
+
869
+
870
+
871
+ @interface GSKStructuredDataExtractor (SWIFT_EXTENSION(GSSDK))
872
+ /// Extract any bank details that were found in a given document by
873
+ /// passing in the result of performing OCR on that document. Use
874
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
875
+ /// was performed for languages that don’t support structured data extraction,
876
+ /// then this method will throw an error.
877
+ - (void)bankDetailsFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataBankDetails * _Nullable, NSError * _Nullable))completionHandler;
878
+ /// Extract any business card contact that was found in a given document
879
+ /// by passing in the result of performing OCR on that document. Use
880
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
881
+ /// was performed for languages that don’t support structured data extraction,
882
+ /// then this method will throw an error.
883
+ - (void)businessCardContactFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataContact * _Nullable, NSError * _Nullable))completionHandler;
884
+ /// Extract any receipt/invoice information that was found in a given
885
+ /// document by passing in the result of performing OCR on that document.
886
+ /// Use <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
887
+ /// was performed for languages that don’t support structured data extraction,
888
+ /// then this method will throw an error.
889
+ - (void)receiptFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataReceipt * _Nullable, NSError * _Nullable))completionHandler;
890
+ @end
891
+
892
+ /// Enum defining errors that can be thrown by <code>GSKStructuredDataExtractor</code>.
893
+ /// Note that thrown errors will be wrapped in <code>NSError</code> containers.
894
+ typedef SWIFT_ENUM(NSInteger, GSKStructuredDataExtractorError, open) {
895
+ GSKStructuredDataExtractorErrorMissingRequiredOCRMetadata = -1,
896
+ };
897
+
898
+
862
899
  /// Phone number data extracted from a business card document through OCR.
863
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
864
- @interface GSKScanFlowStructuredDataResultPhoneNumber : NSObject
900
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataPhoneNumber")
901
+ @interface GSKStructuredDataPhoneNumber : NSObject
865
902
  /// The label of the phone number. For example “Main”, “Office”, etc.
866
903
  @property (nonatomic, readonly, copy) NSString * _Nonnull label;
867
904
  /// A string representation of the phone number itself.
@@ -874,8 +911,8 @@ SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
874
911
  @class NSLocale;
875
912
 
876
913
  /// Receipt/invoice details extracted from a document through OCR.
877
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultReceipt")
878
- @interface GSKScanFlowStructuredDataResultReceipt : NSObject
914
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataReceipt")
915
+ @interface GSKStructuredDataReceipt : NSObject
879
916
  /// The locale that the receipt is in, if successfully extracted, otherwise <code>nil</code>.
880
917
  @property (nonatomic, readonly, copy) NSLocale * _Nullable locale;
881
918
  /// The merchant that the receipt is from, if successfully extracted, otherwise <code>nil</code>.
@@ -931,12 +968,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
931
968
  @end
932
969
 
933
970
 
934
-
935
971
  @interface GSKView (SWIFT_EXTENSION(GSSDK))
936
972
  - (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
937
973
  - (void)endSnapAnimation;
938
974
  @end
939
975
 
976
+
940
977
  @class NSBundle;
941
978
 
942
979
  SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")
@@ -1395,7 +1432,7 @@ SWIFT_CLASS("_TtC5GSSDK12GSKOCRResult")
1395
1432
  @property (nonatomic, readonly, copy) NSString * _Nonnull text;
1396
1433
  /// The recognized text, as a structured text layout.
1397
1434
  @property (nonatomic, readonly, strong) GSKTextLayout * _Nonnull textLayout;
1398
- - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout OBJC_DESIGNATED_INITIALIZER;
1435
+ - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout;
1399
1436
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1400
1437
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1401
1438
  @end
@@ -1613,6 +1650,10 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
1613
1650
  @end
1614
1651
 
1615
1652
 
1653
+ @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
1654
+ - (BOOL)validate:(NSError * _Nullable * _Nullable)error;
1655
+ @end
1656
+
1616
1657
 
1617
1658
 
1618
1659
  @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
@@ -1623,10 +1664,6 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
1623
1664
  @end
1624
1665
 
1625
1666
 
1626
- @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
1627
- - (BOOL)validate:(NSError * _Nullable * _Nullable)error;
1628
- @end
1629
-
1630
1667
  /// Enum that defines various errors that can occur during a scan flow.
1631
1668
  typedef SWIFT_ENUM(NSInteger, GSKScanFlowError, open) {
1632
1669
  /// User has canceled the scan flow
@@ -1720,7 +1757,6 @@ SWIFT_CLASS("_TtC5GSSDK17GSKScanFlowResult")
1720
1757
 
1721
1758
 
1722
1759
  @interface GSKScanFlowResult (SWIFT_EXTENSION(GSSDK))
1723
- @property (nonatomic, readonly, copy) NSURL * _Nullable pdfURL SWIFT_DEPRECATED_MSG("Use multiPageDocumentURL instead");
1724
1760
  /// A dictionary representation of the result.
1725
1761
  /// Convenient for interfacing with React Native, probably no reason to
1726
1762
  /// use it with native code.
@@ -1759,29 +1795,29 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowSource, open) {
1759
1795
  GSKScanFlowSourceLibrary = 2,
1760
1796
  };
1761
1797
 
1762
- @class GSKScanFlowStructuredDataResultBankDetails;
1763
- @class GSKScanFlowStructuredDataResultContact;
1764
- @class GSKScanFlowStructuredDataResultReceipt;
1798
+ @class GSKStructuredDataBankDetails;
1799
+ @class GSKStructuredDataContact;
1800
+ @class GSKStructuredDataReceipt;
1765
1801
 
1766
1802
  /// The result of a structured data extraction.
1767
1803
  SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
1768
1804
  @interface GSKScanFlowStructuredDataResult : NSObject
1769
1805
  /// Present if bank details extraction was requested, <code>nil</code> otherwise.
1770
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultBankDetails * _Nullable bankDetails;
1806
+ @property (nonatomic, strong) GSKStructuredDataBankDetails * _Nullable bankDetails;
1771
1807
  /// Present if business card contact extraction was requested and a contact was
1772
1808
  /// succcessfully extracted, <code>nil</code> otherwise.
1773
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultContact * _Nullable businessCardContact;
1809
+ @property (nonatomic, strong) GSKStructuredDataContact * _Nullable businessCardContact;
1774
1810
  /// Present if receipt extraction was requested and a receipt/invoice was
1775
1811
  /// succcessfully extracted, <code>nil</code> otherwise.
1776
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultReceipt * _Nullable receipt;
1812
+ @property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
1777
1813
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1778
1814
  @end
1779
1815
 
1780
1816
 
1781
1817
 
1782
1818
  /// Address data extracted from a business card document through OCR.
1783
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
1784
- @interface GSKScanFlowStructuredDataResultAddress : NSObject
1819
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataAddress")
1820
+ @interface GSKStructuredDataAddress : NSObject
1785
1821
  /// The city component of the address.
1786
1822
  @property (nonatomic, readonly, copy) NSString * _Nullable city;
1787
1823
  /// The postal/zip code component of the address.
@@ -1799,30 +1835,31 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
1799
1835
 
1800
1836
 
1801
1837
  /// The bank details extracted from a document through OCR.
1802
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultBankDetails")
1803
- @interface GSKScanFlowStructuredDataResultBankDetails : NSObject
1838
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataBankDetails")
1839
+ @interface GSKStructuredDataBankDetails : NSObject
1804
1840
  /// The IBAN if successfully extracted, otherwise is <code>nil</code>.
1805
1841
  @property (nonatomic, copy) NSString * _Nullable iban;
1806
1842
  /// The BIC code if successfully extracted, otherwise is <code>nil</code>.
1807
1843
  @property (nonatomic, copy) NSString * _Nullable bic;
1808
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1844
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1845
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1809
1846
  @end
1810
1847
 
1811
1848
 
1812
- @class GSKScanFlowStructuredDataResultPhoneNumber;
1849
+ @class GSKStructuredDataPhoneNumber;
1813
1850
  @class CNContact;
1814
1851
 
1815
1852
  /// Contact data extracted from a business card document through OCR.
1816
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
1817
- @interface GSKScanFlowStructuredDataResultContact : NSObject
1853
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataContact")
1854
+ @interface GSKStructuredDataContact : NSObject
1818
1855
  /// Any name that appears on the business card. Contains the full name, including all components.
1819
1856
  @property (nonatomic, readonly, copy) NSString * _Nullable name;
1820
1857
  /// Any organization that appears on the business card.
1821
1858
  @property (nonatomic, readonly, copy) NSString * _Nullable organization;
1822
1859
  /// Any address that appears on the business card.
1823
- @property (nonatomic, readonly, strong) GSKScanFlowStructuredDataResultAddress * _Nullable address;
1860
+ @property (nonatomic, readonly, strong) GSKStructuredDataAddress * _Nullable address;
1824
1861
  /// The phone numbers that appear on the business card.
1825
- @property (nonatomic, readonly, copy) NSArray<GSKScanFlowStructuredDataResultPhoneNumber *> * _Nonnull phoneNumbers;
1862
+ @property (nonatomic, readonly, copy) NSArray<GSKStructuredDataPhoneNumber *> * _Nonnull phoneNumbers;
1826
1863
  /// The links/URLs that appear on the business card.
1827
1864
  @property (nonatomic, readonly, copy) NSArray<NSURL *> * _Nonnull links;
1828
1865
  /// The email addresses that appear on the business card.
@@ -1835,9 +1872,46 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
1835
1872
 
1836
1873
 
1837
1874
 
1875
+ /// Class that enables structured data to be extracted from
1876
+ /// scanned documents.
1877
+ SWIFT_CLASS("_TtC5GSSDK26GSKStructuredDataExtractor")
1878
+ @interface GSKStructuredDataExtractor : NSObject
1879
+ - (nonnull instancetype)init;
1880
+ @end
1881
+
1882
+
1883
+
1884
+ @interface GSKStructuredDataExtractor (SWIFT_EXTENSION(GSSDK))
1885
+ /// Extract any bank details that were found in a given document by
1886
+ /// passing in the result of performing OCR on that document. Use
1887
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
1888
+ /// was performed for languages that don’t support structured data extraction,
1889
+ /// then this method will throw an error.
1890
+ - (void)bankDetailsFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataBankDetails * _Nullable, NSError * _Nullable))completionHandler;
1891
+ /// Extract any business card contact that was found in a given document
1892
+ /// by passing in the result of performing OCR on that document. Use
1893
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
1894
+ /// was performed for languages that don’t support structured data extraction,
1895
+ /// then this method will throw an error.
1896
+ - (void)businessCardContactFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataContact * _Nullable, NSError * _Nullable))completionHandler;
1897
+ /// Extract any receipt/invoice information that was found in a given
1898
+ /// document by passing in the result of performing OCR on that document.
1899
+ /// Use <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
1900
+ /// was performed for languages that don’t support structured data extraction,
1901
+ /// then this method will throw an error.
1902
+ - (void)receiptFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataReceipt * _Nullable, NSError * _Nullable))completionHandler;
1903
+ @end
1904
+
1905
+ /// Enum defining errors that can be thrown by <code>GSKStructuredDataExtractor</code>.
1906
+ /// Note that thrown errors will be wrapped in <code>NSError</code> containers.
1907
+ typedef SWIFT_ENUM(NSInteger, GSKStructuredDataExtractorError, open) {
1908
+ GSKStructuredDataExtractorErrorMissingRequiredOCRMetadata = -1,
1909
+ };
1910
+
1911
+
1838
1912
  /// Phone number data extracted from a business card document through OCR.
1839
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
1840
- @interface GSKScanFlowStructuredDataResultPhoneNumber : NSObject
1913
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataPhoneNumber")
1914
+ @interface GSKStructuredDataPhoneNumber : NSObject
1841
1915
  /// The label of the phone number. For example “Main”, “Office”, etc.
1842
1916
  @property (nonatomic, readonly, copy) NSString * _Nonnull label;
1843
1917
  /// A string representation of the phone number itself.
@@ -1850,8 +1924,8 @@ SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
1850
1924
  @class NSLocale;
1851
1925
 
1852
1926
  /// Receipt/invoice details extracted from a document through OCR.
1853
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultReceipt")
1854
- @interface GSKScanFlowStructuredDataResultReceipt : NSObject
1927
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataReceipt")
1928
+ @interface GSKStructuredDataReceipt : NSObject
1855
1929
  /// The locale that the receipt is in, if successfully extracted, otherwise <code>nil</code>.
1856
1930
  @property (nonatomic, readonly, copy) NSLocale * _Nullable locale;
1857
1931
  /// The merchant that the receipt is from, if successfully extracted, otherwise <code>nil</code>.
@@ -1907,12 +1981,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
1907
1981
  @end
1908
1982
 
1909
1983
 
1910
-
1911
1984
  @interface GSKView (SWIFT_EXTENSION(GSSDK))
1912
1985
  - (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
1913
1986
  - (void)endSnapAnimation;
1914
1987
  @end
1915
1988
 
1989
+
1916
1990
  @class NSBundle;
1917
1991
 
1918
1992
  SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")
@@ -19,6 +19,7 @@ FOUNDATION_EXPORT const unsigned char GSSDKVersionString[];
19
19
  #import <GSSDK/GSKLog.h>
20
20
  #import <GSSDK/GSKLoggerSeverity.h>
21
21
  #import <GSSDK/GSKDefaultLogger.h>
22
+ #import <GSSDK/GSKLicenseKeyChecker.h>
22
23
 
23
24
  // UI
24
25
  #import <GSSDK/GSKCameraSession.h>