You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
2.9 KiB

  1. declare module 'simplebar-vue' {
  2. import { DefineComponent } from 'vue';
  3. import SimpleBar from 'simplebar';
  4. export type SimpleBarComponent = DefineComponent<{ // Props
  5. /**
  6. * By default SimpleBar automatically hides the scrollbar if the user is not scrolling
  7. * (it emulates Mac OSX Lion's scrollbar). You can make the scrollbar always visible
  8. * by passing `false`.
  9. *
  10. * Default value is `true`.
  11. *
  12. * You can also control the animation via CSS as it's a simple CSS opacity transition.
  13. */
  14. autoHide?: boolean;
  15. /**
  16. * It is possible to change the default class names that SimpleBar uses.
  17. * To get your own styles to work refer to simplebar.css to get an idea how to setup your css.
  18. * - `content` represents the wrapper for the content being scrolled.
  19. * - `scrollContent` represents the container containing the elements being scrolled.
  20. * - `scrollbar` defines the style of the scrollbar with which the user can interact to scroll the content.
  21. * - `track` styles the area surrounding the `scrollbar`.
  22. *
  23. * ```js
  24. * classNames: {
  25. * // defaults
  26. * content: 'simplebar-content',
  27. * scrollContent: 'simplebar-scroll-content',
  28. * scrollbar: 'simplebar-scrollbar',
  29. * track: 'simplebar-track'
  30. * }
  31. * ```
  32. */
  33. classNames?: Partial<{ content: string; scrollContent: string; scrollbar: string; track: string }>;
  34. /**
  35. * Force the track to be visible (same behaviour as `overflow: scroll`).
  36. * Can be `boolean | 'x' | 'y'`, defaults to `false`, which behaves like `overflow: auto`.
  37. */
  38. forceVisible?: boolean | 'x' | 'y';
  39. /**
  40. * Set custom aria-label attribute for users with screen reader.
  41. */
  42. ariaLabel?: string;
  43. /**
  44. * Set custom tabIndex attribute.
  45. */
  46. tabIndex?: number;
  47. /**
  48. * Activate RTL support by passing `'rtl'`.
  49. * You will also need a css rule with `direction: rtl`.
  50. */
  51. direction?: 'ltr' | 'rtl';
  52. /**
  53. * Define the delay until the scrollbar hides. Has no effect if `autoHide` is `false`.
  54. * Default value is `1000`.
  55. */
  56. timeout?: number;
  57. /**
  58. * Controls the click on track behaviour.
  59. * Default to `true`.
  60. */
  61. clickOnTrack?: boolean;
  62. /**
  63. * Controls the min size of the scrollbar in `px`.
  64. * Default is `25`.
  65. */
  66. scrollbarMinSize?: number;
  67. /**
  68. * Controls the max size of the scrollbar in `px`.
  69. * Default is `0` (no max size).
  70. */
  71. scrollbarMaxSize?: number;
  72. },
  73. { }, // RawBindings
  74. { // Data
  75. SimpleBar: SimpleBar;
  76. contentElement: HTMLDivElement;
  77. scrollElement: HTMLDivElement;
  78. },
  79. { }, // Computed
  80. { // Methods
  81. recalculate (): void;
  82. },
  83. { }, // Mixins
  84. { }, // Extends
  85. { // Emits
  86. scroll: ($event: Event & { target: HTMLElement }) => void
  87. }>;
  88. const Component: SimpleBarComponent;
  89. export default Component;
  90. }