UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

40 lines (39 loc) 1.61 kB
import { ESLMixinElement } from '../../esl-mixin-element/core'; import { ESLIntersectionEvent } from '../../esl-event-listener/core/targets/intersection.target'; export declare class ESLLazyTemplate extends ESLMixinElement { static is: string; protected baseMargin: number; protected INTERSECTION_THRESHOLD: number[]; /** URL to load content from */ url?: string; /** IntersectionObserver rootMargin value */ protected get rootMargin(): string; /** Connection speed ratio */ protected get connectionRatio(): number; /** Host element is a template */ protected get isHostTemplate(): boolean; /** LazyTemplate placeholder */ get $placeholder(): HTMLElement; /** LazyTemplate viewport (root element for IntersectionObservers checking visibility) */ protected get $viewport(): Element | undefined; protected disconnectedCallback(): void; /** Loads content from the URL */ protected loadContent(url: string): Promise<Node | string>; /** Gets content from the URL or host template element */ protected getContent(): Promise<string | Node>; /** Replaces host element with content */ protected replaceWithContent(): Promise<void>; protected _onIntersect(e: ESLIntersectionEvent): void; } declare global { export interface ESLLibrary { LazyTemplate: typeof ESLLazyTemplate; } interface Navigator extends NavigatorNetworkInformation { } interface NavigatorNetworkInformation { readonly connection?: { readonly effectiveType: 'slow-2g' | '2g' | '3g' | '4g'; }; } }