import { NativeEventEmitter, type NativeModule, NativeModules, } from 'react-native'; import { LINKING_ERROR } from '../constants/FWErrorMessage'; import type PushRNContainerParams from '../models/PushRNContainerParams'; const FWNavigatorModule = NativeModules.FWNavigatorModule ? NativeModules.FWNavigatorModule : new Proxy( {}, { get() { throw new Error(LINKING_ERROR); }, } ); interface IFWNavigatorModule extends NativeModule { pushRNContainer(params: PushRNContainerParams): Promise; popRNContainer(): Promise; popNativeContainer(): Promise; canPopNativeContainer(): Promise; startFloatingPlayer(): Promise; stopFloatingPlayer(): Promise; bringRNContainerToTop(): Promise; bringRNContainerToBottom(): Promise; tryStartFloatingOrCloseFullScreen(): Promise; } const FWNavigatorModuleEventEmitter = new NativeEventEmitter(FWNavigatorModule); export { FWNavigatorModuleEventEmitter }; export default FWNavigatorModule as IFWNavigatorModule;