@legendapp/list 3.0.0-beta.32 → 3.0.0-beta.33
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 +600 -6
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/index.d.ts +454 -108
- package/index.js +81 -32
- package/index.mjs +81 -32
- package/index.native.js +89 -44
- package/index.native.mjs +88 -43
- package/keyboard-controller.d.ts +611 -6
- package/keyboard-controller.js +2 -2
- package/keyboard-controller.mjs +1 -1
- package/keyboard.d.ts +204 -8
- package/keyboard.js +66 -52
- package/keyboard.mjs +69 -54
- package/{index.d.mts → list-react-native.d.ts} +95 -32
- package/list-react-native.js +4234 -0
- package/list-react-native.mjs +4204 -0
- package/{index.native.d.mts → list-react.d.ts} +355 -40
- package/list-react.js +4426 -0
- package/list-react.mjs +4396 -0
- package/package.json +52 -1
- package/reanimated.d.ts +595 -7
- package/reanimated.js +156 -11
- package/reanimated.mjs +153 -8
- package/section-list.d.ts +610 -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,10 +1,32 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import { Key,
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Key, ReactNode, ComponentType, CSSProperties, Ref, ReactElement, JSXElementConstructor, HTMLAttributes, RefAttributes, Dispatch, SetStateAction } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ScrollViewMethods {
|
|
5
|
+
scrollBy(x: number, y: number): void;
|
|
6
|
+
getBoundingClientRect(): DOMRect | null | undefined;
|
|
7
|
+
scrollToEnd(options?: {
|
|
8
|
+
animated?: boolean;
|
|
9
|
+
}): void;
|
|
10
|
+
getScrollResponder(): HTMLElement | null;
|
|
11
|
+
getScrollableNode(): HTMLDivElement;
|
|
12
|
+
scrollTo(options: {
|
|
13
|
+
x?: number;
|
|
14
|
+
y?: number;
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
}): void;
|
|
17
|
+
scrollToOffset(params: {
|
|
18
|
+
offset: number;
|
|
19
|
+
animated?: boolean;
|
|
20
|
+
}): void;
|
|
21
|
+
}
|
|
5
22
|
|
|
6
23
|
type AnimatedValue = number;
|
|
7
24
|
|
|
25
|
+
type LooseMeasureCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
|
|
26
|
+
interface LooseView {
|
|
27
|
+
measure?: (callback: LooseMeasureCallback) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
type ListenerType = "activeStickyIndex" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
9
31
|
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
10
32
|
type ListenerTypeValueMap = {
|
|
@@ -65,7 +87,7 @@ interface StateContext {
|
|
|
65
87
|
positionListeners: Map<string, Set<(value: any) => void>>;
|
|
66
88
|
state: InternalState;
|
|
67
89
|
values: Map<ListenerType, any>;
|
|
68
|
-
viewRefs: Map<number, React$1.RefObject<
|
|
90
|
+
viewRefs: Map<number, React$1.RefObject<LooseView>>;
|
|
69
91
|
}
|
|
70
92
|
|
|
71
93
|
declare class ScrollAdjustHandler {
|
|
@@ -85,6 +107,39 @@ type StylesAsSharedValue<Style> = {
|
|
|
85
107
|
[key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
|
|
86
108
|
};
|
|
87
109
|
|
|
110
|
+
interface Insets$1 {
|
|
111
|
+
top: number;
|
|
112
|
+
left: number;
|
|
113
|
+
bottom: number;
|
|
114
|
+
right: number;
|
|
115
|
+
}
|
|
116
|
+
interface LayoutRectangle$1 {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
}
|
|
122
|
+
interface NativeScrollEvent$1 {
|
|
123
|
+
contentOffset: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
};
|
|
127
|
+
contentSize: {
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
};
|
|
131
|
+
layoutMeasurement: {
|
|
132
|
+
width: number;
|
|
133
|
+
height: number;
|
|
134
|
+
};
|
|
135
|
+
contentInset: Insets$1;
|
|
136
|
+
zoomScale: number;
|
|
137
|
+
}
|
|
138
|
+
interface NativeSyntheticEvent$1<T> {
|
|
139
|
+
nativeEvent: T;
|
|
140
|
+
}
|
|
141
|
+
type ViewStyle$1 = Record<string, unknown>;
|
|
142
|
+
type StyleProp$1<T> = T | T[] | null | undefined | false;
|
|
88
143
|
type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
89
144
|
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
90
145
|
/**
|
|
@@ -213,7 +268,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
213
268
|
/**
|
|
214
269
|
* Style for the footer component.
|
|
215
270
|
*/
|
|
216
|
-
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
271
|
+
ListFooterComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
|
|
217
272
|
/**
|
|
218
273
|
* Component or element to render above the list.
|
|
219
274
|
*/
|
|
@@ -221,7 +276,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
221
276
|
/**
|
|
222
277
|
* Style for the header component.
|
|
223
278
|
*/
|
|
224
|
-
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
279
|
+
ListHeaderComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
|
|
225
280
|
/**
|
|
226
281
|
* If true, auto-scrolls to end when new items are added.
|
|
227
282
|
* @default false
|
|
@@ -275,7 +330,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
275
330
|
* Function to call when the user pulls to refresh.
|
|
276
331
|
*/
|
|
277
332
|
onRefresh?: () => void;
|
|
278
|
-
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
333
|
+
onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
|
|
279
334
|
/**
|
|
280
335
|
* Called when scrolling reaches the start within onStartReachedThreshold.
|
|
281
336
|
*/
|
|
@@ -311,7 +366,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
311
366
|
/**
|
|
312
367
|
* Ref to the underlying ScrollView component.
|
|
313
368
|
*/
|
|
314
|
-
refScrollView?: React.Ref<
|
|
369
|
+
refScrollView?: React.Ref<any>;
|
|
315
370
|
/**
|
|
316
371
|
* If true, shows a refresh indicator.
|
|
317
372
|
* @default false
|
|
@@ -322,7 +377,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
322
377
|
* Note: When using `stickyHeaderIndices`, you must provide an Animated ScrollView component.
|
|
323
378
|
* @default (props) => <ScrollView {...props} />
|
|
324
379
|
*/
|
|
325
|
-
renderScrollComponent?: (props:
|
|
380
|
+
renderScrollComponent?: (props: any) => React.ReactElement | null;
|
|
326
381
|
/**
|
|
327
382
|
* This will log a suggested estimatedItemSize.
|
|
328
383
|
* @required
|
|
@@ -366,7 +421,8 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
366
421
|
getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
|
|
367
422
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
368
423
|
}
|
|
369
|
-
type LegendListPropsBase<ItemT,
|
|
424
|
+
type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
425
|
+
type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
|
|
370
426
|
interface MaintainVisibleContentPositionConfig<ItemT = any> {
|
|
371
427
|
data?: boolean;
|
|
372
428
|
size?: boolean;
|
|
@@ -410,7 +466,6 @@ interface LegendListMetrics {
|
|
|
410
466
|
headerSize: number;
|
|
411
467
|
footerSize: number;
|
|
412
468
|
}
|
|
413
|
-
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
414
469
|
interface ThresholdSnapshot {
|
|
415
470
|
scrollPosition: number;
|
|
416
471
|
contentSize?: number;
|
|
@@ -467,7 +522,7 @@ interface InternalState {
|
|
|
467
522
|
isFirst?: boolean;
|
|
468
523
|
isStartReached: boolean | null;
|
|
469
524
|
lastBatchingAction: number;
|
|
470
|
-
lastLayout: LayoutRectangle | undefined;
|
|
525
|
+
lastLayout: LayoutRectangle$1 | undefined;
|
|
471
526
|
lastScrollAdjustForHistory?: number;
|
|
472
527
|
lastScrollDelta: number;
|
|
473
528
|
loadStartTime: number;
|
|
@@ -479,8 +534,8 @@ interface InternalState {
|
|
|
479
534
|
quietPasses: number;
|
|
480
535
|
expiresAt: number;
|
|
481
536
|
};
|
|
482
|
-
contentInsetOverride?: Partial<Insets> | null;
|
|
483
|
-
nativeContentInset?: Insets;
|
|
537
|
+
contentInsetOverride?: Partial<Insets$1> | null;
|
|
538
|
+
nativeContentInset?: Insets$1;
|
|
484
539
|
nativeMarginTop: number;
|
|
485
540
|
needsOtherAxisSize?: boolean;
|
|
486
541
|
otherAxisSize?: number;
|
|
@@ -490,7 +545,7 @@ interface InternalState {
|
|
|
490
545
|
queuedCalculateItemsInView: number | undefined;
|
|
491
546
|
queuedMVCPRecalculate?: number;
|
|
492
547
|
queuedInitialLayout?: boolean | undefined;
|
|
493
|
-
refScroller: React.RefObject<
|
|
548
|
+
refScroller: React.RefObject<any>;
|
|
494
549
|
scroll: number;
|
|
495
550
|
scrollAdjustHandler: ScrollAdjustHandler;
|
|
496
551
|
scrollForNextCalculateItemsInView: {
|
|
@@ -530,38 +585,40 @@ interface InternalState {
|
|
|
530
585
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
531
586
|
props: {
|
|
532
587
|
alignItemsAtEnd: boolean;
|
|
533
|
-
animatedProps: StylesAsSharedValue<
|
|
588
|
+
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
534
589
|
alwaysRender: AlwaysRenderConfig | undefined;
|
|
535
590
|
alwaysRenderIndicesArr: number[];
|
|
536
591
|
alwaysRenderIndicesSet: Set<number>;
|
|
537
|
-
contentInset: Insets | undefined;
|
|
592
|
+
contentInset: Insets$1 | undefined;
|
|
538
593
|
data: readonly any[];
|
|
539
594
|
dataVersion: Key | undefined;
|
|
540
595
|
drawDistance: number;
|
|
541
596
|
estimatedItemSize: number | undefined;
|
|
542
|
-
getEstimatedItemSize:
|
|
543
|
-
getFixedItemSize:
|
|
544
|
-
getItemType:
|
|
597
|
+
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
598
|
+
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
599
|
+
getItemType: LegendListPropsInternal["getItemType"];
|
|
545
600
|
horizontal: boolean;
|
|
546
601
|
initialContainerPoolRatio: number;
|
|
547
|
-
itemsAreEqual:
|
|
548
|
-
keyExtractor:
|
|
602
|
+
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
603
|
+
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
549
604
|
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
550
605
|
maintainScrollAtEndThreshold: number | undefined;
|
|
551
606
|
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
552
607
|
numColumns: number;
|
|
553
|
-
onEndReached:
|
|
608
|
+
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
554
609
|
onEndReachedThreshold: number | null | undefined;
|
|
555
|
-
onItemSizeChanged:
|
|
556
|
-
onLoad:
|
|
557
|
-
onScroll:
|
|
558
|
-
onStartReached:
|
|
610
|
+
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
611
|
+
onLoad: LegendListPropsInternal["onLoad"];
|
|
612
|
+
onScroll: LegendListPropsInternal["onScroll"];
|
|
613
|
+
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
559
614
|
onStartReachedThreshold: number | null | undefined;
|
|
560
|
-
onStickyHeaderChange:
|
|
561
|
-
overrideItemLayout:
|
|
615
|
+
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
616
|
+
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
562
617
|
recycleItems: boolean;
|
|
563
|
-
renderItem:
|
|
618
|
+
renderItem: LegendListPropsInternal["renderItem"];
|
|
619
|
+
scrollBuffer?: number;
|
|
564
620
|
snapToIndices: number[] | undefined;
|
|
621
|
+
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
565
622
|
stickyIndicesArr: number[];
|
|
566
623
|
stickyIndicesSet: Set<number>;
|
|
567
624
|
stylePaddingBottom: number | undefined;
|
|
@@ -583,11 +640,11 @@ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | u
|
|
|
583
640
|
item: ItemT;
|
|
584
641
|
type: TItemType;
|
|
585
642
|
}
|
|
586
|
-
type LegendListState = {
|
|
643
|
+
type LegendListState$1 = {
|
|
587
644
|
activeStickyIndex: number;
|
|
588
645
|
contentLength: number;
|
|
589
646
|
data: readonly any[];
|
|
590
|
-
elementAtIndex: (index: number) =>
|
|
647
|
+
elementAtIndex: (index: number) => any;
|
|
591
648
|
end: number;
|
|
592
649
|
endBuffered: number;
|
|
593
650
|
isAtEnd: boolean;
|
|
@@ -604,7 +661,7 @@ type LegendListState = {
|
|
|
604
661
|
start: number;
|
|
605
662
|
startBuffered: number;
|
|
606
663
|
};
|
|
607
|
-
type LegendListRef = {
|
|
664
|
+
type LegendListRef$1 = {
|
|
608
665
|
/**
|
|
609
666
|
* Displays the scroll indicators momentarily.
|
|
610
667
|
*/
|
|
@@ -612,7 +669,7 @@ type LegendListRef = {
|
|
|
612
669
|
/**
|
|
613
670
|
* Returns the native ScrollView component reference.
|
|
614
671
|
*/
|
|
615
|
-
getNativeScrollRef():
|
|
672
|
+
getNativeScrollRef(): any;
|
|
616
673
|
/**
|
|
617
674
|
* Returns the scroll responder instance for handling scroll events.
|
|
618
675
|
*/
|
|
@@ -620,11 +677,11 @@ type LegendListRef = {
|
|
|
620
677
|
/**
|
|
621
678
|
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
622
679
|
*/
|
|
623
|
-
getScrollResponder():
|
|
680
|
+
getScrollResponder(): any;
|
|
624
681
|
/**
|
|
625
682
|
* Returns the internal state of the scroll virtualization.
|
|
626
683
|
*/
|
|
627
|
-
getState(): LegendListState;
|
|
684
|
+
getState(): LegendListState$1;
|
|
628
685
|
/**
|
|
629
686
|
* Scrolls a specific index into view.
|
|
630
687
|
* @param params - Parameters for scrolling.
|
|
@@ -704,11 +761,19 @@ type LegendListRef = {
|
|
|
704
761
|
* @param enabled - If true, scroll processing is enabled.
|
|
705
762
|
*/
|
|
706
763
|
setScrollProcessingEnabled(enabled: boolean): void;
|
|
764
|
+
/**
|
|
765
|
+
* Clears internal virtualization caches.
|
|
766
|
+
* @param options - Cache clearing options.
|
|
767
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
768
|
+
*/
|
|
769
|
+
clearCaches(options?: {
|
|
770
|
+
mode?: "sizes" | "full";
|
|
771
|
+
}): void;
|
|
707
772
|
/**
|
|
708
773
|
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
709
774
|
* Values are merged on top of props/animated/native insets.
|
|
710
775
|
*/
|
|
711
|
-
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
776
|
+
reportContentInset(inset?: Partial<Insets$1> | null): void;
|
|
712
777
|
};
|
|
713
778
|
interface ViewToken<ItemT = any> {
|
|
714
779
|
containerId: number;
|
|
@@ -799,9 +864,257 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
799
864
|
};
|
|
800
865
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
801
866
|
|
|
802
|
-
|
|
803
|
-
|
|
867
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
868
|
+
type Insets = Insets$1;
|
|
869
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
870
|
+
type LayoutRectangle = LayoutRectangle$1;
|
|
871
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
872
|
+
type NativeScrollEvent = NativeScrollEvent$1;
|
|
873
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
874
|
+
type NativeSyntheticEvent<T> = NativeSyntheticEvent$1<T>;
|
|
875
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
876
|
+
type ViewStyle = ViewStyle$1;
|
|
877
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
878
|
+
type StyleProp<T> = StyleProp$1<T>;
|
|
879
|
+
interface LooseAccessibilityActionEvent {
|
|
880
|
+
nativeEvent?: {
|
|
881
|
+
actionName?: string;
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
type AccessibilityActionEvent = LooseAccessibilityActionEvent;
|
|
885
|
+
type LooseAccessibilityRole = string;
|
|
886
|
+
type AccessibilityRole = LooseAccessibilityRole;
|
|
887
|
+
interface LooseAccessibilityState {
|
|
888
|
+
busy?: boolean;
|
|
889
|
+
checked?: boolean | "mixed";
|
|
890
|
+
disabled?: boolean;
|
|
891
|
+
expanded?: boolean;
|
|
892
|
+
selected?: boolean;
|
|
893
|
+
}
|
|
894
|
+
type AccessibilityState = LooseAccessibilityState;
|
|
895
|
+
interface LooseAccessibilityValue {
|
|
896
|
+
max?: number;
|
|
897
|
+
min?: number;
|
|
898
|
+
now?: number;
|
|
899
|
+
text?: string;
|
|
900
|
+
}
|
|
901
|
+
type AccessibilityValue = LooseAccessibilityValue;
|
|
902
|
+
type LooseColorValue = string | number;
|
|
903
|
+
type ColorValue = LooseColorValue;
|
|
904
|
+
interface LooseGestureResponderEvent {
|
|
905
|
+
nativeEvent?: unknown;
|
|
906
|
+
}
|
|
907
|
+
type GestureResponderEvent = LooseGestureResponderEvent;
|
|
908
|
+
interface LoosePointerEvent {
|
|
909
|
+
nativeEvent?: unknown;
|
|
910
|
+
}
|
|
911
|
+
type PointerEvent = LoosePointerEvent;
|
|
912
|
+
interface LooseRefreshControlProps {
|
|
913
|
+
onRefresh?: () => void;
|
|
914
|
+
progressViewOffset?: number;
|
|
915
|
+
refreshing?: boolean;
|
|
916
|
+
}
|
|
917
|
+
type RefreshControlProps = LooseRefreshControlProps;
|
|
918
|
+
type LooseRole = string;
|
|
919
|
+
type Role = LooseRole;
|
|
920
|
+
interface PointProp {
|
|
921
|
+
x: number;
|
|
922
|
+
y: number;
|
|
923
|
+
}
|
|
924
|
+
interface LayoutChangeEvent {
|
|
925
|
+
nativeEvent: {
|
|
926
|
+
layout: LayoutRectangle;
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
/** @deprecated Use `@legendapp/list/react-native` or `@legendapp/list/react` for strict typing */
|
|
930
|
+
interface LooseScrollViewProps {
|
|
931
|
+
StickyHeaderComponent?: ComponentType<unknown>;
|
|
932
|
+
accessibilityActions?: Array<{
|
|
933
|
+
label?: string;
|
|
934
|
+
name: string;
|
|
935
|
+
}>;
|
|
936
|
+
accessibilityElementsHidden?: boolean;
|
|
937
|
+
accessibilityHint?: string;
|
|
938
|
+
accessibilityIgnoresInvertColors?: boolean;
|
|
939
|
+
accessibilityLabel?: string;
|
|
940
|
+
accessibilityLabelledBy?: string | string[];
|
|
941
|
+
accessibilityLanguage?: string;
|
|
942
|
+
accessibilityLargeContentTitle?: string;
|
|
943
|
+
accessibilityLiveRegion?: "none" | "polite" | "assertive";
|
|
944
|
+
accessibilityRespondsToUserInteraction?: boolean;
|
|
945
|
+
accessibilityRole?: AccessibilityRole;
|
|
946
|
+
accessibilityShowsLargeContentViewer?: boolean;
|
|
947
|
+
accessibilityState?: AccessibilityState;
|
|
948
|
+
accessibilityValue?: AccessibilityValue;
|
|
949
|
+
accessibilityViewIsModal?: boolean;
|
|
950
|
+
accessible?: boolean;
|
|
951
|
+
alwaysBounceHorizontal?: boolean;
|
|
952
|
+
alwaysBounceVertical?: boolean;
|
|
953
|
+
"aria-busy"?: boolean;
|
|
954
|
+
"aria-checked"?: boolean | "mixed";
|
|
955
|
+
"aria-disabled"?: boolean;
|
|
956
|
+
"aria-expanded"?: boolean;
|
|
957
|
+
"aria-hidden"?: boolean;
|
|
958
|
+
"aria-label"?: string;
|
|
959
|
+
"aria-labelledby"?: string;
|
|
960
|
+
"aria-live"?: "polite" | "assertive" | "off";
|
|
961
|
+
"aria-modal"?: boolean;
|
|
962
|
+
"aria-selected"?: boolean;
|
|
963
|
+
"aria-valuemax"?: number;
|
|
964
|
+
"aria-valuemin"?: number;
|
|
965
|
+
"aria-valuenow"?: number;
|
|
966
|
+
"aria-valuetext"?: string;
|
|
967
|
+
automaticallyAdjustContentInsets?: boolean;
|
|
968
|
+
automaticallyAdjustKeyboardInsets?: boolean;
|
|
969
|
+
automaticallyAdjustsScrollIndicatorInsets?: boolean;
|
|
970
|
+
bounces?: boolean;
|
|
971
|
+
bouncesZoom?: boolean;
|
|
972
|
+
canCancelContentTouches?: boolean;
|
|
973
|
+
centerContent?: boolean;
|
|
974
|
+
children?: ReactNode;
|
|
975
|
+
collapsable?: boolean;
|
|
976
|
+
collapsableChildren?: boolean;
|
|
977
|
+
contentContainerStyle?: StyleProp<ViewStyle> | CSSProperties;
|
|
978
|
+
contentInset?: Insets;
|
|
979
|
+
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes";
|
|
980
|
+
contentOffset?: PointProp;
|
|
981
|
+
decelerationRate?: number | "fast" | "normal";
|
|
982
|
+
directionalLockEnabled?: boolean;
|
|
983
|
+
disableIntervalMomentum?: boolean;
|
|
984
|
+
disableScrollViewPanResponder?: boolean;
|
|
985
|
+
endFillColor?: ColorValue;
|
|
986
|
+
fadingEdgeLength?: number | {
|
|
987
|
+
end?: number;
|
|
988
|
+
start?: number;
|
|
989
|
+
};
|
|
990
|
+
focusable?: boolean;
|
|
991
|
+
hasTVPreferredFocus?: boolean;
|
|
992
|
+
hitSlop?: number | Insets;
|
|
993
|
+
horizontal?: boolean;
|
|
994
|
+
id?: string;
|
|
995
|
+
importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants";
|
|
996
|
+
indicatorStyle?: "default" | "black" | "white";
|
|
997
|
+
innerViewRef?: Ref<unknown>;
|
|
998
|
+
invertStickyHeaders?: boolean;
|
|
999
|
+
isTVSelectable?: boolean;
|
|
1000
|
+
keyboardDismissMode?: "none" | "interactive" | "on-drag";
|
|
1001
|
+
keyboardShouldPersistTaps?: boolean | "always" | "never" | "handled";
|
|
1002
|
+
maintainVisibleContentPosition?: {
|
|
1003
|
+
autoscrollToTopThreshold?: number;
|
|
1004
|
+
minIndexForVisible: number;
|
|
1005
|
+
};
|
|
1006
|
+
maximumZoomScale?: number;
|
|
1007
|
+
minimumZoomScale?: number;
|
|
1008
|
+
nativeID?: string;
|
|
1009
|
+
needsOffscreenAlphaCompositing?: boolean;
|
|
1010
|
+
nestedScrollEnabled?: boolean;
|
|
1011
|
+
onAccessibilityAction?: (event: AccessibilityActionEvent) => void;
|
|
1012
|
+
onAccessibilityEscape?: () => void;
|
|
1013
|
+
onAccessibilityTap?: () => void;
|
|
1014
|
+
onBlur?: (event: unknown) => void;
|
|
1015
|
+
onContentSizeChange?: (width: number, height: number) => void;
|
|
1016
|
+
onFocus?: (event: unknown) => void;
|
|
1017
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
1018
|
+
onMagicTap?: () => void;
|
|
1019
|
+
onMomentumScrollBegin?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1020
|
+
onMomentumScrollEnd?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1021
|
+
onMoveShouldSetResponder?: (event: GestureResponderEvent) => boolean;
|
|
1022
|
+
onMoveShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean;
|
|
1023
|
+
onPointerCancel?: (event: PointerEvent) => void;
|
|
1024
|
+
onPointerCancelCapture?: (event: PointerEvent) => void;
|
|
1025
|
+
onPointerDown?: (event: PointerEvent) => void;
|
|
1026
|
+
onPointerDownCapture?: (event: PointerEvent) => void;
|
|
1027
|
+
onPointerEnter?: (event: PointerEvent) => void;
|
|
1028
|
+
onPointerEnterCapture?: (event: PointerEvent) => void;
|
|
1029
|
+
onPointerLeave?: (event: PointerEvent) => void;
|
|
1030
|
+
onPointerLeaveCapture?: (event: PointerEvent) => void;
|
|
1031
|
+
onPointerMove?: (event: PointerEvent) => void;
|
|
1032
|
+
onPointerMoveCapture?: (event: PointerEvent) => void;
|
|
1033
|
+
onPointerUp?: (event: PointerEvent) => void;
|
|
1034
|
+
onPointerUpCapture?: (event: PointerEvent) => void;
|
|
1035
|
+
onResponderEnd?: (event: GestureResponderEvent) => void;
|
|
1036
|
+
onResponderGrant?: (event: GestureResponderEvent) => void;
|
|
1037
|
+
onResponderMove?: (event: GestureResponderEvent) => void;
|
|
1038
|
+
onResponderReject?: (event: GestureResponderEvent) => void;
|
|
1039
|
+
onResponderRelease?: (event: GestureResponderEvent) => void;
|
|
1040
|
+
onResponderStart?: (event: GestureResponderEvent) => void;
|
|
1041
|
+
onResponderTerminate?: (event: GestureResponderEvent) => void;
|
|
1042
|
+
onResponderTerminationRequest?: (event: GestureResponderEvent) => boolean;
|
|
1043
|
+
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1044
|
+
onScrollAnimationEnd?: () => void;
|
|
1045
|
+
onScrollBeginDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1046
|
+
onScrollEndDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1047
|
+
onScrollToTop?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
1048
|
+
onStartShouldSetResponder?: (event: GestureResponderEvent) => boolean;
|
|
1049
|
+
onStartShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean;
|
|
1050
|
+
onTouchCancel?: (event: GestureResponderEvent) => void;
|
|
1051
|
+
onTouchEnd?: (event: GestureResponderEvent) => void;
|
|
1052
|
+
onTouchEndCapture?: (event: GestureResponderEvent) => void;
|
|
1053
|
+
onTouchMove?: (event: GestureResponderEvent) => void;
|
|
1054
|
+
onTouchStart?: (event: GestureResponderEvent) => void;
|
|
1055
|
+
overScrollMode?: "always" | "never" | "auto";
|
|
1056
|
+
pagingEnabled?: boolean;
|
|
1057
|
+
persistentScrollbar?: boolean;
|
|
1058
|
+
pinchGestureEnabled?: boolean;
|
|
1059
|
+
pointerEvents?: "none" | "box-none" | "box-only" | "auto";
|
|
1060
|
+
refreshControl?: ReactElement<RefreshControlProps, string | JSXElementConstructor<unknown>>;
|
|
1061
|
+
removeClippedSubviews?: boolean;
|
|
1062
|
+
renderToHardwareTextureAndroid?: boolean;
|
|
1063
|
+
role?: Role;
|
|
1064
|
+
screenReaderFocusable?: boolean;
|
|
1065
|
+
scrollEnabled?: boolean;
|
|
1066
|
+
scrollEventThrottle?: number;
|
|
1067
|
+
scrollIndicatorInsets?: Insets;
|
|
1068
|
+
scrollPerfTag?: string;
|
|
1069
|
+
scrollToOverflowEnabled?: boolean;
|
|
1070
|
+
scrollViewRef?: Ref<unknown>;
|
|
1071
|
+
scrollsToTop?: boolean;
|
|
1072
|
+
shouldRasterizeIOS?: boolean;
|
|
1073
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
1074
|
+
showsVerticalScrollIndicator?: boolean;
|
|
1075
|
+
snapToAlignment?: "start" | "center" | "end";
|
|
1076
|
+
snapToEnd?: boolean;
|
|
1077
|
+
snapToInterval?: number;
|
|
1078
|
+
snapToOffsets?: number[];
|
|
1079
|
+
snapToStart?: boolean;
|
|
1080
|
+
stickyHeaderHiddenOnScroll?: boolean;
|
|
1081
|
+
stickyHeaderIndices?: number[];
|
|
1082
|
+
style?: StyleProp<ViewStyle> | CSSProperties;
|
|
1083
|
+
tabIndex?: 0 | -1;
|
|
1084
|
+
testID?: string;
|
|
1085
|
+
tvParallaxMagnification?: number;
|
|
1086
|
+
tvParallaxShiftDistanceX?: number;
|
|
1087
|
+
tvParallaxShiftDistanceY?: number;
|
|
1088
|
+
tvParallaxTiltAngle?: number;
|
|
1089
|
+
zoomScale?: number;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainerStyle" | "onScroll" | "onLayout"> & HTMLAttributes<HTMLElement> & {
|
|
1093
|
+
style?: CSSProperties;
|
|
1094
|
+
contentContainerStyle?: CSSProperties;
|
|
1095
|
+
onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
|
|
1096
|
+
onLayout?: (event: {
|
|
1097
|
+
nativeEvent: {
|
|
1098
|
+
layout: LayoutRectangle$1;
|
|
1099
|
+
};
|
|
1100
|
+
}) => void;
|
|
1101
|
+
};
|
|
1102
|
+
type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewPropsWeb, TItemType>, "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
|
|
1103
|
+
refScrollView?: Ref<HTMLElement | ScrollViewMethods>;
|
|
1104
|
+
renderScrollComponent?: (props: ScrollViewPropsWeb) => ReactElement<ScrollViewPropsWeb> | null;
|
|
1105
|
+
ListHeaderComponentStyle?: CSSProperties | undefined;
|
|
1106
|
+
ListFooterComponentStyle?: CSSProperties | undefined;
|
|
804
1107
|
};
|
|
1108
|
+
type LegendListProps<ItemT = any, TItemType extends string | undefined = string | undefined> = LegendListPropsOverrides<ItemT, TItemType>;
|
|
1109
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollableNode" | "getScrollResponder"> & {
|
|
1110
|
+
getNativeScrollRef(): HTMLElement | ScrollViewMethods;
|
|
1111
|
+
getScrollableNode(): HTMLElement;
|
|
1112
|
+
getScrollResponder(): HTMLElement | null;
|
|
1113
|
+
};
|
|
1114
|
+
type LegendListState = Omit<LegendListState$1, "elementAtIndex"> & {
|
|
1115
|
+
elementAtIndex: (index: number) => HTMLElement | null | undefined;
|
|
1116
|
+
};
|
|
1117
|
+
type LegendListComponent = <ItemT = any>(props: LegendListProps<ItemT> & RefAttributes<LegendListRef>) => ReactElement | null;
|
|
805
1118
|
|
|
806
1119
|
declare function useViewability<ItemT = any>(callback: ViewabilityCallback<ItemT>, configId?: string): void;
|
|
807
1120
|
declare function useViewabilityAmount<ItemT = any>(callback: ViewabilityAmountCallback<ItemT>): void;
|
|
@@ -814,4 +1127,6 @@ declare function useListScrollSize(): {
|
|
|
814
1127
|
};
|
|
815
1128
|
declare function useSyncLayout(): () => void;
|
|
816
1129
|
|
|
817
|
-
|
|
1130
|
+
declare const LegendList: LegendListComponent;
|
|
1131
|
+
|
|
1132
|
+
export { type AlwaysRenderConfig, type BaseScrollViewProps, type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets$1 as Insets, type InternalState, type LayoutRectangle$1 as LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent$1 as NativeScrollEvent, type NativeSyntheticEvent$1 as NativeSyntheticEvent, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type StickyHeaderConfig, type StyleProp$1 as StyleProp, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewStyle$1 as ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|