import { YUIComponent } from './component';

interface ScrollbarInstance {
  wrapperEl: HTMLElement;
  wrapperScrollTop: number;
  wrapperScrollLeft: number;
  wrapperScrollHeight: number;
  wrapperScrollWidth: number;
  el: HTMLElement;
  width: number;
  height: number;
}

/** Scrollbar Component */
export declare class YScrollbar extends YUIComponent {
  /** Determine the scroll used by native scrollbar or not */
  native: boolean;

  /**
   * Determine the component resize event is enable
   * @default: true
   */
  enableResizeListener: boolean;

  /**
   * The distance of scroll bottom, would trigger scrollOnBottom and bottom event
   * @default: 0
   */
  bottomDistance: number;

  /**
   * Custom function, would trigger when the scroll on bottom
   * @default: null
   */
  scrollOnBottom: () => void;

  /**
   * scroll event
   *
   * <y-scrollbar @scroll="xx"></y-scrollbar>
   */
  scroll: (si: ScrollbarInstance) => void;

  /**
   * Like scrollOnBottom, bottom event
   *
   * <y-scrollbar @bottom="xx"></y-scrollbar>
   * */
  bottom: () => void;
}
