Skip to content

Commit

Permalink
Remove redundant {||} syntax (#48686)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
  • Loading branch information
coado authored and facebook-github-bot committed Jan 15, 2025
1 parent e8a64fd commit f36bfe5
Show file tree
Hide file tree
Showing 215 changed files with 1,430 additions and 1,435 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
Expand All @@ -39,9 +39,9 @@ type NativeProps = $ReadOnly<{|
edgeInsets?: $ReadOnlyArray<EdgeInsetsValue>,
dimensions?: $ReadOnlyArray<DimensionValue>,
sizes?: WithDefault<$ReadOnlyArray<'small' | 'large'>, 'small'>,
object?: $ReadOnlyArray<$ReadOnly<{|prop: string|}>>,
arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{|prop1: Float, prop2: Int32|}>>,
|}>;
object?: $ReadOnlyArray<$ReadOnly<{prop: string}>>,
arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{prop1: Float, prop2: Int32}>>,
}>;

export default (codegenNativeComponent<NativeProps>(
'ArrayPropsNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
disabled?: WithDefault<boolean, false>,
disabledNullable?: WithDefault<boolean, null>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'BooleanPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet';

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
tintColor?: ColorValue,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'ColorPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {DimensionValue} from 'react-native/Libraries/StyleSheet/StyleSheetT

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
marginBack?: DimensionValue,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'DimensionPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
// TODO(T104760003) Fix EdgeInsetsValue in codegen
// contentInset?: EdgeInsetsValue,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'EdgeInsetsPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
alignment?: WithDefault<'top' | 'center' | 'bottom-right', 'center'>,
intervals?: WithDefault<0 | 15 | 30 | 60, 0>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'EnumPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type OnChangeEvent = $ReadOnly<{|
type OnChangeEvent = $ReadOnly<{
location: {
source: {url: string, ...},
x: Int32,
y: Int32,
arrayOfObjects: $ReadOnlyArray<{value: $ReadOnly<{str: string}>}>,
...
},
|}>;
}>;

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
disabled?: WithDefault<boolean, false>,

// Events
onChange?: ?BubblingEventHandler<OnChangeEvent>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'EventNestedObjectPropsNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type OnChangeEvent = $ReadOnly<{|
type OnChangeEvent = $ReadOnly<{
value: boolean,
source?: string,
progress: ?Int32,
scale?: ?Float,
|}>;
}>;

type OnEventDirect = $ReadOnly<{|
type OnEventDirect = $ReadOnly<{
value: boolean,
|}>;
}>;

type OnOrientationChangeEvent = $ReadOnly<{|
type OnOrientationChangeEvent = $ReadOnly<{
orientation: 'landscape' | 'portrait',
|}>;
}>;

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
Expand All @@ -57,7 +57,7 @@ type NativeProps = $ReadOnly<{|
null,
'paperBubblingName',
>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'EventPropsNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
Expand All @@ -28,7 +28,7 @@ type NativeProps = $ReadOnly<{|
blurRadius5?: WithDefault<Float, 1>,
blurRadius6?: WithDefault<Float, -0.0>,
blurRadiusNullable?: WithDefault<Float, null>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'FloatPropsNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
thumbImage?: ImageSource,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'ImagePropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
progress1?: WithDefault<Int32, 0>,
progress2?: WithDefault<Int32, -1>,
progress3?: WithDefault<Int32, 10>,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'IntegerPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
title?: WithDefault<string, ''>,

// Events
onChange?: ?BubblingEventHandler<$ReadOnly<{|value: boolean|}>>,
|}>;
onChange?: ?BubblingEventHandler<$ReadOnly<{value: boolean}>>,
}>;

export default (codegenNativeComponent<NativeProps>(
'InterfaceOnlyNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {UnsafeMixed} from 'react-native/Libraries/Types/CodegenTypes';

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
mixedProp?: UnsafeMixed,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'MixedPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
thumbImage?: ImageSource,
color?: ColorValue,
thumbTintColor?: ColorValue,
point?: PointValue,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'MultiNativePropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// No Props or events
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'NoPropsNoEventsNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ import type {

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type ObjectArrayPropType = $ReadOnly<{|
type ObjectArrayPropType = $ReadOnly<{
array: $ReadOnlyArray<string>,
|}>;
}>;

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
objectProp?: $ReadOnly<{|
objectProp?: $ReadOnly<{
stringProp?: WithDefault<string, ''>,
booleanProp: boolean,
floatProp: Float,
intProp: Int32,
stringEnumProp?: WithDefault<'small' | 'large', 'small'>,
intEnumProp?: WithDefault<0 | 1, 0>,
|}>,
}>,
objectArrayProp: ObjectArrayPropType,
objectPrimitiveRequiredProp: $ReadOnly<{|
objectPrimitiveRequiredProp: $ReadOnly<{
image: ImageSource,
color?: ColorValue,
point: ?PointValue,
|}>,
|}>;
}>,
}>;

export default (codegenNativeComponent<NativeProps>(
'ObjectPropsNativeComponent',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
startPoint?: PointValue,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'PointPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';

import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

type NativeProps = $ReadOnly<{|
type NativeProps = $ReadOnly<{
...ViewProps,

// Props
placeholder?: WithDefault<string, ''>,
defaultValue?: string,
|}>;
}>;

export default (codegenNativeComponent<NativeProps>(
'StringPropNativeComponentView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';

import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';

export type StateType = {|
export type StateType = {
state: string,
|};
};

export enum StatusRegularEnum {
Active,
Expand All @@ -40,13 +40,13 @@ export enum StatusLowerCaseEnum {
Off = 'off',
}

export type StateTypeWithEnums = {|
export type StateTypeWithEnums = {
state: string,
regular: StatusRegularEnum,
str: StatusStrEnum,
num: StatusNumEnum,
lowerCase: StatusLowerCaseEnum,
|};
};

export interface Spec extends TurboModule {
+getStatusRegular: (statusProp: StateType) => StatusRegularEnum;
Expand Down
Loading

0 comments on commit f36bfe5

Please sign in to comment.