import { NativeModules, Platform } from 'react-native'; const LINKING_ERROR = `The package 'react-native-deeplinking-widget' doesn't seem to be linked. Make sure: \n\n` + Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; // interface DeeplinkingWidgetModule { // onUpdate(data: any): Promise; // } const DeeplinkingWidget = NativeModules.DeeplinkingWidget ? NativeModules.DeeplinkingWidget : new Proxy( {}, { get() { throw new Error(LINKING_ERROR); }, } ); export function onUpdate(data: any): Promise { return DeeplinkingWidget.onUpdate(data); } // export function setWidgetUrl(data: string) { // const url = data ? data : ''; // return DeeplinkingWidget.setWidgetUrl(url); // } // export default { // onUpdate: (data: any) => { // return DeeplinkingWidget.onUpdate(data); // }, // }; export function multiply(a: number, b: number): Promise { return DeeplinkingWidget.multiply(a, b); }