@therealitycrafters/react-native-evskit 0.0.0-stage → 0.1.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 (117) hide show
  1. package/README.md +151 -2
  2. package/android/build.gradle +46 -0
  3. package/android/src/main/java/expo/modules/evskit/EvsKitModule.kt +380 -0
  4. package/build/EvsKit.types.d.ts +76 -0
  5. package/build/EvsKit.types.d.ts.map +1 -0
  6. package/build/EvsKit.types.js +10 -0
  7. package/build/EvsKit.types.js.map +1 -0
  8. package/build/EvsKitModule.d.ts +43 -0
  9. package/build/EvsKitModule.d.ts.map +1 -0
  10. package/build/EvsKitModule.js +3 -0
  11. package/build/EvsKitModule.js.map +1 -0
  12. package/build/index.d.ts +118 -0
  13. package/build/index.d.ts.map +1 -0
  14. package/build/index.js +146 -0
  15. package/build/index.js.map +1 -0
  16. package/expo-module.config.json +9 -0
  17. package/ios/EvsKit.xcframework/Info.plist +44 -0
  18. package/ios/EvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  19. package/ios/EvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  20. package/ios/EvsKit.xcframework/_CodeSignature/CodeResources +945 -0
  21. package/ios/EvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
  22. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Assets.car +0 -0
  23. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/BitTableViewCell.nib +0 -0
  24. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
  25. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsKit +0 -0
  26. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
  27. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
  28. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit-Swift.h +390 -0
  29. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit.h +19 -0
  30. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Info.plist +0 -0
  31. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.abi.json +13039 -0
  32. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.private.swiftinterface +239 -0
  33. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  34. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftinterface +239 -0
  35. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/module.modulemap +11 -0
  36. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemInfoViewCell.nib +0 -0
  37. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
  38. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
  39. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
  40. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
  41. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
  42. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
  43. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
  44. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
  45. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
  46. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
  47. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
  48. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
  49. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
  50. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
  51. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
  52. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
  53. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/evs_logo_green.png +0 -0
  54. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
  55. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/ota_info.json +17 -0
  56. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
  57. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota_background_big.png +0 -0
  58. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Assets.car +0 -0
  59. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/BitTableViewCell.nib +0 -0
  60. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
  61. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsKit +0 -0
  62. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
  63. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
  64. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit-Swift.h +776 -0
  65. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit.h +19 -0
  66. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Info.plist +0 -0
  67. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.abi.json +13039 -0
  68. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +239 -0
  69. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  70. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +239 -0
  71. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +13039 -0
  72. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +239 -0
  73. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  74. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +239 -0
  75. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/module.modulemap +11 -0
  76. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemInfoViewCell.nib +0 -0
  77. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
  78. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
  79. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
  80. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
  81. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
  82. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
  83. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
  84. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
  85. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
  86. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
  87. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
  88. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
  89. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
  90. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/_CodeSignature/CodeResources +542 -0
  91. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
  92. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
  93. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
  94. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/evs_logo_green.png +0 -0
  95. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
  96. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/ota_info.json +17 -0
  97. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
  98. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota_background_big.png +0 -0
  99. package/ios/EvsKitModule.swift +321 -0
  100. package/ios/NativeEvsKit.xcframework/Info.plist +44 -0
  101. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  102. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  103. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeResources +186 -0
  104. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
  105. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
  106. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Info.plist +35 -0
  107. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Modules/module.modulemap +8 -0
  108. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/NativeEvsKit +0 -0
  109. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
  110. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Info.plist +31 -0
  111. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Modules/module.modulemap +8 -0
  112. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/NativeEvsKit +0 -0
  113. package/ios/RNEvsKit.podspec +27 -0
  114. package/package.json +50 -4
  115. package/src/EvsKit.types.ts +122 -0
  116. package/src/EvsKitModule.ts +65 -0
  117. package/src/index.ts +172 -0
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleExecutable</key>
6
+ <string>NativeEvsKit</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>UIKit.NativeEvsKit</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundleName</key>
12
+ <string>NativeEvsKit</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>FMWK</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSupportedPlatforms</key>
18
+ <array>
19
+ <string>iPhoneSimulator</string>
20
+ </array>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ <key>MinimumOSVersion</key>
24
+ <string>14.0</string>
25
+ <key>UIDeviceFamily</key>
26
+ <array>
27
+ <integer>1</integer>
28
+ <integer>2</integer>
29
+ </array>
30
+ </dict>
31
+ </plist>
@@ -0,0 +1,8 @@
1
+ framework module "NativeEvsKit" {
2
+ umbrella header "NativeEvsKit.h"
3
+
4
+ export *
5
+ module * { export * }
6
+
7
+ use Foundation
8
+ }
@@ -0,0 +1,27 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'RNEvsKit'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.author = ''
10
+ s.homepage = 'https://github.com/patcat/react-native-evskit'
11
+ s.platforms = { ios: '15.1' }
12
+ s.source = { git: '' }
13
+ s.static_framework = true
14
+
15
+ s.dependency 'ExpoModulesCore'
16
+
17
+ # The Everysight SDK ships as prebuilt xcframeworks (EvsKit + NativeEvsKit)
18
+ # published on GitHub releases — there is no CocoaPods distribution and
19
+ # CocoaPods targets cannot consume Swift Package Manager packages. So we
20
+ # vendor the SDK xcframeworks here and link them through CocoaPods.
21
+ #
22
+ # The pod also compiles EvsKitModule.swift itself, which is what Expo's
23
+ # autolinking (ExpoModulesProvider.swift) expects: it does
24
+ # `import RNEvsKit` and references the module class directly.
25
+ s.source_files = ['*.swift']
26
+ s.vendored_frameworks = ['EvsKit.xcframework', 'NativeEvsKit.xcframework']
27
+ end
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@therealitycrafters/react-native-evskit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "React Native / Expo bridge for Everysight's Maverick SDK (EvsKit + NativeEvsKit)",
5
+ "author": "Patrick Catanzariti",
6
+ "homepage": "https://therealitycrafters.com",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/patcat/react-native-evskit.git"
11
+ },
12
+ "main": "build/index.js",
13
+ "types": "build/index.d.ts",
14
+ "source": "src/index.ts",
15
+ "files": [
16
+ "build",
17
+ "src",
18
+ "android",
19
+ "ios",
20
+ "expo-module.config.json"
21
+ ],
22
+ "scripts": {
23
+ "build": "expo-module build",
24
+ "clean": "expo-module clean",
25
+ "lint": "expo-module lint",
26
+ "prepare": "expo-module prepare",
27
+ "prepublishOnly": "expo-module prepublishOnly"
28
+ },
29
+ "keywords": [
30
+ "react-native",
31
+ "expo",
32
+ "everysight",
33
+ "maverick",
34
+ "evskit",
35
+ "smart-glasses"
36
+ ],
37
+ "peerDependencies": {
38
+ "expo": ">=57.0.0",
39
+ "react": ">=19.2.0",
40
+ "react-native": ">=0.86.0"
41
+ },
42
+ "dependencies": {
43
+ "@expo/config-plugins": "^8.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/react": "~19.2.18",
47
+ "expo": "~57.0.26",
48
+ "expo-module-scripts": "^4.0.0",
49
+ "react": "19.2.3",
50
+ "react-native": "0.86.3"
51
+ }
52
+ }
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Type definitions mirroring Everysight's Maverick SDK interfaces
3
+ * (IEvsCommunicationService, IEvsGlassesStateService, IEvsDisplayService,
4
+ * IEvsSensorsService, IEvsAuthService).
5
+ *
6
+ * Signatures confirmed against the everysight-maverick/samples repo (v2.6.1)
7
+ * and the MCP API reference.
8
+ */
9
+
10
+ // ---------------------------------------------------------------------------
11
+ // Communication (IEvsCommunicationService)
12
+ // ---------------------------------------------------------------------------
13
+
14
+ export interface EvsDeviceInfo {
15
+ /** Bluetooth device address/id, e.g. from a BLE scan (EV0080 style name). */
16
+ deviceId: string;
17
+ /** Bluetooth device name. */
18
+ name: string;
19
+ }
20
+
21
+ export type EvsConnectionState =
22
+ "disconnected" | "connecting" | "connected" | "authenticating" | "error";
23
+
24
+ // ---------------------------------------------------------------------------
25
+ // Glasses (IEvsGlassesStateService)
26
+ // ---------------------------------------------------------------------------
27
+
28
+ export interface EvsGlassesInfo {
29
+ /** Battery percentage 0-100 from IEvsGlassesStateService.batteryPercentage(). */
30
+ batteryLevel: number;
31
+ /** Battery level category (Unknown/Critical/Low/Medium/High) from batteryLevel(). */
32
+ batteryStatus: string;
33
+ /** Estimated remaining operation time in minutes. */
34
+ estimatedRemainingTime: number;
35
+ /** Firmware version number (Int from fwVersion()). */
36
+ firmwareVersion: number;
37
+ }
38
+
39
+ export type TouchDirection = "backward" | "forward" | "tap" | "longTap";
40
+
41
+ export type ProximityEvent = "onFace" | "offFace";
42
+
43
+ // ---------------------------------------------------------------------------
44
+ // Display (IEvsDisplayService)
45
+ // ---------------------------------------------------------------------------
46
+
47
+ export interface EvsAutoBrightnessOptions {
48
+ enabled: boolean;
49
+ }
50
+
51
+ // ---------------------------------------------------------------------------
52
+ // Sensors (IEvsSensorsService)
53
+ // ---------------------------------------------------------------------------
54
+
55
+ export type CalibrationStatus = "calibrated" | "inProgress" | "required";
56
+
57
+ /** Currently only rate0 and rate1 are operational per the SDK docs; the rest are experimental. */
58
+ export type SensorRate = "rate0" | "rate1" | "rate2" | "rate3";
59
+
60
+ export interface EvsYprData {
61
+ yaw: number;
62
+ pitch: number;
63
+ roll: number;
64
+ }
65
+
66
+ export interface EvsQuaternionData {
67
+ w: number;
68
+ x: number;
69
+ y: number;
70
+ z: number;
71
+ }
72
+
73
+ export interface EvsVector3 {
74
+ x: number;
75
+ y: number;
76
+ z: number;
77
+ }
78
+
79
+ export interface EvsSensorSample<T> {
80
+ timestampMs: number;
81
+ data: T;
82
+ }
83
+
84
+ export interface EvsYprSample extends EvsSensorSample<EvsYprData> {
85
+ calibrationStatus: CalibrationStatus;
86
+ }
87
+
88
+ export interface EvsQuaternionSample extends EvsSensorSample<EvsQuaternionData> {
89
+ calibrationStatus: CalibrationStatus;
90
+ }
91
+
92
+ // ---------------------------------------------------------------------------
93
+ // Stock UI (Evs.instance().showUI(...))
94
+ // ---------------------------------------------------------------------------
95
+
96
+ export type EvsStockUIScreen = "configure" | "adjust" | "calibrate";
97
+
98
+ // ---------------------------------------------------------------------------
99
+ // Auth (IEvsAuthService) / lifecycle events (IEvsAppEvents)
100
+ // ---------------------------------------------------------------------------
101
+
102
+ export interface EvsBeginAuthEvent {
103
+ serial: string;
104
+ fwVersion: number;
105
+ }
106
+
107
+ // ---------------------------------------------------------------------------
108
+ // Native event map — every event the native module can emit to JS via
109
+ // EventEmitter. Keep this in sync with EvsKitModule.kt / EvsKitModule.swift.
110
+ // ---------------------------------------------------------------------------
111
+
112
+ export type EvsKitEvents = {
113
+ onConnectionStateChanged: (state: EvsConnectionState) => void;
114
+ onBeginAuth: (event: EvsBeginAuthEvent) => void;
115
+ onGlassesInfoChanged: (info: EvsGlassesInfo) => void;
116
+ onTouch: (direction: TouchDirection) => void;
117
+ onProximity: (event: ProximityEvent) => void;
118
+ onAmbient: (lux: number) => void;
119
+ onYpr: (sample: EvsYprSample) => void;
120
+ onQuaternion: (sample: EvsQuaternionSample) => void;
121
+ onError: (message: string) => void;
122
+ };
@@ -0,0 +1,65 @@
1
+ import { NativeModule, requireNativeModule } from "expo-modules-core";
2
+
3
+ import type {
4
+ EvsAutoBrightnessOptions,
5
+ EvsDeviceInfo,
6
+ EvsGlassesInfo,
7
+ EvsKitEvents,
8
+ EvsStockUIScreen,
9
+ } from "./EvsKit.types";
10
+
11
+ /**
12
+ * Raw native surface. This intentionally mirrors the SDK's service methods
13
+ * 1:1 (comm/glasses/display/sensors/auth) rather than inventing a different
14
+ * shape, so the JS API stays easy to cross-reference against the Maverick
15
+ * docs. Prefer using the higher-level classes exported from `src/index.ts`
16
+ * over calling this module directly.
17
+ */
18
+ declare class EvsKitNativeModule extends NativeModule<EvsKitEvents> {
19
+ // --- Lifecycle -----------------------------------------------------------
20
+ /** Evs.init(context).start() on Android / Evs.instance().start() on iOS. */
21
+ start(): Promise<void>;
22
+ isStarted(): Promise<boolean>;
23
+
24
+ // --- Stock UI --------------------------------------------------------------
25
+ /** Evs.instance().showUI(name) — "configure" | "adjust" | "calibrate". */
26
+ showUI(screen: EvsStockUIScreen): Promise<void>;
27
+
28
+ // --- Communication (IEvsCommunicationService) -----------------------------
29
+ setDeviceInfo(info: EvsDeviceInfo): Promise<void>;
30
+ connect(): Promise<void>;
31
+ connectSecured(): Promise<void>;
32
+ disconnect(): Promise<void>;
33
+ hasConfiguredDevice(): Promise<boolean>;
34
+
35
+ // --- Glasses (IEvsGlassesStateService) -------------------------------------
36
+ getGlassesInfo(): Promise<EvsGlassesInfo>;
37
+ turnGlassesOff(): Promise<void>;
38
+
39
+ // --- Display (IEvsDisplayService) ------------------------------------------
40
+ turnDisplayOn(): Promise<void>;
41
+ /** Continuous brightness, 1-255. */
42
+ setBrightness(value: number): Promise<void>;
43
+ /** Discrete, display-optimized brightness controller. */
44
+ setBrightnessLevel(level: number): Promise<void>;
45
+ setAutoBrightness(options: EvsAutoBrightnessOptions): Promise<void>;
46
+
47
+ // --- Screens (rendering offset) ---------------------------------------------
48
+ setRenderingCenterX(dx: number): Promise<void>;
49
+ setRenderingCenterY(dy: number): Promise<void>;
50
+
51
+ // --- Sensors (IEvsSensorsService) -------------------------------------------
52
+ enableTouch(enabled: boolean): Promise<void>;
53
+ enableAmbient(enabled: boolean): Promise<void>;
54
+ enableGyro(enabled: boolean): Promise<void>;
55
+ enableMagnetometer(enabled: boolean): Promise<void>;
56
+ enableAccelerometer(enabled: boolean): Promise<void>;
57
+ enableSensorsFusion(enabled: boolean): Promise<void>;
58
+
59
+ // --- Auth (IEvsAuthService) --------------------------------------------------
60
+ setApiKeyName(fileNameWithoutExt: string): Promise<void>;
61
+ /** base64-encoded key bytes. */
62
+ setApiKey(base64Key: string): Promise<void>;
63
+ }
64
+
65
+ export default requireNativeModule<EvsKitNativeModule>("RNEvsKit");
package/src/index.ts ADDED
@@ -0,0 +1,172 @@
1
+ import type { EventSubscription } from "expo-modules-core";
2
+ import { useEffect } from "react";
3
+
4
+ import type {
5
+ EvsAutoBrightnessOptions,
6
+ EvsDeviceInfo,
7
+ EvsGlassesInfo,
8
+ EvsKitEvents,
9
+ EvsStockUIScreen,
10
+ } from "./EvsKit.types";
11
+ import EvsKitNative from "./EvsKitModule";
12
+
13
+ export * from "./EvsKit.types";
14
+
15
+ /**
16
+ * Communication service — mirrors IEvsCommunicationService
17
+ * (`Evs.instance().comm()`).
18
+ *
19
+ * Scanning for glasses is NOT handled here: the SDK docs specify scanning
20
+ * is done with the platform's standard BLE APIs (CBCentralManager /
21
+ * BluetoothLeScanner) against `BTConstants.serviceUUID`, filtering for the
22
+ * "EV####" name pattern. Pair that with a BLE library (e.g. react-native-ble-plx)
23
+ * or just use `EvsUI.show('configure')` for the SDK's built-in scan/pair flow.
24
+ */
25
+ export const EvsComm = {
26
+ setDeviceInfo(info: EvsDeviceInfo) {
27
+ return EvsKitNative.setDeviceInfo(info);
28
+ },
29
+ connect() {
30
+ return EvsKitNative.connect();
31
+ },
32
+ /** Use instead of connect() when the app requires BLE pairing. */
33
+ connectSecured() {
34
+ return EvsKitNative.connectSecured();
35
+ },
36
+ disconnect() {
37
+ return EvsKitNative.disconnect();
38
+ },
39
+ hasConfiguredDevice() {
40
+ return EvsKitNative.hasConfiguredDevice();
41
+ },
42
+ };
43
+
44
+ /** Mirrors IEvsGlassesStateService (`Evs.instance().glasses()`). */
45
+ export const EvsGlasses = {
46
+ getInfo(): Promise<EvsGlassesInfo> {
47
+ return EvsKitNative.getGlassesInfo();
48
+ },
49
+ turnOff() {
50
+ return EvsKitNative.turnGlassesOff();
51
+ },
52
+ };
53
+
54
+ /** Mirrors IEvsDisplayService (`Evs.instance().display()`) plus screen offset controls. */
55
+ export const EvsDisplay = {
56
+ turnOn() {
57
+ return EvsKitNative.turnDisplayOn();
58
+ },
59
+ /** Continuous scale, 1-255. Prefer setBrightnessLevel() where possible. */
60
+ setBrightness(value: number) {
61
+ return EvsKitNative.setBrightness(value);
62
+ },
63
+ /** Discrete brightness level via the SDK's display-optimized controller. */
64
+ setBrightnessLevel(level: number) {
65
+ return EvsKitNative.setBrightnessLevel(level);
66
+ },
67
+ setAutoBrightness(options: EvsAutoBrightnessOptions) {
68
+ return EvsKitNative.setAutoBrightness(options);
69
+ },
70
+ /** Adjust the virtual rendering area's center offset within the 640x400 display. */
71
+ setRenderingCenter(dx: number, dy: number) {
72
+ return Promise.all([
73
+ EvsKitNative.setRenderingCenterX(dx),
74
+ EvsKitNative.setRenderingCenterY(dy),
75
+ ]);
76
+ },
77
+ };
78
+
79
+ /**
80
+ * Mirrors IEvsSensorsService (`Evs.instance().sensors()`).
81
+ * Remember to disable sensors and unsubscribe events when no longer needed —
82
+ * the SDK docs call this out explicitly for battery/bandwidth reasons.
83
+ */
84
+ export const EvsSensors = {
85
+ enableTouch(enabled: boolean) {
86
+ return EvsKitNative.enableTouch(enabled);
87
+ },
88
+ enableAmbient(enabled: boolean) {
89
+ return EvsKitNative.enableAmbient(enabled);
90
+ },
91
+ enableGyro(enabled: boolean) {
92
+ return EvsKitNative.enableGyro(enabled);
93
+ },
94
+ enableMagnetometer(enabled: boolean) {
95
+ return EvsKitNative.enableMagnetometer(enabled);
96
+ },
97
+ enableAccelerometer(enabled: boolean) {
98
+ return EvsKitNative.enableAccelerometer(enabled);
99
+ },
100
+ /** Enables Gyro + Magnetometer + Accelerometer and starts the fusion algorithm. */
101
+ enableFusion(enabled: boolean) {
102
+ return EvsKitNative.enableSensorsFusion(enabled);
103
+ },
104
+ };
105
+
106
+ /** Mirrors IEvsAuthService (`Evs.instance().auth()`). Usually unnecessary — see API Keys docs. */
107
+ export const EvsAuth = {
108
+ setApiKeyName(fileNameWithoutExt: string) {
109
+ return EvsKitNative.setApiKeyName(fileNameWithoutExt);
110
+ },
111
+ setApiKey(base64Key: string) {
112
+ return EvsKitNative.setApiKey(base64Key);
113
+ },
114
+ };
115
+
116
+ /** Mirrors `Evs.instance().showUI(...)` — the SDK's built-in portrait UI screens. */
117
+ export const EvsUI = {
118
+ show(screen: EvsStockUIScreen) {
119
+ return EvsKitNative.showUI(screen);
120
+ },
121
+ };
122
+
123
+ /** Top-level lifecycle, matching `Evs.init(context).start()` / `Evs.instance().start()`. */
124
+ export const EvsKit = {
125
+ start() {
126
+ return EvsKitNative.start();
127
+ },
128
+ isStarted() {
129
+ return EvsKitNative.isStarted();
130
+ },
131
+ comm: EvsComm,
132
+ glasses: EvsGlasses,
133
+ display: EvsDisplay,
134
+ sensors: EvsSensors,
135
+ auth: EvsAuth,
136
+ ui: EvsUI,
137
+ };
138
+
139
+ export default EvsKit;
140
+
141
+ // ---------------------------------------------------------------------------
142
+ // Event subscription helpers
143
+ // ---------------------------------------------------------------------------
144
+
145
+ /** Subscribe to a single EvsKit event; call the returned function to unsubscribe. */
146
+ export function addEvsKitListener<K extends keyof EvsKitEvents>(
147
+ eventName: K,
148
+ listener: EvsKitEvents[K],
149
+ ): EventSubscription {
150
+ return EvsKitNative.addListener(eventName, listener as any);
151
+ }
152
+
153
+ /**
154
+ * React hook that subscribes to an EvsKit event for the lifetime of the
155
+ * component. Pass a stable callback (e.g. via useCallback) to avoid
156
+ * resubscribing every render.
157
+ *
158
+ * @example
159
+ * useEvsKitEvent('onTouch', (direction) => {
160
+ * if (direction === 'tap') showPopup();
161
+ * });
162
+ */
163
+ export function useEvsKitEvent<K extends keyof EvsKitEvents>(
164
+ eventName: K,
165
+ listener: EvsKitEvents[K],
166
+ ) {
167
+ useEffect(() => {
168
+ const subscription = addEvsKitListener(eventName, listener);
169
+ return () => subscription.remove();
170
+ // eslint-disable-next-line react-hooks/exhaustive-deps
171
+ }, [eventName, listener]);
172
+ }