@types/react-scrollbar
TypeScript icon, indicating that this package has built-in type declarations

0.5.7 • Public • Published

Installation

npm install --save @types/react-scrollbar

Summary

This package contains type definitions for react-scrollbar (https://github.com/souhe/reactScrollbar).

Details

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

/// <reference types="react" />

interface ScrollAreaProps extends React.RefAttributes<ScrollArea> {
    children?: React.ReactNode;
    className?: string | undefined;
    style?: React.CSSProperties | undefined;
    speed?: number | undefined;
    contentClassName?: string | undefined;
    contentStyle?: React.CSSProperties | undefined;
    vertical?: boolean | undefined;
    verticalContainerStyle?: React.CSSProperties | undefined;
    verticalScrollbarStyle?: React.CSSProperties | undefined;
    horizontal?: boolean | undefined;
    horizontalContainerStyle?: React.CSSProperties | undefined;
    horizontalScrollbarStyle?: React.CSSProperties | undefined;
    onScroll?:
        | ((
            value: {
                leftPosition: number;
                topPosition: number;
                containerHeight: number;
                containerWidth: number;
                realHeight: number;
                realWidth: number;
            },
        ) => void)
        | undefined;
    contentWindow?: any;
    ownerDocument?: any;
    smoothScrolling?: boolean | undefined;
    minScrollSize?: number | undefined;
    swapWheelAxes?: boolean | undefined;
    stopScrollPropagation?: boolean | undefined;
    focusableTabIndex?: number | undefined;
}

declare class ScrollArea extends React.Component<ScrollAreaProps> {
    /**
     * Allows manual refreshing of the scrollbar.
     */
    refresh: () => void;

    /**
     * Allows to scroll to the top of ScrollArea component.
     */
    scrollTop: () => void;

    /**
     * Allows to scroll to the bottom of ScrollArea component.
     */
    scrollBottom: () => void;

    /**
     * Moves vertical scrollbar.
     * topPosition is a distance between the top of scrollArea container and the top of scrollArea content.
     */
    scrollYTo: (topPosition: number) => void;

    /**
     * Allows to scroll to the left of ScrollArea component.
     */
    scrollLeft: () => void;

    /**
     * Allows to scroll to the right of ScrollArea component.
     */
    scrollRight: () => void;

    /**
     * Moves horizontal scrollbar.
     * leftPosition is a distance between left edge of scrollArea container and left edge of scrollArea content.
     */
    scrollXTo: (leftPosition: number) => void;
}

declare module "react-scrollbar" {
    export = ScrollArea;
}

declare module "react-scrollbar/dist/no-css" {
    export = ScrollArea;
}

Additional Details

  • Last updated: Fri, 01 Mar 2024 01:31:11 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Stephen Jelfs, and Hugo Capocci.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/react-scrollbar

Weekly Downloads

3,644

Version

0.5.7

License

MIT

Unpacked Size

7.71 kB

Total Files

5

Last publish

Collaborators

  • types