// Type definitions for moonstone/UiScroller import * as React from "react"; type Omit = Pick>; type Merge = Omit> & N; export interface ScrollerBaseProps { /** * A callback function that receives a reference to the `scrollTo` feature. * * Once received, the `scrollTo` method can be called as an imperative interface. * * The `scrollTo` function accepts the following parameters: * * {position: {x, y}} - Pixel value for x and/or y position * * {align} - Where the scroll area should be aligned. Values are: `'left'` , `'right'` , `'top'` , `'bottom'` , `'topleft'` , `'topright'` , `'bottomleft'` , and `'bottomright'` . * * {node} - Node to scroll into view * * {animate} - When `true` , scroll occurs with animation. When `false` , no animation occurs. * * {focus} - When `true` , attempts to focus item after scroll. Only valid when scrolling by `index` or `node` . * * Note: Only specify one of: `position` , `align` , `index` or `node` * * Example: * ``` // If you set cbScrollTo prop like below; cbScrollTo: (fn) => {this.scrollTo = fn;} // You can simply call like below; this.scrollTo({align: 'top'}); // scroll to the top ``` */ cbScrollTo?: Function; /** * Direction of the scroller. * * Valid values are: * * `'both'` , * * `'horizontal'` , and * * `'vertical'` . */ direction?: string; /** * Specifies how to show horizontal scrollbar. * * Valid values are: * * `'auto'` , * * `'visible'` , and * * `'hidden'` . */ horizontalScrollbar?: string; /** * Prevents scroll by wheeling on the scroller. */ noScrollByWheel?: boolean; /** * Called when scrolling. * * Passes `scrollLeft` and `scrollTop` . It is not recommended to set this prop since it can cause performance degradation. Use `onScrollStart` or `onScrollStop` instead. */ onScroll?: Function; /** * Called when scroll starts. * * Passes `scrollLeft` and `scrollTop` . * * Example: * ``` onScrollStart = ({scrollLeft, scrollTop}) => { // do something with scrollLeft and scrollTop } render = () => ( ) ``` */ onScrollStart?: Function; /** * Called when scroll stops. * * Passes `scrollLeft` and `scrollTop` . * * Example: * ``` onScrollStop = ({scrollLeft, scrollTop}) => { // do something with scrollLeft and scrollTop } render = () => ( ) ``` */ onScrollStop?: Function; /** * Specifies how to show vertical scrollbar. * * Valid values are: * * `'auto'` , * * `'visible'` , and * * `'hidden'` . */ verticalScrollbar?: string; } /** * An unstyled base scroller component. * * In most circumstances, you will want to use the Scrollable version. */ export class ScrollerBase extends React.Component< Merge, ScrollerBaseProps> > {}