DefinitelyTyped/types/makeup-expander/makeup-expander-tests.ts
2018-10-22 22:37:46 +02:00

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();
}