@legendapp/list 3.0.0-beta.32 → 3.0.0-beta.34
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/README.md +7 -1
- package/animated.d.ts +605 -6
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/index.d.ts +503 -118
- package/index.js +607 -275
- package/index.mjs +607 -275
- package/index.native.js +348 -189
- package/index.native.mjs +347 -188
- package/keyboard-controller.d.ts +616 -6
- package/keyboard-controller.js +2 -2
- package/keyboard-controller.mjs +1 -1
- package/keyboard.d.ts +204 -8
- package/keyboard.js +68 -53
- package/keyboard.mjs +71 -55
- package/{index.d.mts → list-react-native.d.ts} +138 -42
- package/list-react-native.js +4348 -0
- package/list-react-native.mjs +4318 -0
- package/{index.native.d.mts → list-react.d.ts} +195 -42
- package/list-react.js +4709 -0
- package/list-react.mjs +4679 -0
- package/package.json +52 -1
- package/reanimated.d.ts +605 -7
- package/reanimated.js +180 -12
- package/reanimated.mjs +177 -9
- package/section-list.d.ts +615 -14
- package/section-list.js +6 -6
- package/section-list.mjs +1 -1
- package/animated.d.mts +0 -9
- package/animated.native.d.mts +0 -9
- package/animated.native.d.ts +0 -9
- package/animated.native.js +0 -9
- package/animated.native.mjs +0 -7
- package/index.native.d.ts +0 -817
- package/keyboard-controller.d.mts +0 -12
- package/keyboard-controller.native.d.mts +0 -12
- package/keyboard-controller.native.d.ts +0 -12
- package/keyboard-controller.native.js +0 -69
- package/keyboard-controller.native.mjs +0 -48
- package/keyboard.d.mts +0 -13
- package/keyboard.native.d.mts +0 -13
- package/keyboard.native.d.ts +0 -13
- package/keyboard.native.js +0 -399
- package/keyboard.native.mjs +0 -377
- package/reanimated.d.mts +0 -18
- package/reanimated.native.d.mts +0 -18
- package/reanimated.native.d.ts +0 -18
- package/reanimated.native.js +0 -89
- package/reanimated.native.mjs +0 -65
- package/section-list.d.mts +0 -112
- package/section-list.native.d.mts +0 -112
- package/section-list.native.d.ts +0 -112
- package/section-list.native.js +0 -293
- package/section-list.native.mjs +0 -271
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import { Key,
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Key, ReactNode, ReactElement, HTMLAttributes, CSSProperties, Ref, RefAttributes, Dispatch, SetStateAction } from 'react';
|
|
3
|
+
|
|
4
|
+
type ScrollEventTarget = Window | HTMLElement;
|
|
5
|
+
|
|
6
|
+
interface ScrollViewMethods {
|
|
7
|
+
getBoundingClientRect(): DOMRect | null | undefined;
|
|
8
|
+
getContentNode(): HTMLElement | null;
|
|
9
|
+
getCurrentScrollOffset(): number;
|
|
10
|
+
getScrollableNode(): HTMLElement;
|
|
11
|
+
getScrollEventTarget(): ScrollEventTarget | null;
|
|
12
|
+
getScrollResponder(): HTMLElement | null;
|
|
13
|
+
isWindowScroll?(): boolean;
|
|
14
|
+
scrollBy(x: number, y: number): void;
|
|
15
|
+
scrollTo(options: {
|
|
16
|
+
x?: number;
|
|
17
|
+
y?: number;
|
|
18
|
+
animated?: boolean;
|
|
19
|
+
}): void;
|
|
20
|
+
scrollToEnd(options?: {
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
}): void;
|
|
23
|
+
scrollToOffset(params: {
|
|
24
|
+
offset: number;
|
|
25
|
+
animated?: boolean;
|
|
26
|
+
}): void;
|
|
27
|
+
}
|
|
5
28
|
|
|
6
29
|
type AnimatedValue = number;
|
|
7
30
|
|
|
@@ -65,7 +88,7 @@ interface StateContext {
|
|
|
65
88
|
positionListeners: Map<string, Set<(value: any) => void>>;
|
|
66
89
|
state: InternalState;
|
|
67
90
|
values: Map<ListenerType, any>;
|
|
68
|
-
viewRefs: Map<number, React$1.RefObject<
|
|
91
|
+
viewRefs: Map<number, React$1.RefObject<LooseView>>;
|
|
69
92
|
}
|
|
70
93
|
|
|
71
94
|
declare class ScrollAdjustHandler {
|
|
@@ -85,6 +108,62 @@ type StylesAsSharedValue<Style> = {
|
|
|
85
108
|
[key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
|
|
86
109
|
};
|
|
87
110
|
|
|
111
|
+
interface Insets {
|
|
112
|
+
top: number;
|
|
113
|
+
left: number;
|
|
114
|
+
bottom: number;
|
|
115
|
+
right: number;
|
|
116
|
+
}
|
|
117
|
+
interface LayoutRectangle {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
}
|
|
123
|
+
interface NativeScrollEvent {
|
|
124
|
+
contentOffset: {
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
};
|
|
128
|
+
contentSize: {
|
|
129
|
+
width: number;
|
|
130
|
+
height: number;
|
|
131
|
+
};
|
|
132
|
+
layoutMeasurement: {
|
|
133
|
+
width: number;
|
|
134
|
+
height: number;
|
|
135
|
+
};
|
|
136
|
+
contentInset: Insets;
|
|
137
|
+
zoomScale: number;
|
|
138
|
+
}
|
|
139
|
+
interface NativeSyntheticEvent<T> {
|
|
140
|
+
nativeEvent: T;
|
|
141
|
+
}
|
|
142
|
+
type ViewStyle = Record<string, unknown>;
|
|
143
|
+
type StyleProp<T> = T | T[] | null | undefined | false;
|
|
144
|
+
interface ScrollEventTargetLike {
|
|
145
|
+
addEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
146
|
+
removeEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
147
|
+
}
|
|
148
|
+
interface ScrollableNodeLike {
|
|
149
|
+
scrollLeft?: number;
|
|
150
|
+
scrollTop?: number;
|
|
151
|
+
}
|
|
152
|
+
interface LegendListScrollerRef {
|
|
153
|
+
flashScrollIndicators(): void;
|
|
154
|
+
getCurrentScrollOffset?(): number;
|
|
155
|
+
getScrollEventTarget(): ScrollEventTargetLike | null;
|
|
156
|
+
getScrollableNode(): ScrollableNodeLike | null;
|
|
157
|
+
getScrollResponder(): unknown;
|
|
158
|
+
scrollTo(options: {
|
|
159
|
+
animated?: boolean;
|
|
160
|
+
x?: number;
|
|
161
|
+
y?: number;
|
|
162
|
+
}): void;
|
|
163
|
+
scrollToEnd(options?: {
|
|
164
|
+
animated?: boolean;
|
|
165
|
+
}): void;
|
|
166
|
+
}
|
|
88
167
|
type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
89
168
|
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
90
169
|
/**
|
|
@@ -241,6 +320,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
241
320
|
* - true enables both behaviors; false disables both.
|
|
242
321
|
*/
|
|
243
322
|
maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig<ItemT>;
|
|
323
|
+
/**
|
|
324
|
+
* Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
useWindowScroll?: boolean;
|
|
244
328
|
/**
|
|
245
329
|
* Number of columns to render items in.
|
|
246
330
|
* @default 1
|
|
@@ -311,7 +395,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
311
395
|
/**
|
|
312
396
|
* Ref to the underlying ScrollView component.
|
|
313
397
|
*/
|
|
314
|
-
refScrollView?: React.Ref<
|
|
398
|
+
refScrollView?: React.Ref<any>;
|
|
315
399
|
/**
|
|
316
400
|
* If true, shows a refresh indicator.
|
|
317
401
|
* @default false
|
|
@@ -322,7 +406,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
322
406
|
* Note: When using `stickyHeaderIndices`, you must provide an Animated ScrollView component.
|
|
323
407
|
* @default (props) => <ScrollView {...props} />
|
|
324
408
|
*/
|
|
325
|
-
renderScrollComponent?: (props:
|
|
409
|
+
renderScrollComponent?: (props: any) => React.ReactElement | null;
|
|
326
410
|
/**
|
|
327
411
|
* This will log a suggested estimatedItemSize.
|
|
328
412
|
* @required
|
|
@@ -366,7 +450,8 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
366
450
|
getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
|
|
367
451
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
368
452
|
}
|
|
369
|
-
type LegendListPropsBase<ItemT,
|
|
453
|
+
type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
454
|
+
type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
|
|
370
455
|
interface MaintainVisibleContentPositionConfig<ItemT = any> {
|
|
371
456
|
data?: boolean;
|
|
372
457
|
size?: boolean;
|
|
@@ -410,7 +495,6 @@ interface LegendListMetrics {
|
|
|
410
495
|
headerSize: number;
|
|
411
496
|
footerSize: number;
|
|
412
497
|
}
|
|
413
|
-
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
414
498
|
interface ThresholdSnapshot {
|
|
415
499
|
scrollPosition: number;
|
|
416
500
|
contentSize?: number;
|
|
@@ -435,10 +519,11 @@ interface InternalState {
|
|
|
435
519
|
num: number;
|
|
436
520
|
avg: number;
|
|
437
521
|
}>;
|
|
438
|
-
columns:
|
|
439
|
-
columnSpans:
|
|
522
|
+
columns: Array<number | undefined>;
|
|
523
|
+
columnSpans: Array<number | undefined>;
|
|
440
524
|
containerItemKeys: Map<string, number>;
|
|
441
525
|
containerItemTypes: Map<number, string>;
|
|
526
|
+
dataChangeEpoch: number;
|
|
442
527
|
dataChangeNeedsScrollUpdate: boolean;
|
|
443
528
|
didColumnsChange?: boolean;
|
|
444
529
|
didDataChange?: boolean;
|
|
@@ -485,12 +570,13 @@ interface InternalState {
|
|
|
485
570
|
needsOtherAxisSize?: boolean;
|
|
486
571
|
otherAxisSize?: number;
|
|
487
572
|
pendingTotalSize?: number;
|
|
488
|
-
|
|
573
|
+
pendingScrollResolve?: (() => void) | undefined;
|
|
574
|
+
positions: Array<number | undefined>;
|
|
489
575
|
previousData?: readonly unknown[];
|
|
490
576
|
queuedCalculateItemsInView: number | undefined;
|
|
491
577
|
queuedMVCPRecalculate?: number;
|
|
492
578
|
queuedInitialLayout?: boolean | undefined;
|
|
493
|
-
refScroller: React.RefObject<
|
|
579
|
+
refScroller: React.RefObject<LegendListScrollerRef | null>;
|
|
494
580
|
scroll: number;
|
|
495
581
|
scrollAdjustHandler: ScrollAdjustHandler;
|
|
496
582
|
scrollForNextCalculateItemsInView: {
|
|
@@ -514,6 +600,7 @@ interface InternalState {
|
|
|
514
600
|
startBuffered: number;
|
|
515
601
|
startBufferedId?: string;
|
|
516
602
|
startNoBuffer: number;
|
|
603
|
+
startReachedSnapshotDataChangeEpoch: number | undefined;
|
|
517
604
|
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
518
605
|
stickyContainerPool: Set<number>;
|
|
519
606
|
stickyContainers: Map<number, number>;
|
|
@@ -530,7 +617,7 @@ interface InternalState {
|
|
|
530
617
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
531
618
|
props: {
|
|
532
619
|
alignItemsAtEnd: boolean;
|
|
533
|
-
animatedProps: StylesAsSharedValue<
|
|
620
|
+
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
534
621
|
alwaysRender: AlwaysRenderConfig | undefined;
|
|
535
622
|
alwaysRenderIndicesArr: number[];
|
|
536
623
|
alwaysRenderIndicesSet: Set<number>;
|
|
@@ -539,34 +626,38 @@ interface InternalState {
|
|
|
539
626
|
dataVersion: Key | undefined;
|
|
540
627
|
drawDistance: number;
|
|
541
628
|
estimatedItemSize: number | undefined;
|
|
542
|
-
getEstimatedItemSize:
|
|
543
|
-
getFixedItemSize:
|
|
544
|
-
getItemType:
|
|
629
|
+
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
630
|
+
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
631
|
+
getItemType: LegendListPropsInternal["getItemType"];
|
|
545
632
|
horizontal: boolean;
|
|
546
633
|
initialContainerPoolRatio: number;
|
|
547
|
-
itemsAreEqual:
|
|
548
|
-
keyExtractor:
|
|
634
|
+
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
635
|
+
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
549
636
|
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
550
637
|
maintainScrollAtEndThreshold: number | undefined;
|
|
551
638
|
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
552
639
|
numColumns: number;
|
|
553
|
-
onEndReached:
|
|
640
|
+
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
554
641
|
onEndReachedThreshold: number | null | undefined;
|
|
555
|
-
onItemSizeChanged:
|
|
556
|
-
onLoad:
|
|
557
|
-
onScroll:
|
|
558
|
-
onStartReached:
|
|
642
|
+
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
643
|
+
onLoad: LegendListPropsInternal["onLoad"];
|
|
644
|
+
onScroll: LegendListPropsInternal["onScroll"];
|
|
645
|
+
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
559
646
|
onStartReachedThreshold: number | null | undefined;
|
|
560
|
-
onStickyHeaderChange:
|
|
561
|
-
overrideItemLayout:
|
|
647
|
+
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
648
|
+
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
562
649
|
recycleItems: boolean;
|
|
563
|
-
renderItem:
|
|
650
|
+
renderItem: LegendListPropsInternal["renderItem"];
|
|
651
|
+
scrollBuffer?: number;
|
|
564
652
|
snapToIndices: number[] | undefined;
|
|
653
|
+
positionComponentInternal: React.ComponentType<any> | undefined;
|
|
654
|
+
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
565
655
|
stickyIndicesArr: number[];
|
|
566
656
|
stickyIndicesSet: Set<number>;
|
|
567
657
|
stylePaddingBottom: number | undefined;
|
|
568
658
|
stylePaddingTop: number | undefined;
|
|
569
659
|
suggestEstimatedItemSize: boolean;
|
|
660
|
+
useWindowScroll: boolean;
|
|
570
661
|
};
|
|
571
662
|
}
|
|
572
663
|
interface ViewableRange<T> {
|
|
@@ -583,11 +674,11 @@ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | u
|
|
|
583
674
|
item: ItemT;
|
|
584
675
|
type: TItemType;
|
|
585
676
|
}
|
|
586
|
-
type LegendListState = {
|
|
677
|
+
type LegendListState$1 = {
|
|
587
678
|
activeStickyIndex: number;
|
|
588
679
|
contentLength: number;
|
|
589
680
|
data: readonly any[];
|
|
590
|
-
elementAtIndex: (index: number) =>
|
|
681
|
+
elementAtIndex: (index: number) => any;
|
|
591
682
|
end: number;
|
|
592
683
|
endBuffered: number;
|
|
593
684
|
isAtEnd: boolean;
|
|
@@ -595,7 +686,7 @@ type LegendListState = {
|
|
|
595
686
|
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
596
687
|
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
597
688
|
positionAtIndex: (index: number) => number;
|
|
598
|
-
|
|
689
|
+
positionByKey: (key: string) => number | undefined;
|
|
599
690
|
scroll: number;
|
|
600
691
|
scrollLength: number;
|
|
601
692
|
scrollVelocity: number;
|
|
@@ -604,7 +695,7 @@ type LegendListState = {
|
|
|
604
695
|
start: number;
|
|
605
696
|
startBuffered: number;
|
|
606
697
|
};
|
|
607
|
-
type LegendListRef = {
|
|
698
|
+
type LegendListRef$1 = {
|
|
608
699
|
/**
|
|
609
700
|
* Displays the scroll indicators momentarily.
|
|
610
701
|
*/
|
|
@@ -612,7 +703,7 @@ type LegendListRef = {
|
|
|
612
703
|
/**
|
|
613
704
|
* Returns the native ScrollView component reference.
|
|
614
705
|
*/
|
|
615
|
-
getNativeScrollRef():
|
|
706
|
+
getNativeScrollRef(): any;
|
|
616
707
|
/**
|
|
617
708
|
* Returns the scroll responder instance for handling scroll events.
|
|
618
709
|
*/
|
|
@@ -620,11 +711,11 @@ type LegendListRef = {
|
|
|
620
711
|
/**
|
|
621
712
|
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
622
713
|
*/
|
|
623
|
-
getScrollResponder():
|
|
714
|
+
getScrollResponder(): any;
|
|
624
715
|
/**
|
|
625
716
|
* Returns the internal state of the scroll virtualization.
|
|
626
717
|
*/
|
|
627
|
-
getState(): LegendListState;
|
|
718
|
+
getState(): LegendListState$1;
|
|
628
719
|
/**
|
|
629
720
|
* Scrolls a specific index into view.
|
|
630
721
|
* @param params - Parameters for scrolling.
|
|
@@ -634,7 +725,7 @@ type LegendListRef = {
|
|
|
634
725
|
scrollIndexIntoView(params: {
|
|
635
726
|
animated?: boolean | undefined;
|
|
636
727
|
index: number;
|
|
637
|
-
}): void
|
|
728
|
+
}): Promise<void>;
|
|
638
729
|
/**
|
|
639
730
|
* Scrolls a specific index into view.
|
|
640
731
|
* @param params - Parameters for scrolling.
|
|
@@ -644,7 +735,7 @@ type LegendListRef = {
|
|
|
644
735
|
scrollItemIntoView(params: {
|
|
645
736
|
animated?: boolean | undefined;
|
|
646
737
|
item: any;
|
|
647
|
-
}): void
|
|
738
|
+
}): Promise<void>;
|
|
648
739
|
/**
|
|
649
740
|
* Scrolls to the end of the list.
|
|
650
741
|
* @param options - Options for scrolling.
|
|
@@ -654,7 +745,7 @@ type LegendListRef = {
|
|
|
654
745
|
scrollToEnd(options?: {
|
|
655
746
|
animated?: boolean | undefined;
|
|
656
747
|
viewOffset?: number | undefined;
|
|
657
|
-
}): void
|
|
748
|
+
}): Promise<void>;
|
|
658
749
|
/**
|
|
659
750
|
* Scrolls to a specific index in the list.
|
|
660
751
|
* @param params - Parameters for scrolling.
|
|
@@ -668,7 +759,7 @@ type LegendListRef = {
|
|
|
668
759
|
index: number;
|
|
669
760
|
viewOffset?: number | undefined;
|
|
670
761
|
viewPosition?: number | undefined;
|
|
671
|
-
}): void
|
|
762
|
+
}): Promise<void>;
|
|
672
763
|
/**
|
|
673
764
|
* Scrolls to a specific item in the list.
|
|
674
765
|
* @param params - Parameters for scrolling.
|
|
@@ -682,7 +773,7 @@ type LegendListRef = {
|
|
|
682
773
|
item: any;
|
|
683
774
|
viewOffset?: number | undefined;
|
|
684
775
|
viewPosition?: number | undefined;
|
|
685
|
-
}): void
|
|
776
|
+
}): Promise<void>;
|
|
686
777
|
/**
|
|
687
778
|
* Scrolls to a specific offset in pixels.
|
|
688
779
|
* @param params - Parameters for scrolling.
|
|
@@ -692,7 +783,7 @@ type LegendListRef = {
|
|
|
692
783
|
scrollToOffset(params: {
|
|
693
784
|
offset: number;
|
|
694
785
|
animated?: boolean | undefined;
|
|
695
|
-
}): void
|
|
786
|
+
}): Promise<void>;
|
|
696
787
|
/**
|
|
697
788
|
* Sets or adds to the offset of the visible content anchor.
|
|
698
789
|
* @param value - The offset to set or add.
|
|
@@ -704,6 +795,14 @@ type LegendListRef = {
|
|
|
704
795
|
* @param enabled - If true, scroll processing is enabled.
|
|
705
796
|
*/
|
|
706
797
|
setScrollProcessingEnabled(enabled: boolean): void;
|
|
798
|
+
/**
|
|
799
|
+
* Clears internal virtualization caches.
|
|
800
|
+
* @param options - Cache clearing options.
|
|
801
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
802
|
+
*/
|
|
803
|
+
clearCaches(options?: {
|
|
804
|
+
mode?: "sizes" | "full";
|
|
805
|
+
}): void;
|
|
707
806
|
/**
|
|
708
807
|
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
709
808
|
* Values are merged on top of props/animated/native insets.
|
|
@@ -799,9 +898,61 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
799
898
|
};
|
|
800
899
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
801
900
|
|
|
802
|
-
|
|
803
|
-
|
|
901
|
+
type LooseLayoutChangeEvent = {
|
|
902
|
+
nativeEvent: {
|
|
903
|
+
layout: LayoutRectangle;
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
type LooseMeasureCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
|
|
907
|
+
interface LooseView {
|
|
908
|
+
measure?: (callback: LooseMeasureCallback) => void;
|
|
909
|
+
}
|
|
910
|
+
interface LooseScrollViewProps {
|
|
911
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
912
|
+
contentInset?: Insets;
|
|
913
|
+
contentOffset?: {
|
|
914
|
+
x: number;
|
|
915
|
+
y: number;
|
|
916
|
+
};
|
|
917
|
+
horizontal?: boolean;
|
|
918
|
+
maintainVisibleContentPosition?: {
|
|
919
|
+
autoscrollToTopThreshold?: number;
|
|
920
|
+
minIndexForVisible: number;
|
|
921
|
+
};
|
|
922
|
+
onLayout?: (event: LooseLayoutChangeEvent) => void;
|
|
923
|
+
onMomentumScrollBegin?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
924
|
+
onMomentumScrollEnd?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
925
|
+
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
926
|
+
refreshControl?: ReactElement | null;
|
|
927
|
+
removeClippedSubviews?: boolean;
|
|
928
|
+
scrollEventThrottle?: number;
|
|
929
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
930
|
+
showsVerticalScrollIndicator?: boolean;
|
|
931
|
+
stickyHeaderIndices?: number[];
|
|
932
|
+
style?: StyleProp<ViewStyle>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainerStyle" | "onScroll" | "onLayout" | "pagingEnabled" | "snapToInterval"> & Omit<HTMLAttributes<HTMLDivElement>, "onScroll" | "onLayout" | "style"> & {
|
|
936
|
+
style?: CSSProperties;
|
|
937
|
+
contentContainerStyle?: CSSProperties;
|
|
938
|
+
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
939
|
+
onLayout?: (event: LooseLayoutChangeEvent) => void;
|
|
940
|
+
};
|
|
941
|
+
type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewPropsWeb, TItemType>, "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
|
|
942
|
+
refScrollView?: Ref<HTMLElement | ScrollViewMethods>;
|
|
943
|
+
ListHeaderComponentStyle?: CSSProperties | undefined;
|
|
944
|
+
ListFooterComponentStyle?: CSSProperties | undefined;
|
|
804
945
|
};
|
|
946
|
+
type LegendListProps<ItemT = any, TItemType extends string | undefined = string | undefined> = LegendListPropsOverrides<ItemT, TItemType>;
|
|
947
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollableNode" | "getScrollResponder"> & {
|
|
948
|
+
getNativeScrollRef(): HTMLElement | ScrollViewMethods;
|
|
949
|
+
getScrollableNode(): HTMLElement;
|
|
950
|
+
getScrollResponder(): HTMLElement | null;
|
|
951
|
+
};
|
|
952
|
+
type LegendListState = Omit<LegendListState$1, "elementAtIndex"> & {
|
|
953
|
+
elementAtIndex: (index: number) => HTMLElement | null | undefined;
|
|
954
|
+
};
|
|
955
|
+
type LegendListComponent = <ItemT = any>(props: LegendListProps<ItemT> & RefAttributes<LegendListRef>) => ReactElement | null;
|
|
805
956
|
|
|
806
957
|
declare function useViewability<ItemT = any>(callback: ViewabilityCallback<ItemT>, configId?: string): void;
|
|
807
958
|
declare function useViewabilityAmount<ItemT = any>(callback: ViewabilityAmountCallback<ItemT>): void;
|
|
@@ -814,4 +965,6 @@ declare function useListScrollSize(): {
|
|
|
814
965
|
};
|
|
815
966
|
declare function useSyncLayout(): () => void;
|
|
816
967
|
|
|
817
|
-
|
|
968
|
+
declare const LegendList: LegendListComponent;
|
|
969
|
+
|
|
970
|
+
export { type AlwaysRenderConfig, type BaseScrollViewProps, type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets, type InternalState, type LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListScrollerRef, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type ScrollEventTargetLike, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, 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 };
|