import * as i0 from '@angular/core'; /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** * What to scroll to — an `Element`, an `id` string (looked up via * `getElementById`), an arbitrary CSS selector, or absolute coordinates. */ type WrScrollTarget = Element | string | { top: number; left?: number; }; /** Options accepted by {@link WrScroll} scroll methods. */ interface WrScrollOptions { /** Pixel offset to subtract from the target — handy for sticky headers. @default 0 */ readonly offset?: number; /** Smooth or instant scrolling. @default true (smooth) */ readonly smooth?: boolean; /** * Scroll container. `window` (default) means the document; pass an * `Element` to scroll a nested overflow container instead. */ readonly container?: Window | Element; } /** * Smooth-scroll utility. Resolves `id` / selector / element / coords * targets; subtracts an `offset` (for sticky headers); respects * `prefers-reduced-motion` — automatically falls back to instant * scrolling when the user has opted out. * * SSR-safe — all methods no-op on the server. * * @example * ```ts * const scroll = inject(WrScroll); * scroll.to('#section-three', { offset: 80 }); * scroll.toTop({ smooth: false }); * scroll.intoView(myEl, { offset: 64 }); * ``` * * @see https://ngwr.dev/services/scroll */ declare class WrScroll { private readonly doc; private readonly platform; /** Scroll to an arbitrary target. */ to(target: WrScrollTarget, options?: WrScrollOptions): void; /** Convenience for an element — accepts the same options. */ intoView(el: Element, options?: WrScrollOptions): void; /** Scroll the page (or container) to the top. */ toTop(options?: WrScrollOptions): void; private resolveSelector; private behavior; private scroll; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { WrScroll }; export type { WrScrollOptions, WrScrollTarget };