@expo/serve-sim 0.3.0 → 0.3.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.
- package/dist/middleware.js +4 -4
- package/dist/native/serve-sim-native.node +0 -0
- package/dist/serve-sim.js +5 -5
- package/package.json +1 -1
- package/src/native.ts +7 -2
package/package.json
CHANGED
package/src/native.ts
CHANGED
|
@@ -168,12 +168,17 @@ function load(): NativeAddon {
|
|
|
168
168
|
*/
|
|
169
169
|
export class NativeHid {
|
|
170
170
|
private readonly handle: SimHIDHandle;
|
|
171
|
-
private
|
|
171
|
+
private setupFailed = false;
|
|
172
172
|
|
|
173
173
|
constructor(udid: string) {
|
|
174
174
|
this.handle = new (load().SimHID)(udid);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/** A failed native setup stays unavailable until this session is recreated. */
|
|
178
|
+
get inputUnavailable(): boolean {
|
|
179
|
+
return this.setupFailed;
|
|
180
|
+
}
|
|
181
|
+
|
|
177
182
|
// The N-API bindings throw synchronously when a JS value can't be coerced to
|
|
178
183
|
// the native parameter type (e.g. a touch with a non-string `type` →
|
|
179
184
|
// "Could not convert parameter 0 to type String"). HID now runs in-process,
|
|
@@ -202,7 +207,7 @@ export class NativeHid {
|
|
|
202
207
|
} catch (err) {
|
|
203
208
|
// Native setup is cached for this handle; a failed setup cannot recover
|
|
204
209
|
// until a new session. Keep capture running without calling partial HID state.
|
|
205
|
-
this.
|
|
210
|
+
this.setupFailed = true;
|
|
206
211
|
console.error("[hid] Input setup failed; streaming will continue without input:", err instanceof Error ? err.message : err);
|
|
207
212
|
}
|
|
208
213
|
}
|