@trustchex/react-native-sdk 1.161.0

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 (650) hide show
  1. package/LICENSE +49 -0
  2. package/README.md +223 -0
  3. package/TrustchexSDK.podspec +26 -0
  4. package/android/build.gradle +103 -0
  5. package/android/gradle.properties +5 -0
  6. package/android/src/main/AndroidManifest.xml +11 -0
  7. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKModule.kt +40 -0
  8. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +61 -0
  9. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +301 -0
  10. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +205 -0
  11. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +72 -0
  12. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +4 -0
  13. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +303 -0
  14. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +115 -0
  15. package/ios/TrustchexSDK.h +5 -0
  16. package/ios/TrustchexSDK.mm +28 -0
  17. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +22 -0
  18. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +172 -0
  19. package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +13 -0
  20. package/ios/VisionCameraPlugins/Cropper/Cropper.h +20 -0
  21. package/ios/VisionCameraPlugins/Cropper/Cropper.mm +22 -0
  22. package/ios/VisionCameraPlugins/Cropper/Cropper.swift +145 -0
  23. package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +49 -0
  24. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +4 -0
  25. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +22 -0
  26. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +320 -0
  27. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +4 -0
  28. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +27 -0
  29. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +144 -0
  30. package/lib/module/NativeTrustchexSDK.js +4 -0
  31. package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +141 -0
  32. package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +140 -0
  33. package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +100 -0
  34. package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +596 -0
  35. package/lib/module/Screens/Static/QrCodeScanningScreen.js +36 -0
  36. package/lib/module/Screens/Static/ResultScreen.js +627 -0
  37. package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +381 -0
  38. package/lib/module/Shared/Animations/face-scan.json +1 -0
  39. package/lib/module/Shared/Animations/hole.json +76 -0
  40. package/lib/module/Shared/Animations/hologram-scan.json +1 -0
  41. package/lib/module/Shared/Animations/id-or-passport.json +1 -0
  42. package/lib/module/Shared/Animations/light.json +1 -0
  43. package/lib/module/Shared/Animations/loading.json +1 -0
  44. package/lib/module/Shared/Animations/nfc-scan.json +1 -0
  45. package/lib/module/Shared/Animations/nfc.json +1 -0
  46. package/lib/module/Shared/Animations/scanning.json +1 -0
  47. package/lib/module/Shared/Animations/success.json +1 -0
  48. package/lib/module/Shared/Assets/trustchex-logo-black.png +0 -0
  49. package/lib/module/Shared/Components/EIDScanner.js +372 -0
  50. package/lib/module/Shared/Components/FaceCamera.js +223 -0
  51. package/lib/module/Shared/Components/IdentityDocumentCamera.js +968 -0
  52. package/lib/module/Shared/Components/LanguageSelector.js +53 -0
  53. package/lib/module/Shared/Components/NativeCircularProgress.js +64 -0
  54. package/lib/module/Shared/Components/NativeProgressBar.js +53 -0
  55. package/lib/module/Shared/Components/NavigationManager.js +180 -0
  56. package/lib/module/Shared/Components/OTPCodeInput.js +74 -0
  57. package/lib/module/Shared/Components/QrCodeScannerCamera.js +262 -0
  58. package/lib/module/Shared/Contexts/AppContext.js +27 -0
  59. package/lib/module/Shared/EIDReader/abstractMRTDCardService.js +4 -0
  60. package/lib/module/Shared/EIDReader/accessKeySpec.js +1 -0
  61. package/lib/module/Shared/EIDReader/apduLevelBACCapable.js +1 -0
  62. package/lib/module/Shared/EIDReader/apduLevelReadBinaryCapable.js +3 -0
  63. package/lib/module/Shared/EIDReader/bacKey.js +112 -0
  64. package/lib/module/Shared/EIDReader/bacKeySpec.js +3 -0
  65. package/lib/module/Shared/EIDReader/cardFileInputStream.js +140 -0
  66. package/lib/module/Shared/EIDReader/cardService.js +31 -0
  67. package/lib/module/Shared/EIDReader/cbeff/biometricDataBlock.js +3 -0
  68. package/lib/module/Shared/EIDReader/cbeff/biometricDataBlockDecoder.js +3 -0
  69. package/lib/module/Shared/EIDReader/cbeff/biometricDataBlockEncoder.js +3 -0
  70. package/lib/module/Shared/EIDReader/cbeff/cbeffInfo.js +102 -0
  71. package/lib/module/Shared/EIDReader/cbeff/complexCBEFFInfo.js +46 -0
  72. package/lib/module/Shared/EIDReader/cbeff/faceDataBlockDecoder.js +8 -0
  73. package/lib/module/Shared/EIDReader/cbeff/iso781611.js +79 -0
  74. package/lib/module/Shared/EIDReader/cbeff/iso781611Decoder.js +141 -0
  75. package/lib/module/Shared/EIDReader/cbeff/iso781611Encoder.js +53 -0
  76. package/lib/module/Shared/EIDReader/cbeff/simpleCBEFFInfo.js +21 -0
  77. package/lib/module/Shared/EIDReader/cbeff/standardBiometricHeader.js +97 -0
  78. package/lib/module/Shared/EIDReader/cert/cvcPrincipal.js +48 -0
  79. package/lib/module/Shared/EIDReader/data/country.js +66 -0
  80. package/lib/module/Shared/EIDReader/data/gender.js +29 -0
  81. package/lib/module/Shared/EIDReader/data/isoCountry.js +283 -0
  82. package/lib/module/Shared/EIDReader/data/unicodeCountry.js +278 -0
  83. package/lib/module/Shared/EIDReader/defaultFileInfo.js +29 -0
  84. package/lib/module/Shared/EIDReader/defaultFileSystem.js +171 -0
  85. package/lib/module/Shared/EIDReader/eidReader.js +90 -0
  86. package/lib/module/Shared/EIDReader/eidService.js +280 -0
  87. package/lib/module/Shared/EIDReader/fileInfo.js +3 -0
  88. package/lib/module/Shared/EIDReader/fileSystemCardService.js +4 -0
  89. package/lib/module/Shared/EIDReader/fragment.js +17 -0
  90. package/lib/module/Shared/EIDReader/fragmentBuffer.js +130 -0
  91. package/lib/module/Shared/EIDReader/java/byteArrayInputStream.js +73 -0
  92. package/lib/module/Shared/EIDReader/java/byteArrayOutputStream.js +55 -0
  93. package/lib/module/Shared/EIDReader/java/dataInput.js +1 -0
  94. package/lib/module/Shared/EIDReader/java/dataInputStream.js +167 -0
  95. package/lib/module/Shared/EIDReader/java/dataOutputStream.js +91 -0
  96. package/lib/module/Shared/EIDReader/java/filterInputStream.js +134 -0
  97. package/lib/module/Shared/EIDReader/java/filterOutputStream.js +124 -0
  98. package/lib/module/Shared/EIDReader/java/inputStream.js +139 -0
  99. package/lib/module/Shared/EIDReader/java/inputStreamBuffer.js +144 -0
  100. package/lib/module/Shared/EIDReader/java/objectInputStream.js +39 -0
  101. package/lib/module/Shared/EIDReader/java/outputStream.js +77 -0
  102. package/lib/module/Shared/EIDReader/java/positionInputStream.js +50 -0
  103. package/lib/module/Shared/EIDReader/java/splittableInputStream.js +54 -0
  104. package/lib/module/Shared/EIDReader/lds/abstractImageInfo.js +137 -0
  105. package/lib/module/Shared/EIDReader/lds/abstractLDSFile.js +101 -0
  106. package/lib/module/Shared/EIDReader/lds/abstractLDSInfo.js +29 -0
  107. package/lib/module/Shared/EIDReader/lds/abstractListInfo.js +66 -0
  108. package/lib/module/Shared/EIDReader/lds/abstractTaggedLDSFile.js +65 -0
  109. package/lib/module/Shared/EIDReader/lds/cbeffDataGroup.js +118 -0
  110. package/lib/module/Shared/EIDReader/lds/cvcaFile.js +89 -0
  111. package/lib/module/Shared/EIDReader/lds/dataGroup.js +10 -0
  112. package/lib/module/Shared/EIDReader/lds/icao/comFile.js +101 -0
  113. package/lib/module/Shared/EIDReader/lds/icao/dg1File.js +33 -0
  114. package/lib/module/Shared/EIDReader/lds/icao/dg2File.js +42 -0
  115. package/lib/module/Shared/EIDReader/lds/icao/icaoCountry.js +114 -0
  116. package/lib/module/Shared/EIDReader/lds/icao/mrzInfo.js +1418 -0
  117. package/lib/module/Shared/EIDReader/lds/imageInfo.js +3 -0
  118. package/lib/module/Shared/EIDReader/lds/iso19794/faceImageInfo.js +817 -0
  119. package/lib/module/Shared/EIDReader/lds/iso19794/faceInfo.js +116 -0
  120. package/lib/module/Shared/EIDReader/lds/ldsElement.js +1 -0
  121. package/lib/module/Shared/EIDReader/lds/ldsFile.js +3 -0
  122. package/lib/module/Shared/EIDReader/nfcManagerCardService.js +44 -0
  123. package/lib/module/Shared/EIDReader/protocol/bacAPDUSender.js +83 -0
  124. package/lib/module/Shared/EIDReader/protocol/bacProtocol.js +70 -0
  125. package/lib/module/Shared/EIDReader/protocol/bacResult.js +32 -0
  126. package/lib/module/Shared/EIDReader/protocol/readBinaryAPDUSender.js +126 -0
  127. package/lib/module/Shared/EIDReader/protocol/secureMessagingAPDUSender.js +102 -0
  128. package/lib/module/Shared/EIDReader/secureMessagingWrapper.js +218 -0
  129. package/lib/module/Shared/EIDReader/smartcards/apduEvent.js +23 -0
  130. package/lib/module/Shared/EIDReader/smartcards/apduListener.js +3 -0
  131. package/lib/module/Shared/EIDReader/smartcards/apduWrapper.js +3 -0
  132. package/lib/module/Shared/EIDReader/smartcards/commandAPDU.js +124 -0
  133. package/lib/module/Shared/EIDReader/smartcards/fileSystemStructured.js +3 -0
  134. package/lib/module/Shared/EIDReader/smartcards/iso7816.js +107 -0
  135. package/lib/module/Shared/EIDReader/smartcards/responseAPDU.js +35 -0
  136. package/lib/module/Shared/EIDReader/tlv/asn1Constants.js +48 -0
  137. package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +186 -0
  138. package/lib/module/Shared/EIDReader/tlv/tlvInputState.js +141 -0
  139. package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +180 -0
  140. package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +186 -0
  141. package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +85 -0
  142. package/lib/module/Shared/EIDReader/tripleDesSecureMessagingWrapper.js +37 -0
  143. package/lib/module/Shared/EIDReader/utils/crypto.utils.js +218 -0
  144. package/lib/module/Shared/EIDReader/utils/random.js +166 -0
  145. package/lib/module/Shared/EIDReader/wrappedAPDUEvent.js +16 -0
  146. package/lib/module/Shared/Libs/camera.utils.js +32 -0
  147. package/lib/module/Shared/Libs/contains.js +40 -0
  148. package/lib/module/Shared/Libs/crypto.utils.js +35 -0
  149. package/lib/module/Shared/Libs/debounce.utils.js +35 -0
  150. package/lib/module/Shared/Libs/deeplink.utils.js +20 -0
  151. package/lib/module/Shared/Libs/demo.utils.js +57 -0
  152. package/lib/module/Shared/Libs/http-client.js +104 -0
  153. package/lib/module/Shared/Libs/mrz.utils.js +99 -0
  154. package/lib/module/Shared/Libs/native-device-info.utils.js +44 -0
  155. package/lib/module/Shared/Libs/native-keep-awake.utils.js +85 -0
  156. package/lib/module/Shared/Libs/opencv.utils.js +21 -0
  157. package/lib/module/Shared/Libs/promise.utils.js +17 -0
  158. package/lib/module/Shared/Libs/tts.utils.js +31 -0
  159. package/lib/module/Shared/Types/identificationInfo.js +3 -0
  160. package/lib/module/Shared/Types/instruction.js +1 -0
  161. package/lib/module/Shared/Types/livenessIntructionType.js +1 -0
  162. package/lib/module/Shared/Types/verificationSession.js +3 -0
  163. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.js +66 -0
  164. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +46 -0
  165. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +34 -0
  166. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +21 -0
  167. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +24 -0
  168. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +3 -0
  169. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +197 -0
  170. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +101 -0
  171. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +60 -0
  172. package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +47 -0
  173. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +42 -0
  174. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +35 -0
  175. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +4 -0
  176. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +3 -0
  177. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +56 -0
  178. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +20 -0
  179. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +9 -0
  180. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +6 -0
  181. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +20 -0
  182. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +19 -0
  183. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +3 -0
  184. package/lib/module/Translation/Resources/en.js +109 -0
  185. package/lib/module/Translation/Resources/index.js +4 -0
  186. package/lib/module/Translation/Resources/tr.js +112 -0
  187. package/lib/module/Translation/index.js +27 -0
  188. package/lib/module/Trustchex.js +149 -0
  189. package/lib/module/index.js +5 -0
  190. package/lib/module/package.json +1 -0
  191. package/lib/typescript/package.json +1 -0
  192. package/lib/typescript/src/NativeTrustchexSDK.d.ts +8 -0
  193. package/lib/typescript/src/NativeTrustchexSDK.d.ts.map +1 -0
  194. package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts +3 -0
  195. package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts.map +1 -0
  196. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts +3 -0
  197. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -0
  198. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts +3 -0
  199. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -0
  200. package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts +3 -0
  201. package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -0
  202. package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts +3 -0
  203. package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -0
  204. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts +3 -0
  205. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -0
  206. package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts +3 -0
  207. package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -0
  208. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +12 -0
  209. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -0
  210. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +9 -0
  211. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -0
  212. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +58 -0
  213. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -0
  214. package/lib/typescript/src/Shared/Components/LanguageSelector.d.ts +3 -0
  215. package/lib/typescript/src/Shared/Components/LanguageSelector.d.ts.map +1 -0
  216. package/lib/typescript/src/Shared/Components/NativeCircularProgress.d.ts +13 -0
  217. package/lib/typescript/src/Shared/Components/NativeCircularProgress.d.ts.map +1 -0
  218. package/lib/typescript/src/Shared/Components/NativeProgressBar.d.ts +12 -0
  219. package/lib/typescript/src/Shared/Components/NativeProgressBar.d.ts.map +1 -0
  220. package/lib/typescript/src/Shared/Components/NavigationManager.d.ts +11 -0
  221. package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -0
  222. package/lib/typescript/src/Shared/Components/OTPCodeInput.d.ts +10 -0
  223. package/lib/typescript/src/Shared/Components/OTPCodeInput.d.ts.map +1 -0
  224. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +6 -0
  225. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -0
  226. package/lib/typescript/src/Shared/Contexts/AppContext.d.ts +20 -0
  227. package/lib/typescript/src/Shared/Contexts/AppContext.d.ts.map +1 -0
  228. package/lib/typescript/src/Shared/EIDReader/abstractMRTDCardService.d.ts +50 -0
  229. package/lib/typescript/src/Shared/EIDReader/abstractMRTDCardService.d.ts.map +1 -0
  230. package/lib/typescript/src/Shared/EIDReader/accessKeySpec.d.ts +16 -0
  231. package/lib/typescript/src/Shared/EIDReader/accessKeySpec.d.ts.map +1 -0
  232. package/lib/typescript/src/Shared/EIDReader/apduLevelBACCapable.d.ts +5 -0
  233. package/lib/typescript/src/Shared/EIDReader/apduLevelBACCapable.d.ts.map +1 -0
  234. package/lib/typescript/src/Shared/EIDReader/apduLevelReadBinaryCapable.d.ts +8 -0
  235. package/lib/typescript/src/Shared/EIDReader/apduLevelReadBinaryCapable.d.ts.map +1 -0
  236. package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts +65 -0
  237. package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts.map +1 -0
  238. package/lib/typescript/src/Shared/EIDReader/bacKeySpec.d.ts +24 -0
  239. package/lib/typescript/src/Shared/EIDReader/bacKeySpec.d.ts.map +1 -0
  240. package/lib/typescript/src/Shared/EIDReader/cardFileInputStream.d.ts +26 -0
  241. package/lib/typescript/src/Shared/EIDReader/cardFileInputStream.d.ts.map +1 -0
  242. package/lib/typescript/src/Shared/EIDReader/cardService.d.ts +22 -0
  243. package/lib/typescript/src/Shared/EIDReader/cardService.d.ts.map +1 -0
  244. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlock.d.ts +5 -0
  245. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlock.d.ts.map +1 -0
  246. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.d.ts +7 -0
  247. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.d.ts.map +1 -0
  248. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.d.ts +6 -0
  249. package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.d.ts.map +1 -0
  250. package/lib/typescript/src/Shared/EIDReader/cbeff/cbeffInfo.d.ts +61 -0
  251. package/lib/typescript/src/Shared/EIDReader/cbeff/cbeffInfo.d.ts.map +1 -0
  252. package/lib/typescript/src/Shared/EIDReader/cbeff/complexCBEFFInfo.d.ts +33 -0
  253. package/lib/typescript/src/Shared/EIDReader/cbeff/complexCBEFFInfo.d.ts.map +1 -0
  254. package/lib/typescript/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.d.ts +8 -0
  255. package/lib/typescript/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.d.ts.map +1 -0
  256. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611.d.ts +60 -0
  257. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611.d.ts.map +1 -0
  258. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Decoder.d.ts +19 -0
  259. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Decoder.d.ts.map +1 -0
  260. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Encoder.d.ts +15 -0
  261. package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Encoder.d.ts.map +1 -0
  262. package/lib/typescript/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.d.ts +18 -0
  263. package/lib/typescript/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.d.ts.map +1 -0
  264. package/lib/typescript/src/Shared/EIDReader/cbeff/standardBiometricHeader.d.ts +43 -0
  265. package/lib/typescript/src/Shared/EIDReader/cbeff/standardBiometricHeader.d.ts.map +1 -0
  266. package/lib/typescript/src/Shared/EIDReader/cert/cvcPrincipal.d.ts +14 -0
  267. package/lib/typescript/src/Shared/EIDReader/cert/cvcPrincipal.d.ts.map +1 -0
  268. package/lib/typescript/src/Shared/EIDReader/data/country.d.ts +14 -0
  269. package/lib/typescript/src/Shared/EIDReader/data/country.d.ts.map +1 -0
  270. package/lib/typescript/src/Shared/EIDReader/data/gender.d.ts +14 -0
  271. package/lib/typescript/src/Shared/EIDReader/data/gender.d.ts.map +1 -0
  272. package/lib/typescript/src/Shared/EIDReader/data/isoCountry.d.ts +268 -0
  273. package/lib/typescript/src/Shared/EIDReader/data/isoCountry.d.ts.map +1 -0
  274. package/lib/typescript/src/Shared/EIDReader/data/unicodeCountry.d.ts +263 -0
  275. package/lib/typescript/src/Shared/EIDReader/data/unicodeCountry.d.ts.map +1 -0
  276. package/lib/typescript/src/Shared/EIDReader/defaultFileInfo.d.ts +14 -0
  277. package/lib/typescript/src/Shared/EIDReader/defaultFileInfo.d.ts.map +1 -0
  278. package/lib/typescript/src/Shared/EIDReader/defaultFileSystem.d.ts +30 -0
  279. package/lib/typescript/src/Shared/EIDReader/defaultFileSystem.d.ts.map +1 -0
  280. package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts +8 -0
  281. package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -0
  282. package/lib/typescript/src/Shared/EIDReader/eidService.d.ts +150 -0
  283. package/lib/typescript/src/Shared/EIDReader/eidService.d.ts.map +1 -0
  284. package/lib/typescript/src/Shared/EIDReader/fileInfo.d.ts +5 -0
  285. package/lib/typescript/src/Shared/EIDReader/fileInfo.d.ts.map +1 -0
  286. package/lib/typescript/src/Shared/EIDReader/fileSystemCardService.d.ts +28 -0
  287. package/lib/typescript/src/Shared/EIDReader/fileSystemCardService.d.ts.map +1 -0
  288. package/lib/typescript/src/Shared/EIDReader/fragment.d.ts +9 -0
  289. package/lib/typescript/src/Shared/EIDReader/fragment.d.ts.map +1 -0
  290. package/lib/typescript/src/Shared/EIDReader/fragmentBuffer.d.ts +22 -0
  291. package/lib/typescript/src/Shared/EIDReader/fragmentBuffer.d.ts.map +1 -0
  292. package/lib/typescript/src/Shared/EIDReader/java/byteArrayInputStream.d.ts +22 -0
  293. package/lib/typescript/src/Shared/EIDReader/java/byteArrayInputStream.d.ts.map +1 -0
  294. package/lib/typescript/src/Shared/EIDReader/java/byteArrayOutputStream.d.ts +18 -0
  295. package/lib/typescript/src/Shared/EIDReader/java/byteArrayOutputStream.d.ts.map +1 -0
  296. package/lib/typescript/src/Shared/EIDReader/java/dataInput.d.ts +17 -0
  297. package/lib/typescript/src/Shared/EIDReader/java/dataInput.d.ts.map +1 -0
  298. package/lib/typescript/src/Shared/EIDReader/java/dataInputStream.d.ts +28 -0
  299. package/lib/typescript/src/Shared/EIDReader/java/dataInputStream.d.ts.map +1 -0
  300. package/lib/typescript/src/Shared/EIDReader/java/dataOutputStream.d.ts +18 -0
  301. package/lib/typescript/src/Shared/EIDReader/java/dataOutputStream.d.ts.map +1 -0
  302. package/lib/typescript/src/Shared/EIDReader/java/filterInputStream.d.ts +103 -0
  303. package/lib/typescript/src/Shared/EIDReader/java/filterInputStream.d.ts.map +1 -0
  304. package/lib/typescript/src/Shared/EIDReader/java/filterOutputStream.d.ts +83 -0
  305. package/lib/typescript/src/Shared/EIDReader/java/filterOutputStream.d.ts.map +1 -0
  306. package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts +21 -0
  307. package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts.map +1 -0
  308. package/lib/typescript/src/Shared/EIDReader/java/inputStreamBuffer.d.ts +32 -0
  309. package/lib/typescript/src/Shared/EIDReader/java/inputStreamBuffer.d.ts.map +1 -0
  310. package/lib/typescript/src/Shared/EIDReader/java/objectInputStream.d.ts +11 -0
  311. package/lib/typescript/src/Shared/EIDReader/java/objectInputStream.d.ts.map +1 -0
  312. package/lib/typescript/src/Shared/EIDReader/java/outputStream.d.ts +64 -0
  313. package/lib/typescript/src/Shared/EIDReader/java/outputStream.d.ts.map +1 -0
  314. package/lib/typescript/src/Shared/EIDReader/java/positionInputStream.d.ts +17 -0
  315. package/lib/typescript/src/Shared/EIDReader/java/positionInputStream.d.ts.map +1 -0
  316. package/lib/typescript/src/Shared/EIDReader/java/splittableInputStream.d.ts +19 -0
  317. package/lib/typescript/src/Shared/EIDReader/java/splittableInputStream.d.ts.map +1 -0
  318. package/lib/typescript/src/Shared/EIDReader/lds/abstractImageInfo.d.ts +50 -0
  319. package/lib/typescript/src/Shared/EIDReader/lds/abstractImageInfo.d.ts.map +1 -0
  320. package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSFile.d.ts +71 -0
  321. package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSFile.d.ts.map +1 -0
  322. package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSInfo.d.ts +19 -0
  323. package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSInfo.d.ts.map +1 -0
  324. package/lib/typescript/src/Shared/EIDReader/lds/abstractListInfo.d.ts +45 -0
  325. package/lib/typescript/src/Shared/EIDReader/lds/abstractListInfo.d.ts.map +1 -0
  326. package/lib/typescript/src/Shared/EIDReader/lds/abstractTaggedLDSFile.d.ts +18 -0
  327. package/lib/typescript/src/Shared/EIDReader/lds/abstractTaggedLDSFile.d.ts.map +1 -0
  328. package/lib/typescript/src/Shared/EIDReader/lds/cbeffDataGroup.d.ts +59 -0
  329. package/lib/typescript/src/Shared/EIDReader/lds/cbeffDataGroup.d.ts.map +1 -0
  330. package/lib/typescript/src/Shared/EIDReader/lds/cvcaFile.d.ts +19 -0
  331. package/lib/typescript/src/Shared/EIDReader/lds/cvcaFile.d.ts.map +1 -0
  332. package/lib/typescript/src/Shared/EIDReader/lds/dataGroup.d.ts +8 -0
  333. package/lib/typescript/src/Shared/EIDReader/lds/dataGroup.d.ts.map +1 -0
  334. package/lib/typescript/src/Shared/EIDReader/lds/icao/comFile.d.ts +22 -0
  335. package/lib/typescript/src/Shared/EIDReader/lds/icao/comFile.d.ts.map +1 -0
  336. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg1File.d.ts +13 -0
  337. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg1File.d.ts.map +1 -0
  338. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg2File.d.ts +14 -0
  339. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg2File.d.ts.map +1 -0
  340. package/lib/typescript/src/Shared/EIDReader/lds/icao/icaoCountry.d.ts +80 -0
  341. package/lib/typescript/src/Shared/EIDReader/lds/icao/icaoCountry.d.ts.map +1 -0
  342. package/lib/typescript/src/Shared/EIDReader/lds/icao/mrzInfo.d.ts +579 -0
  343. package/lib/typescript/src/Shared/EIDReader/lds/icao/mrzInfo.d.ts.map +1 -0
  344. package/lib/typescript/src/Shared/EIDReader/lds/imageInfo.d.ts +52 -0
  345. package/lib/typescript/src/Shared/EIDReader/lds/imageInfo.d.ts.map +1 -0
  346. package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceImageInfo.d.ts +392 -0
  347. package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceImageInfo.d.ts.map +1 -0
  348. package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceInfo.d.ts +22 -0
  349. package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceInfo.d.ts.map +1 -0
  350. package/lib/typescript/src/Shared/EIDReader/lds/ldsElement.d.ts +9 -0
  351. package/lib/typescript/src/Shared/EIDReader/lds/ldsElement.d.ts.map +1 -0
  352. package/lib/typescript/src/Shared/EIDReader/lds/ldsFile.d.ts +10 -0
  353. package/lib/typescript/src/Shared/EIDReader/lds/ldsFile.d.ts.map +1 -0
  354. package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts +13 -0
  355. package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts.map +1 -0
  356. package/lib/typescript/src/Shared/EIDReader/protocol/bacAPDUSender.d.ts +9 -0
  357. package/lib/typescript/src/Shared/EIDReader/protocol/bacAPDUSender.d.ts.map +1 -0
  358. package/lib/typescript/src/Shared/EIDReader/protocol/bacProtocol.d.ts +17 -0
  359. package/lib/typescript/src/Shared/EIDReader/protocol/bacProtocol.d.ts.map +1 -0
  360. package/lib/typescript/src/Shared/EIDReader/protocol/bacResult.d.ts +26 -0
  361. package/lib/typescript/src/Shared/EIDReader/protocol/bacResult.d.ts.map +1 -0
  362. package/lib/typescript/src/Shared/EIDReader/protocol/readBinaryAPDUSender.d.ts +15 -0
  363. package/lib/typescript/src/Shared/EIDReader/protocol/readBinaryAPDUSender.d.ts.map +1 -0
  364. package/lib/typescript/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.d.ts +19 -0
  365. package/lib/typescript/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.d.ts.map +1 -0
  366. package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts +30 -0
  367. package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts.map +1 -0
  368. package/lib/typescript/src/Shared/EIDReader/smartcards/apduEvent.d.ts +15 -0
  369. package/lib/typescript/src/Shared/EIDReader/smartcards/apduEvent.d.ts.map +1 -0
  370. package/lib/typescript/src/Shared/EIDReader/smartcards/apduListener.d.ts +5 -0
  371. package/lib/typescript/src/Shared/EIDReader/smartcards/apduListener.d.ts.map +1 -0
  372. package/lib/typescript/src/Shared/EIDReader/smartcards/apduWrapper.d.ts +8 -0
  373. package/lib/typescript/src/Shared/EIDReader/smartcards/apduWrapper.d.ts.map +1 -0
  374. package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts +20 -0
  375. package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts.map +1 -0
  376. package/lib/typescript/src/Shared/EIDReader/smartcards/fileSystemStructured.d.ts +7 -0
  377. package/lib/typescript/src/Shared/EIDReader/smartcards/fileSystemStructured.d.ts.map +1 -0
  378. package/lib/typescript/src/Shared/EIDReader/smartcards/iso7816.d.ts +101 -0
  379. package/lib/typescript/src/Shared/EIDReader/smartcards/iso7816.d.ts.map +1 -0
  380. package/lib/typescript/src/Shared/EIDReader/smartcards/responseAPDU.d.ts +13 -0
  381. package/lib/typescript/src/Shared/EIDReader/smartcards/responseAPDU.d.ts.map +1 -0
  382. package/lib/typescript/src/Shared/EIDReader/tlv/asn1Constants.d.ts +36 -0
  383. package/lib/typescript/src/Shared/EIDReader/tlv/asn1Constants.d.ts.map +1 -0
  384. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +44 -0
  385. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -0
  386. package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputState.d.ts +34 -0
  387. package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputState.d.ts.map +1 -0
  388. package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputStream.d.ts +23 -0
  389. package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputStream.d.ts.map +1 -0
  390. package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputState.d.ts +24 -0
  391. package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputState.d.ts.map +1 -0
  392. package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts +16 -0
  393. package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts.map +1 -0
  394. package/lib/typescript/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.d.ts +10 -0
  395. package/lib/typescript/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.d.ts.map +1 -0
  396. package/lib/typescript/src/Shared/EIDReader/utils/crypto.utils.d.ts +16 -0
  397. package/lib/typescript/src/Shared/EIDReader/utils/crypto.utils.d.ts.map +1 -0
  398. package/lib/typescript/src/Shared/EIDReader/utils/random.d.ts +25 -0
  399. package/lib/typescript/src/Shared/EIDReader/utils/random.d.ts.map +1 -0
  400. package/lib/typescript/src/Shared/EIDReader/wrappedAPDUEvent.d.ts +11 -0
  401. package/lib/typescript/src/Shared/EIDReader/wrappedAPDUEvent.d.ts.map +1 -0
  402. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +5 -0
  403. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +1 -0
  404. package/lib/typescript/src/Shared/Libs/contains.d.ts +14 -0
  405. package/lib/typescript/src/Shared/Libs/contains.d.ts.map +1 -0
  406. package/lib/typescript/src/Shared/Libs/crypto.utils.d.ts +9 -0
  407. package/lib/typescript/src/Shared/Libs/crypto.utils.d.ts.map +1 -0
  408. package/lib/typescript/src/Shared/Libs/debounce.utils.d.ts +10 -0
  409. package/lib/typescript/src/Shared/Libs/debounce.utils.d.ts.map +1 -0
  410. package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts +5 -0
  411. package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -0
  412. package/lib/typescript/src/Shared/Libs/demo.utils.d.ts +5 -0
  413. package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -0
  414. package/lib/typescript/src/Shared/Libs/http-client.d.ts +27 -0
  415. package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -0
  416. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +9 -0
  417. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -0
  418. package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts +14 -0
  419. package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -0
  420. package/lib/typescript/src/Shared/Libs/native-keep-awake.utils.d.ts +31 -0
  421. package/lib/typescript/src/Shared/Libs/native-keep-awake.utils.d.ts.map +1 -0
  422. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +3 -0
  423. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +1 -0
  424. package/lib/typescript/src/Shared/Libs/promise.utils.d.ts +3 -0
  425. package/lib/typescript/src/Shared/Libs/promise.utils.d.ts.map +1 -0
  426. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +6 -0
  427. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -0
  428. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +57 -0
  429. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -0
  430. package/lib/typescript/src/Shared/Types/instruction.d.ts +5 -0
  431. package/lib/typescript/src/Shared/Types/instruction.d.ts.map +1 -0
  432. package/lib/typescript/src/Shared/Types/livenessIntructionType.d.ts +2 -0
  433. package/lib/typescript/src/Shared/Types/livenessIntructionType.d.ts.map +1 -0
  434. package/lib/typescript/src/Shared/Types/verificationSession.d.ts +16 -0
  435. package/lib/typescript/src/Shared/Types/verificationSession.d.ts.map +1 -0
  436. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts +13 -0
  437. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts.map +1 -0
  438. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +13 -0
  439. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +1 -0
  440. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +6 -0
  441. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +1 -0
  442. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +14 -0
  443. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +1 -0
  444. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +3 -0
  445. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +1 -0
  446. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +52 -0
  447. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +1 -0
  448. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +62 -0
  449. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +1 -0
  450. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +34 -0
  451. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +1 -0
  452. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +32 -0
  453. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +1 -0
  454. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +23 -0
  455. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +1 -0
  456. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +9 -0
  457. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +1 -0
  458. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +3 -0
  459. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +1 -0
  460. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +3 -0
  461. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +1 -0
  462. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +79 -0
  463. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +1 -0
  464. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +6 -0
  465. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +1 -0
  466. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +3 -0
  467. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +1 -0
  468. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +3 -0
  469. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +1 -0
  470. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +5 -0
  471. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +1 -0
  472. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +3 -0
  473. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +1 -0
  474. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +3 -0
  475. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +1 -0
  476. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +67 -0
  477. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +1 -0
  478. package/lib/typescript/src/Translation/Resources/en.d.ts +109 -0
  479. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -0
  480. package/lib/typescript/src/Translation/Resources/index.d.ts +3 -0
  481. package/lib/typescript/src/Translation/Resources/index.d.ts.map +1 -0
  482. package/lib/typescript/src/Translation/Resources/tr.d.ts +112 -0
  483. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -0
  484. package/lib/typescript/src/Translation/index.d.ts +3 -0
  485. package/lib/typescript/src/Translation/index.d.ts.map +1 -0
  486. package/lib/typescript/src/Trustchex.d.ts +18 -0
  487. package/lib/typescript/src/Trustchex.d.ts.map +1 -0
  488. package/lib/typescript/src/index.d.ts +4 -0
  489. package/lib/typescript/src/index.d.ts.map +1 -0
  490. package/package.json +288 -0
  491. package/src/NativeTrustchexSDK.ts +9 -0
  492. package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +165 -0
  493. package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +205 -0
  494. package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +152 -0
  495. package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +699 -0
  496. package/src/Screens/Static/QrCodeScanningScreen.tsx +37 -0
  497. package/src/Screens/Static/ResultScreen.tsx +877 -0
  498. package/src/Screens/Static/VerificationSessionCheckScreen.tsx +524 -0
  499. package/src/Shared/Animations/face-scan.json +1 -0
  500. package/src/Shared/Animations/hole.json +76 -0
  501. package/src/Shared/Animations/hologram-scan.json +1 -0
  502. package/src/Shared/Animations/id-or-passport.json +1 -0
  503. package/src/Shared/Animations/light.json +1 -0
  504. package/src/Shared/Animations/loading.json +1 -0
  505. package/src/Shared/Animations/nfc-scan.json +1 -0
  506. package/src/Shared/Animations/nfc.json +1 -0
  507. package/src/Shared/Animations/scanning.json +1 -0
  508. package/src/Shared/Animations/success.json +1 -0
  509. package/src/Shared/Assets/trustchex-logo-black.png +0 -0
  510. package/src/Shared/Components/EIDScanner.tsx +472 -0
  511. package/src/Shared/Components/FaceCamera.tsx +267 -0
  512. package/src/Shared/Components/IdentityDocumentCamera.tsx +1377 -0
  513. package/src/Shared/Components/LanguageSelector.tsx +62 -0
  514. package/src/Shared/Components/NativeCircularProgress.tsx +76 -0
  515. package/src/Shared/Components/NativeProgressBar.tsx +74 -0
  516. package/src/Shared/Components/NavigationManager.tsx +275 -0
  517. package/src/Shared/Components/OTPCodeInput.tsx +93 -0
  518. package/src/Shared/Components/QrCodeScannerCamera.tsx +306 -0
  519. package/src/Shared/Contexts/AppContext.ts +47 -0
  520. package/src/Shared/EIDReader/abstractMRTDCardService.ts +195 -0
  521. package/src/Shared/EIDReader/accessKeySpec.ts +16 -0
  522. package/src/Shared/EIDReader/apduLevelBACCapable.ts +10 -0
  523. package/src/Shared/EIDReader/apduLevelReadBinaryCapable.ts +15 -0
  524. package/src/Shared/EIDReader/bacKey.ts +132 -0
  525. package/src/Shared/EIDReader/bacKeySpec.ts +26 -0
  526. package/src/Shared/EIDReader/cardFileInputStream.ts +188 -0
  527. package/src/Shared/EIDReader/cardService.ts +51 -0
  528. package/src/Shared/EIDReader/cbeff/biometricDataBlock.ts +5 -0
  529. package/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.ts +12 -0
  530. package/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.ts +6 -0
  531. package/src/Shared/EIDReader/cbeff/cbeffInfo.ts +100 -0
  532. package/src/Shared/EIDReader/cbeff/complexCBEFFInfo.ts +48 -0
  533. package/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.ts +17 -0
  534. package/src/Shared/EIDReader/cbeff/iso781611.ts +79 -0
  535. package/src/Shared/EIDReader/cbeff/iso781611Decoder.ts +242 -0
  536. package/src/Shared/EIDReader/cbeff/iso781611Encoder.ts +91 -0
  537. package/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.ts +26 -0
  538. package/src/Shared/EIDReader/cbeff/standardBiometricHeader.ts +116 -0
  539. package/src/Shared/EIDReader/cert/cvcPrincipal.ts +63 -0
  540. package/src/Shared/EIDReader/data/country.ts +76 -0
  541. package/src/Shared/EIDReader/data/gender.ts +36 -0
  542. package/src/Shared/EIDReader/data/isoCountry.ts +1251 -0
  543. package/src/Shared/EIDReader/data/unicodeCountry.ts +1516 -0
  544. package/src/Shared/EIDReader/defaultFileInfo.ts +41 -0
  545. package/src/Shared/EIDReader/defaultFileSystem.ts +287 -0
  546. package/src/Shared/EIDReader/eidReader.ts +113 -0
  547. package/src/Shared/EIDReader/eidService.ts +349 -0
  548. package/src/Shared/EIDReader/fileInfo.ts +5 -0
  549. package/src/Shared/EIDReader/fileSystemCardService.ts +32 -0
  550. package/src/Shared/EIDReader/fragment.ts +21 -0
  551. package/src/Shared/EIDReader/fragmentBuffer.ts +191 -0
  552. package/src/Shared/EIDReader/java/byteArrayInputStream.ts +103 -0
  553. package/src/Shared/EIDReader/java/byteArrayOutputStream.ts +67 -0
  554. package/src/Shared/EIDReader/java/dataInput.ts +16 -0
  555. package/src/Shared/EIDReader/java/dataInputStream.ts +203 -0
  556. package/src/Shared/EIDReader/java/dataOutputStream.ts +107 -0
  557. package/src/Shared/EIDReader/java/filterInputStream.ts +138 -0
  558. package/src/Shared/EIDReader/java/filterOutputStream.ts +126 -0
  559. package/src/Shared/EIDReader/java/inputStream.ts +186 -0
  560. package/src/Shared/EIDReader/java/inputStreamBuffer.ts +200 -0
  561. package/src/Shared/EIDReader/java/objectInputStream.ts +45 -0
  562. package/src/Shared/EIDReader/java/outputStream.ts +76 -0
  563. package/src/Shared/EIDReader/java/positionInputStream.ts +64 -0
  564. package/src/Shared/EIDReader/java/splittableInputStream.ts +69 -0
  565. package/src/Shared/EIDReader/lds/abstractImageInfo.ts +191 -0
  566. package/src/Shared/EIDReader/lds/abstractLDSFile.ts +106 -0
  567. package/src/Shared/EIDReader/lds/abstractLDSInfo.ts +31 -0
  568. package/src/Shared/EIDReader/lds/abstractListInfo.ts +72 -0
  569. package/src/Shared/EIDReader/lds/abstractTaggedLDSFile.ts +85 -0
  570. package/src/Shared/EIDReader/lds/cbeffDataGroup.ts +128 -0
  571. package/src/Shared/EIDReader/lds/cvcaFile.ts +112 -0
  572. package/src/Shared/EIDReader/lds/dataGroup.ts +11 -0
  573. package/src/Shared/EIDReader/lds/icao/comFile.ts +166 -0
  574. package/src/Shared/EIDReader/lds/icao/dg1File.ts +45 -0
  575. package/src/Shared/EIDReader/lds/icao/dg2File.ts +54 -0
  576. package/src/Shared/EIDReader/lds/icao/icaoCountry.ts +253 -0
  577. package/src/Shared/EIDReader/lds/icao/mrzInfo.ts +1669 -0
  578. package/src/Shared/EIDReader/lds/imageInfo.ts +58 -0
  579. package/src/Shared/EIDReader/lds/iso19794/faceImageInfo.ts +948 -0
  580. package/src/Shared/EIDReader/lds/iso19794/faceInfo.ts +198 -0
  581. package/src/Shared/EIDReader/lds/ldsElement.ts +8 -0
  582. package/src/Shared/EIDReader/lds/ldsFile.ts +14 -0
  583. package/src/Shared/EIDReader/nfcManagerCardService.ts +58 -0
  584. package/src/Shared/EIDReader/protocol/bacAPDUSender.ts +146 -0
  585. package/src/Shared/EIDReader/protocol/bacProtocol.ts +121 -0
  586. package/src/Shared/EIDReader/protocol/bacResult.ts +36 -0
  587. package/src/Shared/EIDReader/protocol/readBinaryAPDUSender.ts +251 -0
  588. package/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.ts +170 -0
  589. package/src/Shared/EIDReader/secureMessagingWrapper.ts +361 -0
  590. package/src/Shared/EIDReader/smartcards/apduEvent.ts +38 -0
  591. package/src/Shared/EIDReader/smartcards/apduListener.ts +5 -0
  592. package/src/Shared/EIDReader/smartcards/apduWrapper.ts +10 -0
  593. package/src/Shared/EIDReader/smartcards/commandAPDU.ts +172 -0
  594. package/src/Shared/EIDReader/smartcards/fileSystemStructured.ts +7 -0
  595. package/src/Shared/EIDReader/smartcards/iso7816.ts +104 -0
  596. package/src/Shared/EIDReader/smartcards/responseAPDU.ts +44 -0
  597. package/src/Shared/EIDReader/tlv/asn1Constants.ts +46 -0
  598. package/src/Shared/EIDReader/tlv/tlv.utils.ts +201 -0
  599. package/src/Shared/EIDReader/tlv/tlvInputState.ts +186 -0
  600. package/src/Shared/EIDReader/tlv/tlvInputStream.ts +207 -0
  601. package/src/Shared/EIDReader/tlv/tlvOutputState.ts +244 -0
  602. package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +112 -0
  603. package/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.ts +48 -0
  604. package/src/Shared/EIDReader/utils/crypto.utils.ts +273 -0
  605. package/src/Shared/EIDReader/utils/random.ts +198 -0
  606. package/src/Shared/EIDReader/wrappedAPDUEvent.ts +36 -0
  607. package/src/Shared/Libs/camera.utils.ts +34 -0
  608. package/src/Shared/Libs/contains.ts +59 -0
  609. package/src/Shared/Libs/crypto.utils.ts +47 -0
  610. package/src/Shared/Libs/debounce.utils.ts +38 -0
  611. package/src/Shared/Libs/deeplink.utils.ts +19 -0
  612. package/src/Shared/Libs/demo.utils.ts +82 -0
  613. package/src/Shared/Libs/http-client.ts +148 -0
  614. package/src/Shared/Libs/mrz.utils.ts +110 -0
  615. package/src/Shared/Libs/native-device-info.utils.ts +50 -0
  616. package/src/Shared/Libs/native-keep-awake.utils.ts +104 -0
  617. package/src/Shared/Libs/opencv.utils.ts +40 -0
  618. package/src/Shared/Libs/promise.utils.ts +20 -0
  619. package/src/Shared/Libs/tts.utils.ts +40 -0
  620. package/src/Shared/Types/identificationInfo.ts +62 -0
  621. package/src/Shared/Types/instruction.ts +4 -0
  622. package/src/Shared/Types/livenessIntructionType.ts +8 -0
  623. package/src/Shared/Types/verificationSession.ts +17 -0
  624. package/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.tsx +85 -0
  625. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +79 -0
  626. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +45 -0
  627. package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +64 -0
  628. package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +30 -0
  629. package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +82 -0
  630. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +195 -0
  631. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +135 -0
  632. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +84 -0
  633. package/src/Shared/VisionCameraPlugins/Cropper/index.ts +78 -0
  634. package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +63 -0
  635. package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +44 -0
  636. package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +3 -0
  637. package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +99 -0
  638. package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +76 -0
  639. package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +18 -0
  640. package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +7 -0
  641. package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +7 -0
  642. package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +27 -0
  643. package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +21 -0
  644. package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +141 -0
  645. package/src/Translation/Resources/en.ts +151 -0
  646. package/src/Translation/Resources/index.ts +2 -0
  647. package/src/Translation/Resources/tr.ts +152 -0
  648. package/src/Translation/index.ts +37 -0
  649. package/src/Trustchex.tsx +171 -0
  650. package/src/index.tsx +5 -0
@@ -0,0 +1,948 @@
1
+ import { Gender } from '../../data/gender';
2
+ import { ByteArrayOutputStream } from '../../java/byteArrayOutputStream';
3
+ import { DataInputStream } from '../../java/dataInputStream';
4
+ import { DataOutputStream } from '../../java/dataOutputStream';
5
+ import { InputStream } from '../../java/inputStream';
6
+ import { OutputStream } from '../../java/outputStream';
7
+ import { AbstractImageInfo } from '../abstractImageInfo';
8
+ import { Buffer } from 'buffer';
9
+
10
+ /**
11
+ * Feature points as described in Section 5.6.3 of ISO/IEC FCD 19794-5.
12
+ */
13
+ export class FeaturePoint {
14
+ private type: number;
15
+ private majorCode: number;
16
+ private minorCode: number;
17
+ private x: number;
18
+ private y: number;
19
+
20
+ /**
21
+ * Constructs a new feature point.
22
+ *
23
+ * @param type feature point type
24
+ * @param majorCode major code
25
+ * @param minorCode minor code
26
+ * @param x X-coordinate
27
+ * @param y Y-coordinate
28
+ */
29
+ constructor(type: number, code: number, x: number, y: number) {
30
+ this.type = type;
31
+ this.majorCode = (code & 0xf0) >> 4;
32
+ this.minorCode = code & 0x0f;
33
+ this.x = x;
34
+ this.y = y;
35
+ }
36
+
37
+ /**
38
+ * Returns the major code of this point.
39
+ *
40
+ * @return major code
41
+ */
42
+ public getMajorCode(): number {
43
+ return this.majorCode;
44
+ }
45
+
46
+ /**
47
+ * Returns the minor code of this point.
48
+ *
49
+ * @return minor code
50
+ */
51
+ public getMinorCode(): number {
52
+ return this.minorCode;
53
+ }
54
+
55
+ /**
56
+ * Returns the type of this point.
57
+ *
58
+ * @return type
59
+ */
60
+ public getType(): number {
61
+ return this.type;
62
+ }
63
+
64
+ /**
65
+ * Returns the X-coordinate of this point.
66
+ *
67
+ * @return X-coordinate
68
+ */
69
+ public getX(): number {
70
+ return this.x;
71
+ }
72
+
73
+ /**
74
+ * Returns the Y-coordinate of this point.
75
+ *
76
+ * @return Y-coordinate
77
+ */
78
+ public getY(): number {
79
+ return this.y;
80
+ }
81
+ }
82
+
83
+ // /* These correspond to values in Table 4 in 5.5.4 in ISO/IEC 19794-5:2005(E). */
84
+ // public static EYE_COLOR_UNSPECIFIED = 0x00;
85
+ // public static EYE_COLOR_BLACK = 0x01;
86
+ // public static EYE_COLOR_BLUE = 0x02;
87
+ // public static EYE_COLOR_BROWN = 0x03;
88
+ // public static EYE_COLOR_GRAY = 0x04;
89
+ // public static EYE_COLOR_GREEN = 0x05;
90
+ // public static EYE_COLOR_MULTI_COLORED = 0x06;
91
+ // public static EYE_COLOR_PINK = 0x07;
92
+ // public static EYE_COLOR_UNKNOWN = 0xFF;
93
+ /** Eye color code based on Section 5.5.4 of ISO 19794-5. */
94
+ export class EyeColor {
95
+ public static UNSPECIFIED = new EyeColor(0x00);
96
+ public static BLACK = new EyeColor(0x01);
97
+ public static BLUE = new EyeColor(0x02);
98
+ public static BROWN = new EyeColor(0x03);
99
+ public static GRAY = new EyeColor(0x04);
100
+ public static GREEN = new EyeColor(0x05);
101
+ public static MULTI_COLORED = new EyeColor(0x06);
102
+ public static PINK = new EyeColor(0x07);
103
+ public static UNKNOWN = new EyeColor(0xff);
104
+
105
+ private code: number;
106
+
107
+ /**
108
+ * Creates an eye color.
109
+ *
110
+ * @param code the ISO19794-5 integer code for the color
111
+ */
112
+ constructor(code: number) {
113
+ this.code = code;
114
+ }
115
+
116
+ /**
117
+ * Returns the integer code to use in ISO19794-5 encoding for this color.
118
+ *
119
+ * @return the integer code
120
+ */
121
+ public toInt(): number {
122
+ return this.code;
123
+ }
124
+
125
+ /**
126
+ * Returns an eye color value for the given code.
127
+ *
128
+ * @param i the integer code for a color
129
+ *
130
+ * @return the color value
131
+ */
132
+ static toEyeColor(i: number): EyeColor {
133
+ for (const c of EyeColor.values()) {
134
+ if (c.toInt() === i) {
135
+ return c;
136
+ }
137
+ }
138
+ return EyeColor.UNKNOWN;
139
+ }
140
+
141
+ static values() {
142
+ return [
143
+ EyeColor.UNSPECIFIED,
144
+ EyeColor.BLACK,
145
+ EyeColor.BLUE,
146
+ EyeColor.BROWN,
147
+ EyeColor.GRAY,
148
+ EyeColor.GREEN,
149
+ EyeColor.MULTI_COLORED,
150
+ EyeColor.PINK,
151
+ EyeColor.UNKNOWN,
152
+ ];
153
+ }
154
+ }
155
+
156
+ // public static HAIR_COLOR_UNSPECIFIED = 0x00;
157
+ // public static HAIR_COLOR_BALD = 0x01;
158
+ // public static HAIR_COLOR_BLACK = 0x02;
159
+ // public static HAIR_COLOR_BLONDE = 0x03;
160
+ // public static HAIR_COLOR_BROWN = 0x04;
161
+ // public static HAIR_COLOR_GRAY = 0x05;
162
+ // public static HAIR_COLOR_WHITE = 0x06;
163
+ // public static HAIR_COLOR_RED = 0x07;
164
+ // public static HAIR_COLOR_GREEN = 0x08;
165
+ // public static HAIR_COLOR_BLUE = 0x09;
166
+ // public static HAIR_COLOR_UNKNOWN = 0xFF;
167
+ /** Hair color code based on Section 5.5.5 of ISO 19794-5. */
168
+ export class HairColor {
169
+ public static UNSPECIFIED = new HairColor(0x00);
170
+ public static BALD = new HairColor(0x01);
171
+ public static BLACK = new HairColor(0x02);
172
+ public static BLONDE = new HairColor(0x03);
173
+ public static BROWN = new HairColor(0x04);
174
+ public static GRAY = new HairColor(0x05);
175
+ public static WHITE = new HairColor(0x06);
176
+ public static RED = new HairColor(0x07);
177
+ public static GREEN = new HairColor(0x08);
178
+ public static BLUE = new HairColor(0x09);
179
+ public static UNKNOWN = new HairColor(0xff);
180
+
181
+ private code: number;
182
+
183
+ /**
184
+ * Creates a hair color.
185
+ *
186
+ * @param code the integer code for a color
187
+ */
188
+ constructor(code: number) {
189
+ this.code = code;
190
+ }
191
+
192
+ /**
193
+ * Returns the code for this hair color.
194
+ *
195
+ * @return the code
196
+ */
197
+ public toInt(): number {
198
+ return this.code;
199
+ }
200
+
201
+ /**
202
+ * Returns a hair color value for the given code.
203
+ *
204
+ * @param i the integer code for a color
205
+ *
206
+ * @return the color value
207
+ */
208
+ static toHairColor(i: number): HairColor {
209
+ for (const c of HairColor.values()) {
210
+ if (c.toInt() === i) {
211
+ return c;
212
+ }
213
+ }
214
+
215
+ return HairColor.UNKNOWN;
216
+ }
217
+
218
+ static values() {
219
+ return [
220
+ HairColor.UNSPECIFIED,
221
+ HairColor.BALD,
222
+ HairColor.BLACK,
223
+ HairColor.BLONDE,
224
+ HairColor.BROWN,
225
+ HairColor.GRAY,
226
+ HairColor.WHITE,
227
+ HairColor.RED,
228
+ HairColor.GREEN,
229
+ HairColor.BLUE,
230
+ HairColor.UNKNOWN,
231
+ ];
232
+ }
233
+ }
234
+
235
+ /** Feature flags meaning based on Section 5.5.6 of ISO 19794-5. */
236
+ export class Features {
237
+ public static FEATURE_FEATURES_ARE_SPECIFIED_FLAG = 0x000001;
238
+ public static FEATURE_GLASSES_FLAG = 0x000002;
239
+ public static FEATURE_MOUSTACHE_FLAG = 0x000004;
240
+ public static FEATURE_BEARD_FLAG = 0x000008;
241
+ public static FEATURE_TEETH_VISIBLE_FLAG = 0x000010;
242
+ public static FEATURE_BLINK_FLAG = 0x000020;
243
+ public static FEATURE_MOUTH_OPEN_FLAG = 0x000040;
244
+ public static FEATURE_LEFT_EYE_PATCH_FLAG = 0x000080;
245
+ public static FEATURE_RIGHT_EYE_PATCH = 0x000100;
246
+ public static FEATURE_DARK_GLASSES = 0x000200;
247
+ public static FEATURE_DISTORTING_MEDICAL_CONDITION = 0x000400;
248
+ }
249
+
250
+ /** Expression code based on Section 5.5.7 of ISO 19794-5. */
251
+ export class Expression {
252
+ public static EXPRESSION_UNSPECIFIED = 0x0000;
253
+ public static EXPRESSION_NEUTRAL = 0x0001;
254
+ public static EXPRESSION_SMILE_CLOSED = 0x0002;
255
+ public static EXPRESSION_SMILE_OPEN = 0x0003;
256
+ public static EXPRESSION_RAISED_EYEBROWS = 0x0004;
257
+ public static EXPRESSION_EYES_LOOKING_AWAY = 0x0005;
258
+ public static EXPRESSION_SQUINTING = 0x0006;
259
+ public static EXPRESSION_FROWNING = 0x0007;
260
+ }
261
+
262
+ /** Face image type code based on Section 5.7.1 of ISO 19794-5. */
263
+ export class FaceImageType {
264
+ public static FACE_IMAGE_TYPE_BASIC = 0x00;
265
+ public static FACE_IMAGE_TYPE_FULL_FRONTAL = 0x01;
266
+ public static FACE_IMAGE_TYPE_TOKEN_FRONTAL = 0x02;
267
+ }
268
+
269
+ /** Image data type code based on Section 5.7.2 of ISO 19794-5. */
270
+ export class ImageDataType {
271
+ public static IMAGE_DATA_TYPE_JPEG = 0x00;
272
+ public static IMAGE_DATA_TYPE_JPEG2000 = 0x01;
273
+ }
274
+
275
+ /** Color space code based on Section 5.7.4 of ISO 19794-5. */
276
+ export class ImageColorSpace {
277
+ public static IMAGE_COLOR_SPACE_UNSPECIFIED = 0x00;
278
+ public static IMAGE_COLOR_SPACE_RGB24 = 0x01;
279
+ public static IMAGE_COLOR_SPACE_YUV422 = 0x02;
280
+ public static IMAGE_COLOR_SPACE_GRAY8 = 0x03;
281
+ public static IMAGE_COLOR_SPACE_OTHER = 0x04;
282
+ }
283
+
284
+ /** Source type based on Section 5.7.6 of ISO 19794-5. */
285
+ export class SourceType {
286
+ public static SOURCE_TYPE_UNSPECIFIED = 0x00;
287
+ public static SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE = 0x01;
288
+ public static SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM = 0x02;
289
+ public static SOURCE_TYPE_STATIC_PHOTO_SCANNER = 0x03;
290
+ public static SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE = 0x04;
291
+ public static SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM = 0x05;
292
+ public static SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM = 0x06;
293
+ public static SOURCE_TYPE_UNKNOWN = 0x07;
294
+ }
295
+
296
+ export class FaceImageInfo extends AbstractImageInfo {
297
+ /** Indexes into poseAngle array. */
298
+ private static YAW = 0;
299
+
300
+ /** Indexes into poseAngle array. */
301
+ private static PITCH = 1;
302
+
303
+ /** Indexes into poseAngle array. */
304
+ private static ROLL = 2;
305
+
306
+ private recordLength: number;
307
+ private gender: Gender;
308
+ private eyeColor: EyeColor;
309
+ private hairColor: number;
310
+ private featureMask: number;
311
+ private expression: number;
312
+ private poseAngle: number[];
313
+ private poseAngleUncertainty: number[];
314
+ private featurePoints: FeaturePoint[];
315
+ private faceImageType: number;
316
+ private imageDataType: number;
317
+ private colorSpace: number;
318
+ private sourceType: number;
319
+ private deviceType: number;
320
+ private quality: number;
321
+
322
+ /**
323
+ * Constructs a new face information data structure instance.
324
+ *
325
+ * @param gender gender
326
+ * @param eyeColor eye color
327
+ * @param featureMask feature mask (least significant 3 bytes)
328
+ * @param hairColor hair color
329
+ * @param expression expression
330
+ * @param poseAngle (encoded) pose angle
331
+ * @param poseAngleUncertainty pose angle uncertainty
332
+ * @param faceImageType face image type
333
+ * @param colorSpace color space
334
+ * @param sourceType source type
335
+ * @param deviceType capture device type (unspecified is <code>0x00</code>)
336
+ * @param quality quality
337
+ * @param featurePoints feature points
338
+ * @param width width
339
+ * @param height height
340
+ * @param imageInputStream encoded image bytes
341
+ * @param imageLength length of encoded image
342
+ * @param imageDataType either IMAGE_DATA_TYPE_JPEG or IMAGE_DATA_TYPE_JPEG2000
343
+ *
344
+ * @throws IOException on error reading input
345
+ */
346
+ constructor(
347
+ gender: Gender,
348
+ eyeColor: EyeColor,
349
+ featureMask: number,
350
+ hairColor: number,
351
+ expression: number,
352
+ poseAngle: number[],
353
+ poseAngleUncertainty: number[],
354
+ faceImageType: number,
355
+ colorSpace: number,
356
+ sourceType: number,
357
+ deviceType: number,
358
+ quality: number,
359
+ featurePoints: FeaturePoint[],
360
+ width: number,
361
+ height: number,
362
+ imageInputStream: InputStream,
363
+ imageLength: number,
364
+ imageDataType: number
365
+ ) {
366
+ super(
367
+ FaceImageInfo.TYPE_PORTRAIT,
368
+ width,
369
+ height,
370
+ imageInputStream,
371
+ imageLength,
372
+ FaceImageInfo.toMimeType(imageDataType) || 'image/jpeg'
373
+ );
374
+ if (imageInputStream == null) {
375
+ throw new Error('Null image');
376
+ }
377
+ this.gender = gender == null ? Gender.UNSPECIFIED : gender;
378
+ this.eyeColor = eyeColor == null ? EyeColor.UNSPECIFIED : eyeColor;
379
+ this.featureMask = featureMask;
380
+ this.hairColor = hairColor;
381
+ this.expression = expression;
382
+ this.colorSpace = colorSpace;
383
+ this.sourceType = sourceType;
384
+ this.deviceType = deviceType;
385
+ const featurePointCount = featurePoints == null ? 0 : featurePoints.length;
386
+ this.featurePoints = new Array<FeaturePoint>(featurePointCount);
387
+ if (featurePointCount > 0) {
388
+ this.featurePoints = featurePoints.slice();
389
+ }
390
+ this.poseAngle = poseAngle.slice();
391
+ this.poseAngleUncertainty = poseAngleUncertainty.slice();
392
+ this.imageDataType = imageDataType;
393
+ this.recordLength = 20 + 8 * featurePointCount + 12 + imageLength;
394
+
395
+ this.faceImageType = faceImageType;
396
+ this.colorSpace = colorSpace;
397
+ this.sourceType = sourceType;
398
+ this.deviceType = deviceType;
399
+ this.quality = quality;
400
+ }
401
+
402
+ // /**
403
+ // * Constructs a new face information structure from binary encoding.
404
+ // *
405
+ // * @param inputStream an input stream
406
+ // *
407
+ // * @throws IOException if input cannot be read
408
+ // */
409
+ // public FaceImageInfo(InputStream inputStream) {
410
+ // super(TYPE_PORTRAIT);
411
+ // readObject(inputStream);
412
+ protected async readObject(inputStream: InputStream): Promise<void> {
413
+ const dataIn =
414
+ inputStream instanceof DataInputStream
415
+ ? inputStream
416
+ : new DataInputStream(inputStream);
417
+
418
+ /* Facial Information Block (20), see ISO 19794-5 5.5 */
419
+ this.recordLength = (await dataIn.readInt()) & 0xffffffff; /* 4 */
420
+ const featurePointCount = await dataIn.readUnsignedShort(); /* +2 = 6 */
421
+ this.gender = Gender.toGender(await dataIn.readUnsignedByte()); /* +1 = 7 */
422
+ this.eyeColor = EyeColor.toEyeColor(
423
+ await dataIn.readUnsignedByte()
424
+ ); /* +1 = 8 */
425
+ this.hairColor = await dataIn.readUnsignedByte(); /* +1 = 9 */
426
+ this.featureMask = await dataIn.readUnsignedByte(); /* +1 = 10 */
427
+ this.featureMask =
428
+ (this.featureMask << 16) |
429
+ (await dataIn.readUnsignedShort()); /* +2 = 12 */
430
+ this.expression = await dataIn.readShort(); /* +2 = 14 */
431
+ this.poseAngle = new Array(3);
432
+ let by = await dataIn.readUnsignedByte(); /* +1 = 15 */
433
+ this.poseAngle[FaceImageInfo.YAW] = by;
434
+ let bp = await dataIn.readUnsignedByte(); /* +1 = 16 */
435
+ this.poseAngle[FaceImageInfo.PITCH] = bp;
436
+ let br = await dataIn.readUnsignedByte(); /* +1 = 17 */
437
+ this.poseAngle[FaceImageInfo.ROLL] = br;
438
+ this.poseAngleUncertainty = new Array(3);
439
+ this.poseAngleUncertainty[FaceImageInfo.YAW] =
440
+ await dataIn.readUnsignedByte(); /* +1 = 18 */
441
+ this.poseAngleUncertainty[FaceImageInfo.PITCH] =
442
+ await dataIn.readUnsignedByte(); /* +1 = 19 */
443
+ this.poseAngleUncertainty[FaceImageInfo.ROLL] =
444
+ await dataIn.readUnsignedByte(); /* +1 = 20 */
445
+
446
+ /* Feature Point(s) (optional) (8 * featurePointCount), see ISO 19794-5 5.8 */
447
+ this.featurePoints = new Array(featurePointCount);
448
+ for (let i = 0; i < featurePointCount; i++) {
449
+ const featureType = await dataIn.readUnsignedByte(); /* 1 */
450
+ const featurePoint = await dataIn.readByte(); /* +1 = 2 */
451
+ const x = await dataIn.readUnsignedShort(); /* +2 = 4 */
452
+ const y = await dataIn.readUnsignedShort(); /* +2 = 6 */
453
+ let skippedBytes = 0;
454
+ while (skippedBytes < 2) {
455
+ skippedBytes += await dataIn.skip(2);
456
+ } /* +2 = 8, NOTE: 2 bytes reserved */
457
+ this.featurePoints[i] = new FeaturePoint(featureType, featurePoint, x, y);
458
+ }
459
+
460
+ /* Image Information */
461
+ this.faceImageType = await dataIn.readUnsignedByte(); /* 1 */
462
+ this.imageDataType = await dataIn.readUnsignedByte(); /* +1 = 2 */
463
+ this.setWidth(await dataIn.readUnsignedShort()); /* +2 = 4 */
464
+ this.setHeight(await dataIn.readUnsignedShort()); /* +2 = 6 */
465
+ this.colorSpace = await dataIn.readUnsignedByte(); /* +1 = 7 */
466
+ this.sourceType = await dataIn.readUnsignedByte(); /* +1 = 8 */
467
+ this.deviceType = await dataIn.readUnsignedShort(); /* +2 = 10 */
468
+ this.quality = await dataIn.readUnsignedShort(); /* +2 = 12 */
469
+
470
+ /* Temporarily fix width and height if 0. */
471
+ if (this.getWidth() <= 0) {
472
+ this.setWidth(800);
473
+ }
474
+ if (this.getHeight() <= 0) {
475
+ this.setHeight(600);
476
+ }
477
+
478
+ /*
479
+ * Read image data, image data type code based on Section 5.8.1
480
+ * ISO 19794-5.
481
+ */
482
+ this.setMimeType(
483
+ FaceImageInfo.toMimeType(this.imageDataType) || 'image/jpeg'
484
+ );
485
+ const imageLength = this.recordLength - 20 - 8 * featurePointCount - 12;
486
+
487
+ await this.readImage(inputStream, imageLength);
488
+ }
489
+
490
+ /**
491
+ * Writes this face image info to output stream.
492
+ *
493
+ * @param outputStream an output stream
494
+ *
495
+ * @throws IOException if writing fails
496
+ */
497
+ public writeObject(outputStream: OutputStream): void {
498
+ const recordOut = new ByteArrayOutputStream();
499
+ this.writeFacialRecordData(recordOut);
500
+ const facialRecordData = recordOut.toByteArray();
501
+ const faceImageBlockLength = facialRecordData.length + 4;
502
+ const dataOut = new DataOutputStream(outputStream);
503
+ dataOut.write(faceImageBlockLength);
504
+ dataOut.writeUTF(Buffer.from(facialRecordData).toString('utf-8'));
505
+ dataOut.flush();
506
+ }
507
+
508
+ /**
509
+ * Returns the record length.
510
+ *
511
+ * @return the record length
512
+ */
513
+ public getRecordLength(): number {
514
+ /* Should be equal to (20 + 8 * featurePoints.length + 12 + getImageLength()). */
515
+ return this.recordLength;
516
+ }
517
+
518
+ /**
519
+ * Returns the available feature points of this face.
520
+ *
521
+ * @return feature points
522
+ */
523
+ public getFeaturePoints(): FeaturePoint[] {
524
+ return this.featurePoints;
525
+ }
526
+
527
+ /**
528
+ * Returns the expression
529
+ * (neutral, smiling, eyebrow raised, etc).
530
+ *
531
+ * @return expression
532
+ */
533
+ public getExpression(): number {
534
+ return this.expression;
535
+ }
536
+
537
+ /**
538
+ * Returns the eye color
539
+ * (black, blue, brown, etc).
540
+ *
541
+ * @return eye color
542
+ */
543
+ public getEyeColor(): EyeColor {
544
+ return this.eyeColor;
545
+ }
546
+
547
+ /**
548
+ * Returns the gender
549
+ * (male, female, etc).
550
+ *
551
+ * @return gender
552
+ */
553
+ public getGender(): Gender {
554
+ return this.gender;
555
+ }
556
+
557
+ /**
558
+ * Returns the hair color
559
+ * (bald, black, blonde, etc).
560
+ *
561
+ * @return hair color
562
+ */
563
+ public getHairColor(): number {
564
+ return this.hairColor;
565
+ }
566
+
567
+ /**
568
+ * Returns the face image type
569
+ * (full frontal, token frontal, etc).
570
+ *
571
+ * @return face image type
572
+ */
573
+ public getFaceImageType(): number {
574
+ return this.faceImageType;
575
+ }
576
+
577
+ /**
578
+ * Returns the feature mask.
579
+ *
580
+ * @return feature mask
581
+ */
582
+ public getFeatureMask(): number {
583
+ return this.featureMask;
584
+ }
585
+
586
+ /**
587
+ * Returns the quality as unsigned integer.
588
+ *
589
+ * @return quality
590
+ */
591
+ public getQuality(): number {
592
+ return this.quality;
593
+ }
594
+
595
+ /**
596
+ * Returns the source type
597
+ * (camera, scanner, etc).
598
+ *
599
+ * @return source type
600
+ */
601
+ public getSourceType(): number {
602
+ return this.sourceType;
603
+ }
604
+
605
+ /**
606
+ * Returns the image data type.
607
+ *
608
+ * @return image data type
609
+ */
610
+ public getImageDataType(): number {
611
+ return this.imageDataType;
612
+ }
613
+
614
+ /**
615
+ * Returns the image color space
616
+ * (rgb, grayscale, etc).
617
+ *
618
+ * @return image color space
619
+ */
620
+ public getColorSpace(): number {
621
+ return this.colorSpace;
622
+ }
623
+
624
+ /**
625
+ * Returns the device type.
626
+ *
627
+ * @return device type
628
+ */
629
+ public getDeviceType(): number {
630
+ return this.deviceType;
631
+ }
632
+
633
+ /**
634
+ * Returns the pose angle as an integer array of length 3,
635
+ * containing yaw, pitch, and roll angle in encoded form.
636
+ *
637
+ * @return an integer array of length 3
638
+ */
639
+ public getPoseAngle(): number[] {
640
+ const result: number[] = [];
641
+ result.push(...this.poseAngle);
642
+ return result;
643
+ }
644
+
645
+ /**
646
+ * Returns the pose angle uncertainty as an integer array of length 3,
647
+ * containing yaw, pitch, and roll angle uncertainty.
648
+ *
649
+ * @return an integer array of length 3
650
+ */
651
+ public getPoseAngleUncertainty(): number[] {
652
+ const result: number[] = [];
653
+ result.push(...this.poseAngleUncertainty);
654
+ return result;
655
+ }
656
+
657
+ /**
658
+ * Writes the record data to a stream.
659
+ *
660
+ * @param outputStream the stream to write to
661
+ *
662
+ * @throws IOException on error
663
+ */
664
+ private async writeFacialRecordData(
665
+ outputStream: OutputStream
666
+ ): Promise<void> {
667
+ const dataOut = new DataOutputStream(outputStream);
668
+
669
+ /* Facial Information (16) */
670
+ dataOut.write(this.featurePoints.length); /* 2 */
671
+ dataOut.write(
672
+ this.gender == null ? Gender.UNSPECIFIED.getCode() : this.gender.getCode()
673
+ ); /* 1 */
674
+ dataOut.write(
675
+ this.eyeColor == null
676
+ ? EyeColor.UNSPECIFIED.toInt()
677
+ : this.eyeColor.toInt()
678
+ ); /* 1 */
679
+ dataOut.write(this.hairColor); /* 1 */
680
+ dataOut.write((this.featureMask & 0xff0000) >> 16); /* 1 */
681
+ dataOut.write((this.featureMask & 0x00ff00) >> 8); /* 1 */
682
+ dataOut.write(this.featureMask & 0x0000ff); /* 1 */
683
+ dataOut.write(this.expression); /* 2 */
684
+ for (let i = 0; i < 3; i++) {
685
+ /* 3 */
686
+ const b = this.poseAngle[i];
687
+ dataOut.write(b);
688
+ }
689
+ for (let i = 0; i < 3; i++) {
690
+ /* 3 */
691
+ dataOut.write(this.poseAngleUncertainty[i]);
692
+ }
693
+
694
+ /* Feature Point(s) (optional) (8 * featurePointCount) */
695
+ for (const fp of this.featurePoints) {
696
+ dataOut.write(fp.getType());
697
+ dataOut.write((fp.getMajorCode() << 4) | fp.getMinorCode());
698
+ dataOut.write(fp.getX());
699
+ dataOut.write(fp.getY());
700
+ dataOut.write(0x00); /* 2 bytes RFU */
701
+ }
702
+
703
+ /* Image Information (12) */
704
+ dataOut.write(this.faceImageType); /* 1 */
705
+ dataOut.write(this.imageDataType); /* 1 */
706
+ dataOut.write(this.getWidth()); /* 2 */
707
+ dataOut.write(this.getHeight()); /* 2 */
708
+ dataOut.write(this.colorSpace); /* 1 */
709
+ dataOut.write(this.sourceType); /* 1 */
710
+ dataOut.write(this.deviceType); /* 2 */
711
+ dataOut.write(this.quality); /* 2 */
712
+
713
+ /*
714
+ * Image data type code based on Section 5.8.1
715
+ * ISO 19794-5
716
+ */
717
+ await this.writeImage(dataOut);
718
+ dataOut.flush();
719
+ dataOut.close();
720
+ }
721
+
722
+ /**
723
+ * Converts a hair color value to a human readable string.
724
+ *
725
+ * @return a human readable string for the current hair color value
726
+ */
727
+ private hairColorToString(): string {
728
+ switch (this.hairColor) {
729
+ case HairColor.UNSPECIFIED.toInt():
730
+ return 'unspecified';
731
+ case HairColor.BALD.toInt():
732
+ return 'bald';
733
+ case HairColor.BLACK.toInt():
734
+ return 'black';
735
+ case HairColor.BLONDE.toInt():
736
+ return 'blonde';
737
+ case HairColor.BROWN.toInt():
738
+ return 'brown';
739
+ case HairColor.GRAY.toInt():
740
+ return 'gray';
741
+ case HairColor.WHITE.toInt():
742
+ return 'white';
743
+ case HairColor.RED.toInt():
744
+ return 'red';
745
+ case HairColor.GREEN.toInt():
746
+ return 'green';
747
+ case HairColor.BLUE.toInt():
748
+ return 'blue';
749
+ default:
750
+ return 'unknown';
751
+ }
752
+ }
753
+
754
+ /**
755
+ * Returns a human readable string for the current feature mask.
756
+ *
757
+ * @return a human readable string
758
+ */
759
+ private featureMaskToString(): string {
760
+ if (
761
+ (this.featureMask & Features.FEATURE_FEATURES_ARE_SPECIFIED_FLAG) ===
762
+ 0
763
+ ) {
764
+ return '';
765
+ }
766
+ const features: string[] = [];
767
+ if ((this.featureMask & Features.FEATURE_GLASSES_FLAG) !== 0) {
768
+ features.push('glasses');
769
+ }
770
+ if ((this.featureMask & Features.FEATURE_MOUSTACHE_FLAG) !== 0) {
771
+ features.push('moustache');
772
+ }
773
+ if ((this.featureMask & Features.FEATURE_BEARD_FLAG) !== 0) {
774
+ features.push('beard');
775
+ }
776
+ if ((this.featureMask & Features.FEATURE_TEETH_VISIBLE_FLAG) !== 0) {
777
+ features.push('teeth visible');
778
+ }
779
+ if ((this.featureMask & Features.FEATURE_BLINK_FLAG) !== 0) {
780
+ features.push('blink');
781
+ }
782
+ if ((this.featureMask & Features.FEATURE_MOUTH_OPEN_FLAG) !== 0) {
783
+ features.push('mouth open');
784
+ }
785
+ if ((this.featureMask & Features.FEATURE_LEFT_EYE_PATCH_FLAG) !== 0) {
786
+ features.push('left eye patch');
787
+ }
788
+ if ((this.featureMask & Features.FEATURE_RIGHT_EYE_PATCH) !== 0) {
789
+ features.push('right eye patch');
790
+ }
791
+ if ((this.featureMask & Features.FEATURE_DARK_GLASSES) !== 0) {
792
+ features.push('dark glasses');
793
+ }
794
+ if (
795
+ (this.featureMask & Features.FEATURE_DISTORTING_MEDICAL_CONDITION) !==
796
+ 0
797
+ ) {
798
+ features.push(
799
+ 'distorting medical condition (which could impact feature point detection)'
800
+ );
801
+ }
802
+ return features.join(', ');
803
+ }
804
+
805
+ /**
806
+ * Converts the current expression to a human readable string.
807
+ *
808
+ * @return a human readable string
809
+ */
810
+ private expressionToString(): string {
811
+ switch (this.expression) {
812
+ case Expression.EXPRESSION_UNSPECIFIED:
813
+ return 'unspecified';
814
+ case Expression.EXPRESSION_NEUTRAL:
815
+ return 'neutral (non-smiling) with both eyes open and mouth closed';
816
+ case Expression.EXPRESSION_SMILE_CLOSED:
817
+ return 'a smile where the inside of the mouth and/or teeth is not exposed (closed jaw)';
818
+ case Expression.EXPRESSION_SMILE_OPEN:
819
+ return 'a smile where the inside of the mouth and/or teeth is exposed';
820
+ case Expression.EXPRESSION_RAISED_EYEBROWS:
821
+ return 'raised eyebrows';
822
+ case Expression.EXPRESSION_EYES_LOOKING_AWAY:
823
+ return 'eyes looking away from the camera';
824
+ case Expression.EXPRESSION_SQUINTING:
825
+ return 'squinting';
826
+ case Expression.EXPRESSION_FROWNING:
827
+ return 'frowning';
828
+ default:
829
+ return 'unknown';
830
+ }
831
+ }
832
+
833
+ /**
834
+ * Converts the current pose angle to a human readable string.
835
+ *
836
+ * @return a human readable string
837
+ */
838
+ private poseAngleToString(): string {
839
+ let out: string = '(';
840
+ out += 'y: ' + this.poseAngle[FaceImageInfo.YAW];
841
+ if (this.poseAngleUncertainty[FaceImageInfo.YAW] !== 0) {
842
+ out += ' (' + this.poseAngleUncertainty[FaceImageInfo.YAW] + ')';
843
+ }
844
+ out += ', ';
845
+ out += 'p:' + this.poseAngle[FaceImageInfo.PITCH];
846
+ if (this.poseAngleUncertainty[FaceImageInfo.PITCH] !== 0) {
847
+ out += ' (' + this.poseAngleUncertainty[FaceImageInfo.PITCH] + ')';
848
+ }
849
+ out += ', ';
850
+ out += 'r: ' + this.poseAngle[FaceImageInfo.ROLL];
851
+ if (this.poseAngleUncertainty[FaceImageInfo.ROLL] !== 0) {
852
+ out += ' (' + this.poseAngleUncertainty[FaceImageInfo.ROLL] + ')';
853
+ }
854
+ out += ')';
855
+ return out;
856
+ }
857
+
858
+ /**
859
+ * Returns a textual representation of the face image type
860
+ * ({@code "basic"}, {@code "full frontal"}, {@code "token frontal"},
861
+ * or {@code "unknown"}).
862
+ *
863
+ * @return a textual representation of the face image type
864
+ */
865
+ private faceImageTypeToString(): string {
866
+ switch (this.faceImageType) {
867
+ case FaceImageType.FACE_IMAGE_TYPE_BASIC:
868
+ return 'basic';
869
+ case FaceImageType.FACE_IMAGE_TYPE_FULL_FRONTAL:
870
+ return 'full frontal';
871
+ case FaceImageType.FACE_IMAGE_TYPE_TOKEN_FRONTAL:
872
+ return 'token frontal';
873
+ default:
874
+ return 'unknown';
875
+ }
876
+ }
877
+
878
+ /**
879
+ * Returns a textual representation of the source type.
880
+ *
881
+ * @return a textual representation of the source type
882
+ */
883
+ private sourceTypeToString(): string {
884
+ switch (this.sourceType) {
885
+ case SourceType.SOURCE_TYPE_UNSPECIFIED:
886
+ return 'unspecified';
887
+ case SourceType.SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE:
888
+ return 'static photograph from an unknown source';
889
+ case SourceType.SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM:
890
+ return 'static photograph from a digital still-image camera';
891
+ case SourceType.SOURCE_TYPE_STATIC_PHOTO_SCANNER:
892
+ return 'static photograph from a scanner';
893
+ case SourceType.SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE:
894
+ return 'single video frame from an unknown source';
895
+ case SourceType.SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM:
896
+ return 'single video frame from an analogue camera';
897
+ case SourceType.SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM:
898
+ return 'single video frame from a digital camera';
899
+ default:
900
+ return 'unknown';
901
+ }
902
+ }
903
+
904
+ /**
905
+ * Returns a mime-type string for the compression algorithm code.
906
+ *
907
+ * @param compressionAlg the compression algorithm code as it occurs in the header
908
+ *
909
+ * @return a mime-type string,
910
+ * typically {@code JPEG_MIME_TYPE} or {@code JPEG2000_MIME_TYPE}
911
+ */
912
+ private static toMimeType(compressionAlg: number) {
913
+ switch (compressionAlg) {
914
+ case ImageDataType.IMAGE_DATA_TYPE_JPEG:
915
+ return FaceImageInfo.JPEG_MIME_TYPE;
916
+ case ImageDataType.IMAGE_DATA_TYPE_JPEG2000:
917
+ return FaceImageInfo.JPEG2000_MIME_TYPE;
918
+ default:
919
+ console.debug('Unknown image type: ' + compressionAlg);
920
+ return null;
921
+ }
922
+ }
923
+
924
+ public static async from(inputStream: InputStream): Promise<FaceImageInfo> {
925
+ const faceImageInfo = new FaceImageInfo(
926
+ Gender.UNSPECIFIED,
927
+ EyeColor.UNSPECIFIED,
928
+ 0,
929
+ 0,
930
+ 0,
931
+ [0, 0, 0],
932
+ [0, 0, 0],
933
+ 0,
934
+ 0,
935
+ 0,
936
+ 0,
937
+ 0,
938
+ [],
939
+ 0,
940
+ 0,
941
+ inputStream,
942
+ 0,
943
+ 0
944
+ );
945
+ await faceImageInfo.readObject(inputStream);
946
+ return faceImageInfo;
947
+ }
948
+ }