@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
23 lines (22 loc) • 738 B
TypeScript
import { BaseInterface, BaseDecorator } from '../Base/types.js';
import type { Base, BaseProps } from '../Base/index.js';
export interface WithMountWhenInViewProps extends BaseProps {
$options: {
intersectionObserver: IntersectionObserverInit;
};
}
export interface WithMountWhenInViewInterface extends BaseInterface {
/**
* @private
*/
__isVisible: boolean;
/**
* @private
*/
__observer: IntersectionObserver;
$mount(): this;
}
/**
* IntersectionObserver decoration.
*/
export declare function withMountWhenInView<S extends Base = Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithMountWhenInViewInterface, S, WithMountWhenInViewProps>;