Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

73 linhas
2.3 KiB

  1. import './polyfills';
  2. import * as I from './interfaces/';
  3. import { Scrollbar } from './scrollbar';
  4. import { ScrollbarPlugin } from './plugin';
  5. export { ScrollbarPlugin };
  6. /*!
  7. * cast `I.Scrollbar` to `Scrollbar` to avoid error
  8. *
  9. * `I.Scrollbar` is not assignable to `Scrollbar`:
  10. * "privateProp" is missing in `I.Scrollbar`
  11. *
  12. * @see https://github.com/Microsoft/TypeScript/issues/2672
  13. */
  14. export default class SmoothScrollbar extends Scrollbar {
  15. static version: string;
  16. static ScrollbarPlugin: typeof ScrollbarPlugin;
  17. /**
  18. * Initializes a scrollbar on the given element.
  19. *
  20. * @param elem The DOM element that you want to initialize scrollbar to
  21. * @param [options] Initial options
  22. */
  23. static init(elem: HTMLElement, options?: Partial<I.ScrollbarOptions>): Scrollbar;
  24. /**
  25. * Automatically init scrollbar on all elements base on the selector `[data-scrollbar]`
  26. *
  27. * @param options Initial options
  28. */
  29. static initAll(options?: Partial<I.ScrollbarOptions>): Scrollbar[];
  30. /**
  31. * Check if there is a scrollbar on given element
  32. *
  33. * @param elem The DOM element that you want to check
  34. */
  35. static has(elem: HTMLElement): boolean;
  36. /**
  37. * Gets scrollbar on the given element.
  38. * If no scrollbar instance exsits, returns `undefined`
  39. *
  40. * @param elem The DOM element that you want to check.
  41. */
  42. static get(elem: HTMLElement): Scrollbar | undefined;
  43. /**
  44. * Returns an array that contains all scrollbar instances
  45. */
  46. static getAll(): Scrollbar[];
  47. /**
  48. * Removes scrollbar on the given element
  49. */
  50. static destroy(elem: HTMLElement): void;
  51. /**
  52. * Removes all scrollbar instances from current document
  53. */
  54. static destroyAll(): void;
  55. /**
  56. * Attaches plugins to scrollbars
  57. *
  58. * @param ...Plugins Scrollbar plugin classes
  59. */
  60. static use(...Plugins: (typeof ScrollbarPlugin)[]): void;
  61. /**
  62. * Attaches default style sheets to current document.
  63. * You don't need to call this method manually unless
  64. * you removed the default styles via `Scrollbar.detachStyle()`
  65. */
  66. static attachStyle(): void;
  67. /**
  68. * Removes default styles from current document.
  69. * Use this method when you want to use your own css for scrollbars.
  70. */
  71. static detachStyle(): void;
  72. }