Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ import type {

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

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

// Props
names?: $ReadOnlyArray<string>,
disableds?: $ReadOnlyArray<boolean>,
progress?: $ReadOnlyArray<Int32>,
radii?: $ReadOnlyArray<Float>,
colors?: $ReadOnlyArray<ColorValue>,
srcs?: $ReadOnlyArray<ImageSource>,
points?: $ReadOnlyArray<PointValue>,
edgeInsets?: $ReadOnlyArray<EdgeInsetsValue>,
dimensions?: $ReadOnlyArray<DimensionValue>,
sizes?: WithDefault<$ReadOnlyArray<'small' | 'large'>, 'small'>,
object?: $ReadOnlyArray<$ReadOnly<{prop: string}>>,
arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{prop1: Float, prop2: Int32}>>,
arrayOfMixed?: $ReadOnlyArray<UnsafeMixed>,
names?: ReadonlyArray<string>,
disableds?: ReadonlyArray<boolean>,
progress?: ReadonlyArray<Int32>,
radii?: ReadonlyArray<Float>,
colors?: ReadonlyArray<ColorValue>,
srcs?: ReadonlyArray<ImageSource>,
points?: ReadonlyArray<PointValue>,
edgeInsets?: ReadonlyArray<EdgeInsetsValue>,
dimensions?: ReadonlyArray<DimensionValue>,
sizes?: WithDefault<ReadonlyArray<'small' | 'large'>, 'small'>,
object?: ReadonlyArray<Readonly<{prop: string}>>,
arrayOfObjects?: ReadonlyArray<Readonly<{prop1: Float, prop2: Int32}>>,
arrayOfMixed?: ReadonlyArray<UnsafeMixed>,
}>;

export default (codegenNativeComponent<NativeProps>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTyp

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

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

// Props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ 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}>}>,
arrayOfObjects: ReadonlyArray<{value: Readonly<{str: string}>}>,
...
},
}>;

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

// Props
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 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';

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

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

// Props
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 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
title?: WithDefault<string, ''>,

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

export default (codegenNativeComponent<NativeProps>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTyp

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

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

// No Props or events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import type {

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

type ObjectArrayPropType = $ReadOnly<{
array: $ReadOnlyArray<string>,
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,
Expand All @@ -38,7 +38,7 @@ type NativeProps = $ReadOnly<{
intEnumProp?: WithDefault<0 | 1, 0>,
}>,
objectArrayProp: ObjectArrayPropType,
objectPrimitiveRequiredProp: $ReadOnly<{
objectPrimitiveRequiredProp: Readonly<{
image: ImageSource,
color?: ColorValue,
point: ?PointValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type AnotherArray = Array<ArrayType>;

export interface Spec extends TurboModule {
+getArray: (a: Array<any>) => Array<string>;
+getReadOnlyArray: (a: Array<any>) => $ReadOnlyArray<string>;
+getReadOnlyArray: (a: Array<any>) => ReadonlyArray<string>;
+getArrayWithAlias: (a: AnotherArray, b: Array<ArrayType>) => AnotherArray;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type AnotherGenericObject = GenericObject;

export interface Spec extends TurboModule {
+getGenericObject: (arg: Object) => Object;
+getGenericObjectReadOnly: (arg: Object) => $ReadOnly<{a: string}>;
+getGenericObjectReadOnly: (arg: Object) => Readonly<{a: string}>;
+getGenericObjectWithAlias: (arg: GenericObject) => AnotherGenericObject;
+difficultObject: (A: {
D: boolean,
Expand Down
Loading