mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
22 lines
461 B
TypeScript
22 lines
461 B
TypeScript
import Expander = require('makeup-expander');
|
|
|
|
const widgetEl: HTMLElement | null = document.querySelector('.expander');
|
|
|
|
const options: Expander.Options = {
|
|
expandOnClick: true
|
|
};
|
|
|
|
if (widgetEl) {
|
|
// $ExpectType Expander
|
|
new Expander(widgetEl);
|
|
|
|
// $ExpectType Expander
|
|
const widget = new Expander(widgetEl, options);
|
|
|
|
// $ExpectType void
|
|
widget.expand(true);
|
|
|
|
// $ExpectType boolean
|
|
const expanded = widget.isExpanded();
|
|
}
|