export type IntersectCallback = () => void;
export interface IntersectOptions {
/** Called every time the element enters the viewport. */
onVisible?: IntersectCallback;
/** Called every time the element leaves the viewport. */
onHidden?: IntersectCallback;
/**
* Margin around the viewport in CSS syntax (e.g. `"200px"` or `"10%"`).
* Positive values trigger callbacks before the element fully crosses the
* viewport edge. Default: `"0px"`.
*/
rootMargin?: string;
/**
* Intersection ratio threshold (0–1) at which callbacks fire.
* Default: `0`.
*/
threshold?: number;
}
/**
* Attach an `IntersectionObserver` to an element and respond to both
* enter and exit viewport transitions.
*
* ```ts
* html`
`
*
* // With options
* html``
* ```
*/
export declare function onIntersect(options: IntersectOptions): import("lit-html/directive").DirectiveResult;
/**
* Fire `callback` every time the element enters the viewport.
*
* ```ts
* // Infinite scroll sentinel
* html` loadNextPage())}>
`
*
* // Prefetch before fully visible
* html` prefetch(), { rootMargin: "300px" })}>
`
* ```
*
* @param callback - Called on every enter transition.
* @param options - Optional `rootMargin` / `threshold` tuning.
*/
export declare function onVisible(callback: IntersectCallback, options?: Pick): import("lit-html/directive").DirectiveResult;
/**
* Fire `callback` every time the element leaves the viewport.
*
* ```ts
* // Pause when out of view
* html``
*
* // Track when an ad leaves the screen
* html` trackExit())}>
`
* ```
*
* @param callback - Called on every exit transition.
* @param options - Optional `rootMargin` / `threshold` tuning.
*/
export declare function onHidden(callback: IntersectCallback, options?: Pick): import("lit-html/directive").DirectiveResult;
//# sourceMappingURL=intersectDirective.d.ts.map