6.4.4 • Published 6 months ago
@types/react-page-visibility v6.4.4
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
// Type definitions for react-page-visibility 6.4
// Project: https://github.com/pgilad/react-page-visibility#readme
// Definitions by: Daniel <https://github.com/dannycochran>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
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: Thu, 08 Jul 2021 22:41:24 GMT
- Dependencies: @types/react
- Global values: none
Credits
These definitions were written by Daniel.