6.4.4 • Published 6 months ago

@types/react-page-visibility v6.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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.

6.4.3

7 months ago

6.4.2

8 months ago

6.4.4

6 months ago

6.4.1

3 years ago

6.4.0

3 years ago