UNPKG

@cisstech/nge

Version:

NG Essentials is a collection of libraries for Angular developers.

39 lines (38 loc) 2.19 kB
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy } from '@angular/core'; import * as i0 from "@angular/core"; export declare class ViewportIntersectionDirective implements AfterViewInit, OnDestroy { private readonly element; /** * An optional reference to a container element with its own scrollable area. If not provided, the viewport is used as the default container. */ scrollContainer?: HTMLElement | null; /** * A single number or an array of numbers indicating at what percentage of the target's * visibility the observer's callback should be executed. * For example, a threshold of 1.0 means the callback will trigger when 100% of the target is visible within the observed area. * * Please refers to the official documentation of Intersection API for more informations. */ threshold?: number | number[]; /** * A margin around the root element. * This margin works like the CSS margin property, setting how much of the root should be seen before the intersection is observed. * It's specified in pixels or percentages. * * Please refers to the official documentation of Intersection API for more informations. */ rootMargin?: string; debug: boolean; /** * This event is emitted whenever the observed element intersects with the viewport or the specified scrollContainer * according to the given threshold and rootMargin. */ intersected: EventEmitter<void>; private intersectionObserver?; constructor(element: ElementRef<HTMLElement>); ngAfterViewInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ViewportIntersectionDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ViewportIntersectionDirective, "[viewportIntersection]", never, { "scrollContainer": { "alias": "scrollContainer"; "required": false; }; "threshold": { "alias": "threshold"; "required": false; }; "rootMargin": { "alias": "rootMargin"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; }, { "intersected": "intersected"; }, never, never, true, never>; static ngAcceptInputType_debug: unknown; }