DefinitelyTyped/types/simplebar/simplebar-tests.ts
Leonard Thieu c5a75a3c31 [simplebar] Update type definitions (new for v2) (#16767)
* Update type definitions for simplebar (new for v2).

* dtslint bug workaround (and fix linter errors exposed).
2017-05-31 22:02:41 -07:00

52 lines
1.4 KiB
TypeScript

function test_start() {
new SimpleBar(document.getElementById('myElement'));
}
function test_options_wrapContent() {
new SimpleBar(document.getElementById('myElement'), { wrapContent: false });
}
function test_options_autoHide() {
new SimpleBar(document.getElementById('myElement'), { autoHide: false });
}
function test_options_scrollbarMinSize() {
new SimpleBar(document.getElementById('myElement'), { scrollbarMinSize: 10 });
}
function test_options_classNames() {
new SimpleBar(document.getElementById('myElement'), {
classNames: {
// defaults
content: 'simplebar-content',
scrollContent: 'simplebar-scroll-content',
scrollbar: 'simplebar-scrollbar',
track: 'simplebar-track'
}
});
}
function test_recalculate() {
const el = new SimpleBar(document.getElementById('myElement'));
el.recalculate();
}
function test_getScrollElement() {
const el = new SimpleBar(document.getElementById('myElement'));
el.getScrollElement();
}
function test_scrollEvent() {
const el = new SimpleBar(document.getElementById('myElement'));
el.getScrollElement().addEventListener('scroll', () => { });
}
function test_getContentElement() {
const el = new SimpleBar(document.getElementById('myElement'));
el.getContentElement();
}
function test_removeObserver() {
SimpleBar.removeObserver();
}