UNPKG

892 BTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 */
9import * as Types from './types';
10export default class State {
11 private _nativeEventSubscription;
12 private _subscriptions;
13 private _latestState;
14 private _internetReachability;
15 constructor(configuration: Types.NetInfoConfiguration);
16 private _handleNativeStateUpdate;
17 private _handleInternetReachabilityUpdate;
18 _fetchCurrentState: (requestedInterface?: string | undefined) => Promise<Types.NetInfoState>;
19 private _convertState;
20 latest: (requestedInterface?: string | undefined) => Promise<Types.NetInfoState>;
21 add: (handler: Types.NetInfoChangeHandler) => void;
22 remove: (handler: Types.NetInfoChangeHandler) => void;
23 tearDown: () => void;
24}