lenis 1.1.14-dev.3 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lenis.d.ts CHANGED
@@ -17,7 +17,7 @@ declare class Dimensions {
17
17
  private debouncedResize?;
18
18
  private wrapperResizeObserver?;
19
19
  private contentResizeObserver?;
20
- constructor(wrapper: HTMLElement | Window, content: HTMLElement, { autoResize, debounce: debounceValue }?: {
20
+ constructor(wrapper: HTMLElement | Window | Element, content: HTMLElement | Element, { autoResize, debounce: debounceValue }?: {
21
21
  autoResize?: boolean | undefined;
22
22
  debounce?: number | undefined;
23
23
  });
@@ -129,17 +129,17 @@ type LenisOptions = {
129
129
  * The element that will be used as the scroll container
130
130
  * @default window
131
131
  */
132
- wrapper?: Window | HTMLElement;
132
+ wrapper?: Window | HTMLElement | Element;
133
133
  /**
134
134
  * The element that contains the content that will be scrolled, usually `wrapper`'s direct child
135
135
  * @default document.documentElement
136
136
  */
137
- content?: HTMLElement;
137
+ content?: HTMLElement | Element;
138
138
  /**
139
139
  * The element that will listen to `wheel` and `touch` events
140
140
  * @default window
141
141
  */
142
- eventsTarget?: Window | HTMLElement;
142
+ eventsTarget?: Window | HTMLElement | Element;
143
143
  /**
144
144
  * Smooth the scroll initiated by `wheel` events
145
145
  * @default true
@@ -212,6 +212,11 @@ type LenisOptions = {
212
212
  * Manually modify the events before they get consumed
213
213
  */
214
214
  virtualScroll?: (data: VirtualScrollData) => boolean;
215
+ /**
216
+ * Wether or not to enable overscroll on a nested lenis instance, similar to CSS overscroll-behavior (https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior)
217
+ * @default true
218
+ */
219
+ overscroll?: boolean;
215
220
  /**
216
221
  * If `true`, Lenis will not try to detect the size of the content and wrapper
217
222
  * @default false
@@ -281,7 +286,7 @@ declare class Lenis {
281
286
  constructor({ wrapper, content, eventsTarget, smoothWheel, syncTouch, syncTouchLerp, touchInertiaMultiplier, duration, // in seconds
282
287
  easing, lerp, infinite, orientation, // vertical, horizontal
283
288
  gestureOrientation, // vertical, horizontal, both
284
- touchMultiplier, wheelMultiplier, autoResize, prevent, virtualScroll, __experimental__naiveDimensions, }?: LenisOptions);
289
+ touchMultiplier, wheelMultiplier, autoResize, prevent, virtualScroll, overscroll, __experimental__naiveDimensions, }?: LenisOptions);
285
290
  /**
286
291
  * Destroy the lenis instance, remove all event listeners and clean up the class name
287
292
  */