UNPKG

@ng-web-apis/intersection-observer

Version:

A library for declarative use of Intersection Observer API with Angular

62 lines (49 loc) 3.29 kB
import * as i0 from '@angular/core'; import { OnDestroy, InjectionToken, ElementRef } from '@angular/core'; import { Observable } from 'rxjs'; declare class WaIntersectionObservee { readonly waIntersectionObservee: i0.OutputRef<IntersectionObserverEntry[]>; static ɵfac: i0.ɵɵFactoryDeclaration<WaIntersectionObservee, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<WaIntersectionObservee, "[waIntersectionObservee]", never, {}, { "waIntersectionObservee": "waIntersectionObservee"; }, never, never, true, never>; } declare const SafeObserver: { new (callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver; prototype: IntersectionObserver; }; declare class WaIntersectionObserverDirective extends SafeObserver implements OnDestroy { private readonly callbacks; margin: string; threshold: string; constructor(); observe(target: Element, callback?: IntersectionObserverCallback): void; unobserve(target: Element): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<WaIntersectionObserverDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<WaIntersectionObserverDirective, "[waIntersectionObserver]", ["IntersectionObserver"], { "margin": { "alias": "waIntersectionRootMargin"; "required": false; }; "threshold": { "alias": "waIntersectionThreshold"; "required": false; }; }, {}, never, never, true, never>; } declare class WaIntersectionRoot { static ɵfac: i0.ɵɵFactoryDeclaration<WaIntersectionRoot, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<WaIntersectionRoot, "[waIntersectionRoot]", never, {}, {}, never, never, true, never>; } declare const WaIntersectionObserver: readonly [typeof WaIntersectionObserverDirective, typeof WaIntersectionObservee, typeof WaIntersectionRoot]; declare class WaIntersectionObserveeService extends Observable<IntersectionObserverEntry[]> { constructor(); static ɵfac: i0.ɵɵFactoryDeclaration<WaIntersectionObserveeService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<WaIntersectionObserveeService>; } declare class WaIntersectionObserverService extends Observable<IntersectionObserverEntry[]> { private readonly nativeElement; private readonly rootMargin; private readonly threshold; private readonly root; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration<WaIntersectionObserverService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<WaIntersectionObserverService>; } declare const WA_INTERSECTION_ROOT: InjectionToken<ElementRef<Element>>; declare const WA_INTERSECTION_ROOT_MARGIN_DEFAULT = "0px 0px 0px 0px"; declare const WA_INTERSECTION_ROOT_MARGIN: InjectionToken<string>; declare const WA_INTERSECTION_THRESHOLD_DEFAULT = 0; declare const WA_INTERSECTION_THRESHOLD: InjectionToken<number | number[]>; declare const WA_INTERSECTION_OBSERVER_SUPPORT: InjectionToken<boolean>; export { WA_INTERSECTION_OBSERVER_SUPPORT, WA_INTERSECTION_ROOT, WA_INTERSECTION_ROOT_MARGIN, WA_INTERSECTION_ROOT_MARGIN_DEFAULT, WA_INTERSECTION_THRESHOLD, WA_INTERSECTION_THRESHOLD_DEFAULT, WaIntersectionObservee, WaIntersectionObserveeService, WaIntersectionObserver, WaIntersectionObserverDirective, WaIntersectionObserverService, WaIntersectionRoot };