Socket
Book a DemoInstallSign in
Socket

@types/react-detect-offline

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-detect-offline

TypeScript definitions for react-detect-offline

ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
2.4.6
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/react-detect-offline

Summary

This package contains type definitions for react-detect-offline (https://github.com/cwise89/react-detect-offline#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-detect-offline.

index.d.ts

import { JSX } from "react";

export interface PollingConfig {
    /**
     * URL to pool for connection status
     */
    url: string;
    /**
     * Force polling on or off.
     * Polling is only used as a fallback for browsers that don't support the `"online"` event.
     * Currently these are Chrome on Windows, Firefox on Windows, and Chrome on Linux.
     */
    enabled: boolean;
    /**
     * How often (in ms) to poll
     */
    interval: number;
    /**
     * How long (in ms) before timeout
     */
    timeout: number;
}
export interface BaseProps {
    children?: React.ReactNode | undefined;
    /**
     * Called when connection changes
     */
    // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
    onChange?: ((online: boolean) => void | undefined) | undefined;
    wrapperType?: string | undefined;
    /**
     * Config for polling fallback
     */
    polling?: boolean | Partial<Omit<PollingConfig, "enabled">> | undefined;
}
export interface BaseState {
    online: boolean;
}
export const defaultProps: BaseProps;
export const defaultPollingConfig: PollingConfig;
export const Base: React.ComponentClass<BaseProps, BaseState>;
export interface DetectorProps extends BaseProps {
    render: ({ online }: { online: boolean }) => JSX.Element | null;
}
export interface DetectorState extends BaseState {}
export const Detector: React.ComponentClass<DetectorProps, DetectorState>;
export interface OnlineProps extends BaseProps {}
export interface OnlineState extends BaseState {}
export const Online: React.ComponentClass<OnlineProps, OnlineState>;
export interface OfflineProps extends BaseProps {}
export interface OfflineState extends BaseState {}
export const Offline: React.ComponentClass<OfflineProps, OfflineState>;

Additional Details

  • Last updated: Fri, 14 Nov 2025 18:40:46 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Rhythm Bhiwani.

FAQs

Package last updated on 14 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts