Amazon Vinyl
    Preparing search index...

    Interface NetworkInformation

    Provides information about the system’s current network connection, such as estimated bandwidth, round-trip time, and connection type. Also exposes events for monitoring changes to the network state.

    interface NetworkInformation {
        downlink: number | undefined;
        effectiveType: NetworkInformationEffectiveType;
        rtt: number;
        saveData: boolean;
        type?: NetworkInformationType;
        addEventListener<K extends "change">(
            type: K,
            listener: (
                this: NetworkInformation,
                ev: NetworkInformationEventMap[K],
            ) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        removeEventListener<K extends "change">(
            type: K,
            listener: (
                this: NetworkInformation,
                ev: NetworkInformationEventMap[K],
            ) => any,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Hierarchy

    • EventTarget
      • NetworkInformation
    Index
    downlink: number | undefined

    Approximate downlink speed in megabits per second. Rounded to the nearest 25 kbps, based on recent throughput over active connections. May be undefined if no estimate is available.

    A string describing the general quality of the connection (for example, "4g", "3g"). Determined from both downlink and latency estimates.

    rtt: number

    Estimated round-trip latency of the current connection in milliseconds, rounded to the nearest multiple of 25 ms.

    saveData: boolean

    Indicates whether the user has requested reduced data usage in the user agent’s settings.

    Type of underlying network connection in use (for example, "wifi", "cellular"). May be omitted if unknown.