mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-18 06:42:52 +00:00
* move old typings in v2 * add new typings * fix linter errors * move tests under v2 * add more classes * revert original comments in v2
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
function test_constructorWithoutOpts() {
|
|
new SimpleBar(document.getElementById('myElement'));
|
|
}
|
|
|
|
function test_constructor() {
|
|
new SimpleBar(document.getElementById('myElement'), {
|
|
autoHide: true,
|
|
clickOnTrack: true,
|
|
direction: 'ltr',
|
|
forceVisible: 'x',
|
|
scrollbarMaxSize: 20,
|
|
scrollbarMinSize: 10,
|
|
timeout: 300,
|
|
});
|
|
}
|
|
|
|
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_instanceFunctions() {
|
|
const el = new SimpleBar(document.getElementById('myElement'));
|
|
el.recalculate();
|
|
const contentEl: Element = el.getContentElement();
|
|
const scrollEl: Element = el.getScrollElement();
|
|
}
|
|
|
|
function test_staticFunctions() {
|
|
SimpleBar.removeObserver();
|
|
SimpleBar.instances.get(new HTMLDivElement());
|
|
}
|