UNPKG

mithril-materialized

Version:
39 lines (38 loc) 1.21 kB
import { FactoryComponent, Attributes } from 'mithril'; export interface MaterialBoxOptions { /** Animation duration in ms */ inDuration?: number; /** Animation duration in ms for closing */ outDuration?: number; /** Callback when materialbox is opened */ onOpenStart?: () => void; /** Callback when materialbox is closed */ onCloseStart?: () => void; /** Callback when materialbox opening animation is complete */ onOpenEnd?: () => void; /** Callback when materialbox closing animation is complete */ onCloseEnd?: () => void; } export interface MaterialBoxAttrs extends MaterialBoxOptions, Attributes { /** Source image path */ src: string; /** Alt text for the image */ alt?: string; /** * Width of the image * @default undefined */ width?: number; /** * Height of the image * @default undefined */ height?: number; /** Caption for the image overlay */ caption?: string; } /** * Pure TypeScript MaterialBox - creates an image lightbox that fills the screen when clicked * Uses CSS classes from _materialbox.scss */ export declare const MaterialBox: FactoryComponent<MaterialBoxAttrs>;