@legendapp/list 3.1.1 → 3.2.0

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/reanimated.d.ts CHANGED
@@ -94,19 +94,24 @@ type ViewStyle = Record<string, unknown>;
94
94
  type StyleProp<T> = T | T[] | null | undefined | false;
95
95
  type AdaptiveRender = "normal" | "light";
96
96
  interface AdaptiveRenderConfig {
97
+ /**
98
+ * Mode to use before the list is ready to render.
99
+ * @default "normal"
100
+ */
101
+ initialMode?: AdaptiveRender;
97
102
  /**
98
103
  * Scroll velocity in pixels per millisecond above which items should switch to light mode.
99
- * @default 4
104
+ * @default 3 native, 6 web
100
105
  */
101
106
  enterVelocity?: number;
102
107
  /**
103
108
  * Scroll velocity in pixels per millisecond below which items can return to normal mode.
104
- * @default 1
109
+ * @default 1 native, 3 web
105
110
  */
106
111
  exitVelocity?: number;
107
112
  /**
108
113
  * Time to wait without velocity above exitVelocity before returning to normal mode.
109
- * @default 1000
114
+ * @default 250
110
115
  */
111
116
  exitDelay?: number;
112
117
  /**
@@ -322,6 +327,15 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
322
327
  * Called when list layout metrics change.
323
328
  */
324
329
  onMetricsChange?: (metrics: LegendListMetrics) => void;
330
+ /**
331
+ * Called when the first visible item changes. This is emitted from the core range calculation and is cheaper than
332
+ * viewability tracking when you only need to follow the item at the top of the viewport.
333
+ */
334
+ onFirstVisibleItemChanged?: (info: {
335
+ index: number;
336
+ item: ItemT;
337
+ key: string;
338
+ }) => void;
325
339
  /**
326
340
  * Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
327
341
  */
package/section-list.d.ts CHANGED
@@ -150,19 +150,24 @@ type ViewStyle = Record<string, unknown>;
150
150
  type StyleProp<T> = T | T[] | null | undefined | false;
151
151
  type AdaptiveRender = "normal" | "light";
152
152
  interface AdaptiveRenderConfig {
153
+ /**
154
+ * Mode to use before the list is ready to render.
155
+ * @default "normal"
156
+ */
157
+ initialMode?: AdaptiveRender;
153
158
  /**
154
159
  * Scroll velocity in pixels per millisecond above which items should switch to light mode.
155
- * @default 4
160
+ * @default 3 native, 6 web
156
161
  */
157
162
  enterVelocity?: number;
158
163
  /**
159
164
  * Scroll velocity in pixels per millisecond below which items can return to normal mode.
160
- * @default 1
165
+ * @default 1 native, 3 web
161
166
  */
162
167
  exitVelocity?: number;
163
168
  /**
164
169
  * Time to wait without velocity above exitVelocity before returning to normal mode.
165
- * @default 1000
170
+ * @default 250
166
171
  */
167
172
  exitDelay?: number;
168
173
  /**
@@ -378,6 +383,15 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
378
383
  * Called when list layout metrics change.
379
384
  */
380
385
  onMetricsChange?: (metrics: LegendListMetrics) => void;
386
+ /**
387
+ * Called when the first visible item changes. This is emitted from the core range calculation and is cheaper than
388
+ * viewability tracking when you only need to follow the item at the top of the viewport.
389
+ */
390
+ onFirstVisibleItemChanged?: (info: {
391
+ index: number;
392
+ item: ItemT;
393
+ key: string;
394
+ }) => void;
381
395
  /**
382
396
  * Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
383
397
  */