UNPKG

react-native-mosquito-transport

Version:

React native javascript sdk for mosquito-transport (https://github.com/brainbehindx/mosquito-transport)

25 lines (20 loc) 798 B
// @flow import type { TurboModule } from 'react-native'; import { type UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { // storage uploadFile(option: UnsafeObject): void; cancelUpload(process_id: string): void; downloadFile(option: UnsafeObject): void; cancelDownload(process_id: string): void; pauseDownload(process_id: string): void; resumeDownload(process_id: string): void; // utils getSystemUptime(): Promise<number>; // event listeners // readonly onMessage?: EventEmitter<{ message: string }>; addListener(eventName: string): void; removeListeners(count: number): void; } export default TurboModuleRegistry.getEnforcing<Spec>('MosquitoTransport');