@webview-bridge/web 1.6.1-rc.0 → 1.6.2

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.
@@ -1,10 +1,33 @@
1
1
  import type { Bridge, BridgeStore, ExcludePrimitive, ExtractStore, ParserSchema } from "../../../shared/util/src/types";
2
2
  import { LinkBridge } from "./types";
3
3
  export interface LinkBridgeOptions<T extends BridgeStore<T extends Bridge ? T : any>, V extends ParserSchema<any>> {
4
+ /**
5
+ * It is possible to configure `initialBridge` to operate in a non-React Native environment.
6
+ * Prioritize applying the bridge of the React Native WebView, and if it is unavailable, apply the `initialBridge`.
7
+ * Therefore, if `initialBridge` is configured, `bridge.isWebViewBridgeAvailable` should be true even in environments that are not React Native.
8
+ * @link https://gronxb.github.io/webview-bridge/non-react-native-environment.html
9
+ */
4
10
  initialBridge?: Partial<ExtractStore<T>>;
11
+ /**
12
+ * Set the timeout in milliseconds after calling the native method.
13
+ * @default 2000
14
+ */
5
15
  timeout?: number;
16
+ /**
17
+ * If `true`, an error will be thrown when calling a method that is not defined in the bridge.
18
+ */
6
19
  throwOnError?: boolean | (keyof ExtractStore<T>)[] | string[];
20
+ /**
21
+ * Callback function when a method that is not defined in the bridge is called.
22
+ */
7
23
  onFallback?: (methodName: string, args: unknown[]) => void;
24
+ /**
25
+ * Callback function when the bridge is ready.
26
+ */
8
27
  onReady?: (method: LinkBridge<ExcludePrimitive<ExtractStore<T>>, Omit<T, "setState">, V>) => void;
9
28
  }
29
+ /**
30
+ * Create a link to the bridge connected to the React Native WebView.
31
+ * @link https://gronxb.github.io/webview-bridge/getting-started.html
32
+ */
10
33
  export declare const linkBridge: <T extends BridgeStore<T extends Bridge ? T : any>, V extends ParserSchema<any> = ParserSchema<any>>(options?: LinkBridgeOptions<T, V>) => LinkBridge<ExcludePrimitive<ExtractStore<T>>, Omit<T, "setState">, V>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webview-bridge/web",
3
3
  "type": "module",
4
- "version": "1.6.1-rc.0",
4
+ "version": "1.6.2",
5
5
  "description": "Fully Type-Safe Integration for React Native WebView and Web",
6
6
  "publishConfig": {
7
7
  "access": "public"