(
el: HTMLElement,
state: StreamScrollFollow,
options?: { thresholdPx?: number; factor?: number },
)
| 134 | |
| 135 | /** Poll + follow each animation frame while content streams. */ |
| 136 | export function tickStreamScrollFollow( |
| 137 | el: HTMLElement, |
| 138 | state: StreamScrollFollow, |
| 139 | options?: { thresholdPx?: number; factor?: number }, |
| 140 | ): void { |
| 141 | const threshold = options?.thresholdPx ?? DEFAULT_STREAM_SCROLL_THRESHOLD; |
| 142 | const factor = options?.factor ?? DEFAULT_STREAM_SCROLL_EASE; |
| 143 | syncStreamScrollFollow(el, state, threshold); |
| 144 | if (!state.paused) { |
| 145 | easeScrollToBottom(el, factor); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | /** Attach scroll listeners that keep follow state in sync with user intent. */ |
| 150 | export function bindStreamScrollFollow( |
no test coverage detected