import { Accessor } from 'solid-js'; import { ConfigurableWindow } from '../_configurable.js'; type NetworkType = 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown'; type NetworkEffectiveType = 'slow-2g' | '2g' | '3g' | '4g' | undefined; interface NetworkState { isSupported: Accessor; /** * If the user is currently connected. */ isOnline: Accessor; /** * The time since the user was last connected. */ offlineAt: Accessor; /** * At this time, if the user is offline and reconnects */ onlineAt: Accessor; /** * The download speed in Mbps. */ downlink: Accessor; /** * The max reachable download speed in Mbps. */ downlinkMax: Accessor; /** * The detected effective speed type. */ effectiveType: Accessor; /** * The estimated effective round-trip time of the current connection. */ rtt: Accessor; /** * If the user activated data saver mode. */ saveData: Accessor; /** * The detected connection/network type. */ type: Accessor; } /** * Reactive Network status. * * @see https://solidjs-use.github.io/solidjs-use/core/useNetwork */ declare function useNetwork(options?: ConfigurableWindow): Readonly; type UseNetworkReturn = ReturnType; export { NetworkEffectiveType, NetworkState, NetworkType, UseNetworkReturn, useNetwork };