@react-native-tvos/virtualized-lists 0.84.1-0 → 0.85.0-0rc5
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/Lists/CellRenderMask.js +1 -1
- package/Lists/ListMetricsAggregator.js +3 -3
- package/Lists/StateSafePureComponent.js +1 -1
- package/Lists/ViewabilityHelper.js +1 -1
- package/Lists/VirtualizedList.js +4 -4
- package/Lists/VirtualizedListCellRenderer.js +1 -1
- package/Lists/VirtualizedListContext.js +1 -1
- package/Lists/VirtualizedListProps.js +1 -1
- package/Lists/VirtualizedSectionList.js +6 -6
- package/package.json +3 -3
package/Lists/CellRenderMask.js
CHANGED
|
@@ -135,7 +135,7 @@ export default class ListMetricsAggregator {
|
|
|
135
135
|
layout,
|
|
136
136
|
}: {
|
|
137
137
|
orientation: ListOrientation,
|
|
138
|
-
layout:
|
|
138
|
+
layout: Readonly<{width: number, height: number}>,
|
|
139
139
|
}): void {
|
|
140
140
|
this._invalidateIfOrientationChanged(orientation);
|
|
141
141
|
this._contentLength = this._selectLength(layout);
|
|
@@ -320,11 +320,11 @@ export default class ListMetricsAggregator {
|
|
|
320
320
|
_selectLength({
|
|
321
321
|
width,
|
|
322
322
|
height,
|
|
323
|
-
}:
|
|
323
|
+
}: Readonly<{width: number, height: number, ...}>): number {
|
|
324
324
|
return this._orientation.horizontal ? width : height;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
_selectOffset({x, y}:
|
|
327
|
+
_selectOffset({x, y}: Readonly<{x: number, y: number, ...}>): number {
|
|
328
328
|
return this._orientation.horizontal ? x : y;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
@@ -32,7 +32,7 @@ export default class StateSafePureComponent<
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// $FlowFixMe[incompatible-type]
|
|
35
|
-
setState<K:
|
|
35
|
+
setState<K: keyof State>(
|
|
36
36
|
partialState: ?(Pick<State, K> | ((State, Props) => ?Pick<State, K>)),
|
|
37
37
|
callback?: () => unknown,
|
|
38
38
|
): void {
|
|
@@ -38,7 +38,7 @@ export type ViewabilityConfigCallbackPair = {
|
|
|
38
38
|
export type ViewabilityConfigCallbackPairs =
|
|
39
39
|
Array<ViewabilityConfigCallbackPair>;
|
|
40
40
|
|
|
41
|
-
export type ViewabilityConfig =
|
|
41
|
+
export type ViewabilityConfig = Readonly<{
|
|
42
42
|
/**
|
|
43
43
|
* Minimum amount of time (in milliseconds) that an item must be physically viewable before the
|
|
44
44
|
* viewability callback will be fired. A high number means that scrolling through content without
|
package/Lists/VirtualizedList.js
CHANGED
|
@@ -510,7 +510,7 @@ class VirtualizedList extends StateSafePureComponent<
|
|
|
510
510
|
static _createRenderMask(
|
|
511
511
|
props: VirtualizedListProps,
|
|
512
512
|
cellsAroundViewport: {first: number, last: number},
|
|
513
|
-
additionalRegions?:
|
|
513
|
+
additionalRegions?: ?ReadonlyArray<{first: number, last: number}>,
|
|
514
514
|
): CellRenderMask {
|
|
515
515
|
const itemCount = props.getItemCount(props.data);
|
|
516
516
|
|
|
@@ -1545,7 +1545,7 @@ class VirtualizedList extends StateSafePureComponent<
|
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
1547
1547
|
_selectLength(
|
|
1548
|
-
metrics:
|
|
1548
|
+
metrics: Readonly<{
|
|
1549
1549
|
height: number,
|
|
1550
1550
|
width: number,
|
|
1551
1551
|
...
|
|
@@ -1556,7 +1556,7 @@ class VirtualizedList extends StateSafePureComponent<
|
|
|
1556
1556
|
: metrics.width;
|
|
1557
1557
|
}
|
|
1558
1558
|
|
|
1559
|
-
_selectOffset({x, y}:
|
|
1559
|
+
_selectOffset({x, y}: Readonly<{x: number, y: number, ...}>): number {
|
|
1560
1560
|
return this._orientation().horizontal ? x : y;
|
|
1561
1561
|
}
|
|
1562
1562
|
|
|
@@ -1997,7 +1997,7 @@ class VirtualizedList extends StateSafePureComponent<
|
|
|
1997
1997
|
props: CellMetricProps & {
|
|
1998
1998
|
additionalRenderRegions?: {first: number, last: number}[],
|
|
1999
1999
|
},
|
|
2000
|
-
):
|
|
2000
|
+
): ReadonlyArray<{
|
|
2001
2001
|
first: number,
|
|
2002
2002
|
last: number,
|
|
2003
2003
|
}> => {
|
|
@@ -13,7 +13,7 @@ import type VirtualizedList from './VirtualizedList';
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import {createContext, useContext, useMemo} from 'react';
|
|
15
15
|
|
|
16
|
-
type Context =
|
|
16
|
+
type Context = Readonly<{
|
|
17
17
|
cellKey: ?string,
|
|
18
18
|
getScrollMetrics: () => {
|
|
19
19
|
contentLength: number,
|
|
@@ -23,7 +23,7 @@ type DefaultVirtualizedSectionT = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export type SectionData<SectionItemT, SectionT = DefaultVirtualizedSectionT> =
|
|
26
|
-
| (
|
|
26
|
+
| (Readonly<SectionBase<SectionItemT, SectionT>> & SectionT)
|
|
27
27
|
| (SectionBase<SectionItemT, SectionT> & SectionT)
|
|
28
28
|
| SectionT;
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ export type SectionBase<SectionItemT, SectionT = DefaultVirtualizedSectionT> = {
|
|
|
31
31
|
/**
|
|
32
32
|
* The data for rendering items in this section.
|
|
33
33
|
*/
|
|
34
|
-
data:
|
|
34
|
+
data: ReadonlyArray<SectionItemT>,
|
|
35
35
|
/**
|
|
36
36
|
* Optional key to keep track of section re-ordering. If you don't plan on re-ordering sections,
|
|
37
37
|
* the array index will be used by default.
|
|
@@ -59,7 +59,7 @@ type RequiredVirtualizedSectionListProps<
|
|
|
59
59
|
ItemT,
|
|
60
60
|
SectionT = DefaultVirtualizedSectionT,
|
|
61
61
|
> = {
|
|
62
|
-
sections:
|
|
62
|
+
sections: ReadonlyArray<SectionData<ItemT, SectionT>>,
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
type OptionalVirtualizedSectionListProps<
|
|
@@ -228,7 +228,7 @@ class VirtualizedSectionList<
|
|
|
228
228
|
|
|
229
229
|
_getItem(
|
|
230
230
|
props: VirtualizedSectionListProps<ItemT, SectionT>,
|
|
231
|
-
sections:
|
|
231
|
+
sections: ?ReadonlyArray<SectionData<ItemT, SectionT>>,
|
|
232
232
|
index: number,
|
|
233
233
|
): ?ItemT {
|
|
234
234
|
if (!sections) {
|
|
@@ -478,7 +478,7 @@ class VirtualizedSectionList<
|
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
type ItemWithSeparatorCommonProps<ItemT> =
|
|
481
|
+
type ItemWithSeparatorCommonProps<ItemT> = Readonly<{
|
|
482
482
|
leadingItem: ?ItemT,
|
|
483
483
|
leadingSection: ?Object,
|
|
484
484
|
section: Object,
|
|
@@ -486,7 +486,7 @@ type ItemWithSeparatorCommonProps<ItemT> = $ReadOnly<{
|
|
|
486
486
|
trailingSection: ?Object,
|
|
487
487
|
}>;
|
|
488
488
|
|
|
489
|
-
type ItemWithSeparatorProps<ItemT> =
|
|
489
|
+
type ItemWithSeparatorProps<ItemT> = Readonly<{
|
|
490
490
|
...ItemWithSeparatorCommonProps<ItemT>,
|
|
491
491
|
LeadingSeparatorComponent: ?(React.ComponentType<any> | React.MixedElement),
|
|
492
492
|
SeparatorComponent: ?(React.ComponentType<any> | React.MixedElement),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-tvos/virtualized-lists",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0-0rc5",
|
|
4
4
|
"description": "Virtualized lists for React Native.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"bugs": "https://github.com/facebook/react-native/issues",
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": "
|
|
20
|
+
"node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0"
|
|
21
21
|
},
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@types/react": "^19.2.0",
|
|
55
55
|
"react": "*",
|
|
56
|
-
"react-native": "
|
|
56
|
+
"react-native": "0.85.0-rc.5"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@types/react": {
|