react-native-epson-escposprinter
Version:
A Turbo Module wrapper for the Epson ePOS Printer SDK.
17 lines (16 loc) • 888 B
JavaScript
;
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from "react-native";
// @ts-expect-error ts(7017)
const isTurboModuleEnabled = global.__turboModuleProxy != null;
const NativeInterface = isTurboModuleEnabled
// eslint-disable-next-line @typescript-eslint/no-var-requires
? require("./NativeEpsonEscposprinter").default : NativeModules.EpsonEscposprinter;
if (!NativeInterface) {
throw new Error("The package 'react-native-epson-escposprinter' 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");
}
const events = isTurboModuleEnabled ? new NativeEventEmitter(NativeInterface) : DeviceEventEmitter;
export { events, NativeInterface };
//# sourceMappingURL=NativeInterface.js.map