/** * @name whenVisible * @namespace js.dom.when * @type Function * @platform js * @status stable * @async * * Monitor an HTMLElement to be notified when it is visible * * @feature Promise based API * * @param {HTMLElement} $elm The element to monitor * @return (Promise) The promise that will be resolved when the element is visible * * @snippet __whenVisible($1) * __whenVisible($1).then(\$elm => { * $2 * }); * * @todo tests * * @example js * import { __whenVisible } from '@lotsof/sugar/dom' * __whenVisible(myCoolHTMLElement).then(($elm) => { * // do something with your element that is now visible * }); * * @since 1.0.0 * @author Olivier Bossel (https://lotsof.dev) */ export type TWhenVisibleSettings = { whenVisible?: Function; whenInvisible?: Function; once: boolean; }; export default function __whenVisible($elm: HTMLElement, settings?: Partial): Promise;