import * as _angular_core from '@angular/core'; import { InjectionToken, Type, ExistingProvider } from '@angular/core'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; declare const DEFAULT_SCROLL_EDGE_THRESHOLD = 8; declare const DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK = 64; declare const DEFAULT_SCROLL_MARGIN = 0; declare const SCROLL_POSITION_EPSILON = 0.5; declare const AUTOSCROLLING_CLEAR_DELAY = 180; declare const USER_SCROLL_KEYS: Set; type BrnMessageScrollerMode = 'following-bottom' | 'free-scrolling' | 'anchored-to-message' | 'settling-jump'; type BrnMessageScrollerDefaultScrollPosition = 'start' | 'end' | 'last-anchor'; type BrnMessageScrollerButtonDirection = 'start' | 'end'; type BrnMessageScrollerScrollAlign = 'start' | 'center' | 'end' | 'nearest'; type BrnMessageScrollerScrollOptions = { align?: BrnMessageScrollerScrollAlign; behavior?: ScrollBehavior; scrollMargin?: number; }; type BrnMessageScrollerScrollable = { start: boolean; end: boolean; }; type BrnMessageScrollerVisibilityState = { currentAnchorId: string | null; visibleMessageIds: string[]; }; type BrnMessageScrollerProviderProps = { autoScroll?: boolean; defaultScrollPosition?: BrnMessageScrollerDefaultScrollPosition; scrollEdgeThreshold?: number; scrollPreviousItemPeek?: number; scrollMargin?: number; }; type BrnMessageScrollerRegisterMessage = (messageId: string, element: HTMLElement | null, removedElement?: HTMLElement | null) => void; declare const EMPTY_MESSAGE_SCROLLER_SCROLLABLE: BrnMessageScrollerScrollable; declare const EMPTY_VISIBLE_MESSAGE_IDS: string[]; declare const EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE: BrnMessageScrollerVisibilityState; declare class BrnMessageScrollerButton { private readonly _scroller; protected readonly _pending: _angular_core.WritableSignal; /** * Transcript edge to scroll toward. * @default 'end' */ readonly direction: _angular_core.InputSignal; /** * Native scroll behavior when clicked. * @default 'smooth' */ readonly behavior: _angular_core.InputSignal; /** * Accessible name for the control. * When omitted, defaults from `direction` (`Scroll to end` / `Scroll to start`). */ readonly ariaLabel: _angular_core.InputSignal; /** Whether overflow exists toward this button's direction. */ readonly active: _angular_core.Signal; /** Resolved accessible name (explicit `aria-label` or direction default). */ readonly resolvedAriaLabel: _angular_core.Signal; constructor(); protected onClick(event: MouseEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnMessageScrollerContent { /** * aria-relevant for the live log region. * @default 'additions' */ readonly ariaRelevant: _angular_core.InputSignal; /** * Optional class name applied to the internal tail spacer. */ readonly spacerClassName: _angular_core.InputSignal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnMessageScrollerItem { /** * Stable row id for scrollToMessage, visibility, and prepend preservation. */ readonly messageId: _angular_core.InputSignal; /** * Marks a turn boundary that newly appended anchors and last-anchor restore use. * @default false */ readonly scrollAnchor: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnMessageScrollerProvider { /** * Follow new content at the bottom while the viewport is already at the end. * @default false */ readonly autoScroll: _angular_core.InputSignalWithTransform; /** * Opening position on the first non-empty render, applied once. * @default 'end' */ readonly defaultScrollPosition: _angular_core.InputSignal; /** * Distance from an edge that still counts as at-top/at-bottom. * @default 8 */ readonly scrollEdgeThreshold: _angular_core.InputSignalWithTransform; /** * Extra top margin for a newly anchored row, added to scrollMargin. * @default 64 */ readonly scrollPreviousItemPeek: _angular_core.InputSignalWithTransform; /** * Default margin on the aligned edge for commands and visibility. * @default 0 */ readonly scrollMargin: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnMessageScrollerRoot { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnMessageScrollerViewport { private readonly _scroller; /** * Keep the first visible messageId row stable on prepend. * @default true */ readonly preserveScrollOnPrepend: _angular_core.InputSignalWithTransform; /** * Accessible name for the scroll region. * @default 'Messages' */ readonly ariaLabel: _angular_core.InputSignal; /** * Tab index for keyboard scrolling. * @default 0 */ readonly tabIndex: _angular_core.InputSignalWithTransform; constructor(); protected onScroll(): void; protected onWheel(): void; protected onTouchMove(): void; protected onKeyDown(event: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Headless message-scroller controller. Owns scroll behavior and state; renders no DOM. * Combine refs, commands, and controller policy from the shadcn React implementation. */ declare class BrnMessageScroller { private _autoScroll; private _autoscrolling; private _autoscrollingTimeout; private _streamingTurn; private _content; private _defaultScrollPosition; private _defaultScrollPositionApplied; private _firstItem; private _itemCount; private _lastScrollTop; private readonly _messageElements; private _mode; private _pendingScrollFrame; private _pendingScrollToMessage; private _prependRestore; private _preserveScrollOnPrepend; private _root; private _scrollEdgeThreshold; private _scrollMargin; private _scrollPreviousItemPeek; private _spacerGap; private _spacerHeight; private _spacer; /** Height queued before the spacer mounts (created after hydration). */ private _pendingSpacerHeight; private _stateFrame; private _viewport; private _visibilityFrame; private _visibilityObserver; private _visibilityTracking; private readonly _visibleMessageIds; private _handledScrollAnchors; private _destroyed; private readonly _scrollable; private readonly _visibility; /** Scrollable edges snapshot (start / end overflow). */ readonly scrollable: _angular_core.Signal; /** Visibility snapshot (current anchor + visible message ids). Requires observeVisibility(). */ readonly visibility: _angular_core.Signal; /** * @internal * Whether prepend scroll preservation is enabled (mirrored from viewport). */ get preserveScrollOnPrepend(): boolean; /** @internal */ set preserveScrollOnPrepend(value: boolean); /** * @internal * Apply provider configuration. Safe to call when inputs change. */ configure(props: BrnMessageScrollerProviderProps): void; /** * Scroll a registered `messageId` into view. * Queues the request when the item is not mounted yet (empty transcript). * @returns false when the id is unknown and items are already present */ scrollToMessage(messageId: string, options?: BrnMessageScrollerScrollOptions): boolean; /** * Jump to the live end of the transcript. * With `autoScroll`, re-enters following-bottom mode. */ scrollToEnd({ behavior }?: BrnMessageScrollerScrollOptions): boolean; /** Jump to the start of the transcript and leave follow/anchor modes. */ scrollToStart({ behavior }?: BrnMessageScrollerScrollOptions): boolean; /** @internal */ registerMessage: BrnMessageScrollerRegisterMessage; /** @internal */ handleContentChange(): void; /** @internal */ handleResize(): void; /** @internal */ syncAfterScroll(): void; /** @internal */ userScrollIntent(): void; /** * Start tracking `visibility` (current anchor + visible message ids). * Uses IntersectionObserver when available; otherwise falls back to layout. */ observeVisibility(): void; /** Stop visibility tracking and reset the `visibility` signal. */ unobserveVisibility(): void; /** @internal */ setRootElement(element: HTMLDivElement | null): void; /** @internal */ clearRootElement(element: HTMLDivElement): void; /** @internal */ setViewportElement(element: HTMLDivElement | null): void; /** @internal */ clearViewportElement(element: HTMLDivElement): void; /** @internal */ setContentElement(element: HTMLDivElement | null): void; /** @internal */ clearContentElement(element: HTMLDivElement): void; /** @internal */ setSpacerElement(element: HTMLDivElement | null): void; /** @internal */ clearSpacerElement(element: HTMLDivElement): void; private resetForContentMount; /** @internal */ destroy(): void; private setAutoScrolling; private setTailSpacerHeight; private scrollToPosition; private scrollToElement; private reanchorToAnchoredMessage; private flushPendingScrollToMessage; private writeStateAttributes; /** Arm follow-bottom at the end; release only on real upward scroll (not content growth). */ private reconcileFollowMode; private commitScrollState; private scheduleStateCommit; private scheduleVisibilitySync; private restorePrependedAnchor; private capturePrependAnchor; private schedulePendingScrollToMessageFlush; private applyDefaultScrollPosition; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } declare const BrnMessageScrollerToken: InjectionToken; declare function injectBrnMessageScroller(): BrnMessageScroller; declare function provideBrnMessageScroller(scroller: Type): ExistingProvider; declare const BrnMessageScrollerImports: readonly [typeof BrnMessageScrollerProvider, typeof BrnMessageScrollerRoot, typeof BrnMessageScrollerViewport, typeof BrnMessageScrollerContent, typeof BrnMessageScrollerItem, typeof BrnMessageScrollerButton]; export { AUTOSCROLLING_CLEAR_DELAY, BrnMessageScroller, BrnMessageScrollerButton, BrnMessageScrollerContent, BrnMessageScrollerImports, BrnMessageScrollerItem, BrnMessageScrollerProvider, BrnMessageScrollerRoot, BrnMessageScrollerToken, BrnMessageScrollerViewport, DEFAULT_SCROLL_EDGE_THRESHOLD, DEFAULT_SCROLL_MARGIN, DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK, EMPTY_MESSAGE_SCROLLER_SCROLLABLE, EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE, EMPTY_VISIBLE_MESSAGE_IDS, SCROLL_POSITION_EPSILON, USER_SCROLL_KEYS, injectBrnMessageScroller, provideBrnMessageScroller }; export type { BrnMessageScrollerButtonDirection, BrnMessageScrollerDefaultScrollPosition, BrnMessageScrollerMode, BrnMessageScrollerProviderProps, BrnMessageScrollerRegisterMessage, BrnMessageScrollerScrollAlign, BrnMessageScrollerScrollOptions, BrnMessageScrollerScrollable, BrnMessageScrollerVisibilityState };