@spartacus/storefront
Version:
Spartacus Storefront is a package that you can include in your application, which allows you to add default storefront features.
35 lines (34 loc) • 1.5 kB
TypeScript
import { Observable } from 'rxjs';
import { LayoutConfig } from '../config/layout-config';
import { IntersectionOptions } from './intersection.model';
import * as i0 from "@angular/core";
/**
* The IntersectionService uses the native IntersectionObserver (v2), which
* can be used to implement pre-loading and deferred loading of DOM content.
*
*/
export declare class IntersectionService {
protected config: LayoutConfig;
constructor(config: LayoutConfig);
/**
* Returns an Observable that emits only once a boolean value whenever
* the given element has shown in the view port.
*
* The returned observable will only emit the first value. The
* observable must be cleaned up either way, since the value might never emit; it
* depends on whether the element appears in the view port.
*/
isIntersected(element: HTMLElement, options?: IntersectionOptions): Observable<boolean>;
/**
* Indicates whenever the element intersects the view port. An optional margin
* is used to intersects before the element shows up in the viewport.
* A value is emitted each time the element intersects.
*
* This is private for now, but could be exposed as a public API
* to introduce additional (css) render effects to the UI.
*/
private intersects;
private getRootMargin;
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IntersectionService>;
}