@legendapp/list 3.0.0-beta.43 → 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 -47
- package/index.d.ts +383 -294
- package/index.js +2262 -1186
- package/index.mjs +2262 -1186
- package/index.native.js +2348 -1362
- package/index.native.mjs +2348 -1362
- 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 +84 -318
- package/react-native.js +2350 -1363
- package/react-native.mjs +2351 -1362
- package/react-native.web.d.ts +91 -319
- package/react-native.web.js +2274 -1173
- package/react-native.web.mjs +2275 -1172
- package/react.d.ts +91 -319
- package/react.js +2274 -1173
- package/react.mjs +2275 -1172
- package/reanimated.d.ts +96 -49
- package/reanimated.js +94 -19
- package/reanimated.mjs +95 -20
- package/section-list.d.ts +88 -47
- 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,15 +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
|
-
/**
|
|
406
|
-
* If true, delays rendering until initial layout is complete.
|
|
407
|
-
* @default false
|
|
408
|
-
*/
|
|
409
|
-
waitForInitialLayout?: boolean;
|
|
410
|
-
onLoad?: (info: {
|
|
411
|
-
elapsedTimeInMs: number;
|
|
412
|
-
}) => void;
|
|
413
|
-
snapToIndices?: number[];
|
|
414
690
|
/**
|
|
415
691
|
* Array of child indices determining which children get docked to the top of the screen when scrolling.
|
|
416
692
|
* For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
|
|
@@ -427,21 +703,24 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
427
703
|
* @default undefined
|
|
428
704
|
*/
|
|
429
705
|
stickyHeaderConfig?: StickyHeaderConfig$1;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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;
|
|
433
711
|
}
|
|
434
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);
|
|
435
|
-
type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
|
|
436
713
|
interface MaintainVisibleContentPositionConfig$1<ItemT = any> {
|
|
437
714
|
data?: boolean;
|
|
438
715
|
size?: boolean;
|
|
439
716
|
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
440
717
|
}
|
|
441
|
-
interface
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
718
|
+
interface AnchoredEndSpaceConfig$1 {
|
|
719
|
+
anchorIndex: number;
|
|
720
|
+
anchorOffset?: number;
|
|
721
|
+
anchorMaxSize?: number;
|
|
722
|
+
includeInEndInset?: boolean;
|
|
723
|
+
onSizeChanged?: (size: number) => void;
|
|
445
724
|
}
|
|
446
725
|
interface StickyHeaderConfig$1 {
|
|
447
726
|
/**
|
|
@@ -488,197 +767,6 @@ interface LegendListMetrics$1 {
|
|
|
488
767
|
headerSize: number;
|
|
489
768
|
footerSize: number;
|
|
490
769
|
}
|
|
491
|
-
interface ThresholdSnapshot$1 {
|
|
492
|
-
scrollPosition: number;
|
|
493
|
-
contentSize?: number;
|
|
494
|
-
dataLength?: number;
|
|
495
|
-
atThreshold: boolean;
|
|
496
|
-
}
|
|
497
|
-
interface ScrollTarget$1 {
|
|
498
|
-
animated?: boolean;
|
|
499
|
-
index?: number;
|
|
500
|
-
isInitialScroll?: boolean;
|
|
501
|
-
itemSize?: number;
|
|
502
|
-
offset: number;
|
|
503
|
-
precomputedWithViewOffset?: boolean;
|
|
504
|
-
targetOffset?: number;
|
|
505
|
-
viewOffset?: number;
|
|
506
|
-
viewPosition?: number;
|
|
507
|
-
}
|
|
508
|
-
interface InternalState$1 {
|
|
509
|
-
activeStickyIndex: number | undefined;
|
|
510
|
-
adjustingFromInitialMount?: number;
|
|
511
|
-
animFrameCheckFinishedScroll?: any;
|
|
512
|
-
averageSizes: Record<string, {
|
|
513
|
-
num: number;
|
|
514
|
-
avg: number;
|
|
515
|
-
}>;
|
|
516
|
-
columns: Array<number | undefined>;
|
|
517
|
-
columnSpans: Array<number | undefined>;
|
|
518
|
-
containerItemKeys: Map<string, number>;
|
|
519
|
-
containerItemTypes: Map<number, string>;
|
|
520
|
-
dataChangeEpoch: number;
|
|
521
|
-
dataChangeNeedsScrollUpdate: boolean;
|
|
522
|
-
didColumnsChange?: boolean;
|
|
523
|
-
didDataChange?: boolean;
|
|
524
|
-
didFinishInitialScroll?: boolean;
|
|
525
|
-
didContainersLayout?: boolean;
|
|
526
|
-
enableScrollForNextCalculateItemsInView: boolean;
|
|
527
|
-
endBuffered: number;
|
|
528
|
-
endNoBuffer: number;
|
|
529
|
-
endReachedSnapshot: ThresholdSnapshot$1 | undefined;
|
|
530
|
-
firstFullyOnScreenIndex: number;
|
|
531
|
-
hasScrolled?: boolean;
|
|
532
|
-
idCache: string[];
|
|
533
|
-
idsInView: string[];
|
|
534
|
-
ignoreScrollFromMVCP?: {
|
|
535
|
-
lt?: number;
|
|
536
|
-
gt?: number;
|
|
537
|
-
};
|
|
538
|
-
ignoreScrollFromMVCPIgnored?: boolean;
|
|
539
|
-
ignoreScrollFromMVCPTimeout?: any;
|
|
540
|
-
indexByKey: Map<string, number>;
|
|
541
|
-
initialAnchor?: InitialScrollAnchor$1;
|
|
542
|
-
initialNativeScrollWatchdog?: {
|
|
543
|
-
startScroll: number;
|
|
544
|
-
targetOffset: number;
|
|
545
|
-
};
|
|
546
|
-
initialScrollLastDidFinish: boolean;
|
|
547
|
-
initialScrollLastTarget: ScrollIndexWithOffsetAndContentOffset$1 | undefined;
|
|
548
|
-
initialScrollLastTargetUsesOffset: boolean;
|
|
549
|
-
initialScrollPreviousDataLength: number;
|
|
550
|
-
initialScrollRetryLastLength: number | undefined;
|
|
551
|
-
initialScrollRetryWindowUntil: number;
|
|
552
|
-
initialScroll: ScrollIndexWithOffsetAndContentOffset$1 | undefined;
|
|
553
|
-
initialScrollUsesOffset: boolean;
|
|
554
|
-
isAtEnd: boolean;
|
|
555
|
-
isAtStart: boolean;
|
|
556
|
-
isEndReached: boolean | null;
|
|
557
|
-
isFirst?: boolean;
|
|
558
|
-
isStartReached: boolean | null;
|
|
559
|
-
lastBatchingAction: number;
|
|
560
|
-
lastLayout: LayoutRectangle$1 | undefined;
|
|
561
|
-
lastScrollAdjustForHistory?: number;
|
|
562
|
-
lastScrollDelta: number;
|
|
563
|
-
loadStartTime: number;
|
|
564
|
-
maintainingScrollAtEnd?: boolean;
|
|
565
|
-
minIndexSizeChanged: number | undefined;
|
|
566
|
-
mvcpAnchorLock?: {
|
|
567
|
-
id: string;
|
|
568
|
-
position: number;
|
|
569
|
-
quietPasses: number;
|
|
570
|
-
expiresAt: number;
|
|
571
|
-
};
|
|
572
|
-
contentInsetOverride?: Partial<Insets$1> | null;
|
|
573
|
-
nativeContentInset?: Insets$1;
|
|
574
|
-
nativeMarginTop: number;
|
|
575
|
-
needsOtherAxisSize?: boolean;
|
|
576
|
-
otherAxisSize?: number;
|
|
577
|
-
pendingNativeMVCPAdjust?: {
|
|
578
|
-
amount: number;
|
|
579
|
-
furthestProgressTowardAmount: number;
|
|
580
|
-
manualApplied: number;
|
|
581
|
-
startScroll: number;
|
|
582
|
-
};
|
|
583
|
-
pendingMaintainScrollAtEnd?: boolean;
|
|
584
|
-
pendingTotalSize?: number;
|
|
585
|
-
pendingScrollResolve?: (() => void) | undefined;
|
|
586
|
-
positions: Array<number | undefined>;
|
|
587
|
-
previousData?: readonly unknown[];
|
|
588
|
-
queuedCalculateItemsInView: number | undefined;
|
|
589
|
-
queuedMVCPRecalculate?: number;
|
|
590
|
-
queuedInitialLayout?: boolean | undefined;
|
|
591
|
-
refScroller: React.RefObject<LegendListScrollerRef$1 | null>;
|
|
592
|
-
scroll: number;
|
|
593
|
-
scrollAdjustHandler: ScrollAdjustHandler;
|
|
594
|
-
scrollForNextCalculateItemsInView: {
|
|
595
|
-
top: number | null;
|
|
596
|
-
bottom: number | null;
|
|
597
|
-
} | undefined;
|
|
598
|
-
scrollHistory: Array<{
|
|
599
|
-
scroll: number;
|
|
600
|
-
time: number;
|
|
601
|
-
}>;
|
|
602
|
-
scrollingTo?: ScrollTarget$1 | undefined;
|
|
603
|
-
scrollLastCalculate?: number;
|
|
604
|
-
scrollLength: number;
|
|
605
|
-
scrollPending: number;
|
|
606
|
-
scrollPrev: number;
|
|
607
|
-
scrollPrevTime: number;
|
|
608
|
-
scrollProcessingEnabled: boolean;
|
|
609
|
-
scrollTime: number;
|
|
610
|
-
sizes: Map<string, number>;
|
|
611
|
-
sizesKnown: Map<string, number>;
|
|
612
|
-
startBuffered: number;
|
|
613
|
-
startBufferedId?: string;
|
|
614
|
-
startNoBuffer: number;
|
|
615
|
-
startReachedSnapshotDataChangeEpoch: number | undefined;
|
|
616
|
-
startReachedSnapshot: ThresholdSnapshot$1 | undefined;
|
|
617
|
-
stickyContainerPool: Set<number>;
|
|
618
|
-
stickyContainers: Map<number, number>;
|
|
619
|
-
timeouts: Set<number>;
|
|
620
|
-
timeoutSetPaddingTop?: any;
|
|
621
|
-
timeoutSizeMessage: any;
|
|
622
|
-
timeoutCheckFinishedScrollFallback?: any;
|
|
623
|
-
totalSize: number;
|
|
624
|
-
triggerCalculateItemsInView?: (params?: {
|
|
625
|
-
doMVCP?: boolean;
|
|
626
|
-
dataChanged?: boolean;
|
|
627
|
-
forceFullItemPositions?: boolean;
|
|
628
|
-
}) => void;
|
|
629
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs$1<any> | undefined;
|
|
630
|
-
props: {
|
|
631
|
-
alignItemsAtEnd: boolean;
|
|
632
|
-
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
633
|
-
alwaysRender: AlwaysRenderConfig$1 | undefined;
|
|
634
|
-
alwaysRenderIndicesArr: number[];
|
|
635
|
-
alwaysRenderIndicesSet: Set<number>;
|
|
636
|
-
contentInset: Insets$1 | undefined;
|
|
637
|
-
data: readonly any[];
|
|
638
|
-
dataVersion: Key | undefined;
|
|
639
|
-
drawDistance: number;
|
|
640
|
-
estimatedItemSize: number | undefined;
|
|
641
|
-
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
642
|
-
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
643
|
-
getItemType: LegendListPropsInternal["getItemType"];
|
|
644
|
-
horizontal: boolean;
|
|
645
|
-
initialContainerPoolRatio: number;
|
|
646
|
-
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
647
|
-
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
648
|
-
maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
|
|
649
|
-
maintainScrollAtEndThreshold: number | undefined;
|
|
650
|
-
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized$1;
|
|
651
|
-
numColumns: number;
|
|
652
|
-
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
653
|
-
onEndReachedThreshold: number | null | undefined;
|
|
654
|
-
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
655
|
-
onLoad: LegendListPropsInternal["onLoad"];
|
|
656
|
-
onScroll: LegendListPropsInternal["onScroll"];
|
|
657
|
-
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
658
|
-
onStartReachedThreshold: number | null | undefined;
|
|
659
|
-
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
660
|
-
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
661
|
-
recycleItems: boolean;
|
|
662
|
-
renderItem: LegendListPropsInternal["renderItem"];
|
|
663
|
-
scrollBuffer?: number;
|
|
664
|
-
snapToIndices: number[] | undefined;
|
|
665
|
-
positionComponentInternal: React.ComponentType<any> | undefined;
|
|
666
|
-
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
667
|
-
stickyIndicesArr: number[];
|
|
668
|
-
stickyIndicesSet: Set<number>;
|
|
669
|
-
stylePaddingBottom: number | undefined;
|
|
670
|
-
stylePaddingTop: number | undefined;
|
|
671
|
-
suggestEstimatedItemSize: boolean;
|
|
672
|
-
useWindowScroll: boolean;
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
interface ViewableRange$1<T> {
|
|
676
|
-
end: number;
|
|
677
|
-
endBuffered: number;
|
|
678
|
-
items: T[];
|
|
679
|
-
start: number;
|
|
680
|
-
startBuffered: number;
|
|
681
|
-
}
|
|
682
770
|
interface LegendListRenderItemProps$1<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
|
|
683
771
|
data: readonly ItemT[];
|
|
684
772
|
extraData: any;
|
|
@@ -695,8 +783,11 @@ type LegendListState$1 = {
|
|
|
695
783
|
endBuffered: number;
|
|
696
784
|
isAtEnd: boolean;
|
|
697
785
|
isAtStart: boolean;
|
|
786
|
+
isNearEnd: boolean;
|
|
787
|
+
isNearStart: boolean;
|
|
698
788
|
isEndReached: boolean;
|
|
699
789
|
isStartReached: boolean;
|
|
790
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
700
791
|
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
701
792
|
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
702
793
|
positionAtIndex: (index: number) => number;
|
|
@@ -842,10 +933,15 @@ interface ViewabilityConfigCallbackPair$1<ItemT = any> {
|
|
|
842
933
|
viewabilityConfig: ViewabilityConfig$1;
|
|
843
934
|
}
|
|
844
935
|
type ViewabilityConfigCallbackPairs$1<ItemT> = ViewabilityConfigCallbackPair$1<ItemT>[];
|
|
845
|
-
|
|
846
|
-
viewableItems: Array<ViewToken$1<ItemT>>;
|
|
936
|
+
interface OnViewableItemsChangedInfo$1<ItemT> {
|
|
847
937
|
changed: Array<ViewToken$1<ItemT>>;
|
|
848
|
-
|
|
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;
|
|
849
945
|
interface ViewabilityConfig$1 {
|
|
850
946
|
/**
|
|
851
947
|
* A unique ID to identify this viewability config
|
|
@@ -883,12 +979,6 @@ interface LegendListRecyclingState$1<T> {
|
|
|
883
979
|
prevIndex: number | undefined;
|
|
884
980
|
prevItem: T | undefined;
|
|
885
981
|
}
|
|
886
|
-
type TypedForwardRef$1 = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
887
|
-
declare const typedForwardRef: TypedForwardRef$1;
|
|
888
|
-
type TypedMemo$1 = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
|
|
889
|
-
displayName?: string;
|
|
890
|
-
};
|
|
891
|
-
declare const typedMemo: TypedMemo$1;
|
|
892
982
|
interface ScrollIndexWithOffset$1 {
|
|
893
983
|
index: number;
|
|
894
984
|
viewOffset?: number;
|
|
@@ -900,17 +990,12 @@ interface ScrollIndexWithOffsetPosition$1 extends ScrollIndexWithOffset$1 {
|
|
|
900
990
|
interface ScrollIndexWithOffsetAndContentOffset$1 extends ScrollIndexWithOffsetPosition$1 {
|
|
901
991
|
contentOffset?: number;
|
|
902
992
|
}
|
|
993
|
+
/** @deprecated Kept for backwards compatibility. Use `ScrollIndexWithOffsetPosition`. */
|
|
903
994
|
interface InitialScrollAnchor$1 extends ScrollIndexWithOffsetPosition$1 {
|
|
904
995
|
attempts?: number;
|
|
905
996
|
lastDelta?: number;
|
|
906
997
|
settledTicks?: number;
|
|
907
998
|
}
|
|
908
|
-
type GetRenderedItemResult$1<ItemT> = {
|
|
909
|
-
index: number;
|
|
910
|
-
item: ItemT;
|
|
911
|
-
renderedItem: React.ReactNode;
|
|
912
|
-
};
|
|
913
|
-
type GetRenderedItem$1 = (key: string) => GetRenderedItemResult$1<any> | null;
|
|
914
999
|
|
|
915
1000
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
916
1001
|
type Insets = Insets$1;
|
|
@@ -937,6 +1022,8 @@ type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemTyp
|
|
|
937
1022
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
938
1023
|
type MaintainVisibleContentPositionConfig<ItemT = any> = MaintainVisibleContentPositionConfig$1<ItemT>;
|
|
939
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 */
|
|
940
1027
|
type MaintainVisibleContentPositionNormalized<ItemT = any> = MaintainVisibleContentPositionNormalized$1<ItemT>;
|
|
941
1028
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
942
1029
|
type StickyHeaderConfig = StickyHeaderConfig$1;
|
|
@@ -973,6 +1060,8 @@ type ViewabilityConfigCallbackPair<ItemT = any> = ViewabilityConfigCallbackPair$
|
|
|
973
1060
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
974
1061
|
type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPairs$1<ItemT>;
|
|
975
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 */
|
|
976
1065
|
type OnViewableItemsChanged<ItemT> = OnViewableItemsChanged$1<ItemT>;
|
|
977
1066
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
978
1067
|
type ViewabilityConfig = ViewabilityConfig$1;
|
|
@@ -992,7 +1081,7 @@ type ScrollIndexWithOffset = ScrollIndexWithOffset$1;
|
|
|
992
1081
|
type ScrollIndexWithOffsetPosition = ScrollIndexWithOffsetPosition$1;
|
|
993
1082
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
994
1083
|
type ScrollIndexWithOffsetAndContentOffset = ScrollIndexWithOffsetAndContentOffset$1;
|
|
995
|
-
/** @deprecated Use `@legendapp/list/react-native`
|
|
1084
|
+
/** @deprecated Use `ScrollIndexWithOffsetPosition`, or `@legendapp/list/react-native` / `@legendapp/list/react` for strict typing */
|
|
996
1085
|
type InitialScrollAnchor = InitialScrollAnchor$1;
|
|
997
1086
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
998
1087
|
type GetRenderedItemResult<ItemT> = GetRenderedItemResult$1<ItemT>;
|
|
@@ -1235,4 +1324,4 @@ declare function useSyncLayout(): () => void;
|
|
|
1235
1324
|
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
1236
1325
|
declare const LegendList: LegendListComponent;
|
|
1237
1326
|
|
|
1238
|
-
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 };
|