@legendapp/list 3.0.0-beta.44 → 3.0.0-beta.45
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/animated.d.ts +84 -42
- package/index.d.ts +381 -316
- package/index.js +1054 -658
- package/index.mjs +1054 -658
- package/index.native.js +1182 -810
- package/index.native.mjs +1182 -810
- package/keyboard-chat.d.ts +228 -0
- package/keyboard-chat.js +97 -0
- package/keyboard-chat.mjs +76 -0
- package/keyboard-test.d.ts +18 -8
- package/keyboard-test.js +8 -3
- package/keyboard-test.mjs +9 -4
- package/keyboard.d.ts +17 -7
- package/keyboard.js +5 -4
- package/keyboard.mjs +5 -4
- package/package.json +7 -1
- package/react-native.d.ts +83 -341
- package/react-native.js +1184 -811
- package/react-native.mjs +1185 -810
- package/react-native.web.d.ts +90 -342
- package/react-native.web.js +1069 -648
- package/react-native.web.mjs +1070 -647
- package/react.d.ts +90 -342
- package/react.js +1069 -648
- package/react.mjs +1070 -647
- package/reanimated.d.ts +96 -44
- package/reanimated.js +94 -19
- package/reanimated.mjs +95 -20
- package/section-list.d.ts +88 -42
- package/section-list.js +16 -4
- package/section-list.mjs +15 -3
package/index.d.ts
CHANGED
|
@@ -8,16 +8,317 @@ interface LooseView {
|
|
|
8
8
|
measure?: (callback: LooseMeasureCallback) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs$1<any> | undefined;
|
|
240
|
+
props: {
|
|
241
|
+
alignItemsAtEnd: boolean;
|
|
242
|
+
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
243
|
+
anchoredEndSpace: AnchoredEndSpaceConfig$1 | undefined;
|
|
244
|
+
alwaysRender: AlwaysRenderConfig$1 | undefined;
|
|
245
|
+
alwaysRenderIndicesArr: number[];
|
|
246
|
+
alwaysRenderIndicesSet: Set<number>;
|
|
247
|
+
contentInset: Insets$1 | undefined;
|
|
248
|
+
data: readonly any[];
|
|
249
|
+
dataVersion: Key | undefined;
|
|
250
|
+
drawDistance: number;
|
|
251
|
+
estimatedItemSize: number | undefined;
|
|
252
|
+
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
253
|
+
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
254
|
+
getItemType: LegendListPropsInternal["getItemType"];
|
|
255
|
+
horizontal: boolean;
|
|
256
|
+
initialContainerPoolRatio: number;
|
|
257
|
+
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
258
|
+
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
259
|
+
maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
|
|
260
|
+
maintainScrollAtEndThreshold: number | undefined;
|
|
261
|
+
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
|
|
262
|
+
numColumns: number;
|
|
263
|
+
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
264
|
+
onEndReachedThreshold: number | null | undefined;
|
|
265
|
+
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
266
|
+
onLoad: LegendListPropsInternal["onLoad"];
|
|
267
|
+
onScroll: LegendListPropsInternal["onScroll"];
|
|
268
|
+
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
269
|
+
onStartReachedThreshold: number | null | undefined;
|
|
270
|
+
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
271
|
+
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
272
|
+
recycleItems: boolean;
|
|
273
|
+
renderItem: LegendListPropsInternal["renderItem"];
|
|
274
|
+
scrollBuffer?: number;
|
|
275
|
+
snapToIndices: number[] | undefined;
|
|
276
|
+
positionComponentInternal: React.ComponentType<any> | undefined;
|
|
277
|
+
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
278
|
+
stickyIndicesArr: number[];
|
|
279
|
+
stickyIndicesSet: Set<number>;
|
|
280
|
+
stylePaddingBottom: number | undefined;
|
|
281
|
+
stylePaddingTop: number | undefined;
|
|
282
|
+
suggestEstimatedItemSize: boolean;
|
|
283
|
+
useWindowScroll: boolean;
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
interface ViewableRange$1<T> {
|
|
287
|
+
end: number;
|
|
288
|
+
endBuffered: number;
|
|
289
|
+
items: T[];
|
|
290
|
+
start: number;
|
|
291
|
+
startBuffered: number;
|
|
292
|
+
}
|
|
293
|
+
type GetRenderedItemResult$1<ItemT> = {
|
|
294
|
+
index: number;
|
|
295
|
+
item: ItemT;
|
|
296
|
+
renderedItem: React.ReactNode;
|
|
297
|
+
};
|
|
298
|
+
type GetRenderedItem$1 = (key: string) => GetRenderedItemResult$1<any> | null;
|
|
299
|
+
type TypedForwardRef$1 = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
300
|
+
declare const typedForwardRef: TypedForwardRef$1;
|
|
301
|
+
type TypedMemo$1 = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
|
|
302
|
+
displayName?: string;
|
|
303
|
+
};
|
|
304
|
+
declare const typedMemo: TypedMemo$1;
|
|
305
|
+
|
|
306
|
+
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}`;
|
|
307
|
+
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
13
308
|
type ListenerTypeValueMap = {
|
|
14
309
|
activeStickyIndex: number;
|
|
310
|
+
anchoredEndSpaceSize: number;
|
|
15
311
|
animatedScrollY: any;
|
|
16
312
|
debugComputedScroll: number;
|
|
17
313
|
debugRawScroll: number;
|
|
18
314
|
extraData: any;
|
|
19
315
|
footerSize: number;
|
|
20
316
|
headerSize: number;
|
|
317
|
+
isAtEnd: boolean;
|
|
318
|
+
isAtStart: boolean;
|
|
319
|
+
isNearEnd: boolean;
|
|
320
|
+
isNearStart: boolean;
|
|
321
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
21
322
|
lastItemKeys: string[];
|
|
22
323
|
lastPositionUpdate: number;
|
|
23
324
|
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
|
|
@@ -59,11 +360,13 @@ interface StateContext {
|
|
|
59
360
|
mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback$1>;
|
|
60
361
|
mapViewabilityAmountValues: Map<number, ViewAmountToken$1>;
|
|
61
362
|
mapViewabilityConfigStates: Map<string, {
|
|
62
|
-
viewableItems: ViewToken$1[];
|
|
63
|
-
start: number;
|
|
64
363
|
end: number;
|
|
364
|
+
endBuffered: number;
|
|
65
365
|
previousStart: number;
|
|
66
366
|
previousEnd: number;
|
|
367
|
+
start: number;
|
|
368
|
+
startBuffered: number;
|
|
369
|
+
viewableItems: ViewToken$1[];
|
|
67
370
|
}>;
|
|
68
371
|
positionListeners: Map<string, Set<(value: any) => void>>;
|
|
69
372
|
state: InternalState$1;
|
|
@@ -71,23 +374,6 @@ interface StateContext {
|
|
|
71
374
|
viewRefs: Map<number, React.RefObject<LooseView | null>>;
|
|
72
375
|
}
|
|
73
376
|
|
|
74
|
-
declare class ScrollAdjustHandler {
|
|
75
|
-
private appliedAdjust;
|
|
76
|
-
private pendingAdjust;
|
|
77
|
-
private ctx;
|
|
78
|
-
constructor(ctx: StateContext);
|
|
79
|
-
requestAdjust(add: number): void;
|
|
80
|
-
getAdjust(): number;
|
|
81
|
-
commitPendingAdjust(scrollTarget: ScrollTarget$1): void;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type BaseSharedValue<T = number> = {
|
|
85
|
-
get: () => T;
|
|
86
|
-
};
|
|
87
|
-
type StylesAsSharedValue<Style> = {
|
|
88
|
-
[key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
377
|
interface Insets$1 {
|
|
92
378
|
top: number;
|
|
93
379
|
left: number;
|
|
@@ -121,29 +407,6 @@ interface NativeSyntheticEvent$1<T> {
|
|
|
121
407
|
}
|
|
122
408
|
type ViewStyle$1 = Record<string, unknown>;
|
|
123
409
|
type StyleProp$1<T> = T | T[] | null | undefined | false;
|
|
124
|
-
interface ScrollEventTargetLike$1 {
|
|
125
|
-
addEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
126
|
-
removeEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
127
|
-
}
|
|
128
|
-
interface ScrollableNodeLike$1 {
|
|
129
|
-
scrollLeft?: number;
|
|
130
|
-
scrollTop?: number;
|
|
131
|
-
}
|
|
132
|
-
interface LegendListScrollerRef$1 {
|
|
133
|
-
flashScrollIndicators(): void;
|
|
134
|
-
getCurrentScrollOffset?(): number;
|
|
135
|
-
getScrollEventTarget(): ScrollEventTargetLike$1 | null;
|
|
136
|
-
getScrollableNode(): ScrollableNodeLike$1 | null;
|
|
137
|
-
getScrollResponder(): unknown;
|
|
138
|
-
scrollTo(options: {
|
|
139
|
-
animated?: boolean;
|
|
140
|
-
x?: number;
|
|
141
|
-
y?: number;
|
|
142
|
-
}): void;
|
|
143
|
-
scrollToEnd(options?: {
|
|
144
|
-
animated?: boolean;
|
|
145
|
-
}): void;
|
|
146
|
-
}
|
|
147
410
|
type BaseScrollViewProps$1<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
148
411
|
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
149
412
|
/**
|
|
@@ -186,6 +449,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
186
449
|
* Style applied to each column's wrapper view.
|
|
187
450
|
*/
|
|
188
451
|
columnWrapperStyle?: ColumnWrapperStyle$1;
|
|
452
|
+
/**
|
|
453
|
+
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
454
|
+
* Increment or change this when mutating the data array in place.
|
|
455
|
+
*/
|
|
456
|
+
dataVersion?: Key;
|
|
189
457
|
/**
|
|
190
458
|
* Distance in pixels to pre-render items ahead of the visible area.
|
|
191
459
|
* @default 250
|
|
@@ -209,33 +477,35 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
209
477
|
* Extra data to trigger re-rendering when changed.
|
|
210
478
|
*/
|
|
211
479
|
extraData?: any;
|
|
212
|
-
/**
|
|
213
|
-
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
214
|
-
* Increment or change this when mutating the data array in place.
|
|
215
|
-
*/
|
|
216
|
-
dataVersion?: Key;
|
|
217
480
|
/**
|
|
218
481
|
* In case you have distinct item sizes, you can provide a function to get the size of an item.
|
|
219
|
-
* Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
|
|
220
482
|
*/
|
|
221
483
|
getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
|
|
222
484
|
/**
|
|
223
|
-
*
|
|
224
|
-
* Similar to FlashList's overrideItemLayout.
|
|
485
|
+
* In case items always have a fixed size, you can provide a function to return it.
|
|
225
486
|
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
487
|
+
getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
|
|
488
|
+
/**
|
|
489
|
+
* Returns a stable item type used for pooling and size estimation.
|
|
490
|
+
*/
|
|
491
|
+
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
492
|
+
/**
|
|
493
|
+
* Component to render between items, receiving the leading item as prop.
|
|
494
|
+
*/
|
|
495
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
496
|
+
leadingItem: ItemT;
|
|
497
|
+
}>;
|
|
229
498
|
/**
|
|
230
499
|
* Ratio of initial container pool size to data length (e.g., 0.5 for half).
|
|
231
500
|
* @default 2
|
|
232
501
|
*/
|
|
233
502
|
initialContainerPoolRatio?: number | undefined;
|
|
234
503
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
504
|
+
* When true, the list initializes scrolled to the last item.
|
|
505
|
+
* Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
|
|
506
|
+
* @default false
|
|
237
507
|
*/
|
|
238
|
-
|
|
508
|
+
initialScrollAtEnd?: boolean;
|
|
239
509
|
/**
|
|
240
510
|
* Index to scroll to initially.
|
|
241
511
|
* @default 0
|
|
@@ -246,17 +516,14 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
246
516
|
viewPosition?: number | undefined;
|
|
247
517
|
};
|
|
248
518
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* @default false
|
|
519
|
+
* Initial scroll position in pixels.
|
|
520
|
+
* @default 0
|
|
252
521
|
*/
|
|
253
|
-
|
|
522
|
+
initialScrollOffset?: number;
|
|
254
523
|
/**
|
|
255
|
-
*
|
|
524
|
+
* Custom equality function to detect semantically unchanged items.
|
|
256
525
|
*/
|
|
257
|
-
|
|
258
|
-
leadingItem: ItemT;
|
|
259
|
-
}>;
|
|
526
|
+
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
260
527
|
/**
|
|
261
528
|
* Function to extract a unique key for each item.
|
|
262
529
|
*/
|
|
@@ -302,10 +569,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
302
569
|
*/
|
|
303
570
|
maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig$1<ItemT>;
|
|
304
571
|
/**
|
|
305
|
-
*
|
|
306
|
-
* @default false
|
|
572
|
+
* Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
|
|
307
573
|
*/
|
|
308
|
-
|
|
574
|
+
anchoredEndSpace?: AnchoredEndSpaceConfig$1;
|
|
309
575
|
/**
|
|
310
576
|
* Number of columns to render items in.
|
|
311
577
|
* @default 1
|
|
@@ -332,6 +598,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
332
598
|
itemKey: string;
|
|
333
599
|
itemData: ItemT;
|
|
334
600
|
}) => void;
|
|
601
|
+
/**
|
|
602
|
+
* Called after the initial render work completes.
|
|
603
|
+
*/
|
|
604
|
+
onLoad?: (info: {
|
|
605
|
+
elapsedTimeInMs: number;
|
|
606
|
+
}) => void;
|
|
335
607
|
/**
|
|
336
608
|
* Called when list layout metrics change.
|
|
337
609
|
*/
|
|
@@ -340,6 +612,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
340
612
|
* Function to call when the user pulls to refresh.
|
|
341
613
|
*/
|
|
342
614
|
onRefresh?: () => void;
|
|
615
|
+
/**
|
|
616
|
+
* Called when the list scrolls.
|
|
617
|
+
*/
|
|
343
618
|
onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
|
|
344
619
|
/**
|
|
345
620
|
* Called when scrolling reaches the start within onStartReachedThreshold.
|
|
@@ -363,6 +638,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
363
638
|
* Called when the viewability of items changes.
|
|
364
639
|
*/
|
|
365
640
|
onViewableItemsChanged?: OnViewableItemsChanged$1<ItemT> | undefined;
|
|
641
|
+
/**
|
|
642
|
+
* Customize layout for multi-column lists, such as allowing items to span multiple columns.
|
|
643
|
+
*/
|
|
644
|
+
overrideItemLayout?: (layout: {
|
|
645
|
+
span?: number;
|
|
646
|
+
}, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
|
|
366
647
|
/**
|
|
367
648
|
* Offset in pixels for the refresh indicator.
|
|
368
649
|
* @default 0
|
|
@@ -388,6 +669,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
388
669
|
* @default (props) => <ScrollView {...props} />
|
|
389
670
|
*/
|
|
390
671
|
renderScrollComponent?: (props: any) => React.ReactElement | null;
|
|
672
|
+
/**
|
|
673
|
+
* Array of item indices to use as snap points.
|
|
674
|
+
*/
|
|
675
|
+
snapToIndices?: number[];
|
|
391
676
|
/**
|
|
392
677
|
* This will log a suggested estimatedItemSize.
|
|
393
678
|
* @required
|
|
@@ -402,10 +687,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
402
687
|
* Pairs of viewability configs and their callbacks for tracking visibility.
|
|
403
688
|
*/
|
|
404
689
|
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs$1<ItemT> | undefined;
|
|
405
|
-
onLoad?: (info: {
|
|
406
|
-
elapsedTimeInMs: number;
|
|
407
|
-
}) => void;
|
|
408
|
-
snapToIndices?: number[];
|
|
409
690
|
/**
|
|
410
691
|
* Array of child indices determining which children get docked to the top of the screen when scrolling.
|
|
411
692
|
* For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
|
|
@@ -422,21 +703,24 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
422
703
|
* @default undefined
|
|
423
704
|
*/
|
|
424
705
|
stickyHeaderConfig?: StickyHeaderConfig$1;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
706
|
+
/**
|
|
707
|
+
* Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
|
|
708
|
+
* @default false
|
|
709
|
+
*/
|
|
710
|
+
useWindowScroll?: boolean;
|
|
428
711
|
}
|
|
429
712
|
type LegendListPropsBase$1<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps$1<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
430
|
-
type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
|
|
431
713
|
interface MaintainVisibleContentPositionConfig$1<ItemT = any> {
|
|
432
714
|
data?: boolean;
|
|
433
715
|
size?: boolean;
|
|
434
716
|
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
435
717
|
}
|
|
436
|
-
interface
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
718
|
+
interface AnchoredEndSpaceConfig$1 {
|
|
719
|
+
anchorIndex: number;
|
|
720
|
+
anchorOffset?: number;
|
|
721
|
+
anchorMaxSize?: number;
|
|
722
|
+
includeInEndInset?: boolean;
|
|
723
|
+
onSizeChanged?: (size: number) => void;
|
|
440
724
|
}
|
|
441
725
|
interface StickyHeaderConfig$1 {
|
|
442
726
|
/**
|
|
@@ -483,225 +767,6 @@ interface LegendListMetrics$1 {
|
|
|
483
767
|
headerSize: number;
|
|
484
768
|
footerSize: number;
|
|
485
769
|
}
|
|
486
|
-
interface ThresholdSnapshot$1 {
|
|
487
|
-
scrollPosition: number;
|
|
488
|
-
contentSize?: number;
|
|
489
|
-
dataLength?: number;
|
|
490
|
-
atThreshold: boolean;
|
|
491
|
-
}
|
|
492
|
-
interface ScrollTarget$1 {
|
|
493
|
-
animated?: boolean;
|
|
494
|
-
index?: number;
|
|
495
|
-
isInitialScroll?: boolean;
|
|
496
|
-
itemSize?: number;
|
|
497
|
-
offset: number;
|
|
498
|
-
precomputedWithViewOffset?: boolean;
|
|
499
|
-
targetOffset?: number;
|
|
500
|
-
viewOffset?: number;
|
|
501
|
-
viewPosition?: number;
|
|
502
|
-
}
|
|
503
|
-
type BootstrapInitialScrollSession = {
|
|
504
|
-
frameHandle?: number;
|
|
505
|
-
mountFrameCount: number;
|
|
506
|
-
passCount: number;
|
|
507
|
-
previousResolvedOffset?: number;
|
|
508
|
-
scroll: number;
|
|
509
|
-
seedContentOffset: number;
|
|
510
|
-
targetIndexSeed?: number;
|
|
511
|
-
visibleIndices?: readonly number[];
|
|
512
|
-
};
|
|
513
|
-
type InternalScrollTarget = ScrollTarget$1 & {
|
|
514
|
-
waitForInitialScrollCompletionFrame?: boolean;
|
|
515
|
-
};
|
|
516
|
-
type InitialScrollSessionCompletion = {
|
|
517
|
-
didDispatchNativeScroll?: boolean;
|
|
518
|
-
didRetrySilentInitialScroll?: boolean;
|
|
519
|
-
watchdog?: {
|
|
520
|
-
startScroll: number;
|
|
521
|
-
targetOffset: number;
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
interface InternalInitialScrollTarget extends ScrollIndexWithOffsetAndContentOffset$1 {
|
|
525
|
-
preserveForBottomPadding?: boolean;
|
|
526
|
-
preserveForFooterLayout?: boolean;
|
|
527
|
-
}
|
|
528
|
-
type InternalInitialScrollSessionBase = {
|
|
529
|
-
completion?: InitialScrollSessionCompletion;
|
|
530
|
-
previousDataLength: number;
|
|
531
|
-
};
|
|
532
|
-
type OffsetInitialScrollSession = InternalInitialScrollSessionBase & {
|
|
533
|
-
kind: "offset";
|
|
534
|
-
};
|
|
535
|
-
type BootstrapOwnedInitialScrollSession = InternalInitialScrollSessionBase & {
|
|
536
|
-
bootstrap?: BootstrapInitialScrollSession;
|
|
537
|
-
kind: "bootstrap";
|
|
538
|
-
};
|
|
539
|
-
type InternalInitialScrollSession = OffsetInitialScrollSession | BootstrapOwnedInitialScrollSession;
|
|
540
|
-
interface InternalState$1 {
|
|
541
|
-
activeStickyIndex: number | undefined;
|
|
542
|
-
adjustingFromInitialMount?: number;
|
|
543
|
-
animFrameCheckFinishedScroll?: any;
|
|
544
|
-
averageSizes: Record<string, {
|
|
545
|
-
num: number;
|
|
546
|
-
avg: number;
|
|
547
|
-
}>;
|
|
548
|
-
columns: Array<number | undefined>;
|
|
549
|
-
columnSpans: Array<number | undefined>;
|
|
550
|
-
containerItemKeys: Map<string, number>;
|
|
551
|
-
containerItemTypes: Map<number, string>;
|
|
552
|
-
dataChangeEpoch: number;
|
|
553
|
-
dataChangeNeedsScrollUpdate: boolean;
|
|
554
|
-
deferredPublicOnScrollEvent?: NativeSyntheticEvent$1<NativeScrollEvent$1>;
|
|
555
|
-
didColumnsChange?: boolean;
|
|
556
|
-
didDataChange?: boolean;
|
|
557
|
-
didFinishInitialScroll?: boolean;
|
|
558
|
-
didContainersLayout?: boolean;
|
|
559
|
-
enableScrollForNextCalculateItemsInView: boolean;
|
|
560
|
-
endBuffered: number;
|
|
561
|
-
endNoBuffer: number;
|
|
562
|
-
endReachedSnapshot: ThresholdSnapshot$1 | undefined;
|
|
563
|
-
firstFullyOnScreenIndex: number;
|
|
564
|
-
hasScrolled?: boolean;
|
|
565
|
-
idCache: string[];
|
|
566
|
-
idsInView: string[];
|
|
567
|
-
ignoreScrollFromMVCP?: {
|
|
568
|
-
lt?: number;
|
|
569
|
-
gt?: number;
|
|
570
|
-
};
|
|
571
|
-
ignoreScrollFromMVCPIgnored?: boolean;
|
|
572
|
-
ignoreScrollFromMVCPTimeout?: any;
|
|
573
|
-
indexByKey: Map<string, number>;
|
|
574
|
-
initialScrollSession?: InternalInitialScrollSession;
|
|
575
|
-
initialScroll: InternalInitialScrollTarget | undefined;
|
|
576
|
-
isAtEnd: boolean;
|
|
577
|
-
isAtStart: boolean;
|
|
578
|
-
isEndReached: boolean | null;
|
|
579
|
-
isFirst?: boolean;
|
|
580
|
-
isStartReached: boolean | null;
|
|
581
|
-
lastBatchingAction: number;
|
|
582
|
-
lastLayout: LayoutRectangle$1 | undefined;
|
|
583
|
-
lastScrollAdjustForHistory?: number;
|
|
584
|
-
lastScrollDelta: number;
|
|
585
|
-
loadStartTime: number;
|
|
586
|
-
maintainingScrollAtEnd?: boolean;
|
|
587
|
-
minIndexSizeChanged: number | undefined;
|
|
588
|
-
mvcpAnchorLock?: {
|
|
589
|
-
id: string;
|
|
590
|
-
position: number;
|
|
591
|
-
quietPasses: number;
|
|
592
|
-
expiresAt: number;
|
|
593
|
-
};
|
|
594
|
-
contentInsetOverride?: Partial<Insets$1> | null;
|
|
595
|
-
nativeContentInset?: Insets$1;
|
|
596
|
-
nativeMarginTop: number;
|
|
597
|
-
needsOtherAxisSize?: boolean;
|
|
598
|
-
otherAxisSize?: number;
|
|
599
|
-
pendingNativeMVCPAdjust?: {
|
|
600
|
-
amount: number;
|
|
601
|
-
furthestProgressTowardAmount: number;
|
|
602
|
-
manualApplied: number;
|
|
603
|
-
startScroll: number;
|
|
604
|
-
};
|
|
605
|
-
pendingMaintainScrollAtEnd?: boolean;
|
|
606
|
-
pendingTotalSize?: number;
|
|
607
|
-
pendingScrollResolve?: (() => void) | undefined;
|
|
608
|
-
positions: Array<number | undefined>;
|
|
609
|
-
previousData?: readonly unknown[];
|
|
610
|
-
queuedCalculateItemsInView: number | undefined;
|
|
611
|
-
queuedMVCPRecalculate?: number;
|
|
612
|
-
queuedInitialLayout?: boolean | undefined;
|
|
613
|
-
reprocessCurrentScroll?: () => void;
|
|
614
|
-
refScroller: React.RefObject<LegendListScrollerRef$1 | null>;
|
|
615
|
-
scroll: number;
|
|
616
|
-
scrollAdjustHandler: ScrollAdjustHandler;
|
|
617
|
-
scrollForNextCalculateItemsInView: {
|
|
618
|
-
top: number | null;
|
|
619
|
-
bottom: number | null;
|
|
620
|
-
} | undefined;
|
|
621
|
-
scrollHistory: Array<{
|
|
622
|
-
scroll: number;
|
|
623
|
-
time: number;
|
|
624
|
-
}>;
|
|
625
|
-
scrollingTo?: InternalScrollTarget | undefined;
|
|
626
|
-
scrollLastCalculate?: number;
|
|
627
|
-
scrollLength: number;
|
|
628
|
-
scrollPending: number;
|
|
629
|
-
scrollPrev: number;
|
|
630
|
-
scrollPrevTime: number;
|
|
631
|
-
scrollProcessingEnabled: boolean;
|
|
632
|
-
scrollTime: number;
|
|
633
|
-
sizes: Map<string, number>;
|
|
634
|
-
sizesKnown: Map<string, number>;
|
|
635
|
-
startBuffered: number;
|
|
636
|
-
startBufferedId?: string;
|
|
637
|
-
startNoBuffer: number;
|
|
638
|
-
startReachedSnapshotDataChangeEpoch: number | undefined;
|
|
639
|
-
startReachedSnapshot: ThresholdSnapshot$1 | undefined;
|
|
640
|
-
stickyContainerPool: Set<number>;
|
|
641
|
-
stickyContainers: Map<number, number>;
|
|
642
|
-
timeouts: Set<number>;
|
|
643
|
-
timeoutSetPaddingTop?: any;
|
|
644
|
-
timeoutSizeMessage: any;
|
|
645
|
-
timeoutCheckFinishedScrollFallback?: any;
|
|
646
|
-
totalSize: number;
|
|
647
|
-
triggerCalculateItemsInView?: (params?: {
|
|
648
|
-
doMVCP?: boolean;
|
|
649
|
-
dataChanged?: boolean;
|
|
650
|
-
forceFullItemPositions?: boolean;
|
|
651
|
-
}) => void;
|
|
652
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs$1<any> | undefined;
|
|
653
|
-
props: {
|
|
654
|
-
alignItemsAtEnd: boolean;
|
|
655
|
-
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
656
|
-
alwaysRender: AlwaysRenderConfig$1 | undefined;
|
|
657
|
-
alwaysRenderIndicesArr: number[];
|
|
658
|
-
alwaysRenderIndicesSet: Set<number>;
|
|
659
|
-
contentInset: Insets$1 | undefined;
|
|
660
|
-
data: readonly any[];
|
|
661
|
-
dataVersion: Key | undefined;
|
|
662
|
-
drawDistance: number;
|
|
663
|
-
estimatedItemSize: number | undefined;
|
|
664
|
-
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
665
|
-
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
666
|
-
getItemType: LegendListPropsInternal["getItemType"];
|
|
667
|
-
horizontal: boolean;
|
|
668
|
-
initialContainerPoolRatio: number;
|
|
669
|
-
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
670
|
-
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
671
|
-
maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
|
|
672
|
-
maintainScrollAtEndThreshold: number | undefined;
|
|
673
|
-
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
|
|
674
|
-
numColumns: number;
|
|
675
|
-
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
676
|
-
onEndReachedThreshold: number | null | undefined;
|
|
677
|
-
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
678
|
-
onLoad: LegendListPropsInternal["onLoad"];
|
|
679
|
-
onScroll: LegendListPropsInternal["onScroll"];
|
|
680
|
-
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
681
|
-
onStartReachedThreshold: number | null | undefined;
|
|
682
|
-
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
683
|
-
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
684
|
-
recycleItems: boolean;
|
|
685
|
-
renderItem: LegendListPropsInternal["renderItem"];
|
|
686
|
-
scrollBuffer?: number;
|
|
687
|
-
snapToIndices: number[] | undefined;
|
|
688
|
-
positionComponentInternal: React.ComponentType<any> | undefined;
|
|
689
|
-
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
690
|
-
stickyIndicesArr: number[];
|
|
691
|
-
stickyIndicesSet: Set<number>;
|
|
692
|
-
stylePaddingBottom: number | undefined;
|
|
693
|
-
stylePaddingTop: number | undefined;
|
|
694
|
-
suggestEstimatedItemSize: boolean;
|
|
695
|
-
useWindowScroll: boolean;
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
interface ViewableRange$1<T> {
|
|
699
|
-
end: number;
|
|
700
|
-
endBuffered: number;
|
|
701
|
-
items: T[];
|
|
702
|
-
start: number;
|
|
703
|
-
startBuffered: number;
|
|
704
|
-
}
|
|
705
770
|
interface LegendListRenderItemProps$1<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
|
|
706
771
|
data: readonly ItemT[];
|
|
707
772
|
extraData: any;
|
|
@@ -718,8 +783,11 @@ type LegendListState$1 = {
|
|
|
718
783
|
endBuffered: number;
|
|
719
784
|
isAtEnd: boolean;
|
|
720
785
|
isAtStart: boolean;
|
|
786
|
+
isNearEnd: boolean;
|
|
787
|
+
isNearStart: boolean;
|
|
721
788
|
isEndReached: boolean;
|
|
722
789
|
isStartReached: boolean;
|
|
790
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
723
791
|
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
724
792
|
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
725
793
|
positionAtIndex: (index: number) => number;
|
|
@@ -865,10 +933,15 @@ interface ViewabilityConfigCallbackPair$1<ItemT = any> {
|
|
|
865
933
|
viewabilityConfig: ViewabilityConfig$1;
|
|
866
934
|
}
|
|
867
935
|
type ViewabilityConfigCallbackPairs$1<ItemT> = ViewabilityConfigCallbackPair$1<ItemT>[];
|
|
868
|
-
|
|
869
|
-
viewableItems: Array<ViewToken$1<ItemT>>;
|
|
936
|
+
interface OnViewableItemsChangedInfo$1<ItemT> {
|
|
870
937
|
changed: Array<ViewToken$1<ItemT>>;
|
|
871
|
-
|
|
938
|
+
end: number;
|
|
939
|
+
endBuffered: number;
|
|
940
|
+
start: number;
|
|
941
|
+
startBuffered: number;
|
|
942
|
+
viewableItems: Array<ViewToken$1<ItemT>>;
|
|
943
|
+
}
|
|
944
|
+
type OnViewableItemsChanged$1<ItemT> = ((info: OnViewableItemsChangedInfo$1<ItemT>) => void) | null;
|
|
872
945
|
interface ViewabilityConfig$1 {
|
|
873
946
|
/**
|
|
874
947
|
* A unique ID to identify this viewability config
|
|
@@ -906,12 +979,6 @@ interface LegendListRecyclingState$1<T> {
|
|
|
906
979
|
prevIndex: number | undefined;
|
|
907
980
|
prevItem: T | undefined;
|
|
908
981
|
}
|
|
909
|
-
type TypedForwardRef$1 = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
910
|
-
declare const typedForwardRef: TypedForwardRef$1;
|
|
911
|
-
type TypedMemo$1 = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
|
|
912
|
-
displayName?: string;
|
|
913
|
-
};
|
|
914
|
-
declare const typedMemo: TypedMemo$1;
|
|
915
982
|
interface ScrollIndexWithOffset$1 {
|
|
916
983
|
index: number;
|
|
917
984
|
viewOffset?: number;
|
|
@@ -929,12 +996,6 @@ interface InitialScrollAnchor$1 extends ScrollIndexWithOffsetPosition$1 {
|
|
|
929
996
|
lastDelta?: number;
|
|
930
997
|
settledTicks?: number;
|
|
931
998
|
}
|
|
932
|
-
type GetRenderedItemResult$1<ItemT> = {
|
|
933
|
-
index: number;
|
|
934
|
-
item: ItemT;
|
|
935
|
-
renderedItem: React.ReactNode;
|
|
936
|
-
};
|
|
937
|
-
type GetRenderedItem$1 = (key: string) => GetRenderedItemResult$1<any> | null;
|
|
938
999
|
|
|
939
1000
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
940
1001
|
type Insets = Insets$1;
|
|
@@ -961,6 +1022,8 @@ type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemTyp
|
|
|
961
1022
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
962
1023
|
type MaintainVisibleContentPositionConfig<ItemT = any> = MaintainVisibleContentPositionConfig$1<ItemT>;
|
|
963
1024
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1025
|
+
type AnchoredEndSpaceConfig = AnchoredEndSpaceConfig$1;
|
|
1026
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
964
1027
|
type MaintainVisibleContentPositionNormalized<ItemT = any> = MaintainVisibleContentPositionNormalized$1<ItemT>;
|
|
965
1028
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
966
1029
|
type StickyHeaderConfig = StickyHeaderConfig$1;
|
|
@@ -997,6 +1060,8 @@ type ViewabilityConfigCallbackPair<ItemT = any> = ViewabilityConfigCallbackPair$
|
|
|
997
1060
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
998
1061
|
type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPairs$1<ItemT>;
|
|
999
1062
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1063
|
+
type OnViewableItemsChangedInfo<ItemT> = OnViewableItemsChangedInfo$1<ItemT>;
|
|
1064
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1000
1065
|
type OnViewableItemsChanged<ItemT> = OnViewableItemsChanged$1<ItemT>;
|
|
1001
1066
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1002
1067
|
type ViewabilityConfig = ViewabilityConfig$1;
|
|
@@ -1259,4 +1324,4 @@ declare function useSyncLayout(): () => void;
|
|
|
1259
1324
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1260
1325
|
declare const LegendList: LegendListComponent;
|
|
1261
1326
|
|
|
1262
|
-
export { type AccessibilityActionEvent, type AccessibilityRole, type AccessibilityState, type AccessibilityValue, type AlwaysRenderConfig, 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 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 };
|
|
1327
|
+
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 };
|