Installation
npm install --save @types/react-page-visibility
Summary
This package contains type definitions for react-page-visibility (https://github.com/pgilad/react-page-visibility#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-page-visibility.
index.d.ts
import { Component } from "react";
/**
* A hook which returns whether the page is currently visible.
*/
export function usePageVisibility(): boolean;
/**
* Note that support for these states differs by browser.
*/
export type KnownVisibilityStates = "visible" | "hidden" | "prerender" | "unloaded";
export interface PageVisibilityProps {
children?:
| React.ReactNode
| ((isVisible: boolean, visibilityState: KnownVisibilityStates) => React.ReactNode)
| undefined;
onChange?: ((isVisible: boolean, visibilityState: KnownVisibilityStates) => void) | undefined;
}
/**
* A higher order component for managing visibility state via the child
* rendering pattern.
*/
export default class PageVisibility extends Component<PageVisibilityProps> {}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/react
Credits
These definitions were written by Daniel.