@legendapp/list 3.0.0-beta.5 → 3.0.0-beta.50

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.
Files changed (51) hide show
  1. package/.DS_Store +0 -0
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +9 -2
  4. package/animated.d.ts +657 -5
  5. package/animated.js +2 -2
  6. package/animated.mjs +1 -1
  7. package/index.d.ts +1316 -11
  8. package/index.js +4009 -1279
  9. package/index.mjs +4008 -1280
  10. package/index.native.js +3772 -1337
  11. package/index.native.mjs +3758 -1325
  12. package/keyboard-chat.d.ts +228 -0
  13. package/keyboard-chat.js +97 -0
  14. package/keyboard-chat.mjs +76 -0
  15. package/keyboard-test.d.ts +216 -0
  16. package/keyboard-test.js +39 -0
  17. package/keyboard-test.mjs +18 -0
  18. package/keyboard.d.ts +216 -8
  19. package/keyboard.js +355 -64
  20. package/keyboard.mjs +358 -66
  21. package/package.json +68 -1
  22. package/{types-YNdphn_A.d.mts → react-native.d.ts} +306 -263
  23. package/react-native.js +6003 -0
  24. package/react-native.mjs +5974 -0
  25. package/{types-YNdphn_A.d.ts → react-native.web.d.ts} +367 -261
  26. package/react-native.web.js +6537 -0
  27. package/react-native.web.mjs +6508 -0
  28. package/react.d.ts +776 -0
  29. package/react.js +6537 -0
  30. package/react.mjs +6508 -0
  31. package/reanimated.d.ts +679 -8
  32. package/reanimated.js +230 -29
  33. package/reanimated.mjs +232 -31
  34. package/section-list.d.ts +661 -5
  35. package/section-list.js +50 -3675
  36. package/section-list.mjs +48 -3674
  37. package/animated.d.mts +0 -9
  38. package/index.d.mts +0 -23
  39. package/index.native.d.mts +0 -23
  40. package/index.native.d.ts +0 -23
  41. package/keyboard-controller.d.mts +0 -12
  42. package/keyboard-controller.d.ts +0 -12
  43. package/keyboard-controller.js +0 -69
  44. package/keyboard-controller.mjs +0 -48
  45. package/keyboard.d.mts +0 -13
  46. package/reanimated.d.mts +0 -18
  47. package/section-list.d.mts +0 -113
  48. package/section-list.native.d.mts +0 -113
  49. package/section-list.native.d.ts +0 -113
  50. package/section-list.native.js +0 -3711
  51. package/section-list.native.mjs +0 -3690
package/index.d.ts CHANGED
@@ -1,18 +1,1320 @@
1
1
  import * as React from 'react';
2
- import { Dispatch, SetStateAction } from 'react';
3
- import { L as LegendListProps, a as LegendListRef, V as ViewabilityCallback, b as ViewabilityAmountCallback, c as LegendListRecyclingState } from './types-YNdphn_A.js';
4
- export { C as ColumnWrapperStyle, u as GetRenderedItem, G as GetRenderedItemResult, s as InitialScrollAnchor, I as InternalState, d as LegendListPropsBase, f as LegendListRenderItemProps, M as MaintainScrollAtEndOptions, O as OnViewableItemsChanged, p as ScrollIndexWithOffset, r as ScrollIndexWithOffsetAndContentOffset, q as ScrollIndexWithOffsetPosition, g as ScrollState, S as ScrollTarget, T as ThresholdSnapshot, m as TypedForwardRef, n as TypedMemo, i as ViewAmountToken, h as ViewToken, l as ViewabilityConfig, j as ViewabilityConfigCallbackPair, k as ViewabilityConfigCallbackPairs, e as ViewableRange, t as typedForwardRef, o as typedMemo } from './types-YNdphn_A.js';
5
- import 'react-native';
6
- import 'react-native-reanimated';
2
+ import { Key, ComponentType, ReactNode, CSSProperties, Ref, ReactElement, JSXElementConstructor, RefAttributes, Dispatch, SetStateAction } from 'react';
7
3
 
8
- declare const LegendList: (<T>(props: LegendListProps<T> & React.RefAttributes<LegendListRef>) => React.ReactNode) & {
4
+ type AnimatedValue = number;
5
+
6
+ type LooseMeasureCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
7
+ interface LooseView {
8
+ measure?: (callback: LooseMeasureCallback) => void;
9
+ }
10
+
11
+ declare class ScrollAdjustHandler {
12
+ private appliedAdjust;
13
+ private pendingAdjust;
14
+ private ctx;
15
+ constructor(ctx: StateContext);
16
+ requestAdjust(add: number): void;
17
+ getAdjust(): number;
18
+ commitPendingAdjust(scrollTarget: ScrollTarget$1): void;
19
+ }
20
+
21
+ type BaseSharedValue<T = number> = {
22
+ get: () => T;
23
+ };
24
+ type StylesAsSharedValue<Style> = {
25
+ [key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
26
+ };
27
+
28
+ interface ScrollEventTargetLike$1 {
29
+ addEventListener(type: string, listener: (...args: any[]) => void): void;
30
+ removeEventListener(type: string, listener: (...args: any[]) => void): void;
31
+ }
32
+ interface ScrollableNodeLike$1 {
33
+ scrollLeft?: number;
34
+ scrollTop?: number;
35
+ }
36
+ interface LegendListScrollerRef$1 {
37
+ flashScrollIndicators(): void;
38
+ getCurrentScrollOffset?(): number;
39
+ getScrollEventTarget?(): ScrollEventTargetLike$1 | null;
40
+ getScrollableNode(): ScrollableNodeLike$1 | null;
41
+ getScrollResponder(): unknown;
42
+ scrollTo(options: {
43
+ animated?: boolean;
44
+ x?: number;
45
+ y?: number;
46
+ }): void;
47
+ scrollToEnd(options?: {
48
+ animated?: boolean;
49
+ }): void;
50
+ }
51
+ interface MaintainVisibleContentPositionNormalized$1<ItemT = any> {
52
+ data: boolean;
53
+ size: boolean;
54
+ shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
55
+ }
56
+ interface MaintainScrollAtEndNormalized {
57
+ animated: boolean;
58
+ onLayout: boolean;
59
+ onItemLayout: boolean;
60
+ onDataChange: boolean;
61
+ }
62
+ interface ThresholdSnapshot$1 {
63
+ scrollPosition: number;
64
+ contentSize?: number;
65
+ dataLength?: number;
66
+ atThreshold: boolean;
67
+ }
68
+ interface ScrollTarget$1 {
69
+ averageSizeSnapshot?: Record<string, number>;
70
+ animated?: boolean;
71
+ index?: number;
72
+ isInitialScroll?: boolean;
73
+ itemSize?: number;
74
+ offset: number;
75
+ precomputedWithViewOffset?: boolean;
76
+ targetOffset?: number;
77
+ viewOffset?: number;
78
+ viewPosition?: number;
79
+ }
80
+ type BootstrapInitialScrollSession = {
81
+ frameHandle?: number;
82
+ mountFrameCount: number;
83
+ passCount: number;
84
+ previousResolvedOffset?: number;
85
+ scroll: number;
86
+ seedContentOffset: number;
87
+ targetIndexSeed?: number;
88
+ visibleIndices?: readonly number[];
89
+ };
90
+ type InternalScrollTarget = ScrollTarget$1 & {
91
+ waitForInitialScrollCompletionFrame?: boolean;
92
+ };
93
+ type InitialScrollSessionCompletion = {
94
+ didDispatchNativeScroll?: boolean;
95
+ didRetrySilentInitialScroll?: boolean;
96
+ watchdog?: {
97
+ startScroll: number;
98
+ targetOffset: number;
99
+ };
100
+ };
101
+ interface InternalInitialScrollTarget extends ScrollIndexWithOffsetAndContentOffset$1 {
102
+ preserveForBottomPadding?: boolean;
103
+ preserveForFooterLayout?: boolean;
104
+ }
105
+ type InternalInitialScrollSessionBase = {
106
+ completion?: InitialScrollSessionCompletion;
107
+ previousDataLength: number;
108
+ };
109
+ type OffsetInitialScrollSession = InternalInitialScrollSessionBase & {
110
+ kind: "offset";
111
+ };
112
+ type BootstrapOwnedInitialScrollSession = InternalInitialScrollSessionBase & {
113
+ bootstrap?: BootstrapInitialScrollSession;
114
+ kind: "bootstrap";
115
+ };
116
+ type InternalInitialScrollSession = OffsetInitialScrollSession | BootstrapOwnedInitialScrollSession;
117
+ type LegendListPropsInternal = LegendListPropsBase$1<any, Record<string, any>, string | undefined> & {
118
+ data: readonly any[];
119
+ renderItem: ((props: LegendListRenderItemProps$1<any, string | undefined>) => React.ReactNode) | React.ComponentType<LegendListRenderItemProps$1<any, string | undefined>>;
120
+ };
121
+ interface PendingDataComparison {
122
+ byIndex: Array<0 | 1 | 2 | undefined>;
123
+ nextData: readonly unknown[];
124
+ previousData: readonly unknown[];
125
+ }
126
+ type AverageSizes = Record<string, {
127
+ num: number;
128
+ avg: number;
129
+ }>;
130
+ interface InternalState$1 {
131
+ adjustingFromInitialMount?: number;
132
+ animFrameCheckFinishedScroll?: any;
133
+ averageSizes: AverageSizes;
134
+ columns: Array<number | undefined>;
135
+ columnSpans: Array<number | undefined>;
136
+ containerItemKeys: Map<string, number>;
137
+ containerItemTypes: Map<number, string>;
138
+ dataChangeEpoch: number;
139
+ dataChangeNeedsScrollUpdate: boolean;
140
+ deferredPublicOnScrollEvent?: NativeSyntheticEvent$1<NativeScrollEvent$1>;
141
+ didColumnsChange?: boolean;
142
+ didDataChange?: boolean;
143
+ didFinishInitialScroll?: boolean;
144
+ didContainersLayout?: boolean;
145
+ enableScrollForNextCalculateItemsInView: boolean;
146
+ endBuffered: number;
147
+ endNoBuffer: number;
148
+ endReachedSnapshot: ThresholdSnapshot$1 | undefined;
149
+ firstFullyOnScreenIndex: number;
150
+ hasScrolled?: boolean;
151
+ idCache: string[];
152
+ idsInView: string[];
153
+ ignoreScrollFromMVCP?: {
154
+ lt?: number;
155
+ gt?: number;
156
+ };
157
+ ignoreScrollFromMVCPIgnored?: boolean;
158
+ ignoreScrollFromMVCPTimeout?: any;
159
+ indexByKey: Map<string, number>;
160
+ clearPreservedInitialScrollOnNextFinish?: boolean;
161
+ initialScrollSession?: InternalInitialScrollSession;
162
+ initialScroll: InternalInitialScrollTarget | undefined;
163
+ timeoutPreservedInitialScrollClear?: any;
164
+ isEndReached: boolean | null;
165
+ isFirst?: boolean;
166
+ isStartReached: boolean | null;
167
+ lastBatchingAction: number;
168
+ lastLayout: LayoutRectangle$1 | undefined;
169
+ lastScrollAdjustForHistory?: number;
170
+ lastScrollDelta: number;
171
+ loadStartTime: number;
172
+ maintainingScrollAtEnd?: boolean;
173
+ minIndexSizeChanged: number | undefined;
174
+ mvcpAnchorLock?: {
175
+ id: string;
176
+ position: number;
177
+ quietPasses: number;
178
+ expiresAt: number;
179
+ };
180
+ contentInsetOverride?: Partial<Insets$1> | null;
181
+ nativeContentInset?: Insets$1;
182
+ nativeMarginTop: number;
183
+ needsOtherAxisSize?: boolean;
184
+ otherAxisSize?: number;
185
+ pendingNativeMVCPAdjust?: {
186
+ amount: number;
187
+ furthestProgressTowardAmount: number;
188
+ manualApplied: number;
189
+ startScroll: number;
190
+ };
191
+ pendingMaintainScrollAtEnd?: boolean;
192
+ pendingDataComparison?: PendingDataComparison;
193
+ pendingTotalSize?: number;
194
+ pendingScrollResolve?: (() => void) | undefined;
195
+ positions: Array<number | undefined>;
196
+ previousData?: readonly unknown[];
197
+ queuedCalculateItemsInView: number | undefined;
198
+ queuedMVCPRecalculate?: number;
199
+ queuedInitialLayout?: boolean | undefined;
200
+ reprocessCurrentScroll?: () => void;
201
+ refScroller: React.RefObject<LegendListScrollerRef$1 | null>;
202
+ scroll: number;
203
+ scrollAdjustHandler: ScrollAdjustHandler;
204
+ scrollForNextCalculateItemsInView: {
205
+ top: number | null;
206
+ bottom: number | null;
207
+ } | undefined;
208
+ scrollHistory: Array<{
209
+ scroll: number;
210
+ time: number;
211
+ }>;
212
+ scrollingTo?: InternalScrollTarget | undefined;
213
+ scrollLastCalculate?: number;
214
+ scrollLength: number;
215
+ scrollPending: number;
216
+ scrollPrev: number;
217
+ scrollPrevTime: number;
218
+ scrollProcessingEnabled: boolean;
219
+ scrollTime: number;
220
+ sizes: Map<string, number>;
221
+ sizesKnown: Map<string, number>;
222
+ startBuffered: number;
223
+ startBufferedId?: string;
224
+ startNoBuffer: number;
225
+ startReachedSnapshotDataChangeEpoch: number | undefined;
226
+ startReachedSnapshot: ThresholdSnapshot$1 | undefined;
227
+ stickyContainerPool: Set<number>;
228
+ stickyContainers: Map<number, number>;
229
+ timeouts: Set<number>;
230
+ timeoutSetPaddingTop?: any;
231
+ timeoutSizeMessage: any;
232
+ timeoutCheckFinishedScrollFallback?: any;
233
+ totalSize: number;
234
+ triggerCalculateItemsInView?: (params?: {
235
+ doMVCP?: boolean;
236
+ dataChanged?: boolean;
237
+ forceFullItemPositions?: boolean;
238
+ }) => void;
239
+ userScrollAnchorResetKeys?: Set<string>;
240
+ viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs$1<any> | undefined;
241
+ props: {
242
+ alignItemsAtEnd: boolean;
243
+ animatedProps: StylesAsSharedValue<Record<string, any>>;
244
+ anchoredEndSpace: AnchoredEndSpaceConfig$1 | undefined;
245
+ alwaysRender: AlwaysRenderConfig$1 | undefined;
246
+ alwaysRenderIndicesArr: number[];
247
+ alwaysRenderIndicesSet: Set<number>;
248
+ contentInset: Insets$1 | undefined;
249
+ data: readonly any[];
250
+ dataVersion: Key | undefined;
251
+ drawDistance: number;
252
+ estimatedItemSize: number | undefined;
253
+ getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
254
+ getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
255
+ getItemType: LegendListPropsInternal["getItemType"];
256
+ horizontal: boolean;
257
+ initialContainerPoolRatio: number;
258
+ itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
259
+ keyExtractor: LegendListPropsInternal["keyExtractor"];
260
+ maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
261
+ maintainScrollAtEndThreshold: number | undefined;
262
+ maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
263
+ numColumns: number;
264
+ onEndReached: LegendListPropsInternal["onEndReached"];
265
+ onEndReachedThreshold: number | null | undefined;
266
+ onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
267
+ onLoad: LegendListPropsInternal["onLoad"];
268
+ onScroll: LegendListPropsInternal["onScroll"];
269
+ onStartReached: LegendListPropsInternal["onStartReached"];
270
+ onStartReachedThreshold: number | null | undefined;
271
+ onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
272
+ overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
273
+ recycleItems: boolean;
274
+ renderItem: LegendListPropsInternal["renderItem"];
275
+ scrollBuffer?: number;
276
+ snapToIndices: number[] | undefined;
277
+ positionComponentInternal: React.ComponentType<any> | undefined;
278
+ stickyPositionComponentInternal: React.ComponentType<any> | undefined;
279
+ stickyIndicesArr: number[];
280
+ stickyIndicesSet: Set<number>;
281
+ stylePaddingBottom: number | undefined;
282
+ stylePaddingTop: number | undefined;
283
+ suggestEstimatedItemSize: boolean;
284
+ useWindowScroll: boolean;
285
+ };
286
+ }
287
+ interface ViewableRange$1<T> {
288
+ end: number;
289
+ endBuffered: number;
290
+ items: T[];
291
+ start: number;
292
+ startBuffered: number;
293
+ }
294
+ type GetRenderedItemResult$1<ItemT> = {
295
+ index: number;
296
+ item: ItemT;
297
+ renderedItem: React.ReactNode;
298
+ };
299
+ type GetRenderedItem$1 = (key: string) => GetRenderedItemResult$1<any> | null;
300
+ type TypedForwardRef$1 = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
301
+ declare const typedForwardRef: TypedForwardRef$1;
302
+ type TypedMemo$1 = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
9
303
  displayName?: string;
10
304
  };
305
+ declare const typedMemo: TypedMemo$1;
306
+
307
+ type ListenerType = "activeStickyIndex" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
308
+ type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
309
+ type ListenerTypeValueMap = {
310
+ activeStickyIndex: number;
311
+ anchoredEndSpaceSize: number;
312
+ animatedScrollY: any;
313
+ debugComputedScroll: number;
314
+ debugRawScroll: number;
315
+ extraData: any;
316
+ footerSize: number;
317
+ headerSize: number;
318
+ isAtEnd: boolean;
319
+ isAtStart: boolean;
320
+ isNearEnd: boolean;
321
+ isNearStart: boolean;
322
+ isWithinMaintainScrollAtEndThreshold: boolean;
323
+ lastItemKeys: string[];
324
+ lastPositionUpdate: number;
325
+ maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
326
+ numColumns: number;
327
+ numContainers: number;
328
+ numContainersPooled: number;
329
+ otherAxisSize: number;
330
+ readyToRender: boolean;
331
+ scrollAdjust: number;
332
+ scrollAdjustPending: number;
333
+ scrollAdjustUserOffset: number;
334
+ scrollSize: {
335
+ width: number;
336
+ height: number;
337
+ };
338
+ snapToOffsets: number[];
339
+ stylePaddingTop: number;
340
+ totalSize: number;
341
+ } & {
342
+ [K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
343
+ } & {
344
+ [K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
345
+ } & {
346
+ [K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
347
+ } & {
348
+ [K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
349
+ } & {
350
+ [K in ListenerType as K extends `containerSpan${number}` ? K : never]: number;
351
+ } & {
352
+ [K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
353
+ };
354
+ interface StateContext {
355
+ animatedScrollY: AnimatedValue;
356
+ columnWrapperStyle: ColumnWrapperStyle$1 | undefined;
357
+ contextNum: number;
358
+ listeners: Map<ListenerType, Set<(value: any) => void>>;
359
+ mapViewabilityCallbacks: Map<string, ViewabilityCallback$1>;
360
+ mapViewabilityValues: Map<string, ViewToken$1>;
361
+ mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback$1>;
362
+ mapViewabilityAmountValues: Map<number, ViewAmountToken$1>;
363
+ mapViewabilityConfigStates: Map<string, {
364
+ end: number;
365
+ endBuffered: number;
366
+ previousStart: number;
367
+ previousEnd: number;
368
+ start: number;
369
+ startBuffered: number;
370
+ viewableItems: ViewToken$1[];
371
+ }>;
372
+ positionListeners: Map<string, Set<(value: any) => void>>;
373
+ state: InternalState$1;
374
+ values: Map<ListenerType, any>;
375
+ viewRefs: Map<number, React.RefObject<LooseView | null>>;
376
+ }
377
+
378
+ interface Insets$1 {
379
+ top: number;
380
+ left: number;
381
+ bottom: number;
382
+ right: number;
383
+ }
384
+ interface LayoutRectangle$1 {
385
+ x: number;
386
+ y: number;
387
+ width: number;
388
+ height: number;
389
+ }
390
+ interface NativeScrollEvent$1 {
391
+ contentOffset: {
392
+ x: number;
393
+ y: number;
394
+ };
395
+ contentSize: {
396
+ width: number;
397
+ height: number;
398
+ };
399
+ layoutMeasurement: {
400
+ width: number;
401
+ height: number;
402
+ };
403
+ contentInset: Insets$1;
404
+ zoomScale: number;
405
+ }
406
+ interface NativeSyntheticEvent$1<T> {
407
+ nativeEvent: T;
408
+ }
409
+ type ViewStyle$1 = Record<string, unknown>;
410
+ type StyleProp$1<T> = T | T[] | null | undefined | false;
411
+ type BaseScrollViewProps$1<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
412
+ interface DataModeProps<ItemT, TItemType extends string | undefined> {
413
+ /**
414
+ * Array of items to render in the list.
415
+ * @required when using data mode
416
+ */
417
+ data: ReadonlyArray<ItemT>;
418
+ /**
419
+ * Function or React component to render each item in the list.
420
+ * Can be either:
421
+ * - A function: (props: LegendListRenderItemProps<ItemT>) => ReactNode
422
+ * - A React component: React.ComponentType<LegendListRenderItemProps<ItemT>>
423
+ * @required when using data mode
424
+ */
425
+ renderItem: ((props: LegendListRenderItemProps$1<ItemT, TItemType>) => React.ReactNode) | React.ComponentType<LegendListRenderItemProps$1<ItemT, TItemType>>;
426
+ children?: never;
427
+ }
428
+ interface ChildrenModeProps {
429
+ /**
430
+ * React children elements to render as list items.
431
+ * Each child will be treated as an individual list item.
432
+ * @required when using children mode
433
+ */
434
+ children: React.ReactNode;
435
+ data?: never;
436
+ renderItem?: never;
437
+ }
438
+ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
439
+ /**
440
+ * If true, aligns items at the end of the list.
441
+ * @default false
442
+ */
443
+ alignItemsAtEnd?: boolean;
444
+ /**
445
+ * Keeps selected items mounted even when they scroll out of view.
446
+ * @default undefined
447
+ */
448
+ alwaysRender?: AlwaysRenderConfig$1;
449
+ /**
450
+ * Style applied to each column's wrapper view.
451
+ */
452
+ columnWrapperStyle?: ColumnWrapperStyle$1;
453
+ /**
454
+ * Version token that forces the list to treat data as updated even when the array reference is stable.
455
+ * Increment or change this when mutating the data array in place.
456
+ */
457
+ dataVersion?: Key;
458
+ /**
459
+ * Distance in pixels to pre-render items ahead of the visible area.
460
+ * @default 250
461
+ */
462
+ drawDistance?: number;
463
+ /**
464
+ * Estimated size of each item in pixels, a hint for the first render. After some
465
+ * items are rendered, the average size of rendered items will be used instead.
466
+ * @default undefined
467
+ */
468
+ estimatedItemSize?: number;
469
+ /**
470
+ * Estimated size of the ScrollView in pixels, a hint for the first render to improve performance
471
+ * @default undefined
472
+ */
473
+ estimatedListSize?: {
474
+ height: number;
475
+ width: number;
476
+ };
477
+ /**
478
+ * Extra data to trigger re-rendering when changed.
479
+ */
480
+ extraData?: any;
481
+ /**
482
+ * In case you have distinct item sizes, you can provide a function to get the size of an item.
483
+ */
484
+ getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
485
+ /**
486
+ * In case items always have a fixed size, you can provide a function to return it.
487
+ */
488
+ getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
489
+ /**
490
+ * Returns a stable item type used for pooling and size estimation.
491
+ */
492
+ getItemType?: (item: ItemT, index: number) => TItemType;
493
+ /**
494
+ * Component to render between items, receiving the leading item as prop.
495
+ */
496
+ ItemSeparatorComponent?: React.ComponentType<{
497
+ leadingItem: ItemT;
498
+ }>;
499
+ /**
500
+ * Ratio of initial container pool size to data length (e.g., 0.5 for half).
501
+ * @default 2
502
+ */
503
+ initialContainerPoolRatio?: number | undefined;
504
+ /**
505
+ * When true, the list initializes scrolled to the last item.
506
+ * Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
507
+ * @default false
508
+ */
509
+ initialScrollAtEnd?: boolean;
510
+ /**
511
+ * Index to scroll to initially.
512
+ * @default 0
513
+ */
514
+ initialScrollIndex?: number | {
515
+ index: number;
516
+ viewOffset?: number | undefined;
517
+ viewPosition?: number | undefined;
518
+ };
519
+ /**
520
+ * Initial scroll position in pixels.
521
+ * @default 0
522
+ */
523
+ initialScrollOffset?: number;
524
+ /**
525
+ * Custom equality function to detect semantically unchanged items.
526
+ */
527
+ itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
528
+ /**
529
+ * Function to extract a unique key for each item.
530
+ */
531
+ keyExtractor?: (item: ItemT, index: number) => string;
532
+ /**
533
+ * Component or element to render when the list is empty.
534
+ */
535
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
536
+ /**
537
+ * Component or element to render below the list.
538
+ */
539
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
540
+ /**
541
+ * Style for the footer component.
542
+ */
543
+ ListFooterComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
544
+ /**
545
+ * Component or element to render above the list.
546
+ */
547
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
548
+ /**
549
+ * Style for the header component.
550
+ */
551
+ ListHeaderComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
552
+ /**
553
+ * If true, auto-scrolls to end when new items are added.
554
+ * Use an options object to opt into specific triggers and control whether that scroll is animated.
555
+ * @default false
556
+ */
557
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions$1;
558
+ /**
559
+ * Distance threshold in percentage of screen size to trigger maintainScrollAtEnd.
560
+ * @default 0.1
561
+ */
562
+ maintainScrollAtEndThreshold?: number;
563
+ /**
564
+ * Maintains visibility of content.
565
+ * - scroll (default: true) stabilizes during size/layout changes while scrolling.
566
+ * - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
567
+ * - shouldRestorePosition can opt out specific items from data-change anchoring.
568
+ * - undefined (default) enables scroll stabilization but skips data-change anchoring.
569
+ * - true enables both behaviors; false disables both.
570
+ */
571
+ maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig$1<ItemT>;
572
+ /**
573
+ * Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
574
+ */
575
+ anchoredEndSpace?: AnchoredEndSpaceConfig$1;
576
+ /**
577
+ * Number of columns to render items in.
578
+ * @default 1
579
+ */
580
+ numColumns?: number;
581
+ /**
582
+ * Called when scrolling reaches the end within onEndReachedThreshold.
583
+ */
584
+ onEndReached?: ((info: {
585
+ distanceFromEnd: number;
586
+ }) => void) | null | undefined;
587
+ /**
588
+ * How close to the end (in fractional units of visible length) to trigger onEndReached.
589
+ * @default 0.5
590
+ */
591
+ onEndReachedThreshold?: number | null | undefined;
592
+ /**
593
+ * Called when an item's size changes.
594
+ */
595
+ onItemSizeChanged?: (info: {
596
+ size: number;
597
+ previous: number;
598
+ index: number;
599
+ itemKey: string;
600
+ itemData: ItemT;
601
+ }) => void;
602
+ /**
603
+ * Called after the initial render work completes.
604
+ */
605
+ onLoad?: (info: {
606
+ elapsedTimeInMs: number;
607
+ }) => void;
608
+ /**
609
+ * Called when list layout metrics change.
610
+ */
611
+ onMetricsChange?: (metrics: LegendListMetrics$1) => void;
612
+ /**
613
+ * Function to call when the user pulls to refresh.
614
+ */
615
+ onRefresh?: () => void;
616
+ /**
617
+ * Called when the list scrolls.
618
+ */
619
+ onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
620
+ /**
621
+ * Called when scrolling reaches the start within onStartReachedThreshold.
622
+ */
623
+ onStartReached?: ((info: {
624
+ distanceFromStart: number;
625
+ }) => void) | null | undefined;
626
+ /**
627
+ * How close to the start (in fractional units of visible length) to trigger onStartReached.
628
+ * @default 0.5
629
+ */
630
+ onStartReachedThreshold?: number | null | undefined;
631
+ /**
632
+ * Called when the sticky header changes.
633
+ */
634
+ onStickyHeaderChange?: (info: {
635
+ index: number;
636
+ item: any;
637
+ }) => void;
638
+ /**
639
+ * Called when the viewability of items changes.
640
+ */
641
+ onViewableItemsChanged?: OnViewableItemsChanged$1<ItemT> | undefined;
642
+ /**
643
+ * Customize layout for multi-column lists, such as allowing items to span multiple columns.
644
+ */
645
+ overrideItemLayout?: (layout: {
646
+ span?: number;
647
+ }, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
648
+ /**
649
+ * Offset in pixels for the refresh indicator.
650
+ * @default 0
651
+ */
652
+ progressViewOffset?: number;
653
+ /**
654
+ * If true, recycles item views for better performance.
655
+ * @default false
656
+ */
657
+ recycleItems?: boolean;
658
+ /**
659
+ * Ref to the underlying ScrollView component.
660
+ */
661
+ refScrollView?: React.Ref<any>;
662
+ /**
663
+ * If true, shows a refresh indicator.
664
+ * @default false
665
+ */
666
+ refreshing?: boolean;
667
+ /**
668
+ * Render custom ScrollView component.
669
+ * Note: When using `stickyHeaderIndices`, you must provide an Animated ScrollView component.
670
+ * @default (props) => <ScrollView {...props} />
671
+ */
672
+ renderScrollComponent?: (props: any) => React.ReactElement | null;
673
+ /**
674
+ * Array of item indices to use as snap points.
675
+ */
676
+ snapToIndices?: number[];
677
+ /**
678
+ * This will log a suggested estimatedItemSize.
679
+ * @required
680
+ * @default false
681
+ */
682
+ suggestEstimatedItemSize?: boolean;
683
+ /**
684
+ * Configuration for determining item viewability.
685
+ */
686
+ viewabilityConfig?: ViewabilityConfig$1;
687
+ /**
688
+ * Pairs of viewability configs and their callbacks for tracking visibility.
689
+ */
690
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs$1<ItemT> | undefined;
691
+ /**
692
+ * Array of child indices determining which children get docked to the top of the screen when scrolling.
693
+ * For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
694
+ * Not supported in conjunction with horizontal={true}.
695
+ * @default undefined
696
+ */
697
+ stickyHeaderIndices?: number[];
698
+ /**
699
+ * @deprecated Use stickyHeaderIndices instead for parity with React Native.
700
+ */
701
+ stickyIndices?: number[];
702
+ /**
703
+ * Configuration for sticky headers.
704
+ * @default undefined
705
+ */
706
+ stickyHeaderConfig?: StickyHeaderConfig$1;
707
+ /**
708
+ * Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
709
+ * @default false
710
+ */
711
+ useWindowScroll?: boolean;
712
+ }
713
+ type LegendListPropsBase$1<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps$1<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
714
+ interface MaintainVisibleContentPositionConfig$1<ItemT = any> {
715
+ data?: boolean;
716
+ size?: boolean;
717
+ shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
718
+ }
719
+ interface AnchoredEndSpaceConfig$1 {
720
+ anchorIndex: number;
721
+ anchorOffset?: number;
722
+ anchorMaxSize?: number;
723
+ includeInEndInset?: boolean;
724
+ onSizeChanged?: (size: number) => void;
725
+ }
726
+ interface StickyHeaderConfig$1 {
727
+ /**
728
+ * Specifies how far from the top edge sticky headers should start sticking.
729
+ * Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
730
+ * @default 0
731
+ */
732
+ offset?: number;
733
+ /**
734
+ * Component to render as a backdrop behind the sticky header.
735
+ * @default undefined
736
+ */
737
+ backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
738
+ }
739
+ interface AlwaysRenderConfig$1 {
740
+ top?: number;
741
+ bottom?: number;
742
+ indices?: number[];
743
+ keys?: string[];
744
+ }
745
+ interface MaintainScrollAtEndOnOptions$1 {
746
+ dataChange?: boolean;
747
+ itemLayout?: boolean;
748
+ layout?: boolean;
749
+ }
750
+ interface MaintainScrollAtEndOptions$1 {
751
+ /**
752
+ * Whether maintainScrollAtEnd should animate when it scrolls to the end.
753
+ */
754
+ animated?: boolean;
755
+ /**
756
+ * Which events should keep the list pinned to the end.
757
+ * - If omitted, object values default to all triggers.
758
+ * - If provided, only the keys set to `true` are enabled.
759
+ */
760
+ on?: MaintainScrollAtEndOnOptions$1;
761
+ }
762
+ interface ColumnWrapperStyle$1 {
763
+ rowGap?: number;
764
+ gap?: number;
765
+ columnGap?: number;
766
+ }
767
+ interface LegendListMetrics$1 {
768
+ headerSize: number;
769
+ footerSize: number;
770
+ }
771
+ interface LegendListRenderItemProps$1<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
772
+ data: readonly ItemT[];
773
+ extraData: any;
774
+ index: number;
775
+ item: ItemT;
776
+ type: TItemType;
777
+ }
778
+ type LegendListState$1 = {
779
+ activeStickyIndex: number;
780
+ contentLength: number;
781
+ data: readonly any[];
782
+ elementAtIndex: (index: number) => any;
783
+ end: number;
784
+ endBuffered: number;
785
+ isAtEnd: boolean;
786
+ isAtStart: boolean;
787
+ isNearEnd: boolean;
788
+ isNearStart: boolean;
789
+ isEndReached: boolean;
790
+ isStartReached: boolean;
791
+ isWithinMaintainScrollAtEndThreshold: boolean;
792
+ listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
793
+ listenToPosition: (key: string, callback: (value: number) => void) => () => void;
794
+ positionAtIndex: (index: number) => number;
795
+ positionByKey: (key: string) => number | undefined;
796
+ scroll: number;
797
+ scrollLength: number;
798
+ scrollVelocity: number;
799
+ sizeAtIndex: (index: number) => number;
800
+ sizes: Map<string, number>;
801
+ start: number;
802
+ startBuffered: number;
803
+ };
804
+ type LegendListRef$1 = {
805
+ /**
806
+ * Displays the scroll indicators momentarily.
807
+ */
808
+ flashScrollIndicators(): void;
809
+ /**
810
+ * Returns the native ScrollView component reference.
811
+ */
812
+ getNativeScrollRef(): any;
813
+ /**
814
+ * Returns the scroll responder instance for handling scroll events.
815
+ */
816
+ getScrollableNode(): any;
817
+ /**
818
+ * Returns the ScrollResponderMixin for advanced scroll handling.
819
+ */
820
+ getScrollResponder(): any;
821
+ /**
822
+ * Returns the internal state of the scroll virtualization.
823
+ */
824
+ getState(): LegendListState$1;
825
+ /**
826
+ * Scrolls a specific index into view.
827
+ * @param params - Parameters for scrolling.
828
+ * @param params.animated - If true, animates the scroll. Default: true.
829
+ * @param params.index - The index to scroll to.
830
+ */
831
+ scrollIndexIntoView(params: {
832
+ animated?: boolean | undefined;
833
+ index: number;
834
+ }): Promise<void>;
835
+ /**
836
+ * Scrolls a specific index into view.
837
+ * @param params - Parameters for scrolling.
838
+ * @param params.animated - If true, animates the scroll. Default: true.
839
+ * @param params.item - The item to scroll to.
840
+ */
841
+ scrollItemIntoView(params: {
842
+ animated?: boolean | undefined;
843
+ item: any;
844
+ }): Promise<void>;
845
+ /**
846
+ * Scrolls to the end of the list.
847
+ * @param options - Options for scrolling.
848
+ * @param options.animated - If true, animates the scroll. Default: true.
849
+ * @param options.viewOffset - Offset from the target position.
850
+ */
851
+ scrollToEnd(options?: {
852
+ animated?: boolean | undefined;
853
+ viewOffset?: number | undefined;
854
+ }): Promise<void>;
855
+ /**
856
+ * Scrolls to a specific index in the list.
857
+ * @param params - Parameters for scrolling.
858
+ * @param params.animated - If true, animates the scroll. Default: true.
859
+ * @param params.index - The index to scroll to.
860
+ * @param params.viewOffset - Offset from the target position.
861
+ * @param params.viewPosition - Position of the item in the viewport (0 to 1).
862
+ */
863
+ scrollToIndex(params: {
864
+ animated?: boolean | undefined;
865
+ index: number;
866
+ viewOffset?: number | undefined;
867
+ viewPosition?: number | undefined;
868
+ }): Promise<void>;
869
+ /**
870
+ * Scrolls to a specific item in the list.
871
+ * @param params - Parameters for scrolling.
872
+ * @param params.animated - If true, animates the scroll. Default: true.
873
+ * @param params.item - The item to scroll to.
874
+ * @param params.viewOffset - Offset from the target position.
875
+ * @param params.viewPosition - Position of the item in the viewport (0 to 1).
876
+ */
877
+ scrollToItem(params: {
878
+ animated?: boolean | undefined;
879
+ item: any;
880
+ viewOffset?: number | undefined;
881
+ viewPosition?: number | undefined;
882
+ }): Promise<void>;
883
+ /**
884
+ * Scrolls to a specific offset in pixels.
885
+ * @param params - Parameters for scrolling.
886
+ * @param params.offset - The pixel offset to scroll to.
887
+ * @param params.animated - If true, animates the scroll. Default: true.
888
+ */
889
+ scrollToOffset(params: {
890
+ offset: number;
891
+ animated?: boolean | undefined;
892
+ }): Promise<void>;
893
+ /**
894
+ * Sets or adds to the offset of the visible content anchor.
895
+ * @param value - The offset to set or add.
896
+ * @param animated - If true, uses Animated to animate the change.
897
+ */
898
+ setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
899
+ /**
900
+ * Sets whether scroll processing is enabled.
901
+ * @param enabled - If true, scroll processing is enabled.
902
+ */
903
+ setScrollProcessingEnabled(enabled: boolean): void;
904
+ /**
905
+ * Clears internal virtualization caches.
906
+ * @param options - Cache clearing options.
907
+ * @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
908
+ */
909
+ clearCaches(options?: {
910
+ mode?: "sizes" | "full";
911
+ }): void;
912
+ /**
913
+ * Reports an externally measured content inset. Pass null/undefined to clear.
914
+ * Values are merged on top of props/animated/native insets.
915
+ */
916
+ reportContentInset(inset?: Partial<Insets$1> | null): void;
917
+ };
918
+ interface ViewToken$1<ItemT = any> {
919
+ containerId: number;
920
+ index: number;
921
+ isViewable: boolean;
922
+ item: ItemT;
923
+ key: string;
924
+ }
925
+ interface ViewAmountToken$1<ItemT = any> extends ViewToken$1<ItemT> {
926
+ percentOfScroller: number;
927
+ percentVisible: number;
928
+ scrollSize: number;
929
+ size: number;
930
+ sizeVisible: number;
931
+ }
932
+ interface ViewabilityConfigCallbackPair$1<ItemT = any> {
933
+ onViewableItemsChanged?: OnViewableItemsChanged$1<ItemT>;
934
+ viewabilityConfig: ViewabilityConfig$1;
935
+ }
936
+ type ViewabilityConfigCallbackPairs$1<ItemT> = ViewabilityConfigCallbackPair$1<ItemT>[];
937
+ interface OnViewableItemsChangedInfo$1<ItemT> {
938
+ changed: Array<ViewToken$1<ItemT>>;
939
+ end: number;
940
+ endBuffered: number;
941
+ start: number;
942
+ startBuffered: number;
943
+ viewableItems: Array<ViewToken$1<ItemT>>;
944
+ }
945
+ type OnViewableItemsChanged$1<ItemT> = ((info: OnViewableItemsChangedInfo$1<ItemT>) => void) | null;
946
+ interface ViewabilityConfig$1 {
947
+ /**
948
+ * A unique ID to identify this viewability config
949
+ */
950
+ id?: string;
951
+ /**
952
+ * Minimum amount of time (in milliseconds) that an item must be physically viewable before the
953
+ * viewability callback will be fired. A high number means that scrolling through content without
954
+ * stopping will not mark the content as viewable.
955
+ */
956
+ minimumViewTime?: number | undefined;
957
+ /**
958
+ * Percent of viewport that must be covered for a partially occluded item to count as
959
+ * "viewable", 0-100. Fully visible items are always considered viewable. A value of 0 means
960
+ * that a single pixel in the viewport makes the item viewable, and a value of 100 means that
961
+ * an item must be either entirely visible or cover the entire viewport to count as viewable.
962
+ */
963
+ viewAreaCoveragePercentThreshold?: number | undefined;
964
+ /**
965
+ * Similar to `viewAreaCoveragePercentThreshold`, but considers the percent of the item that is visible,
966
+ * rather than the fraction of the viewable area it covers.
967
+ */
968
+ itemVisiblePercentThreshold?: number | undefined;
969
+ /**
970
+ * Nothing is considered viewable until the user scrolls or `recordInteraction` is called after
971
+ * render.
972
+ */
973
+ waitForInteraction?: boolean | undefined;
974
+ }
975
+ type ViewabilityCallback$1<ItemT = any> = (viewToken: ViewToken$1<ItemT>) => void;
976
+ type ViewabilityAmountCallback$1<ItemT = any> = (viewToken: ViewAmountToken$1<ItemT>) => void;
977
+ interface LegendListRecyclingState$1<T> {
978
+ index: number;
979
+ item: T;
980
+ prevIndex: number | undefined;
981
+ prevItem: T | undefined;
982
+ }
983
+ interface ScrollIndexWithOffset$1 {
984
+ index: number;
985
+ viewOffset?: number;
986
+ viewPosition?: number;
987
+ }
988
+ interface ScrollIndexWithOffsetPosition$1 extends ScrollIndexWithOffset$1 {
989
+ viewPosition?: number;
990
+ }
991
+ interface ScrollIndexWithOffsetAndContentOffset$1 extends ScrollIndexWithOffsetPosition$1 {
992
+ contentOffset?: number;
993
+ }
994
+ /** @deprecated Kept for backwards compatibility. Use `ScrollIndexWithOffsetPosition`. */
995
+ interface InitialScrollAnchor$1 extends ScrollIndexWithOffsetPosition$1 {
996
+ attempts?: number;
997
+ lastDelta?: number;
998
+ settledTicks?: number;
999
+ }
11
1000
 
12
- declare function useViewability<ItemT = any>(callback: ViewabilityCallback<ItemT>, configId?: string): void;
13
- declare function useViewabilityAmount<ItemT = any>(callback: ViewabilityAmountCallback<ItemT>): void;
14
- declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
15
- declare function useRecyclingState<ItemT>(valueOrFun: ((info: LegendListRecyclingState<ItemT>) => ItemT) | ItemT): readonly [ItemT | null, Dispatch<SetStateAction<ItemT>>];
1001
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1002
+ type Insets = Insets$1;
1003
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1004
+ type LayoutRectangle = LayoutRectangle$1;
1005
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1006
+ type NativeScrollEvent = NativeScrollEvent$1;
1007
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1008
+ type NativeSyntheticEvent<T> = NativeSyntheticEvent$1<T>;
1009
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1010
+ type ViewStyle = ViewStyle$1;
1011
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1012
+ type StyleProp<T> = StyleProp$1<T>;
1013
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1014
+ type ScrollEventTargetLike = ScrollEventTargetLike$1;
1015
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1016
+ type ScrollableNodeLike = ScrollableNodeLike$1;
1017
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1018
+ type LegendListScrollerRef = LegendListScrollerRef$1;
1019
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1020
+ type BaseScrollViewProps<TScrollView> = BaseScrollViewProps$1<TScrollView>;
1021
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1022
+ type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = LegendListPropsBase$1<ItemT, TScrollViewProps, TItemType>;
1023
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1024
+ type MaintainVisibleContentPositionConfig<ItemT = any> = MaintainVisibleContentPositionConfig$1<ItemT>;
1025
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1026
+ type AnchoredEndSpaceConfig = AnchoredEndSpaceConfig$1;
1027
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1028
+ type MaintainVisibleContentPositionNormalized<ItemT = any> = MaintainVisibleContentPositionNormalized$1<ItemT>;
1029
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1030
+ type StickyHeaderConfig = StickyHeaderConfig$1;
1031
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1032
+ type AlwaysRenderConfig = AlwaysRenderConfig$1;
1033
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1034
+ type MaintainScrollAtEndOnOptions = MaintainScrollAtEndOnOptions$1;
1035
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1036
+ type MaintainScrollAtEndOptions = MaintainScrollAtEndOptions$1;
1037
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1038
+ type ColumnWrapperStyle = ColumnWrapperStyle$1;
1039
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1040
+ type LegendListMetrics = LegendListMetrics$1;
1041
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1042
+ type ThresholdSnapshot = ThresholdSnapshot$1;
1043
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1044
+ type ScrollTarget = ScrollTarget$1;
1045
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1046
+ type InternalState = InternalState$1;
1047
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1048
+ type ViewableRange<T> = ViewableRange$1<T>;
1049
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1050
+ type LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> = LegendListRenderItemProps$1<ItemT, TItemType>;
1051
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1052
+ type LegendListState = LegendListState$1;
1053
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1054
+ type LegendListRef = LegendListRef$1;
1055
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1056
+ type ViewToken<ItemT = any> = ViewToken$1<ItemT>;
1057
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1058
+ type ViewAmountToken<ItemT = any> = ViewAmountToken$1<ItemT>;
1059
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1060
+ type ViewabilityConfigCallbackPair<ItemT = any> = ViewabilityConfigCallbackPair$1<ItemT>;
1061
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1062
+ type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPairs$1<ItemT>;
1063
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1064
+ type OnViewableItemsChangedInfo<ItemT> = OnViewableItemsChangedInfo$1<ItemT>;
1065
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1066
+ type OnViewableItemsChanged<ItemT> = OnViewableItemsChanged$1<ItemT>;
1067
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1068
+ type ViewabilityConfig = ViewabilityConfig$1;
1069
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1070
+ type ViewabilityCallback<ItemT = any> = ViewabilityCallback$1<ItemT>;
1071
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1072
+ type ViewabilityAmountCallback<ItemT = any> = ViewabilityAmountCallback$1<ItemT>;
1073
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1074
+ type LegendListRecyclingState<T> = LegendListRecyclingState$1<T>;
1075
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1076
+ type TypedForwardRef = TypedForwardRef$1;
1077
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1078
+ type TypedMemo = TypedMemo$1;
1079
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1080
+ type ScrollIndexWithOffset = ScrollIndexWithOffset$1;
1081
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1082
+ type ScrollIndexWithOffsetPosition = ScrollIndexWithOffsetPosition$1;
1083
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1084
+ type ScrollIndexWithOffsetAndContentOffset = ScrollIndexWithOffsetAndContentOffset$1;
1085
+ /** @deprecated Use `ScrollIndexWithOffsetPosition`, or `@legendapp/list/react-native` / `@legendapp/list/react` for strict typing */
1086
+ type InitialScrollAnchor = InitialScrollAnchor$1;
1087
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1088
+ type GetRenderedItemResult<ItemT> = GetRenderedItemResult$1<ItemT>;
1089
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1090
+ type GetRenderedItem = GetRenderedItem$1;
1091
+ interface LooseAccessibilityActionEvent {
1092
+ nativeEvent?: {
1093
+ actionName?: string;
1094
+ };
1095
+ }
1096
+ type AccessibilityActionEvent = LooseAccessibilityActionEvent;
1097
+ type LooseAccessibilityRole = string;
1098
+ type AccessibilityRole = LooseAccessibilityRole;
1099
+ interface LooseAccessibilityState {
1100
+ busy?: boolean;
1101
+ checked?: boolean | "mixed";
1102
+ disabled?: boolean;
1103
+ expanded?: boolean;
1104
+ selected?: boolean;
1105
+ }
1106
+ type AccessibilityState = LooseAccessibilityState;
1107
+ interface LooseAccessibilityValue {
1108
+ max?: number;
1109
+ min?: number;
1110
+ now?: number;
1111
+ text?: string;
1112
+ }
1113
+ type AccessibilityValue = LooseAccessibilityValue;
1114
+ type LooseColorValue = string | number;
1115
+ type ColorValue = LooseColorValue;
1116
+ interface LooseGestureResponderEvent {
1117
+ nativeEvent?: unknown;
1118
+ }
1119
+ type GestureResponderEvent = LooseGestureResponderEvent;
1120
+ interface LoosePointerEvent {
1121
+ nativeEvent?: unknown;
1122
+ }
1123
+ type PointerEvent = LoosePointerEvent;
1124
+ interface LooseRefreshControlProps {
1125
+ onRefresh?: () => void;
1126
+ progressViewOffset?: number;
1127
+ refreshing?: boolean;
1128
+ }
1129
+ type RefreshControlProps = LooseRefreshControlProps;
1130
+ type LooseRole = string;
1131
+ type Role = LooseRole;
1132
+ interface PointProp {
1133
+ x: number;
1134
+ y: number;
1135
+ }
1136
+ interface LayoutChangeEvent {
1137
+ nativeEvent: {
1138
+ layout: LayoutRectangle;
1139
+ };
1140
+ }
1141
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1142
+ interface LooseScrollViewProps {
1143
+ StickyHeaderComponent?: ComponentType<unknown>;
1144
+ accessibilityActions?: Array<{
1145
+ label?: string;
1146
+ name: string;
1147
+ }>;
1148
+ accessibilityElementsHidden?: boolean;
1149
+ accessibilityHint?: string;
1150
+ accessibilityIgnoresInvertColors?: boolean;
1151
+ accessibilityLabel?: string;
1152
+ accessibilityLabelledBy?: string | string[];
1153
+ accessibilityLanguage?: string;
1154
+ accessibilityLargeContentTitle?: string;
1155
+ accessibilityLiveRegion?: "none" | "polite" | "assertive";
1156
+ accessibilityRespondsToUserInteraction?: boolean;
1157
+ accessibilityRole?: AccessibilityRole;
1158
+ accessibilityShowsLargeContentViewer?: boolean;
1159
+ accessibilityState?: AccessibilityState;
1160
+ accessibilityValue?: AccessibilityValue;
1161
+ accessibilityViewIsModal?: boolean;
1162
+ accessible?: boolean;
1163
+ alwaysBounceHorizontal?: boolean;
1164
+ alwaysBounceVertical?: boolean;
1165
+ "aria-busy"?: boolean;
1166
+ "aria-checked"?: boolean | "mixed";
1167
+ "aria-disabled"?: boolean;
1168
+ "aria-expanded"?: boolean;
1169
+ "aria-hidden"?: boolean;
1170
+ "aria-label"?: string;
1171
+ "aria-labelledby"?: string;
1172
+ "aria-live"?: "polite" | "assertive" | "off";
1173
+ "aria-modal"?: boolean;
1174
+ "aria-selected"?: boolean;
1175
+ "aria-valuemax"?: number;
1176
+ "aria-valuemin"?: number;
1177
+ "aria-valuenow"?: number;
1178
+ "aria-valuetext"?: string;
1179
+ automaticallyAdjustContentInsets?: boolean;
1180
+ automaticallyAdjustKeyboardInsets?: boolean;
1181
+ automaticallyAdjustsScrollIndicatorInsets?: boolean;
1182
+ bounces?: boolean;
1183
+ bouncesZoom?: boolean;
1184
+ canCancelContentTouches?: boolean;
1185
+ centerContent?: boolean;
1186
+ children?: ReactNode;
1187
+ collapsable?: boolean;
1188
+ collapsableChildren?: boolean;
1189
+ contentContainerStyle?: StyleProp<ViewStyle> | CSSProperties;
1190
+ contentInset?: Insets;
1191
+ contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes";
1192
+ contentOffset?: PointProp;
1193
+ decelerationRate?: number | "fast" | "normal";
1194
+ directionalLockEnabled?: boolean;
1195
+ disableIntervalMomentum?: boolean;
1196
+ disableScrollViewPanResponder?: boolean;
1197
+ endFillColor?: ColorValue;
1198
+ fadingEdgeLength?: number | {
1199
+ end?: number;
1200
+ start?: number;
1201
+ };
1202
+ focusable?: boolean;
1203
+ hasTVPreferredFocus?: boolean;
1204
+ hitSlop?: number | Insets;
1205
+ horizontal?: boolean;
1206
+ id?: string;
1207
+ importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants";
1208
+ indicatorStyle?: "default" | "black" | "white";
1209
+ innerViewRef?: Ref<unknown>;
1210
+ invertStickyHeaders?: boolean;
1211
+ isTVSelectable?: boolean;
1212
+ keyboardDismissMode?: "none" | "interactive" | "on-drag";
1213
+ keyboardShouldPersistTaps?: boolean | "always" | "never" | "handled";
1214
+ maintainVisibleContentPosition?: {
1215
+ autoscrollToTopThreshold?: number;
1216
+ minIndexForVisible: number;
1217
+ };
1218
+ maximumZoomScale?: number;
1219
+ minimumZoomScale?: number;
1220
+ nativeID?: string;
1221
+ needsOffscreenAlphaCompositing?: boolean;
1222
+ nestedScrollEnabled?: boolean;
1223
+ onAccessibilityAction?: (event: AccessibilityActionEvent) => void;
1224
+ onAccessibilityEscape?: () => void;
1225
+ onAccessibilityTap?: () => void;
1226
+ onBlur?: (event: unknown) => void;
1227
+ onContentSizeChange?: (width: number, height: number) => void;
1228
+ onFocus?: (event: unknown) => void;
1229
+ onLayout?: (event: LayoutChangeEvent) => void;
1230
+ onMagicTap?: () => void;
1231
+ onMomentumScrollBegin?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1232
+ onMomentumScrollEnd?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1233
+ onMoveShouldSetResponder?: (event: GestureResponderEvent) => boolean;
1234
+ onMoveShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean;
1235
+ onPointerCancel?: (event: PointerEvent) => void;
1236
+ onPointerCancelCapture?: (event: PointerEvent) => void;
1237
+ onPointerDown?: (event: PointerEvent) => void;
1238
+ onPointerDownCapture?: (event: PointerEvent) => void;
1239
+ onPointerEnter?: (event: PointerEvent) => void;
1240
+ onPointerEnterCapture?: (event: PointerEvent) => void;
1241
+ onPointerLeave?: (event: PointerEvent) => void;
1242
+ onPointerLeaveCapture?: (event: PointerEvent) => void;
1243
+ onPointerMove?: (event: PointerEvent) => void;
1244
+ onPointerMoveCapture?: (event: PointerEvent) => void;
1245
+ onPointerUp?: (event: PointerEvent) => void;
1246
+ onPointerUpCapture?: (event: PointerEvent) => void;
1247
+ onResponderEnd?: (event: GestureResponderEvent) => void;
1248
+ onResponderGrant?: (event: GestureResponderEvent) => void;
1249
+ onResponderMove?: (event: GestureResponderEvent) => void;
1250
+ onResponderReject?: (event: GestureResponderEvent) => void;
1251
+ onResponderRelease?: (event: GestureResponderEvent) => void;
1252
+ onResponderStart?: (event: GestureResponderEvent) => void;
1253
+ onResponderTerminate?: (event: GestureResponderEvent) => void;
1254
+ onResponderTerminationRequest?: (event: GestureResponderEvent) => boolean;
1255
+ onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1256
+ onScrollAnimationEnd?: () => void;
1257
+ onScrollBeginDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1258
+ onScrollEndDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1259
+ onScrollToTop?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
1260
+ onStartShouldSetResponder?: (event: GestureResponderEvent) => boolean;
1261
+ onStartShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean;
1262
+ onTouchCancel?: (event: GestureResponderEvent) => void;
1263
+ onTouchEnd?: (event: GestureResponderEvent) => void;
1264
+ onTouchEndCapture?: (event: GestureResponderEvent) => void;
1265
+ onTouchMove?: (event: GestureResponderEvent) => void;
1266
+ onTouchStart?: (event: GestureResponderEvent) => void;
1267
+ overScrollMode?: "always" | "never" | "auto";
1268
+ pagingEnabled?: boolean;
1269
+ persistentScrollbar?: boolean;
1270
+ pinchGestureEnabled?: boolean;
1271
+ pointerEvents?: "none" | "box-none" | "box-only" | "auto";
1272
+ refreshControl?: ReactElement<RefreshControlProps, string | JSXElementConstructor<unknown>>;
1273
+ removeClippedSubviews?: boolean;
1274
+ renderToHardwareTextureAndroid?: boolean;
1275
+ role?: Role;
1276
+ screenReaderFocusable?: boolean;
1277
+ scrollEnabled?: boolean;
1278
+ scrollEventThrottle?: number;
1279
+ scrollIndicatorInsets?: Insets;
1280
+ scrollPerfTag?: string;
1281
+ scrollToOverflowEnabled?: boolean;
1282
+ scrollViewRef?: Ref<unknown>;
1283
+ scrollsToTop?: boolean;
1284
+ shouldRasterizeIOS?: boolean;
1285
+ showsHorizontalScrollIndicator?: boolean;
1286
+ showsVerticalScrollIndicator?: boolean;
1287
+ snapToAlignment?: "start" | "center" | "end";
1288
+ snapToEnd?: boolean;
1289
+ snapToInterval?: number;
1290
+ snapToOffsets?: number[];
1291
+ snapToStart?: boolean;
1292
+ stickyHeaderHiddenOnScroll?: boolean;
1293
+ stickyHeaderIndices?: number[];
1294
+ style?: StyleProp<ViewStyle> | CSSProperties;
1295
+ tabIndex?: 0 | -1;
1296
+ testID?: string;
1297
+ tvParallaxMagnification?: number;
1298
+ tvParallaxShiftDistanceX?: number;
1299
+ tvParallaxShiftDistanceY?: number;
1300
+ tvParallaxTiltAngle?: number;
1301
+ zoomScale?: number;
1302
+ }
1303
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1304
+ type ScrollViewPropsLoose = LooseScrollViewProps;
1305
+ type LegendListPropsLoose<ItemT = any> = Omit<LegendListPropsBase<ItemT, LooseScrollViewProps>, "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
1306
+ ListHeaderComponentStyle?: StyleProp<ViewStyle> | CSSProperties | undefined;
1307
+ ListFooterComponentStyle?: StyleProp<ViewStyle> | CSSProperties | undefined;
1308
+ };
1309
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1310
+ type LegendListProps<ItemT = any> = LegendListPropsLoose<ItemT>;
1311
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1312
+ type LegendListComponent = <ItemT = any>(props: LegendListProps<ItemT> & RefAttributes<LegendListRef>) => ReactElement | null;
1313
+
1314
+ declare function useViewability<ItemT = any>(callback: ViewabilityCallback$1<ItemT>, configId?: string): void;
1315
+ declare function useViewabilityAmount<ItemT = any>(callback: ViewabilityAmountCallback$1<ItemT>): void;
1316
+ declare function useRecyclingEffect(effect: (info: LegendListRecyclingState$1<unknown>) => void | (() => void)): void;
1317
+ declare function useRecyclingState<ItemT>(valueOrFun: ((info: LegendListRecyclingState$1<ItemT>) => ItemT) | ItemT): readonly [ItemT, Dispatch<SetStateAction<ItemT>>];
16
1318
  declare function useIsLastItem(): boolean;
17
1319
  declare function useListScrollSize(): {
18
1320
  width: number;
@@ -20,4 +1322,7 @@ declare function useListScrollSize(): {
20
1322
  };
21
1323
  declare function useSyncLayout(): () => void;
22
1324
 
23
- export { LegendList, LegendListProps, LegendListRecyclingState, LegendListRef, ViewabilityAmountCallback, ViewabilityCallback, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
1325
+ /** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
1326
+ declare const LegendList: LegendListComponent;
1327
+
1328
+ export { type AccessibilityActionEvent, type AccessibilityRole, type AccessibilityState, type AccessibilityValue, type AlwaysRenderConfig, type AnchoredEndSpaceConfig, type BaseScrollViewProps, type ColorValue, type ColumnWrapperStyle, type GestureResponderEvent, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets, type InternalState, type LayoutChangeEvent, type LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListScrollerRef, type LegendListState, type LooseAccessibilityActionEvent, type LooseAccessibilityRole, type LooseAccessibilityState, type LooseAccessibilityValue, type LooseColorValue, type LooseGestureResponderEvent, type LoosePointerEvent, type LooseRefreshControlProps, type LooseRole, type LooseScrollViewProps, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type OnViewableItemsChangedInfo, type PointProp, type PointerEvent, type RefreshControlProps, type Role, type ScrollEventTargetLike, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type ScrollViewPropsLoose, type ScrollableNodeLike, type StickyHeaderConfig, type StyleProp, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };