@legendapp/list 3.0.0-beta.4 → 3.0.0-beta.41
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/.DS_Store +0 -0
- package/CHANGELOG.md +19 -0
- package/README.md +9 -2
- package/animated.d.ts +620 -5
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/index.d.ts +1227 -11
- package/index.js +2594 -1023
- package/index.mjs +2593 -1024
- package/index.native.js +2347 -961
- package/index.native.mjs +2327 -943
- package/keyboard-test.d.ts +206 -0
- package/keyboard-test.js +34 -0
- package/keyboard-test.mjs +13 -0
- package/keyboard.d.ts +206 -8
- package/keyboard.js +340 -32
- package/keyboard.mjs +343 -34
- package/package.json +62 -1
- package/{types-JPHClxiw.d.mts → react-native.d.ts} +436 -158
- package/react-native.js +4942 -0
- package/react-native.mjs +4911 -0
- package/{types-JPHClxiw.d.ts → react-native.web.d.ts} +493 -158
- package/react-native.web.js +5357 -0
- package/react-native.web.mjs +5326 -0
- package/{types-YNdphn_A.d.mts → react.d.ts} +493 -158
- package/react.js +5357 -0
- package/react.mjs +5326 -0
- package/reanimated.d.ts +631 -7
- package/reanimated.js +156 -30
- package/reanimated.mjs +155 -29
- package/section-list.d.ts +620 -5
- package/section-list.js +38 -3679
- package/section-list.mjs +34 -3676
- package/animated.d.mts +0 -9
- package/index.d.mts +0 -23
- package/index.native.d.mts +0 -23
- package/index.native.d.ts +0 -23
- package/keyboard-controller.d.mts +0 -12
- package/keyboard-controller.d.ts +0 -12
- package/keyboard-controller.js +0 -69
- package/keyboard-controller.mjs +0 -48
- package/keyboard.d.mts +0 -13
- package/reanimated.d.mts +0 -18
- package/section-list.d.mts +0 -113
- package/section-list.native.d.mts +0 -113
- package/section-list.native.d.ts +0 -113
- package/section-list.native.js +0 -3700
- package/section-list.native.mjs +0 -3679
- package/types-YNdphn_A.d.ts +0 -670
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1, ScrollViewProps } from 'react-native';
|
|
3
|
+
import { KeyboardChatScrollViewProps } from 'react-native-keyboard-controller';
|
|
4
|
+
import { AnimatedLegendListProps } from '@legendapp/list/reanimated';
|
|
5
|
+
|
|
6
|
+
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}`;
|
|
7
|
+
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
8
|
+
type ListenerTypeValueMap = {
|
|
9
|
+
activeStickyIndex: number;
|
|
10
|
+
animatedScrollY: any;
|
|
11
|
+
debugComputedScroll: number;
|
|
12
|
+
debugRawScroll: number;
|
|
13
|
+
extraData: any;
|
|
14
|
+
footerSize: number;
|
|
15
|
+
headerSize: number;
|
|
16
|
+
lastItemKeys: string[];
|
|
17
|
+
lastPositionUpdate: number;
|
|
18
|
+
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
19
|
+
numColumns: number;
|
|
20
|
+
numContainers: number;
|
|
21
|
+
numContainersPooled: number;
|
|
22
|
+
otherAxisSize: number;
|
|
23
|
+
readyToRender: boolean;
|
|
24
|
+
scrollAdjust: number;
|
|
25
|
+
scrollAdjustPending: number;
|
|
26
|
+
scrollAdjustUserOffset: number;
|
|
27
|
+
scrollSize: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
snapToOffsets: number[];
|
|
32
|
+
stylePaddingTop: number;
|
|
33
|
+
totalSize: number;
|
|
34
|
+
} & {
|
|
35
|
+
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
36
|
+
} & {
|
|
37
|
+
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
38
|
+
} & {
|
|
39
|
+
[K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
|
|
40
|
+
} & {
|
|
41
|
+
[K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
|
|
42
|
+
} & {
|
|
43
|
+
[K in ListenerType as K extends `containerSpan${number}` ? K : never]: number;
|
|
44
|
+
} & {
|
|
45
|
+
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface Insets {
|
|
49
|
+
top: number;
|
|
50
|
+
left: number;
|
|
51
|
+
bottom: number;
|
|
52
|
+
right: number;
|
|
53
|
+
}
|
|
54
|
+
interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
55
|
+
data: boolean;
|
|
56
|
+
size: boolean;
|
|
57
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
58
|
+
}
|
|
59
|
+
type LegendListState = {
|
|
60
|
+
activeStickyIndex: number;
|
|
61
|
+
contentLength: number;
|
|
62
|
+
data: readonly any[];
|
|
63
|
+
elementAtIndex: (index: number) => any;
|
|
64
|
+
end: number;
|
|
65
|
+
endBuffered: number;
|
|
66
|
+
isAtEnd: boolean;
|
|
67
|
+
isAtStart: boolean;
|
|
68
|
+
isEndReached: boolean;
|
|
69
|
+
isStartReached: boolean;
|
|
70
|
+
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
71
|
+
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
72
|
+
positionAtIndex: (index: number) => number;
|
|
73
|
+
positionByKey: (key: string) => number | undefined;
|
|
74
|
+
scroll: number;
|
|
75
|
+
scrollLength: number;
|
|
76
|
+
scrollVelocity: number;
|
|
77
|
+
sizeAtIndex: (index: number) => number;
|
|
78
|
+
sizes: Map<string, number>;
|
|
79
|
+
start: number;
|
|
80
|
+
startBuffered: number;
|
|
81
|
+
};
|
|
82
|
+
type LegendListRef$1 = {
|
|
83
|
+
/**
|
|
84
|
+
* Displays the scroll indicators momentarily.
|
|
85
|
+
*/
|
|
86
|
+
flashScrollIndicators(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the native ScrollView component reference.
|
|
89
|
+
*/
|
|
90
|
+
getNativeScrollRef(): any;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the scroll responder instance for handling scroll events.
|
|
93
|
+
*/
|
|
94
|
+
getScrollableNode(): any;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
97
|
+
*/
|
|
98
|
+
getScrollResponder(): any;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the internal state of the scroll virtualization.
|
|
101
|
+
*/
|
|
102
|
+
getState(): LegendListState;
|
|
103
|
+
/**
|
|
104
|
+
* Scrolls a specific index into view.
|
|
105
|
+
* @param params - Parameters for scrolling.
|
|
106
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
107
|
+
* @param params.index - The index to scroll to.
|
|
108
|
+
*/
|
|
109
|
+
scrollIndexIntoView(params: {
|
|
110
|
+
animated?: boolean | undefined;
|
|
111
|
+
index: number;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Scrolls a specific index into view.
|
|
115
|
+
* @param params - Parameters for scrolling.
|
|
116
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
117
|
+
* @param params.item - The item to scroll to.
|
|
118
|
+
*/
|
|
119
|
+
scrollItemIntoView(params: {
|
|
120
|
+
animated?: boolean | undefined;
|
|
121
|
+
item: any;
|
|
122
|
+
}): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Scrolls to the end of the list.
|
|
125
|
+
* @param options - Options for scrolling.
|
|
126
|
+
* @param options.animated - If true, animates the scroll. Default: true.
|
|
127
|
+
* @param options.viewOffset - Offset from the target position.
|
|
128
|
+
*/
|
|
129
|
+
scrollToEnd(options?: {
|
|
130
|
+
animated?: boolean | undefined;
|
|
131
|
+
viewOffset?: number | undefined;
|
|
132
|
+
}): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Scrolls to a specific index in the list.
|
|
135
|
+
* @param params - Parameters for scrolling.
|
|
136
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
137
|
+
* @param params.index - The index to scroll to.
|
|
138
|
+
* @param params.viewOffset - Offset from the target position.
|
|
139
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
140
|
+
*/
|
|
141
|
+
scrollToIndex(params: {
|
|
142
|
+
animated?: boolean | undefined;
|
|
143
|
+
index: number;
|
|
144
|
+
viewOffset?: number | undefined;
|
|
145
|
+
viewPosition?: number | undefined;
|
|
146
|
+
}): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Scrolls to a specific item in the list.
|
|
149
|
+
* @param params - Parameters for scrolling.
|
|
150
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
151
|
+
* @param params.item - The item to scroll to.
|
|
152
|
+
* @param params.viewOffset - Offset from the target position.
|
|
153
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
154
|
+
*/
|
|
155
|
+
scrollToItem(params: {
|
|
156
|
+
animated?: boolean | undefined;
|
|
157
|
+
item: any;
|
|
158
|
+
viewOffset?: number | undefined;
|
|
159
|
+
viewPosition?: number | undefined;
|
|
160
|
+
}): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Scrolls to a specific offset in pixels.
|
|
163
|
+
* @param params - Parameters for scrolling.
|
|
164
|
+
* @param params.offset - The pixel offset to scroll to.
|
|
165
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
166
|
+
*/
|
|
167
|
+
scrollToOffset(params: {
|
|
168
|
+
offset: number;
|
|
169
|
+
animated?: boolean | undefined;
|
|
170
|
+
}): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Sets or adds to the offset of the visible content anchor.
|
|
173
|
+
* @param value - The offset to set or add.
|
|
174
|
+
* @param animated - If true, uses Animated to animate the change.
|
|
175
|
+
*/
|
|
176
|
+
setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
|
|
177
|
+
/**
|
|
178
|
+
* Sets whether scroll processing is enabled.
|
|
179
|
+
* @param enabled - If true, scroll processing is enabled.
|
|
180
|
+
*/
|
|
181
|
+
setScrollProcessingEnabled(enabled: boolean): void;
|
|
182
|
+
/**
|
|
183
|
+
* Clears internal virtualization caches.
|
|
184
|
+
* @param options - Cache clearing options.
|
|
185
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
186
|
+
*/
|
|
187
|
+
clearCaches(options?: {
|
|
188
|
+
mode?: "sizes" | "full";
|
|
189
|
+
}): void;
|
|
190
|
+
/**
|
|
191
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
192
|
+
* Values are merged on top of props/animated/native insets.
|
|
193
|
+
*/
|
|
194
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
|
|
198
|
+
getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
|
|
199
|
+
getScrollResponder(): ScrollResponderMixin;
|
|
200
|
+
reportContentInset(inset?: Partial<Insets$1> | null): void;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
type KeyboardChatScrollViewPropsUnique = Omit<KeyboardChatScrollViewProps, keyof ScrollViewProps | "inverted" | "ScrollViewComponent">;
|
|
204
|
+
declare const KeyboardAvoidingLegendList: <ItemT>(props: Omit<AnimatedLegendListProps<ItemT>, "renderScrollComponent"> & KeyboardChatScrollViewPropsUnique & React.RefAttributes<LegendListRef>) => React.ReactNode;
|
|
205
|
+
|
|
206
|
+
export { KeyboardAvoidingLegendList };
|
package/keyboard-test.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactNativeKeyboardController = require('react-native-keyboard-controller');
|
|
5
|
+
var reanimated = require('@legendapp/list/reanimated');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
// src/integrations/keyboard-test.tsx
|
|
28
|
+
var typedForwardRef = React.forwardRef;
|
|
29
|
+
var KeyboardAvoidingLegendList = typedForwardRef(function KeyboardAvoidingLegendList2(props, forwardedRef) {
|
|
30
|
+
const memoList = React.useCallback((listProps) => /* @__PURE__ */ React__namespace.createElement(reactNativeKeyboardController.KeyboardChatScrollView, { ...listProps }), []);
|
|
31
|
+
return /* @__PURE__ */ React__namespace.createElement(reanimated.AnimatedLegendList, { ref: forwardedRef, renderScrollComponent: memoList, ...props });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
exports.KeyboardAvoidingLegendList = KeyboardAvoidingLegendList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCallback, forwardRef } from 'react';
|
|
3
|
+
import { KeyboardChatScrollView } from 'react-native-keyboard-controller';
|
|
4
|
+
import { AnimatedLegendList } from '@legendapp/list/reanimated';
|
|
5
|
+
|
|
6
|
+
// src/integrations/keyboard-test.tsx
|
|
7
|
+
var typedForwardRef = forwardRef;
|
|
8
|
+
var KeyboardAvoidingLegendList = typedForwardRef(function KeyboardAvoidingLegendList2(props, forwardedRef) {
|
|
9
|
+
const memoList = useCallback((listProps) => /* @__PURE__ */ React.createElement(KeyboardChatScrollView, { ...listProps }), []);
|
|
10
|
+
return /* @__PURE__ */ React.createElement(AnimatedLegendList, { ref: forwardedRef, renderScrollComponent: memoList, ...props });
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { KeyboardAvoidingLegendList };
|
package/keyboard.d.ts
CHANGED
|
@@ -1,13 +1,211 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Insets } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { LegendListRef } from '@legendapp/list';
|
|
2
|
+
import { ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1 } from 'react-native';
|
|
3
|
+
import { ScrollEvent, ScrollHandlerProcessed } from 'react-native-reanimated';
|
|
5
4
|
import { AnimatedLegendListProps } from '@legendapp/list/reanimated';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
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}`;
|
|
7
|
+
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
8
|
+
type ListenerTypeValueMap = {
|
|
9
|
+
activeStickyIndex: number;
|
|
10
|
+
animatedScrollY: any;
|
|
11
|
+
debugComputedScroll: number;
|
|
12
|
+
debugRawScroll: number;
|
|
13
|
+
extraData: any;
|
|
14
|
+
footerSize: number;
|
|
15
|
+
headerSize: number;
|
|
16
|
+
lastItemKeys: string[];
|
|
17
|
+
lastPositionUpdate: number;
|
|
18
|
+
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
19
|
+
numColumns: number;
|
|
20
|
+
numContainers: number;
|
|
21
|
+
numContainersPooled: number;
|
|
22
|
+
otherAxisSize: number;
|
|
23
|
+
readyToRender: boolean;
|
|
24
|
+
scrollAdjust: number;
|
|
25
|
+
scrollAdjustPending: number;
|
|
26
|
+
scrollAdjustUserOffset: number;
|
|
27
|
+
scrollSize: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
snapToOffsets: number[];
|
|
32
|
+
stylePaddingTop: number;
|
|
33
|
+
totalSize: number;
|
|
34
|
+
} & {
|
|
35
|
+
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
36
|
+
} & {
|
|
37
|
+
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
38
|
+
} & {
|
|
39
|
+
[K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
|
|
40
|
+
} & {
|
|
41
|
+
[K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
|
|
42
|
+
} & {
|
|
43
|
+
[K in ListenerType as K extends `containerSpan${number}` ? K : never]: number;
|
|
44
|
+
} & {
|
|
45
|
+
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface Insets {
|
|
49
|
+
top: number;
|
|
50
|
+
left: number;
|
|
51
|
+
bottom: number;
|
|
52
|
+
right: number;
|
|
53
|
+
}
|
|
54
|
+
interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
55
|
+
data: boolean;
|
|
56
|
+
size: boolean;
|
|
57
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
58
|
+
}
|
|
59
|
+
type LegendListState = {
|
|
60
|
+
activeStickyIndex: number;
|
|
61
|
+
contentLength: number;
|
|
62
|
+
data: readonly any[];
|
|
63
|
+
elementAtIndex: (index: number) => any;
|
|
64
|
+
end: number;
|
|
65
|
+
endBuffered: number;
|
|
66
|
+
isAtEnd: boolean;
|
|
67
|
+
isAtStart: boolean;
|
|
68
|
+
isEndReached: boolean;
|
|
69
|
+
isStartReached: boolean;
|
|
70
|
+
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
71
|
+
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
72
|
+
positionAtIndex: (index: number) => number;
|
|
73
|
+
positionByKey: (key: string) => number | undefined;
|
|
74
|
+
scroll: number;
|
|
75
|
+
scrollLength: number;
|
|
76
|
+
scrollVelocity: number;
|
|
77
|
+
sizeAtIndex: (index: number) => number;
|
|
78
|
+
sizes: Map<string, number>;
|
|
79
|
+
start: number;
|
|
80
|
+
startBuffered: number;
|
|
81
|
+
};
|
|
82
|
+
type LegendListRef$1 = {
|
|
83
|
+
/**
|
|
84
|
+
* Displays the scroll indicators momentarily.
|
|
85
|
+
*/
|
|
86
|
+
flashScrollIndicators(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the native ScrollView component reference.
|
|
89
|
+
*/
|
|
90
|
+
getNativeScrollRef(): any;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the scroll responder instance for handling scroll events.
|
|
93
|
+
*/
|
|
94
|
+
getScrollableNode(): any;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
97
|
+
*/
|
|
98
|
+
getScrollResponder(): any;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the internal state of the scroll virtualization.
|
|
101
|
+
*/
|
|
102
|
+
getState(): LegendListState;
|
|
103
|
+
/**
|
|
104
|
+
* Scrolls a specific index into view.
|
|
105
|
+
* @param params - Parameters for scrolling.
|
|
106
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
107
|
+
* @param params.index - The index to scroll to.
|
|
108
|
+
*/
|
|
109
|
+
scrollIndexIntoView(params: {
|
|
110
|
+
animated?: boolean | undefined;
|
|
111
|
+
index: number;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Scrolls a specific index into view.
|
|
115
|
+
* @param params - Parameters for scrolling.
|
|
116
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
117
|
+
* @param params.item - The item to scroll to.
|
|
118
|
+
*/
|
|
119
|
+
scrollItemIntoView(params: {
|
|
120
|
+
animated?: boolean | undefined;
|
|
121
|
+
item: any;
|
|
122
|
+
}): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Scrolls to the end of the list.
|
|
125
|
+
* @param options - Options for scrolling.
|
|
126
|
+
* @param options.animated - If true, animates the scroll. Default: true.
|
|
127
|
+
* @param options.viewOffset - Offset from the target position.
|
|
128
|
+
*/
|
|
129
|
+
scrollToEnd(options?: {
|
|
130
|
+
animated?: boolean | undefined;
|
|
131
|
+
viewOffset?: number | undefined;
|
|
132
|
+
}): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Scrolls to a specific index in the list.
|
|
135
|
+
* @param params - Parameters for scrolling.
|
|
136
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
137
|
+
* @param params.index - The index to scroll to.
|
|
138
|
+
* @param params.viewOffset - Offset from the target position.
|
|
139
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
140
|
+
*/
|
|
141
|
+
scrollToIndex(params: {
|
|
142
|
+
animated?: boolean | undefined;
|
|
143
|
+
index: number;
|
|
144
|
+
viewOffset?: number | undefined;
|
|
145
|
+
viewPosition?: number | undefined;
|
|
146
|
+
}): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Scrolls to a specific item in the list.
|
|
149
|
+
* @param params - Parameters for scrolling.
|
|
150
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
151
|
+
* @param params.item - The item to scroll to.
|
|
152
|
+
* @param params.viewOffset - Offset from the target position.
|
|
153
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
154
|
+
*/
|
|
155
|
+
scrollToItem(params: {
|
|
156
|
+
animated?: boolean | undefined;
|
|
157
|
+
item: any;
|
|
158
|
+
viewOffset?: number | undefined;
|
|
159
|
+
viewPosition?: number | undefined;
|
|
160
|
+
}): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Scrolls to a specific offset in pixels.
|
|
163
|
+
* @param params - Parameters for scrolling.
|
|
164
|
+
* @param params.offset - The pixel offset to scroll to.
|
|
165
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
166
|
+
*/
|
|
167
|
+
scrollToOffset(params: {
|
|
168
|
+
offset: number;
|
|
169
|
+
animated?: boolean | undefined;
|
|
170
|
+
}): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Sets or adds to the offset of the visible content anchor.
|
|
173
|
+
* @param value - The offset to set or add.
|
|
174
|
+
* @param animated - If true, uses Animated to animate the change.
|
|
175
|
+
*/
|
|
176
|
+
setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
|
|
177
|
+
/**
|
|
178
|
+
* Sets whether scroll processing is enabled.
|
|
179
|
+
* @param enabled - If true, scroll processing is enabled.
|
|
180
|
+
*/
|
|
181
|
+
setScrollProcessingEnabled(enabled: boolean): void;
|
|
182
|
+
/**
|
|
183
|
+
* Clears internal virtualization caches.
|
|
184
|
+
* @param options - Cache clearing options.
|
|
185
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
186
|
+
*/
|
|
187
|
+
clearCaches(options?: {
|
|
188
|
+
mode?: "sizes" | "full";
|
|
189
|
+
}): void;
|
|
190
|
+
/**
|
|
191
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
192
|
+
* Values are merged on top of props/animated/native insets.
|
|
193
|
+
*/
|
|
194
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
|
|
198
|
+
getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
|
|
199
|
+
getScrollResponder(): ScrollResponderMixin;
|
|
200
|
+
reportContentInset(inset?: Partial<Insets$1> | null): void;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
type KeyboardOnScrollCallback = (event: ScrollEvent) => void;
|
|
204
|
+
type KeyboardOnScrollHandler = KeyboardOnScrollCallback | ScrollHandlerProcessed<Record<string, unknown>>;
|
|
205
|
+
declare const KeyboardAvoidingLegendList: <ItemT>(props: Omit<AnimatedLegendListProps<ItemT>, "onScroll" | "automaticallyAdjustContentInsets" | "contentInset"> & {
|
|
206
|
+
onScroll?: KeyboardOnScrollHandler;
|
|
207
|
+
contentInset?: Insets$1 | undefined;
|
|
10
208
|
safeAreaInsetBottom?: number;
|
|
11
|
-
} & React.RefAttributes<LegendListRef>) => React.
|
|
209
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactElement | null;
|
|
12
210
|
|
|
13
|
-
export { KeyboardAvoidingLegendList
|
|
211
|
+
export { KeyboardAvoidingLegendList };
|