-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more configuration options (#374)
* Add more configuration options * Add cleanup functionality
- Loading branch information
Showing
11 changed files
with
517 additions
and
1,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export declare type EasingFunction = (t: number) => number; | ||
export declare type EasingFunctions = Record<string, EasingFunction>; | ||
export declare type UnknownFunction = (...args: unknown[]) => unknown; | ||
export declare type ScrollToOptions = { | ||
readonly position: number; | ||
readonly duration: number; | ||
readonly callback: UnknownFunction; | ||
readonly easingFunction: EasingFunction; | ||
}; | ||
export declare type ScrollSpyOptions = { | ||
readonly headerClass: string; | ||
readonly headerOffset: boolean; | ||
readonly animationSpeed: number; | ||
readonly animationEasing: string; | ||
readonly sectionSelector: string; | ||
readonly linkCurrentClass: string; | ||
readonly linksContainerSelector: string; | ||
readonly onAfterScroll: UnknownFunction; | ||
}; | ||
export default class ScrollSpy { | ||
private options; | ||
private easings; | ||
private links; | ||
private sections; | ||
private currentIdx; | ||
private headerClass; | ||
private headerOffset; | ||
private linksContainer; | ||
private sectionSelector; | ||
private linkCurrentClass; | ||
private linksContainerSelector; | ||
private data; | ||
constructor(settings?: Partial<ScrollSpyOptions>, easings?: EasingFunctions); | ||
init(): void; | ||
private setProperties; | ||
private setSectionData; | ||
private refreshPositions; | ||
private getSectionOffset; | ||
private setCurrentIndex; | ||
private setCurrentState; | ||
bind(): void; | ||
unbind(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.