-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb978e2
commit 4b0a97b
Showing
14 changed files
with
104 additions
and
630 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,45 @@ | ||
import Lenis from 'lenis'; | ||
|
||
type UID = number; | ||
|
||
type Viewport = { | ||
width: number; | ||
height: number; | ||
}; | ||
type SnapOptions = { | ||
type?: 'mandatory' | 'proximity'; | ||
lerp?: number; | ||
easing?: (t: number) => number; | ||
duration?: number; | ||
velocityThreshold?: number; | ||
onSnapStart?: (t: number) => number; | ||
onSnapComplete?: (t: number) => number; | ||
}; | ||
declare class Snap { | ||
constructor(lenis: any, { type, lerp, easing, duration, velocityThreshold, onSnapStart, onSnapComplete, }?: { | ||
type?: string; | ||
lerp: any; | ||
easing: any; | ||
duration: any; | ||
velocityThreshold?: number; | ||
onSnapStart: any; | ||
onSnapComplete: any; | ||
}); | ||
lenis: Lenis; | ||
options: SnapOptions; | ||
elements: Map<number, Node>; | ||
snaps: Map<number, number>; | ||
viewport: Viewport; | ||
isStopped: Boolean; | ||
constructor(lenis: Lenis, { type, lerp, easing, duration, velocityThreshold, onSnapStart, onSnapComplete, }?: SnapOptions); | ||
destroy(): void; | ||
start(): void; | ||
stop(): void; | ||
add(value: any): () => void; | ||
remove(id: any): void; | ||
addElement(element: any, options?: {}): () => void; | ||
removeElement(id: any): void; | ||
add(value: number): () => void; | ||
remove(id: UID): void; | ||
addElement(element: Node, options?: {}): () => void; | ||
removeElement(id: UID): void; | ||
onWindowResize: () => void; | ||
onScroll: ({ scroll, limit, lastVelocity, velocity, isScrolling, isTouching, userData, }: { | ||
onScroll: ({ scroll, limit, lastVelocity, velocity, isScrolling, userData, isHorizontal, }: { | ||
scroll: any; | ||
limit: any; | ||
lastVelocity: any; | ||
velocity: any; | ||
isScrolling: any; | ||
isTouching: any; | ||
userData: any; | ||
isHorizontal: any; | ||
}) => void; | ||
} | ||
|
||
export { Snap as default }; | ||
export { type SnapOptions, Snap as default }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.