Skip to content

Commit

Permalink
Add as const cast and make types readonly to prepare for natural in…
Browse files Browse the repository at this point in the history
…ference (#47184)

Summary:

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64859497
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Oct 24, 2024
1 parent 2d97a6c commit 9c82b0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 7 additions & 1 deletion packages/react-native/Libraries/StyleSheet/StyleSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ if (hairlineWidth === 0) {
hairlineWidth = 1 / PixelRatio.get();
}

const absoluteFill = {
const absoluteFill: {
+bottom: 0,
+left: 0,
+position: 'absolute',
+right: 0,
+top: 0,
} = {
position: 'absolute',
left: 0,
right: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7889,11 +7889,11 @@ export type ImageStyle = ____ImageStyle_Internal;
export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;
declare let hairlineWidth: number;
declare const absoluteFill: {
position: \\"absolute\\",
left: 0,
right: 0,
top: 0,
bottom: 0,
+bottom: 0,
+left: 0,
+position: \\"absolute\\",
+right: 0,
+top: 0,
};
declare module.exports: {
hairlineWidth: hairlineWidth,
Expand Down
4 changes: 2 additions & 2 deletions packages/virtualized-lists/Lists/ViewabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type ViewabilityConfigCallbackPair = {
...
};

export type ViewabilityConfig = {|
export type ViewabilityConfig = $ReadOnly<{|
/**
* Minimum amount of time (in milliseconds) that an item must be physically viewable before the
* viewability callback will be fired. A high number means that scrolling through content without
Expand All @@ -62,7 +62,7 @@ export type ViewabilityConfig = {|
* render.
*/
waitForInteraction?: boolean,
|};
|}>;

/**
* A Utility class for calculating viewable items based on current metrics like scroll position and
Expand Down

0 comments on commit 9c82b0e

Please sign in to comment.