mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for basicLightbox * Fix header * Add strictFunctionTypes * Fix linting errors * Fix return type of instance.visible()
28 lines
653 B
TypeScript
28 lines
653 B
TypeScript
import * as basicLightbox from 'basiclightbox';
|
|
|
|
const instance = basicLightbox.create(`
|
|
<h1>Dynamic Content</h1>
|
|
<p>You can set the content of the lightbox with JS.</p>
|
|
`);
|
|
|
|
const instance2 = basicLightbox.create(`
|
|
<h1>Not closable</h1>
|
|
<p>It's not possible to close this lightbox with a click.</p>
|
|
`, {
|
|
closable: false
|
|
});
|
|
|
|
const instance3 = basicLightbox.create(
|
|
document.querySelector('#template')!
|
|
);
|
|
|
|
const visible = basicLightbox.visible();
|
|
|
|
instance.show(() => console.log('lightbox now visible'));
|
|
|
|
instance.close(() => console.log('lightbox not visible anymore'));
|
|
|
|
const visible2 = instance.visible();
|
|
|
|
const elem = instance.element();
|