@qontinui/ui-bridge-native 0.6.13 → 0.6.15

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.
@@ -23,11 +23,33 @@ export interface DeviceAnnouncerState {
23
23
  mdnsActive: boolean;
24
24
  cloudConnected: boolean;
25
25
  }
26
- /** Minimal interface for the react-native-zeroconf Zeroconf instance */
27
- interface ZeroconfService {
28
- publishService(type: string, protocol: string, domain: string, name: string, port: number, txtRecord: Record<string, string>): void;
29
- unpublishService(name: string): void;
26
+ /**
27
+ * Minimal interface for the react-native-zeroconf Zeroconf instance.
28
+ *
29
+ * The positional `publishService` form is the one every published version
30
+ * accepts (0.17.x keeps it as a deprecated overload beside the options object).
31
+ * Both methods are typed `void | Promise<unknown>` because 0.17.x returns a
32
+ * Promise that REJECTS on failure (e.g. local-network permission denied); the
33
+ * announcer awaits it so a failure lands in its catch instead of becoming an
34
+ * unhandled rejection with `mdnsActive` already reporting true.
35
+ */
36
+ export interface ZeroconfService {
37
+ /** `type` / `protocol` are bare (`'uibridge'`, `'tcp'`): the library adds the underscores. */
38
+ publishService(type: string, protocol: string, domain: string, name: string, port: number, txtRecord: Record<string, string>): void | Promise<unknown>;
39
+ unpublishService(name: string): void | Promise<unknown>;
40
+ /**
41
+ * 0.17.x's constructor subscribes native event listeners
42
+ * (`addDeviceListeners()`); without this call every discarded instance keeps
43
+ * them. Optional because older versions and test fakes may not have it.
44
+ */
45
+ removeDeviceListeners?(): void;
30
46
  }
47
+ /**
48
+ * The `Zeroconf` constructor `startMdnsAdvertise` accepts — the default export
49
+ * of `react-native-zeroconf` satisfies it. The one definition of the type: the
50
+ * provider's `zeroconf` prop is declared as this, not a parallel copy.
51
+ */
52
+ export type ZeroconfConstructor = new () => ZeroconfService;
31
53
  /**
32
54
  * Announces the UI Bridge server on the local network (mDNS) and optionally
33
55
  * registers with the qontinui.io cloud relay for remote discovery.
@@ -39,8 +61,16 @@ export declare class DeviceAnnouncer {
39
61
  private reconnectTimer;
40
62
  private reconnectDelay;
41
63
  private stopped;
42
- /** Zeroconf instance, set when mDNS is successfully started */
64
+ /** Zeroconf instance, set when mDNS is started (cleared by `stop()`) */
43
65
  private zeroconf;
66
+ /** The name the library registered — the only name this announcer may unpublish */
67
+ private publishedName;
68
+ /**
69
+ * True while a publish is awaiting the library. A `stop()` that lands in that
70
+ * window leaves the cleanup to the publish path, which is the only side that
71
+ * will learn the registered name.
72
+ */
73
+ private publishInFlight;
44
74
  /** Rotated pairing token for mDNS TXT records */
45
75
  private pairingToken;
46
76
  constructor(config: AnnouncerConfig);
@@ -57,7 +87,7 @@ export declare class DeviceAnnouncer {
57
87
  *
58
88
  * @param ZeroconfCtor - constructor from `import Zeroconf from 'react-native-zeroconf'`
59
89
  */
60
- startMdnsAdvertise(ZeroconfCtor?: new () => ZeroconfService): Promise<void>;
90
+ startMdnsAdvertise(ZeroconfCtor?: ZeroconfConstructor): Promise<void>;
61
91
  /**
62
92
  * Connect to the cloud relay WebSocket and send a device_register message.
63
93
  *
@@ -71,5 +101,4 @@ export declare class DeviceAnnouncer {
71
101
  getState(): DeviceAnnouncerState;
72
102
  private scheduleReconnect;
73
103
  }
74
- export {};
75
104
  //# sourceMappingURL=DeviceAnnouncer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceAnnouncer.d.ts","sourceRoot":"","sources":["../../src/transport/DeviceAnnouncer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CACl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AY,CAAS;gBAEjB,MAAM,EAAE,eAAe;IAOnC;;;;;;;;;;;;OAYG;IACG,kBAAkB,CAAC,YAAY,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2D3E;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqFxC,6CAA6C;IACvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B,oDAAoD;IACpD,QAAQ,IAAI,oBAAoB;IAMhC,OAAO,CAAC,iBAAiB;CAa1B"}
@@ -1,3 +1,3 @@
1
- export { DeviceAnnouncer, type AnnouncerConfig, type DeviceAnnouncerState, } from './DeviceAnnouncer';
1
+ export { DeviceAnnouncer, type AnnouncerConfig, type DeviceAnnouncerState, type ZeroconfConstructor, type ZeroconfService, } from './DeviceAnnouncer';
2
2
  export { CloudRelayClient, type CloudRelayConfig } from './CloudRelayClient';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qontinui/ui-bridge-native",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "UI Bridge Framework for React Native - Hooks and providers for UI observation and control in mobile apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",