From ce01bd77a075dc1f635c151b7c63a05142b89757 Mon Sep 17 00:00:00 2001 From: Zsolt Tovis Date: Thu, 28 Mar 2024 15:56:17 +0100 Subject: [PATCH] improve documentation --- lib/ScrollSpy.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ScrollSpy.d.ts b/lib/ScrollSpy.d.ts index 4a335b5..4aed0f6 100644 --- a/lib/ScrollSpy.d.ts +++ b/lib/ScrollSpy.d.ts @@ -14,14 +14,14 @@ declare function ScrollSpy(props: { activeAttr?: boolean; /** - * Offset from top the final scroll position in pixels + * Offset the final scroll position from top in pixels * @uses Element: scrollTo() * @default 0 */ offsetTop?: number; /** - * Offset from left the final scroll position in pixels + * Offset the final scroll position from left in pixels * @uses Element: scrollTo() * @default 0 */ @@ -36,8 +36,8 @@ declare function ScrollSpy(props: { behavior?: 'smooth' | 'instant' | 'auto'; /** - * Root element to be observed. - * @uses ntersectionObserver: IntersectionObserver() + * Root element for the intersection observer. + * @uses IntersectionObserver: IntersectionObserver() * @see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#options * @default null */ @@ -45,7 +45,7 @@ declare function ScrollSpy(props: { /** * Root margin for the intersection observer. - * @uses ntersectionObserver: IntersectionObserver() + * @uses IntersectionObserver: IntersectionObserver() * @see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#options * @default '0px 0px 0px 0px' */ @@ -53,19 +53,19 @@ declare function ScrollSpy(props: { /** * Thresholds for the intersection observer. - * @uses ntersectionObserver: IntersectionObserver() + * @uses IntersectionObserver: IntersectionObserver() * @see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#options * @default [0, 0.25, 0.5, 0.75, 1] */ threshold?: number | number[]; - /** Callback fired when an element is clicked. */ + /** Callback function for handle the click event */ onClickEach?: ( - /** Cliick event */ + /** The original click event */ event: React.MouseEvent, - /** Function that will be called internally */ - clickHandler: () => void, + /** The internal function that scrolls to the element */ + internalClickHandler: () => void, /** Container element that is being scrolled */ container: HTMLElement,