import { Injector } from '@angular/core'; export interface InjectIsIntersectingOptions { injector?: Injector; element?: Element; } /** * Injects an observable that emits whenever the element is intersecting the viewport. * The observable will complete when the element is destroyed. * @param options * * @example * export class MyComponent { * private destroyRef = inject(DestroyRef); * * isIntersecting$ = injectIsIntersecting(); * isInViewport$ = this.isIntersecting$.pipe( * filter(x => x.intersectionRatio > 0), * take(1), * ); * * ngOnInit() { * this.getData().subscribe(); * } * * getData() { * // Only fetch data when the element is in the viewport * return this.isInViewport$.pipe( * switchMap(() => this.service.getData()), * takeUntil(this.destroy$) * ); * } * } */ export declare const injectIsIntersecting: ({ injector, element, }?: InjectIsIntersectingOptions) => import("rxjs").Subject;