@therealitycrafters/react-native-evskit 0.0.0-stage → 0.1.1

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 (120) 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/app.plugin.js +7 -0
  5. package/build/EvsKit.types.d.ts +76 -0
  6. package/build/EvsKit.types.d.ts.map +1 -0
  7. package/build/EvsKit.types.js +10 -0
  8. package/build/EvsKit.types.js.map +1 -0
  9. package/build/EvsKitModule.d.ts +43 -0
  10. package/build/EvsKitModule.d.ts.map +1 -0
  11. package/build/EvsKitModule.js +3 -0
  12. package/build/EvsKitModule.js.map +1 -0
  13. package/build/index.d.ts +118 -0
  14. package/build/index.d.ts.map +1 -0
  15. package/build/index.js +146 -0
  16. package/build/index.js.map +1 -0
  17. package/expo-module.config.json +9 -0
  18. package/ios/EvsKit.xcframework/Info.plist +44 -0
  19. package/ios/EvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  20. package/ios/EvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  21. package/ios/EvsKit.xcframework/_CodeSignature/CodeResources +945 -0
  22. package/ios/EvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
  23. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Assets.car +0 -0
  24. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/BitTableViewCell.nib +0 -0
  25. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
  26. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsKit +0 -0
  27. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
  28. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
  29. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit-Swift.h +390 -0
  30. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit.h +19 -0
  31. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Info.plist +0 -0
  32. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.abi.json +13039 -0
  33. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.private.swiftinterface +239 -0
  34. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  35. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftinterface +239 -0
  36. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/module.modulemap +11 -0
  37. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemInfoViewCell.nib +0 -0
  38. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
  39. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
  40. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
  41. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
  42. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
  43. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
  44. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
  45. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
  46. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
  47. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
  48. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
  49. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
  50. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
  51. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
  52. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
  53. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
  54. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/evs_logo_green.png +0 -0
  55. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
  56. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/ota_info.json +17 -0
  57. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
  58. package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota_background_big.png +0 -0
  59. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Assets.car +0 -0
  60. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/BitTableViewCell.nib +0 -0
  61. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
  62. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsKit +0 -0
  63. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
  64. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
  65. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit-Swift.h +776 -0
  66. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit.h +19 -0
  67. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Info.plist +0 -0
  68. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.abi.json +13039 -0
  69. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +239 -0
  70. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  71. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +239 -0
  72. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +13039 -0
  73. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +239 -0
  74. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  75. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +239 -0
  76. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/module.modulemap +11 -0
  77. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemInfoViewCell.nib +0 -0
  78. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
  79. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
  80. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
  81. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
  82. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
  83. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
  84. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
  85. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
  86. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
  87. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
  88. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
  89. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
  90. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
  91. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/_CodeSignature/CodeResources +542 -0
  92. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
  93. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
  94. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
  95. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/evs_logo_green.png +0 -0
  96. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
  97. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/ota_info.json +17 -0
  98. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
  99. package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota_background_big.png +0 -0
  100. package/ios/EvsKitModule.swift +321 -0
  101. package/ios/NativeEvsKit.xcframework/Info.plist +44 -0
  102. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  103. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  104. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeResources +186 -0
  105. package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
  106. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
  107. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Info.plist +35 -0
  108. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Modules/module.modulemap +8 -0
  109. package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/NativeEvsKit +0 -0
  110. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
  111. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Info.plist +31 -0
  112. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Modules/module.modulemap +8 -0
  113. package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/NativeEvsKit +0 -0
  114. package/ios/RNEvsKit.podspec +27 -0
  115. package/package.json +52 -4
  116. package/plugin/withEverysightBundleResources.js +110 -0
  117. package/plugin/withEverysightSPM.js +276 -0
  118. package/src/EvsKit.types.ts +122 -0
  119. package/src/EvsKitModule.ts +65 -0
  120. package/src/index.ts +172 -0
@@ -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
+ }