5.0.4 • Published 6 months ago

@types/react-collapse v5.0.4

Weekly downloads
20,684
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-collapse

Summary

This package contains type definitions for react-collapse (https://github.com/nkbt/react-collapse).

Details

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

index.d.ts

// Type definitions for react-collapse 5.0
// Project: https://github.com/nkbt/react-collapse
// Definitions by:  Adam Binford <https://github.com/Kimahriman>
//                  Kristofer Giltvedt Selbekk <https://github.com/selbekk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';

export interface CollapseCallbackArgs {
    /** `true` only when Collapse reached final height */
    isFullyOpened: boolean;
    /** `true` only when Collapse is fully closed and height is zero */
    isFullyClosed: boolean;
    /** `true` if Collapse has any non-zero height */
    isOpened: boolean;
    /** current pixel height of Collapse container (changes until reaches `contentHeight`) */
    containerHeight: number;
    /** determined height of supplied Content */
    contentHeight: number;
}

export interface CollapseProps extends React.HTMLProps<Collapse> {
    /** Expands or collapses content. */
    isOpened: boolean;
    /** One or multiple children with static, variable or dynamic height. */
    children: React.ReactNode;
    /** It is possible to set className for extra div elements that ReactCollapse creates. */
    theme?: {
        collapse?: string | undefined;
        content?: string | undefined;
    } | undefined;
    /** Callback function triggered when animation has completed */
    onRest?: ((args: CollapseCallbackArgs) => void) | undefined;
    /** Callback function triggered when animation begins */
    onWork?: ((args: CollapseCallbackArgs) => void) | undefined;
    /** A way to control the initial element style. Will not be valid after the initial render */
    initialStyle?: {
        height?: string | number | undefined;
        overflow?: string | undefined;
    } | undefined;
    /** How often (in ms) the height of the content is checked. */
    checkTimeout?: number | undefined;
}

export class Collapse extends React.PureComponent<CollapseProps> {}

export class UnmountClosed extends React.PureComponent<CollapseProps> {}

Additional Details

  • Last updated: Wed, 07 Jul 2021 17:33:35 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Adam Binford, and Kristofer Giltvedt Selbekk.