@rn-bridge-tools/react 0.0.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/index.cjs ADDED
@@ -0,0 +1,490 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ BridgeProvider: () => BridgeProvider,
24
+ createBridgeStore: () => createBridgeStore,
25
+ useAuth: () => useAuth,
26
+ useBridge: () => useBridge,
27
+ useBridgeEvent: () => useBridgeEvent,
28
+ useBridgeEvents: () => useBridgeEvents,
29
+ useBridgeStore: () => useBridgeStore,
30
+ useBridgeStoreSelector: () => useBridgeStoreSelector,
31
+ useBrowser: () => useBrowser,
32
+ useCamera: () => useCamera,
33
+ useClipboard: () => useClipboard,
34
+ useDevice: () => useDevice,
35
+ useFile: () => useFile,
36
+ useHaptic: () => useHaptic,
37
+ useIAP: () => useIAP,
38
+ useKeyboard: () => useKeyboard,
39
+ useLocation: () => useLocation,
40
+ useLocationWatch: () => useLocationWatch,
41
+ useNavigation: () => useNavigation,
42
+ usePermission: () => usePermission,
43
+ usePreference: () => usePreference,
44
+ usePush: () => usePush,
45
+ usePushNotification: () => usePushNotification,
46
+ useScanner: () => useScanner,
47
+ useShare: () => useShare,
48
+ useStatusBar: () => useStatusBar
49
+ });
50
+ module.exports = __toCommonJS(index_exports);
51
+
52
+ // src/provider.tsx
53
+ var import_react = require("react");
54
+ var import_web = require("@webview-bridge/web");
55
+ var import_jsx_runtime = require("react/jsx-runtime");
56
+ var BridgeContext = (0, import_react.createContext)(null);
57
+ function BridgeProvider({ children, timeout, debug, onReady }) {
58
+ const bridgeRef = (0, import_react.useRef)(null);
59
+ const onReadyRef = (0, import_react.useRef)(onReady);
60
+ onReadyRef.current = onReady;
61
+ if (bridgeRef.current === null) {
62
+ bridgeRef.current = (0, import_web.linkBridge)({
63
+ timeout: timeout ?? 5e3,
64
+ debug: debug ?? false,
65
+ throwOnError: false,
66
+ onReady: () => {
67
+ onReadyRef.current?.();
68
+ }
69
+ });
70
+ }
71
+ const send = (0, import_react.useCallback)(
72
+ async (action, payload) => {
73
+ const bridge = bridgeRef.current;
74
+ if (!bridge) {
75
+ throw new Error("Bridge not initialized");
76
+ }
77
+ const method = bridge[action];
78
+ if (typeof method !== "function") {
79
+ throw new Error(`Bridge method "${action}" is not available`);
80
+ }
81
+ return method(payload);
82
+ },
83
+ []
84
+ );
85
+ const on = (0, import_react.useCallback)(
86
+ (event, callback) => {
87
+ const bridge = bridgeRef.current;
88
+ if (!bridge) {
89
+ return () => {
90
+ };
91
+ }
92
+ return bridge.addEventListener(event, callback);
93
+ },
94
+ []
95
+ );
96
+ const value = (0, import_react.useMemo)(
97
+ () => ({
98
+ send,
99
+ on,
100
+ isAvailable: bridgeRef.current?.isWebViewBridgeAvailable ?? false
101
+ }),
102
+ [send, on]
103
+ );
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BridgeContext.Provider, { value, children });
105
+ }
106
+ function useBridge() {
107
+ const context = (0, import_react.useContext)(BridgeContext);
108
+ if (!context) {
109
+ throw new Error("useBridge must be used within a BridgeProvider");
110
+ }
111
+ return context;
112
+ }
113
+
114
+ // src/store.ts
115
+ var import_react2 = require("react");
116
+ function createBridgeStore(initialState) {
117
+ let state = initialState;
118
+ const listeners = /* @__PURE__ */ new Set();
119
+ return {
120
+ getSnapshot() {
121
+ return state;
122
+ },
123
+ getServerSnapshot() {
124
+ return initialState;
125
+ },
126
+ subscribe(listener) {
127
+ listeners.add(listener);
128
+ return () => listeners.delete(listener);
129
+ },
130
+ setState(next) {
131
+ const nextState = typeof next === "function" ? next(state) : next;
132
+ if (Object.is(state, nextState)) return;
133
+ state = nextState;
134
+ listeners.forEach((l) => l(state));
135
+ },
136
+ destroy() {
137
+ listeners.clear();
138
+ }
139
+ };
140
+ }
141
+ function useBridgeStore(store) {
142
+ return (0, import_react2.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getServerSnapshot);
143
+ }
144
+ function useBridgeStoreSelector(store, selector) {
145
+ return (0, import_react2.useSyncExternalStore)(
146
+ store.subscribe,
147
+ () => selector(store.getSnapshot()),
148
+ () => selector(store.getServerSnapshot())
149
+ );
150
+ }
151
+ function useBridgeEvent(on, event, initialState, updater2) {
152
+ const storeRef = (0, import_react2.useRef)(null);
153
+ if (!storeRef.current) {
154
+ storeRef.current = createBridgeStore(initialState);
155
+ }
156
+ (0, import_react2.useEffect)(() => {
157
+ const store = storeRef.current;
158
+ const unsubscribe = on(event, (data) => {
159
+ store.setState((prev) => updater2(prev, data));
160
+ });
161
+ return unsubscribe;
162
+ }, [on, event, updater2]);
163
+ return useBridgeStore(storeRef.current);
164
+ }
165
+ function useBridgeEvents(on, initialState, bindings) {
166
+ const storeRef = (0, import_react2.useRef)(null);
167
+ if (!storeRef.current) {
168
+ storeRef.current = createBridgeStore(initialState);
169
+ }
170
+ const bindingsRef = (0, import_react2.useRef)(bindings);
171
+ (0, import_react2.useEffect)(() => {
172
+ const store = storeRef.current;
173
+ const unsubs = bindingsRef.current.map(
174
+ ({ event, updater: updater2 }) => on(event, ((data) => {
175
+ store.setState((prev) => updater2(prev, data));
176
+ }))
177
+ );
178
+ return () => unsubs.forEach((u) => u());
179
+ }, [on]);
180
+ return useBridgeStore(storeRef.current);
181
+ }
182
+
183
+ // src/namespaces/useCamera.ts
184
+ var import_react3 = require("react");
185
+ function useCamera() {
186
+ const { send } = useBridge();
187
+ return (0, import_react3.useMemo)(
188
+ () => ({
189
+ take: (opts) => send("camera.take", opts ?? {}),
190
+ pickImage: (opts) => send("camera.pickImage", opts ?? {})
191
+ }),
192
+ [send]
193
+ );
194
+ }
195
+
196
+ // src/namespaces/useLocation.ts
197
+ var import_react4 = require("react");
198
+ function useLocation() {
199
+ const { send } = useBridge();
200
+ return (0, import_react4.useMemo)(
201
+ () => ({
202
+ getCurrent: (opts) => send("location.getCurrent", opts ?? {}),
203
+ watchStart: (opts) => send("location.watchStart", opts ?? {}),
204
+ watchStop: (opts) => send("location.watchStop", opts)
205
+ }),
206
+ [send]
207
+ );
208
+ }
209
+ var updater = (_prev, data) => data;
210
+ function useLocationWatch(opts) {
211
+ const { send, on } = useBridge();
212
+ const watchIdRef = (0, import_react4.useRef)(null);
213
+ const location = useBridgeEvent(
214
+ on,
215
+ "location.update",
216
+ null,
217
+ updater
218
+ );
219
+ (0, import_react4.useEffect)(() => {
220
+ send("location.watchStart", opts ?? {}).then((res) => {
221
+ watchIdRef.current = res.watchId;
222
+ });
223
+ return () => {
224
+ if (watchIdRef.current) {
225
+ send("location.watchStop", { watchId: watchIdRef.current });
226
+ }
227
+ };
228
+ }, [send, opts]);
229
+ return location;
230
+ }
231
+
232
+ // src/namespaces/useFile.ts
233
+ var import_react5 = require("react");
234
+ function useFile() {
235
+ const { send } = useBridge();
236
+ return (0, import_react5.useMemo)(
237
+ () => ({
238
+ download: (opts) => send("file.download", opts),
239
+ read: (opts) => send("file.read", opts),
240
+ write: (opts) => send("file.write", opts),
241
+ pick: (opts) => send("file.pick", opts ?? {})
242
+ }),
243
+ [send]
244
+ );
245
+ }
246
+
247
+ // src/namespaces/useShare.ts
248
+ var import_react6 = require("react");
249
+ function useShare() {
250
+ const { send } = useBridge();
251
+ return (0, import_react6.useMemo)(
252
+ () => ({
253
+ open: (opts) => send("share.open", opts ?? {})
254
+ }),
255
+ [send]
256
+ );
257
+ }
258
+
259
+ // src/namespaces/useDevice.ts
260
+ var import_react7 = require("react");
261
+ function useDevice() {
262
+ const { send } = useBridge();
263
+ return (0, import_react7.useMemo)(
264
+ () => ({
265
+ getInfo: () => send("device.getInfo", {}),
266
+ getBattery: () => send("device.getBattery", {}),
267
+ getNetwork: () => send("device.getNetwork", {})
268
+ }),
269
+ [send]
270
+ );
271
+ }
272
+
273
+ // src/namespaces/useStatusBar.ts
274
+ var import_react8 = require("react");
275
+ function useStatusBar() {
276
+ const { send } = useBridge();
277
+ return (0, import_react8.useMemo)(
278
+ () => ({
279
+ setStyle: (opts) => send("statusbar.setStyle", opts),
280
+ setBackgroundColor: (opts) => send("statusbar.setBackgroundColor", opts),
281
+ setHidden: (opts) => send("statusbar.setHidden", opts)
282
+ }),
283
+ [send]
284
+ );
285
+ }
286
+
287
+ // src/namespaces/useKeyboard.ts
288
+ var import_react9 = require("react");
289
+ var INITIAL = { visible: false, height: 0 };
290
+ function useKeyboard() {
291
+ const { send, on } = useBridge();
292
+ const updater2 = (0, import_react9.useCallback)(
293
+ (_prev, data) => ({
294
+ visible: data.visible,
295
+ height: data.height
296
+ }),
297
+ []
298
+ );
299
+ const state = useBridgeEvent(on, "keyboard.change", INITIAL, updater2);
300
+ const dismiss = (0, import_react9.useMemo)(() => () => send("keyboard.dismiss", {}), [send]);
301
+ return { visible: state.visible, height: state.height, dismiss };
302
+ }
303
+
304
+ // src/namespaces/useHaptic.ts
305
+ var import_react10 = require("react");
306
+ function useHaptic() {
307
+ const { send } = useBridge();
308
+ return (0, import_react10.useMemo)(
309
+ () => ({
310
+ impact: (opts) => send("haptic.impact", opts),
311
+ notification: (opts) => send("haptic.notification", opts),
312
+ selection: () => send("haptic.selection", {})
313
+ }),
314
+ [send]
315
+ );
316
+ }
317
+
318
+ // src/namespaces/useClipboard.ts
319
+ var import_react11 = require("react");
320
+ function useClipboard() {
321
+ const { send } = useBridge();
322
+ return (0, import_react11.useMemo)(
323
+ () => ({
324
+ copy: (opts) => send("clipboard.copy", opts),
325
+ paste: () => send("clipboard.paste", {})
326
+ }),
327
+ [send]
328
+ );
329
+ }
330
+
331
+ // src/namespaces/useScanner.ts
332
+ var import_react12 = require("react");
333
+ function useScanner() {
334
+ const { send } = useBridge();
335
+ return (0, import_react12.useMemo)(
336
+ () => ({
337
+ scanQR: (opts) => send("scanner.scanQR", opts ?? {})
338
+ }),
339
+ [send]
340
+ );
341
+ }
342
+
343
+ // src/namespaces/useAuth.ts
344
+ var import_react13 = require("react");
345
+ function useAuth() {
346
+ const { send } = useBridge();
347
+ return (0, import_react13.useMemo)(
348
+ () => ({
349
+ biometric: (opts) => send("auth.biometric", opts ?? {}),
350
+ isBiometricAvailable: () => send("auth.isBiometricAvailable", {})
351
+ }),
352
+ [send]
353
+ );
354
+ }
355
+
356
+ // src/namespaces/useIAP.ts
357
+ var import_react14 = require("react");
358
+ function useIAP() {
359
+ const { send } = useBridge();
360
+ return (0, import_react14.useMemo)(
361
+ () => ({
362
+ getProducts: (opts) => send("iap.getProducts", opts),
363
+ purchase: (opts) => send("iap.purchase", opts),
364
+ restore: () => send("iap.restore", {})
365
+ }),
366
+ [send]
367
+ );
368
+ }
369
+
370
+ // src/namespaces/usePush.ts
371
+ var import_react15 = require("react");
372
+ function usePush() {
373
+ const { send } = useBridge();
374
+ return (0, import_react15.useMemo)(
375
+ () => ({
376
+ getToken: () => send("push.getToken", {}),
377
+ requestPermission: () => send("push.requestPermission", {})
378
+ }),
379
+ [send]
380
+ );
381
+ }
382
+ var INITIAL2 = { lastReceived: null, lastTapped: null };
383
+ var BINDINGS = [
384
+ {
385
+ event: "push.received",
386
+ updater: (prev, data) => ({
387
+ ...prev,
388
+ lastReceived: data
389
+ })
390
+ },
391
+ {
392
+ event: "push.tapped",
393
+ updater: (prev, data) => ({
394
+ ...prev,
395
+ lastTapped: data
396
+ })
397
+ }
398
+ ];
399
+ function usePushNotification() {
400
+ const { on } = useBridge();
401
+ const state = useBridgeEvents(on, INITIAL2, BINDINGS);
402
+ return { lastReceived: state.lastReceived, lastTapped: state.lastTapped };
403
+ }
404
+
405
+ // src/namespaces/usePermission.ts
406
+ var import_react16 = require("react");
407
+ function usePermission() {
408
+ const { send } = useBridge();
409
+ return (0, import_react16.useMemo)(
410
+ () => ({
411
+ check: (opts) => send("permission.check", opts),
412
+ request: (opts) => send("permission.request", opts),
413
+ openSettings: () => send("permission.openSettings", {})
414
+ }),
415
+ [send]
416
+ );
417
+ }
418
+
419
+ // src/namespaces/usePreference.ts
420
+ var import_react17 = require("react");
421
+ function usePreference() {
422
+ const { send } = useBridge();
423
+ return (0, import_react17.useMemo)(
424
+ () => ({
425
+ get: (opts) => send("preference.get", opts),
426
+ set: (opts) => send("preference.set", opts),
427
+ remove: (opts) => send("preference.remove", opts),
428
+ clear: () => send("preference.clear", {})
429
+ }),
430
+ [send]
431
+ );
432
+ }
433
+
434
+ // src/namespaces/useNavigation.ts
435
+ var import_react18 = require("react");
436
+ function useNavigation() {
437
+ const { send } = useBridge();
438
+ return (0, import_react18.useMemo)(
439
+ () => ({
440
+ goBack: () => send("navigation.goBack", {}),
441
+ push: (opts) => send("navigation.push", opts),
442
+ close: () => send("navigation.close", {}),
443
+ setSwipeBack: (opts) => send("navigation.setSwipeBack", opts)
444
+ }),
445
+ [send]
446
+ );
447
+ }
448
+
449
+ // src/namespaces/useBrowser.ts
450
+ var import_react19 = require("react");
451
+ function useBrowser() {
452
+ const { send } = useBridge();
453
+ return (0, import_react19.useMemo)(
454
+ () => ({
455
+ openExternal: (opts) => send("browser.openExternal", opts),
456
+ openInternal: (opts) => send("browser.openInternal", opts)
457
+ }),
458
+ [send]
459
+ );
460
+ }
461
+ // Annotate the CommonJS export names for ESM import in node:
462
+ 0 && (module.exports = {
463
+ BridgeProvider,
464
+ createBridgeStore,
465
+ useAuth,
466
+ useBridge,
467
+ useBridgeEvent,
468
+ useBridgeEvents,
469
+ useBridgeStore,
470
+ useBridgeStoreSelector,
471
+ useBrowser,
472
+ useCamera,
473
+ useClipboard,
474
+ useDevice,
475
+ useFile,
476
+ useHaptic,
477
+ useIAP,
478
+ useKeyboard,
479
+ useLocation,
480
+ useLocationWatch,
481
+ useNavigation,
482
+ usePermission,
483
+ usePreference,
484
+ usePush,
485
+ usePushNotification,
486
+ useScanner,
487
+ useShare,
488
+ useStatusBar
489
+ });
490
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/provider.tsx","../src/store.ts","../src/namespaces/useCamera.ts","../src/namespaces/useLocation.ts","../src/namespaces/useFile.ts","../src/namespaces/useShare.ts","../src/namespaces/useDevice.ts","../src/namespaces/useStatusBar.ts","../src/namespaces/useKeyboard.ts","../src/namespaces/useHaptic.ts","../src/namespaces/useClipboard.ts","../src/namespaces/useScanner.ts","../src/namespaces/useAuth.ts","../src/namespaces/useIAP.ts","../src/namespaces/usePush.ts","../src/namespaces/usePermission.ts","../src/namespaces/usePreference.ts","../src/namespaces/useNavigation.ts","../src/namespaces/useBrowser.ts"],"sourcesContent":["// Provider and core hook\nexport { BridgeProvider, useBridge } from './provider.js';\nexport type { BridgeProviderProps, BridgeContextValue } from './provider.js';\n\n// External store utilities (useSyncExternalStore based)\nexport { createBridgeStore, useBridgeStore, useBridgeStoreSelector, useBridgeEvent, useBridgeEvents } from './store.js';\nexport type { BridgeStore } from './store.js';\n\n// Namespace hooks\nexport { useCamera } from './namespaces/useCamera.js';\nexport { useLocation, useLocationWatch } from './namespaces/useLocation.js';\nexport { useFile } from './namespaces/useFile.js';\nexport { useShare } from './namespaces/useShare.js';\nexport { useDevice } from './namespaces/useDevice.js';\nexport { useStatusBar } from './namespaces/useStatusBar.js';\nexport { useKeyboard } from './namespaces/useKeyboard.js';\nexport { useHaptic } from './namespaces/useHaptic.js';\nexport { useClipboard } from './namespaces/useClipboard.js';\nexport { useScanner } from './namespaces/useScanner.js';\nexport { useAuth } from './namespaces/useAuth.js';\nexport { useIAP } from './namespaces/useIAP.js';\nexport { usePush, usePushNotification } from './namespaces/usePush.js';\nexport { usePermission } from './namespaces/usePermission.js';\nexport { usePreference } from './namespaces/usePreference.js';\nexport { useNavigation } from './namespaces/useNavigation.js';\nexport { useBrowser } from './namespaces/useBrowser.js';\n","import React, { createContext, useContext, useRef, useCallback, useMemo } from 'react';\nimport { linkBridge } from '@webview-bridge/web';\nimport type {\n BridgeToolsSchema,\n BridgeToolsAction,\n BridgeToolsEvents,\n BridgeToolsEvent,\n} from '@rn-bridge-tools/core';\n\ntype SendFn = <K extends BridgeToolsAction>(\n action: K,\n payload: BridgeToolsSchema[K]['request'],\n) => Promise<BridgeToolsSchema[K]['response']>;\n\ntype OnFn = <E extends BridgeToolsEvent>(\n event: E,\n callback: (data: BridgeToolsEvents[E]) => void,\n) => () => void;\n\nexport interface BridgeContextValue {\n send: SendFn;\n on: OnFn;\n isAvailable: boolean;\n}\n\nconst BridgeContext = createContext<BridgeContextValue | null>(null);\n\nexport interface BridgeProviderProps {\n children?: React.ReactNode | undefined;\n timeout?: number;\n debug?: boolean;\n onReady?: () => void;\n}\n\nexport function BridgeProvider({ children, timeout, debug, onReady }: BridgeProviderProps) {\n const bridgeRef = useRef<ReturnType<typeof linkBridge> | null>(null);\n const onReadyRef = useRef(onReady);\n onReadyRef.current = onReady;\n\n if (bridgeRef.current === null) {\n bridgeRef.current = linkBridge({\n timeout: timeout ?? 5000,\n debug: debug ?? false,\n throwOnError: false,\n onReady: () => {\n onReadyRef.current?.();\n },\n });\n }\n\n const send: SendFn = useCallback(\n async <K extends BridgeToolsAction>(\n action: K,\n payload: BridgeToolsSchema[K]['request'],\n ): Promise<BridgeToolsSchema[K]['response']> => {\n const bridge = bridgeRef.current;\n if (!bridge) {\n throw new Error('Bridge not initialized');\n }\n const method = (bridge as Record<string, (...args: unknown[]) => Promise<unknown>>)[action];\n if (typeof method !== 'function') {\n throw new Error(`Bridge method \"${action}\" is not available`);\n }\n return method(payload) as Promise<BridgeToolsSchema[K]['response']>;\n },\n [],\n );\n\n const on: OnFn = useCallback(\n <E extends BridgeToolsEvent>(\n event: E,\n callback: (data: BridgeToolsEvents[E]) => void,\n ): (() => void) => {\n const bridge = bridgeRef.current;\n if (!bridge) {\n return () => {};\n }\n return bridge.addEventListener(event, callback as (data: unknown) => void);\n },\n [],\n );\n\n const value = useMemo<BridgeContextValue>(\n () => ({\n send,\n on,\n isAvailable: bridgeRef.current?.isWebViewBridgeAvailable ?? false,\n }),\n [send, on],\n );\n\n return <BridgeContext.Provider value={value}>{children}</BridgeContext.Provider>;\n}\n\nexport function useBridge(): BridgeContextValue {\n const context = useContext(BridgeContext);\n if (!context) {\n throw new Error('useBridge must be used within a BridgeProvider');\n }\n return context;\n}\n","import { useEffect, useRef, useSyncExternalStore } from 'react';\nimport type { BridgeToolsEvents, BridgeToolsEvent } from '@rn-bridge-tools/core';\nimport type { BridgeContextValue } from './provider.js';\n\ntype Listener<T> = (state: T) => void;\n\n/**\n * Lightweight external store compatible with useSyncExternalStore.\n * Used for bridge event subscriptions (keyboard, location, push, etc.)\n */\nexport function createBridgeStore<T>(initialState: T) {\n let state = initialState;\n const listeners = new Set<Listener<T>>();\n\n return {\n getSnapshot(): T {\n return state;\n },\n getServerSnapshot(): T {\n return initialState;\n },\n subscribe(listener: () => void): () => void {\n listeners.add(listener as Listener<T>);\n return () => listeners.delete(listener as Listener<T>);\n },\n setState(next: T | ((prev: T) => T)): void {\n const nextState = typeof next === 'function' ? (next as (prev: T) => T)(state) : next;\n if (Object.is(state, nextState)) return;\n state = nextState;\n listeners.forEach((l) => l(state));\n },\n destroy(): void {\n listeners.clear();\n },\n };\n}\n\nexport type BridgeStore<T> = ReturnType<typeof createBridgeStore<T>>;\n\n/**\n * Hook that subscribes to a BridgeStore using useSyncExternalStore.\n * Concurrent Mode safe — no tearing.\n */\nexport function useBridgeStore<T>(store: BridgeStore<T>): T {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);\n}\n\n/**\n * Hook that subscribes to a BridgeStore with a selector.\n * Only re-renders when the selected value changes.\n */\nexport function useBridgeStoreSelector<T, S>(store: BridgeStore<T>, selector: (state: T) => S): S {\n return useSyncExternalStore(\n store.subscribe,\n () => selector(store.getSnapshot()),\n () => selector(store.getServerSnapshot()),\n );\n}\n\n/**\n * Subscribe to a single bridge event and sync to a store.\n * Returns the current snapshot via useSyncExternalStore.\n */\nexport function useBridgeEvent<T, E extends BridgeToolsEvent>(\n on: BridgeContextValue['on'],\n event: E,\n initialState: T,\n updater: (prev: T, data: BridgeToolsEvents[E]) => T,\n): T {\n const storeRef = useRef<BridgeStore<T> | null>(null);\n if (!storeRef.current) {\n storeRef.current = createBridgeStore<T>(initialState);\n }\n\n useEffect(() => {\n const store = storeRef.current!;\n const unsubscribe = on(event, (data) => {\n store.setState((prev) => updater(prev, data));\n });\n return unsubscribe;\n }, [on, event, updater]);\n\n return useBridgeStore(storeRef.current!);\n}\n\ntype EventBinding<T> = {\n event: BridgeToolsEvent;\n updater: (prev: T, data: never) => T;\n};\n\n/**\n * Subscribe to multiple bridge events and sync to a single store.\n * Returns the current snapshot via useSyncExternalStore.\n */\nexport function useBridgeEvents<T>(\n on: BridgeContextValue['on'],\n initialState: T,\n bindings: EventBinding<T>[],\n): T {\n const storeRef = useRef<BridgeStore<T> | null>(null);\n if (!storeRef.current) {\n storeRef.current = createBridgeStore<T>(initialState);\n }\n const bindingsRef = useRef(bindings);\n\n useEffect(() => {\n const store = storeRef.current!;\n const unsubs = bindingsRef.current.map(({ event, updater }) =>\n on(event as BridgeToolsEvent, ((data: never) => {\n store.setState((prev) => updater(prev, data));\n }) as (data: BridgeToolsEvents[typeof event]) => void),\n );\n return () => unsubs.forEach((u) => u());\n }, [on]);\n\n return useBridgeStore(storeRef.current!);\n}\n","import { useMemo } from 'react';\nimport type { CameraNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useCamera() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n take: (opts?: CameraNamespace['camera.take']['request']) =>\n send('camera.take', opts ?? {}),\n pickImage: (opts?: CameraNamespace['camera.pickImage']['request']) =>\n send('camera.pickImage', opts ?? {}),\n }),\n [send],\n );\n}\n","import { useEffect, useMemo, useRef } from 'react';\nimport type { LocationNamespace, LocationEvents } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\nimport { useBridgeEvent } from '../store.js';\n\nexport function useLocation() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n getCurrent: (opts?: LocationNamespace['location.getCurrent']['request']) =>\n send('location.getCurrent', opts ?? {}),\n watchStart: (opts?: LocationNamespace['location.watchStart']['request']) =>\n send('location.watchStart', opts ?? {}),\n watchStop: (opts: LocationNamespace['location.watchStop']['request']) =>\n send('location.watchStop', opts),\n }),\n [send],\n );\n}\n\ntype LocationUpdate = LocationEvents['location.update'] | null;\n\nconst updater = (_prev: LocationUpdate, data: LocationEvents['location.update']): LocationUpdate =>\n data;\n\nexport function useLocationWatch(opts?: LocationNamespace['location.watchStart']['request']) {\n const { send, on } = useBridge();\n const watchIdRef = useRef<string | null>(null);\n\n const location = useBridgeEvent<LocationUpdate, 'location.update'>(\n on,\n 'location.update',\n null,\n updater,\n );\n\n useEffect(() => {\n send('location.watchStart', opts ?? {}).then((res) => {\n watchIdRef.current = res.watchId;\n });\n return () => {\n if (watchIdRef.current) {\n send('location.watchStop', { watchId: watchIdRef.current });\n }\n };\n }, [send, opts]);\n\n return location;\n}\n","import { useMemo } from 'react';\nimport type { FileNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useFile() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n download: (opts: FileNamespace['file.download']['request']) =>\n send('file.download', opts),\n read: (opts: FileNamespace['file.read']['request']) =>\n send('file.read', opts),\n write: (opts: FileNamespace['file.write']['request']) =>\n send('file.write', opts),\n pick: (opts?: FileNamespace['file.pick']['request']) =>\n send('file.pick', opts ?? {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { ShareNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useShare() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n open: (opts?: ShareNamespace['share.open']['request']) =>\n send('share.open', opts ?? {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport { useBridge } from '../provider.js';\n\nexport function useDevice() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n getInfo: () => send('device.getInfo', {}),\n getBattery: () => send('device.getBattery', {}),\n getNetwork: () => send('device.getNetwork', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { StatusBarNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useStatusBar() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n setStyle: (opts: StatusBarNamespace['statusbar.setStyle']['request']) =>\n send('statusbar.setStyle', opts),\n setBackgroundColor: (opts: StatusBarNamespace['statusbar.setBackgroundColor']['request']) =>\n send('statusbar.setBackgroundColor', opts),\n setHidden: (opts: StatusBarNamespace['statusbar.setHidden']['request']) =>\n send('statusbar.setHidden', opts),\n }),\n [send],\n );\n}\n","import { useCallback, useMemo } from 'react';\nimport { useBridge } from '../provider.js';\nimport { useBridgeEvent } from '../store.js';\n\ninterface KeyboardState {\n visible: boolean;\n height: number;\n}\n\nconst INITIAL: KeyboardState = { visible: false, height: 0 };\n\nexport function useKeyboard() {\n const { send, on } = useBridge();\n\n const updater = useCallback(\n (_prev: KeyboardState, data: { visible: boolean; height: number }) => ({\n visible: data.visible,\n height: data.height,\n }),\n [],\n );\n\n const state = useBridgeEvent(on, 'keyboard.change', INITIAL, updater);\n\n const dismiss = useMemo(() => () => send('keyboard.dismiss', {}), [send]);\n\n return { visible: state.visible, height: state.height, dismiss };\n}\n","import { useMemo } from 'react';\nimport type { HapticNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useHaptic() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n impact: (opts: HapticNamespace['haptic.impact']['request']) =>\n send('haptic.impact', opts),\n notification: (opts: HapticNamespace['haptic.notification']['request']) =>\n send('haptic.notification', opts),\n selection: () => send('haptic.selection', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { ClipboardNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useClipboard() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n copy: (opts: ClipboardNamespace['clipboard.copy']['request']) =>\n send('clipboard.copy', opts),\n paste: () => send('clipboard.paste', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { ScannerNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useScanner() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n scanQR: (opts?: ScannerNamespace['scanner.scanQR']['request']) =>\n send('scanner.scanQR', opts ?? {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { AuthNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useAuth() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n biometric: (opts?: AuthNamespace['auth.biometric']['request']) =>\n send('auth.biometric', opts ?? {}),\n isBiometricAvailable: () => send('auth.isBiometricAvailable', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { IAPNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useIAP() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n getProducts: (opts: IAPNamespace['iap.getProducts']['request']) =>\n send('iap.getProducts', opts),\n purchase: (opts: IAPNamespace['iap.purchase']['request']) =>\n send('iap.purchase', opts),\n restore: () => send('iap.restore', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { PushEvents } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\nimport { useBridgeEvents } from '../store.js';\n\nexport function usePush() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n getToken: () => send('push.getToken', {}),\n requestPermission: () => send('push.requestPermission', {}),\n }),\n [send],\n );\n}\n\ninterface PushNotificationState {\n lastReceived: PushEvents['push.received'] | null;\n lastTapped: PushEvents['push.tapped'] | null;\n}\n\nconst INITIAL: PushNotificationState = { lastReceived: null, lastTapped: null };\n\nconst BINDINGS = [\n {\n event: 'push.received' as const,\n updater: (prev: PushNotificationState, data: PushEvents['push.received']) => ({\n ...prev,\n lastReceived: data,\n }),\n },\n {\n event: 'push.tapped' as const,\n updater: (prev: PushNotificationState, data: PushEvents['push.tapped']) => ({\n ...prev,\n lastTapped: data,\n }),\n },\n];\n\nexport function usePushNotification() {\n const { on } = useBridge();\n const state = useBridgeEvents(on, INITIAL, BINDINGS);\n return { lastReceived: state.lastReceived, lastTapped: state.lastTapped };\n}\n","import { useMemo } from 'react';\nimport type { PermissionNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function usePermission() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n check: (opts: PermissionNamespace['permission.check']['request']) =>\n send('permission.check', opts),\n request: (opts: PermissionNamespace['permission.request']['request']) =>\n send('permission.request', opts),\n openSettings: () => send('permission.openSettings', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { PreferenceNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function usePreference() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n get: (opts: PreferenceNamespace['preference.get']['request']) =>\n send('preference.get', opts),\n set: (opts: PreferenceNamespace['preference.set']['request']) =>\n send('preference.set', opts),\n remove: (opts: PreferenceNamespace['preference.remove']['request']) =>\n send('preference.remove', opts),\n clear: () => send('preference.clear', {}),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { NavigationNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useNavigation() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n goBack: () => send('navigation.goBack', {}),\n push: (opts: NavigationNamespace['navigation.push']['request']) =>\n send('navigation.push', opts),\n close: () => send('navigation.close', {}),\n setSwipeBack: (opts: NavigationNamespace['navigation.setSwipeBack']['request']) =>\n send('navigation.setSwipeBack', opts),\n }),\n [send],\n );\n}\n","import { useMemo } from 'react';\nimport type { BrowserNamespace } from '@rn-bridge-tools/core';\nimport { useBridge } from '../provider.js';\n\nexport function useBrowser() {\n const { send } = useBridge();\n return useMemo(\n () => ({\n openExternal: (opts: BrowserNamespace['browser.openExternal']['request']) =>\n send('browser.openExternal', opts),\n openInternal: (opts: BrowserNamespace['browser.openInternal']['request']) =>\n send('browser.openInternal', opts),\n }),\n [send],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA+E;AAC/E,iBAA2B;AA0FlB;AAlET,IAAM,oBAAgB,4BAAyC,IAAI;AAS5D,SAAS,eAAe,EAAE,UAAU,SAAS,OAAO,QAAQ,GAAwB;AACzF,QAAM,gBAAY,qBAA6C,IAAI;AACnE,QAAM,iBAAa,qBAAO,OAAO;AACjC,aAAW,UAAU;AAErB,MAAI,UAAU,YAAY,MAAM;AAC9B,cAAU,cAAU,uBAAW;AAAA,MAC7B,SAAS,WAAW;AAAA,MACpB,OAAO,SAAS;AAAA,MAChB,cAAc;AAAA,MACd,SAAS,MAAM;AACb,mBAAW,UAAU;AAAA,MACvB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,WAAe;AAAA,IACnB,OACE,QACA,YAC8C;AAC9C,YAAM,SAAS,UAAU;AACzB,UAAI,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B,QAAM,EAAE,KAAK,IAAI,UAAU;AAC3B,aAAO;AAAA,IACL,OAAO;AAAA,MACL,cAAc,CAAC,SACb,KAAK,wBAAwB,IAAI;AAAA,MACnC,cAAc,CAAC,SACb,KAAK,wBAAwB,IAAI;AAAA,IACrC;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AACF;","names":["import_react","updater","import_react","import_react","import_react","import_react","import_react","import_react","import_react","updater","import_react","import_react","import_react","import_react","import_react","import_react","INITIAL","import_react","import_react","import_react","import_react"]}