UNPKG

react-native-studia

Version:
84 lines (62 loc) 1.55 kB
// @flow 'use strict' import { ErrorCode } from './StudiaError' import { NativeFeed } from './StudiaModules'; export type Subscriber = string export type ServalId = string export type Base64 = string export type Message = string export type ObservableId = string //export type CarrierType = number export type ErrorCodeMessageMapping = { [$Values<typeof ErrorCode>]: string } export interface StudiaManagerOptions { /** * Optional mapping of error codes to error messages. Uses {@link BleErrorCodeMessage} * by default. * * To override logging UUIDs or MAC adresses in error messages copy the original object * and overwrite values of interest to you. * * @memberof BleManagerOptions * @instance */ errorCodesToMessagesMapping?: ErrorCodeMessageMapping; } export interface Network { ssid: string; password: ?string; } export interface Subscription { remove(): void; } export interface Socket<T> { send(message: string): Promise<T>; stop(): void; } export interface Feed { message: Message; date: string; token: string; } export const State = { Unknown: 'Unknown', PoweredOff: 'PoweredOff', PoweredOn: 'PoweredOn', PoweringOn: 'PoweringOn', PoweringOff: 'PoweringOff', Unsupported: 'Unsupported', AirplanOn: 'AirplanOn', Queued: 'Queued', Undiscoverable: 'Undiscoverable' } export const PeerState = { Followed: 'Followed', Blocked: 'Blocked', Ignored: 'Ignored' } export const Carriers = { Wifi: 1, WifiDirect: 2, Ble: 3, Hotspot: 4 }