UNPKG

react-native-fast-io

Version:

Modern IO for React Native, built on top of Nitro and Web standards

18 lines (12 loc) 467 B
import { HybridObject, NitroModules } from 'react-native-nitro-modules' import { InputStream } from './streams.nitro' export type RequestMethod = 'POST' | 'GET' export type RequestOptions = { url: string method: RequestMethod body?: InputStream } export interface Network extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> { request(opts: RequestOptions): Promise<void> } export const Network = NitroModules.createHybridObject<Network>('Network')