Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
toviszsolt committed Mar 28, 2024
1 parent acdc943 commit ce01bd7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/ScrollSpy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -36,36 +36,36 @@ 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
*/
root?: HTMLElement | null;

/**
* 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'
*/
rootMargin?: string;

/**
* 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<HTMLAnchorElement, 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,
Expand Down

0 comments on commit ce01bd7

Please sign in to comment.