(
options: () => PartialKeys<
VirtualizerOptions<Window, TItemElement>,
| 'getScrollElement'
| 'observeElementRect'
| 'observeElementOffset'
| 'scrollToFn'
>,
)
| 118 | } |
| 119 | |
| 120 | export function injectWindowVirtualizer<TItemElement extends Element>( |
| 121 | options: () => PartialKeys< |
| 122 | VirtualizerOptions<Window, TItemElement>, |
| 123 | | 'getScrollElement' |
| 124 | | 'observeElementRect' |
| 125 | | 'observeElementOffset' |
| 126 | | 'scrollToFn' |
| 127 | >, |
| 128 | ): AngularVirtualizer<Window, TItemElement> { |
| 129 | const resolvedOptions = computed(() => { |
| 130 | return { |
| 131 | getScrollElement: () => (typeof document !== 'undefined' ? window : null), |
| 132 | observeElementRect: observeWindowRect, |
| 133 | observeElementOffset: observeWindowOffset, |
| 134 | scrollToFn: windowScroll, |
| 135 | initialOffset: () => |
| 136 | typeof document !== 'undefined' ? window.scrollY : 0, |
| 137 | ...options(), |
| 138 | } |
| 139 | }) |
| 140 | return createVirtualizerBase<Window, TItemElement>(resolvedOptions) |
| 141 | } |
no test coverage detected