Skip to content

Commit 0ef6333

Browse files
committed
types(useOnScroll): improve typings when using ref
1 parent 2337ef2 commit 0ef6333

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/vue-composable/src/event/onScroll.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ export function useOnScroll(
4040
options?: boolean | AddEventListenerOptions,
4141
wait?: number
4242
): ScrollResult;
43+
44+
export function useOnScroll<T extends Element>(
45+
el: Ref<T> | Ref<T | null>,
46+
options?: boolean | AddEventListenerOptions,
47+
wait?: number
48+
): ScrollResult;
49+
50+
export function useOnScroll<T extends Element>(
51+
el: Ref<T | null>,
52+
wait: number
53+
): ScrollResult;
54+
4355
export function useOnScroll(
4456
el?: any,
4557
options?: number | boolean | AddEventListenerOptions,

0 commit comments

Comments
 (0)