mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Make generated props and style types augmentable (#58168)
Summary:
react-native-web and Nativewind extend React Native's types with module augmentation. https://github.com/react/react-native/issues/58062 made the props and style types interfaces, which cleared the duplicate identifier errors. Two things still can't be extended.
**Styles:** `ViewStyle` is an interface derived from `____ViewStyle_Internal`, but `ViewProps['style']` reads the base, so augmenting `ViewStyle` doesn't reach it:
```ts
declare module 'react-native' {
interface ViewStyle { transitionDuration?: string }
}
<View style={{ transitionDuration: '1s' }} />; // error
StyleSheet.create({ box: { transitionDuration: '1s' } }); // error
```
`____ViewStyle_Internal` is now named `ViewStyle`, and the same for Text and Image. `StyleSheet` re-exports each name unchanged, so the interface and the base are one symbol.
**Props written as inline object literals:** The transform copies them into the interface body, where a second declaration is a merge conflict rather than an override, so the augmentation is silently ignored. Eleven of the 24 annotated types are affected. Each now moves its inline members into a private `<Name>Core` alias, so they reach the interface through the extends clause and are inherited, like everything from `ViewProps` already was:
```ts
// before
declare interface KeyboardAvoidingViewProps extends Readonly<ViewProps> {
readonly enabled?: boolean
}
// after
declare interface KeyboardAvoidingViewProps extends Readonly<
ViewProps & KeyboardAvoidingViewPropsCore
> {}
```
That costs 11 new names in the API snapshot, one per affected type. `PressableProps` set the precedent with `PressableBaseProps`.
`ImagePropsBase` and `ImageBackgroundProps` declare members that shadow keys of the type they spread, and a Flow spread of an optional property unions the two types instead of replacing the member, so those keys get an explicit `Omit`.
Caveat: an augmented member has to be assignable to the inherited one. Adding a key is clean and narrowing works, but widening raises `TS2430` on the declaration file, which `skipLibCheck: true` silences.
[GENERAL] [CHANGED] - Allow module augmentation to extend generated props and style types
Pull Request resolved: https://github.com/react/react-native/pull/58168
Test Plan:
`yarn build-types`: all 24 annotated types now emit an empty interface body. `ViewStyle`, `TextStyle` and `ImageStyle` are unchanged; the props types gain the 11 `<Name>Core` aliases.
Compiled augmentations with `skipLibCheck: false`. Styles: the two lines above pass here and report `TS2353` on `main`. Props: adding a key and narrowing an existing one on each of the 11 types passes here and reports `TS2717` on `main`.
`yarn flow-check`, `yarn test-generated-typescript`, `yarn format-check` and `yarn lint`: clean, apart from 3 Flow errors in `packages/react-native-codegen/lib` already on `main`. `yarn jest packages/react-native/Libraries packages/react-native/src scripts/js-api`: 632 tests pass, no snapshot changed.
Reviewed By: christophpurrer
Differential Revision: D117876097
Pulled By: cortinico
fbshipit-source-id: c0797f14d95a01662930f7158738ea79e1bf1a30
(cherry picked from commit 447ccd1ddb)
This commit is contained in:
1 parent
7822b9cce2
commit
ee4bd403d4
17 files changed
+356
-314
No files matched your search
@@ -8,7 +8,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {____ViewStyle_Internal} from '../../StyleSheet/StyleSheetTypes';
|
||||
import type {ViewStyle} from '../../StyleSheet/StyleSheetTypes';
|
||||
import type {
|
||||
AnimatedComponentType,
|
||||
AnimatedProps,
|
||||
@@ -99,7 +99,7 @@ const AnimatedScrollViewWithInvertedRefreshControl =
|
||||
|
||||
// Handle animated props on `refreshControl`.
|
||||
const [refreshControlAnimatedProps, refreshControlRef] = useAnimatedProps<
|
||||
{style: ?____ViewStyle_Internal},
|
||||
{style: ?ViewStyle},
|
||||
$FlowFixMe,
|
||||
>(intermediatePropsForRefreshControl);
|
||||
// NOTE: Assumes that refreshControl.ref` and `refreshControl.style` can be
|
||||
|
||||
+8
-5
@@ -38,11 +38,7 @@ type ActivityIndicatorIOSProps = Readonly<{
|
||||
hidesWhenStopped?: ?boolean,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ActivityIndicatorProps = Readonly<{
|
||||
...ViewProps,
|
||||
...ActivityIndicatorIOSProps,
|
||||
|
||||
type ActivityIndicatorPropsCore = Readonly<{
|
||||
/**
|
||||
* Whether to show the indicator (`true`) or hide it (`false`).
|
||||
*/
|
||||
@@ -67,6 +63,13 @@ export type ActivityIndicatorProps = Readonly<{
|
||||
size?: ?IndicatorSize,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ActivityIndicatorProps = Readonly<{
|
||||
...ViewProps,
|
||||
...ActivityIndicatorIOSProps,
|
||||
...ActivityIndicatorPropsCore,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Displays a circular loading indicator.
|
||||
*
|
||||
|
||||
+4
-2
@@ -27,8 +27,7 @@ import View from './View/View';
|
||||
import invariant from 'invariant';
|
||||
import * as React from 'react';
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ButtonProps = Readonly<{
|
||||
type ButtonPropsCore = Readonly<{
|
||||
/**
|
||||
* Text to display inside the button. On Android the given title will be
|
||||
* converted to the uppercased form.
|
||||
@@ -167,6 +166,9 @@ export type ButtonProps = Readonly<{
|
||||
accessibilityLanguage?: ?Stringish,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ButtonProps = ButtonPropsCore;
|
||||
|
||||
const NativeTouchable:
|
||||
typeof TouchableNativeFeedback | typeof TouchableOpacity =
|
||||
Platform.OS === 'android' ? TouchableNativeFeedback : TouchableOpacity;
|
||||
|
||||
+7
-4
@@ -26,10 +26,7 @@ import Keyboard from './Keyboard';
|
||||
import * as React from 'react';
|
||||
import {createRef} from 'react';
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type KeyboardAvoidingViewProps = Readonly<{
|
||||
...ViewProps,
|
||||
|
||||
type KeyboardAvoidingViewPropsCore = Readonly<{
|
||||
/**
|
||||
* Specify how to react to the presence of the keyboard.
|
||||
*/
|
||||
@@ -56,6 +53,12 @@ export type KeyboardAvoidingViewProps = Readonly<{
|
||||
keyboardVerticalOffset?: number,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type KeyboardAvoidingViewProps = Readonly<{
|
||||
...ViewProps,
|
||||
...KeyboardAvoidingViewPropsCore,
|
||||
}>;
|
||||
|
||||
type KeyboardAvoidingViewState = {
|
||||
bottom: number,
|
||||
};
|
||||
|
||||
@@ -32,11 +32,13 @@ export type PressableInstance = HostInstance;
|
||||
|
||||
export type {PressableAndroidRippleConfig};
|
||||
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type PressableStateCallbackType = Readonly<{
|
||||
type PressableStateCallbackTypeCore = Readonly<{
|
||||
pressed: boolean,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type PressableStateCallbackType = PressableStateCallbackTypeCore;
|
||||
|
||||
type PressableBaseProps = Readonly<{
|
||||
/**
|
||||
* Whether a press gesture can be interrupted by a parent gesture such as a
|
||||
|
||||
@@ -18,12 +18,7 @@ import useWindowDimensions from '../../Utilities/useWindowDimensions';
|
||||
import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent';
|
||||
import * as React from 'react';
|
||||
|
||||
/**
|
||||
* InputAccessoryView is deprecated and will be removed in a future release.
|
||||
* @deprecated
|
||||
* @build-types emit-as-interface Expo compatibility
|
||||
*/
|
||||
export type InputAccessoryViewProps = Readonly<{
|
||||
type InputAccessoryViewPropsCore = Readonly<{
|
||||
readonly children: React.Node,
|
||||
/**
|
||||
* An ID used to associate this `InputAccessoryView` to specified `TextInput`(s).
|
||||
@@ -33,6 +28,13 @@ export type InputAccessoryViewProps = Readonly<{
|
||||
backgroundColor?: ?ColorValue,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* InputAccessoryView is deprecated and will be removed in a future release.
|
||||
* @deprecated
|
||||
* @build-types emit-as-interface Expo compatibility
|
||||
*/
|
||||
export type InputAccessoryViewProps = InputAccessoryViewPropsCore;
|
||||
|
||||
/**
|
||||
* A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is displayed above the keyboard whenever a `TextInput` has focus. This component can be used to create custom toolbars.
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import type {HostInstance} from '../../../src/private/types/HostInstance';
|
||||
import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
|
||||
import type {TextStyle} from '../../StyleSheet/StyleSheetTypes';
|
||||
import type {
|
||||
BlurEvent,
|
||||
FocusEvent,
|
||||
@@ -543,16 +543,16 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
let _style = props.style;
|
||||
const flattenedStyle = flattenStyle<TextStyleProp>(props.style);
|
||||
if (flattenedStyle != null) {
|
||||
let overrides: ?{...TextStyleInternal} = null;
|
||||
let overrides: ?{...TextStyle} = null;
|
||||
if (typeof flattenedStyle?.fontWeight === 'number') {
|
||||
overrides = overrides || ({} as {...TextStyleInternal});
|
||||
overrides = overrides || ({} as {...TextStyle});
|
||||
overrides.fontWeight =
|
||||
// $FlowFixMe[incompatible-type]
|
||||
flattenedStyle.fontWeight.toString() as TextStyleInternal['fontWeight'];
|
||||
flattenedStyle.fontWeight.toString() as TextStyle['fontWeight'];
|
||||
}
|
||||
|
||||
if (flattenedStyle.verticalAlign != null) {
|
||||
overrides = overrides || ({} as {...TextStyleInternal});
|
||||
overrides = overrides || ({} as {...TextStyle});
|
||||
overrides.textAlignVertical =
|
||||
verticalAlignToTextAlignVerticalMap[flattenedStyle.verticalAlign];
|
||||
overrides.verticalAlign = undefined;
|
||||
|
||||
+85
-84
@@ -36,92 +36,93 @@ export type TouchableWithoutFeedbackPropsAndroid = {
|
||||
touchSoundDisabled?: ?boolean,
|
||||
};
|
||||
|
||||
type TouchableWithoutFeedbackPropsCore = {
|
||||
children?: ?React.Node,
|
||||
/**
|
||||
* Delay in ms, from onPressIn, before onLongPress is called.
|
||||
*/
|
||||
delayLongPress?: ?number,
|
||||
/**
|
||||
* Delay in ms, from the start of the touch, before onPressIn is called.
|
||||
*/
|
||||
delayPressIn?: ?number,
|
||||
/**
|
||||
* Delay in ms, from the release of the touch, before onPressOut is called.
|
||||
*/
|
||||
delayPressOut?: ?number,
|
||||
/**
|
||||
* If true, disable all interactions for this component.
|
||||
*/
|
||||
disabled?: ?boolean,
|
||||
/**
|
||||
* Whether this View should be focusable with a non-touch input device,
|
||||
* eg. receive focus with a hardware keyboard / TV remote.
|
||||
*/
|
||||
focusable?: ?boolean,
|
||||
/**
|
||||
* This defines how far your touch can start away from the button.
|
||||
* This is added to pressRetentionOffset when moving off of the button.
|
||||
* NOTE The touch area never extends past the parent view bounds and
|
||||
* the Z-index of sibling views always takes precedence if a touch hits
|
||||
* two overlapping views.
|
||||
*/
|
||||
hitSlop?: ?EdgeInsetsOrSizeProp,
|
||||
/**
|
||||
* Used to reference react managed views from native code.
|
||||
*/
|
||||
id?: string,
|
||||
importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'),
|
||||
nativeID?: ?string,
|
||||
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
||||
/**
|
||||
* When `accessible` is true (which is the default) this may be called when
|
||||
* the OS-specific concept of "blur" occurs, meaning the element lost focus.
|
||||
* Some platforms may not have the concept of blur.
|
||||
*/
|
||||
onBlur?: ?(event: BlurEvent) => unknown,
|
||||
/**
|
||||
* When `accessible` is true (which is the default) this may be called when
|
||||
* the OS-specific concept of "focus" occurs. Some platforms may not have
|
||||
* the concept of focus.
|
||||
*/
|
||||
onFocus?: ?(event: FocusEvent) => unknown,
|
||||
/**
|
||||
* Invoked on mount and layout changes with
|
||||
* {nativeEvent: {layout: {x, y, width, height}}}
|
||||
*/
|
||||
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
||||
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
||||
/**
|
||||
* Called when the touch is released,
|
||||
* but not if cancelled (e.g. by a scroll that steals the responder lock).
|
||||
*/
|
||||
onPress?: ?(event: GestureResponderEvent) => unknown,
|
||||
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
||||
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
||||
/**
|
||||
* When the scroll view is disabled, this defines how far your
|
||||
* touch may move off of the button, before deactivating the button.
|
||||
* Once deactivated, try moving it back and you'll see that the button
|
||||
* is once again reactivated! Move it back and forth several times
|
||||
* while the scroll view is disabled. Ensure you pass in a constant
|
||||
* to reduce memory allocations.
|
||||
*/
|
||||
pressRetentionOffset?: ?EdgeInsetsOrSizeProp,
|
||||
rejectResponderTermination?: ?boolean,
|
||||
/**
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*/
|
||||
testID?: ?string,
|
||||
/**
|
||||
* //FIXME: not in doc but available in examples
|
||||
*/
|
||||
style?: ?ViewStyleProp,
|
||||
};
|
||||
|
||||
/** @build-types emit-as-interface Expo compatibility */
|
||||
export type TouchableWithoutFeedbackProps = Readonly<
|
||||
{
|
||||
children?: ?React.Node,
|
||||
/**
|
||||
* Delay in ms, from onPressIn, before onLongPress is called.
|
||||
*/
|
||||
delayLongPress?: ?number,
|
||||
/**
|
||||
* Delay in ms, from the start of the touch, before onPressIn is called.
|
||||
*/
|
||||
delayPressIn?: ?number,
|
||||
/**
|
||||
* Delay in ms, from the release of the touch, before onPressOut is called.
|
||||
*/
|
||||
delayPressOut?: ?number,
|
||||
/**
|
||||
* If true, disable all interactions for this component.
|
||||
*/
|
||||
disabled?: ?boolean,
|
||||
/**
|
||||
* Whether this View should be focusable with a non-touch input device,
|
||||
* eg. receive focus with a hardware keyboard / TV remote.
|
||||
*/
|
||||
focusable?: ?boolean,
|
||||
/**
|
||||
* This defines how far your touch can start away from the button.
|
||||
* This is added to pressRetentionOffset when moving off of the button.
|
||||
* NOTE The touch area never extends past the parent view bounds and
|
||||
* the Z-index of sibling views always takes precedence if a touch hits
|
||||
* two overlapping views.
|
||||
*/
|
||||
hitSlop?: ?EdgeInsetsOrSizeProp,
|
||||
/**
|
||||
* Used to reference react managed views from native code.
|
||||
*/
|
||||
id?: string,
|
||||
importantForAccessibility?: ?(
|
||||
'auto' | 'yes' | 'no' | 'no-hide-descendants'
|
||||
),
|
||||
nativeID?: ?string,
|
||||
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
||||
/**
|
||||
* When `accessible` is true (which is the default) this may be called when
|
||||
* the OS-specific concept of "blur" occurs, meaning the element lost focus.
|
||||
* Some platforms may not have the concept of blur.
|
||||
*/
|
||||
onBlur?: ?(event: BlurEvent) => unknown,
|
||||
/**
|
||||
* When `accessible` is true (which is the default) this may be called when
|
||||
* the OS-specific concept of "focus" occurs. Some platforms may not have
|
||||
* the concept of focus.
|
||||
*/
|
||||
onFocus?: ?(event: FocusEvent) => unknown,
|
||||
/**
|
||||
* Invoked on mount and layout changes with
|
||||
* {nativeEvent: {layout: {x, y, width, height}}}
|
||||
*/
|
||||
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
||||
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
||||
/**
|
||||
* Called when the touch is released,
|
||||
* but not if cancelled (e.g. by a scroll that steals the responder lock).
|
||||
*/
|
||||
onPress?: ?(event: GestureResponderEvent) => unknown,
|
||||
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
||||
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
||||
/**
|
||||
* When the scroll view is disabled, this defines how far your
|
||||
* touch may move off of the button, before deactivating the button.
|
||||
* Once deactivated, try moving it back and you'll see that the button
|
||||
* is once again reactivated! Move it back and forth several times
|
||||
* while the scroll view is disabled. Ensure you pass in a constant
|
||||
* to reduce memory allocations.
|
||||
*/
|
||||
pressRetentionOffset?: ?EdgeInsetsOrSizeProp,
|
||||
rejectResponderTermination?: ?boolean,
|
||||
/**
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*/
|
||||
testID?: ?string,
|
||||
/**
|
||||
* //FIXME: not in doc but available in examples
|
||||
*/
|
||||
style?: ?ViewStyleProp,
|
||||
} & TouchableWithoutFeedbackPropsAndroid &
|
||||
TouchableWithoutFeedbackPropsCore &
|
||||
TouchableWithoutFeedbackPropsAndroid &
|
||||
TouchableWithoutFeedbackPropsIOS &
|
||||
AccessibilityProps,
|
||||
>;
|
||||
|
||||
@@ -349,10 +349,7 @@ export type AccessibilityPropsIOS = Readonly<{
|
||||
accessibilityRespondsToUserInteraction?: ?boolean,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type AccessibilityProps = Readonly<{
|
||||
...AccessibilityPropsAndroid,
|
||||
...AccessibilityPropsIOS,
|
||||
type AccessibilityPropsCore = Readonly<{
|
||||
/**
|
||||
* When `true`, indicates that the view is an accessibility element.
|
||||
* By default, all the touchable elements are accessible.
|
||||
@@ -434,3 +431,10 @@ export type AccessibilityProps = Readonly<{
|
||||
*/
|
||||
'aria-hidden'?: ?boolean,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type AccessibilityProps = Readonly<{
|
||||
...AccessibilityPropsAndroid,
|
||||
...AccessibilityPropsIOS,
|
||||
...AccessibilityPropsCore,
|
||||
}>;
|
||||
+38
-18
@@ -147,10 +147,7 @@ export type ImagePropsAndroid = Readonly<{
|
||||
resizeMultiplier?: ?number,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Expo compatibility */
|
||||
export type ImagePropsBase = Readonly<{
|
||||
...Omit<ViewProps, 'style'>,
|
||||
|
||||
type ImagePropsBaseCore = Readonly<{
|
||||
/**
|
||||
* When `true`, indicates the image is an accessibility element.
|
||||
*/
|
||||
@@ -327,27 +324,38 @@ export type ImagePropsBase = Readonly<{
|
||||
children?: empty,
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ImageProps = Readonly<{
|
||||
...ImagePropsIOS,
|
||||
...ImagePropsAndroid,
|
||||
...ImagePropsBase,
|
||||
/** @build-types emit-as-interface Expo compatibility */
|
||||
export type ImagePropsBase = Readonly<{
|
||||
...Omit<
|
||||
ViewProps,
|
||||
| 'accessibilityLabel'
|
||||
| 'accessible'
|
||||
| 'aria-label'
|
||||
| 'aria-labelledby'
|
||||
| 'children'
|
||||
| 'onLayout'
|
||||
| 'style'
|
||||
| 'testID',
|
||||
>,
|
||||
...ImagePropsBaseCore,
|
||||
}>;
|
||||
|
||||
type ImagePropsCore = Readonly<{
|
||||
/**
|
||||
* Style applied to the `Image` component.
|
||||
*/
|
||||
style?: ?ImageStyleProp,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ImageBackground is deprecated and will be removed in a future release.
|
||||
* Use a `View` with an absolutely positioned `Image` instead.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
* @deprecated
|
||||
* @build-types emit-as-interface Uniwind compatibility
|
||||
*/
|
||||
export type ImageBackgroundProps = Readonly<{
|
||||
...ImageProps,
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ImageProps = Readonly<{
|
||||
...ImagePropsIOS,
|
||||
...ImagePropsAndroid,
|
||||
...ImagePropsBase,
|
||||
...ImagePropsCore,
|
||||
}>;
|
||||
|
||||
type ImageBackgroundPropsCore = Readonly<{
|
||||
children?: React.Node,
|
||||
|
||||
/**
|
||||
@@ -367,3 +375,15 @@ export type ImageBackgroundProps = Readonly<{
|
||||
*/
|
||||
imageRef?: React.RefSetter<React.ElementRef<ImageType>>,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* ImageBackground is deprecated and will be removed in a future release.
|
||||
* Use a `View` with an absolutely positioned `Image` instead.
|
||||
* @see https://reactnative.dev/docs/imagebackground
|
||||
* @deprecated
|
||||
* @build-types emit-as-interface Uniwind compatibility
|
||||
*/
|
||||
export type ImageBackgroundProps = Readonly<{
|
||||
...Omit<ImageProps, 'children' | 'style'>,
|
||||
...ImageBackgroundPropsCore,
|
||||
}>;
|
||||
+4
-2
@@ -41,8 +41,7 @@ type OrientationChangeEvent = Readonly<{
|
||||
orientation: 'portrait' | 'landscape',
|
||||
}>;
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ModalBaseProps = {
|
||||
type ModalBasePropsCore = {
|
||||
/**
|
||||
* Controls how the modal animates. `'slide'` slides in from the bottom,
|
||||
* `'fade'` fades into view, `'none'` appears without animation.
|
||||
@@ -92,6 +91,9 @@ export type ModalBaseProps = {
|
||||
modalRef?: React.RefSetter<ModalInstance>,
|
||||
};
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ModalBaseProps = ModalBasePropsCore;
|
||||
|
||||
export type ModalPropsIOS = {
|
||||
/**
|
||||
* Controls how the modal appears.
|
||||
|
||||
@@ -16,12 +16,9 @@ import type {
|
||||
____DangerouslyImpreciseStyle_Internal,
|
||||
____DangerouslyImpreciseStyleProp_Internal,
|
||||
____FontVariant_Internal,
|
||||
____ImageStyle_Internal,
|
||||
____ImageStyleProp_Internal,
|
||||
____TextStyle_Internal,
|
||||
____TextStyleProp_Internal,
|
||||
____TransformStyle_Internal,
|
||||
____ViewStyle_Internal,
|
||||
____ViewStyleProp_Internal,
|
||||
NativeColorValue,
|
||||
} from './StyleSheetTypes';
|
||||
@@ -136,8 +133,7 @@ export type TypeForStyleKey<
|
||||
* object of styles to pass to a View that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ViewStyle = ____ViewStyle_Internal;
|
||||
export type {ViewStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* This type is an object of the different possible style
|
||||
@@ -154,8 +150,7 @@ export type ViewStyle = ____ViewStyle_Internal;
|
||||
* object of styles to pass to a Text that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type TextStyle = ____TextStyle_Internal;
|
||||
export type {TextStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* This type is an object of the different possible style
|
||||
@@ -172,8 +167,7 @@ export type TextStyle = ____TextStyle_Internal;
|
||||
* object of styles to pass to an Image that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ImageStyle = ____ImageStyle_Internal;
|
||||
export type {ImageStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* WARNING: You probably shouldn't be using this type. This type is an object
|
||||
|
||||
@@ -15,12 +15,9 @@ import type {
|
||||
____DangerouslyImpreciseStyle_Internal,
|
||||
____DangerouslyImpreciseStyleProp_Internal,
|
||||
____FontVariant_Internal,
|
||||
____ImageStyle_Internal,
|
||||
____ImageStyleProp_Internal,
|
||||
____TextStyle_Internal,
|
||||
____TextStyleProp_Internal,
|
||||
____TransformStyle_Internal,
|
||||
____ViewStyle_Internal,
|
||||
____ViewStyleProp_Internal,
|
||||
NativeColorValue,
|
||||
} from './StyleSheetTypes';
|
||||
@@ -137,8 +134,7 @@ export type TypeForStyleKey<
|
||||
* object of styles to pass to a View that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ViewStyle = ____ViewStyle_Internal;
|
||||
export type {ViewStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* This type is an object of the different possible style
|
||||
@@ -155,8 +151,7 @@ export type ViewStyle = ____ViewStyle_Internal;
|
||||
* object of styles to pass to a Text that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type TextStyle = ____TextStyle_Internal;
|
||||
export type {TextStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* This type is an object of the different possible style
|
||||
@@ -173,8 +168,7 @@ export type TextStyle = ____TextStyle_Internal;
|
||||
* object of styles to pass to an Image that can't be precomputed with
|
||||
* StyleSheet.create.
|
||||
*/
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ImageStyle = ____ImageStyle_Internal;
|
||||
export type {ImageStyle} from './StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* WARNING: You probably shouldn't be using this type. This type is an object
|
||||
|
||||
@@ -910,7 +910,8 @@ export type ____ViewStyle_InternalCore = Readonly<{
|
||||
...____ViewStyle_InternalBase,
|
||||
}>;
|
||||
|
||||
export type ____ViewStyle_Internal = Readonly<{
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ViewStyle = Readonly<{
|
||||
...____ViewStyle_InternalCore,
|
||||
...____ViewStyle_InternalOverrides,
|
||||
}>;
|
||||
@@ -1047,17 +1048,18 @@ type ____TextStyle_InternalBase = Readonly<{
|
||||
}>;
|
||||
|
||||
export type ____TextStyle_InternalCore = Readonly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
...$Exact<ViewStyle>,
|
||||
...____TextStyle_InternalBase,
|
||||
}>;
|
||||
|
||||
export type ____TextStyle_Internal = Readonly<{
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type TextStyle = Readonly<{
|
||||
...____TextStyle_InternalCore,
|
||||
...____TextStyle_InternalOverrides,
|
||||
}>;
|
||||
|
||||
export type ____ImageStyle_InternalCore = Readonly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
...$Exact<ViewStyle>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
@@ -1065,13 +1067,14 @@ export type ____ImageStyle_InternalCore = Readonly<{
|
||||
overflow?: 'visible' | 'hidden',
|
||||
}>;
|
||||
|
||||
export type ____ImageStyle_Internal = Readonly<{
|
||||
/** @build-types emit-as-interface react-native-web compatibility */
|
||||
export type ImageStyle = Readonly<{
|
||||
...____ImageStyle_InternalCore,
|
||||
...____ImageStyle_InternalOverrides,
|
||||
}>;
|
||||
|
||||
export type ____DangerouslyImpreciseStyle_InternalCore = Readonly<{
|
||||
...$Exact<____TextStyle_Internal>,
|
||||
...$Exact<TextStyle>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
@@ -1095,13 +1098,13 @@ export type ____DangerouslyImpreciseAnimatedStyleProp_Internal =
|
||||
WithAnimatedValue<StyleProp<Partial<____DangerouslyImpreciseStyle_Internal>>>;
|
||||
|
||||
export type ____ViewStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____ViewStyle_Internal>>,
|
||||
Readonly<Partial<ViewStyle>>,
|
||||
>;
|
||||
export type ____TextStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____TextStyle_Internal>>,
|
||||
Readonly<Partial<TextStyle>>,
|
||||
>;
|
||||
export type ____ImageStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____ImageStyle_Internal>>,
|
||||
Readonly<Partial<ImageStyle>>,
|
||||
>;
|
||||
|
||||
export type ____Styles_Internal = {
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {____ViewStyle_Internal} from './StyleSheetTypes';
|
||||
import type {ViewStyle} from './StyleSheetTypes';
|
||||
|
||||
export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
|
||||
outer: ?____ViewStyle_Internal,
|
||||
inner: ?____ViewStyle_Internal,
|
||||
export default function splitLayoutProps(props: ?ViewStyle): {
|
||||
outer: ?ViewStyle,
|
||||
inner: ?ViewStyle,
|
||||
} {
|
||||
let outer: ?____ViewStyle_Internal = null;
|
||||
let inner: ?____ViewStyle_Internal = null;
|
||||
let outer: ?ViewStyle = null;
|
||||
let inner: ?ViewStyle = null;
|
||||
|
||||
if (props != null) {
|
||||
// $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
|
||||
|
||||
+6
-6
@@ -10,7 +10,7 @@
|
||||
|
||||
import type {HostInstance} from '../../src/private/types/HostInstance';
|
||||
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
||||
import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
|
||||
import type {TextStyle} from '../StyleSheet/StyleSheetTypes';
|
||||
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
||||
import type {NativeTextProps} from './TextNativeComponent';
|
||||
import type {PressRetentionOffset, TextProps} from './TextProps';
|
||||
@@ -186,22 +186,22 @@ const TextImpl: component(
|
||||
|
||||
let processedStyle = flattenStyle<TextStyleProp>(_style);
|
||||
if (processedStyle != null) {
|
||||
let overrides: ?{...TextStyleInternal} = null;
|
||||
let overrides: ?{...TextStyle} = null;
|
||||
if (typeof processedStyle.fontWeight === 'number') {
|
||||
overrides = overrides || ({} as {...TextStyleInternal});
|
||||
overrides = overrides || ({} as {...TextStyle});
|
||||
overrides.fontWeight =
|
||||
// $FlowFixMe[incompatible-type]
|
||||
String(processedStyle.fontWeight) as TextStyleInternal['fontWeight'];
|
||||
String(processedStyle.fontWeight) as TextStyle['fontWeight'];
|
||||
}
|
||||
|
||||
if (processedStyle.userSelect != null) {
|
||||
_selectable = userSelectToSelectableMap[processedStyle.userSelect];
|
||||
overrides = overrides || ({} as {...TextStyleInternal});
|
||||
overrides = overrides || ({} as {...TextStyle});
|
||||
overrides.userSelect = undefined;
|
||||
}
|
||||
|
||||
if (processedStyle.verticalAlign != null) {
|
||||
overrides = overrides || ({} as {...TextStyleInternal});
|
||||
overrides = overrides || ({} as {...TextStyle});
|
||||
overrides.textAlignVertical =
|
||||
verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
|
||||
overrides.verticalAlign = undefined;
|
||||
|
||||
+153
-141
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<cf6a759b9ae1a69151a61e1babd1abd3>>
|
||||
* @generated SignedSource<<5f853a6c76b0bcd1d2565b0968145e90>>
|
||||
*
|
||||
* This file was generated by scripts/js-api/build-types/index.js.
|
||||
*/
|
||||
@@ -517,7 +517,7 @@ declare type ____DangerouslyImpreciseStyle_Internal = Readonly<
|
||||
____DangerouslyImpreciseStyle_InternalOverrides
|
||||
>
|
||||
declare type ____DangerouslyImpreciseStyle_InternalCore = Readonly<
|
||||
____TextStyle_Internal & {
|
||||
TextStyle & {
|
||||
objectFit?: "contain" | "cover" | "fill" | "none" | "scale-down"
|
||||
overlayColor?: ColorValue
|
||||
resizeMode?: ImageResizeMode
|
||||
@@ -616,11 +616,8 @@ declare type ____FontWeight_Internal =
|
||||
| 700
|
||||
| 800
|
||||
| 900
|
||||
declare type ____ImageStyle_Internal = Readonly<
|
||||
____ImageStyle_InternalCore & ____ImageStyle_InternalOverrides
|
||||
>
|
||||
declare type ____ImageStyle_InternalCore = Readonly<
|
||||
Omit<____ViewStyle_Internal, "overflow"> & {
|
||||
Omit<ViewStyle, "overflow"> & {
|
||||
objectFit?: "contain" | "cover" | "fill" | "none" | "scale-down"
|
||||
overflow?: "hidden" | "visible"
|
||||
overlayColor?: ColorValue
|
||||
@@ -630,7 +627,7 @@ declare type ____ImageStyle_InternalCore = Readonly<
|
||||
>
|
||||
declare type ____ImageStyle_InternalOverrides = {}
|
||||
declare type ____ImageStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____ImageStyle_Internal>>
|
||||
Readonly<Partial<ImageStyle>>
|
||||
>
|
||||
declare type ____LayoutStyle_Internal = {
|
||||
readonly alignContent?:
|
||||
@@ -741,9 +738,6 @@ declare type ____ShadowStyle_InternalOverrides = {}
|
||||
declare type ____Styles_Internal = {
|
||||
readonly [key: string]: Partial<____DangerouslyImpreciseStyle_Internal>
|
||||
}
|
||||
declare type ____TextStyle_Internal = Readonly<
|
||||
____TextStyle_InternalCore & ____TextStyle_InternalOverrides
|
||||
>
|
||||
declare type ____TextStyle_InternalBase = {
|
||||
readonly color?: ____ColorValue_Internal
|
||||
readonly fontFamily?: string
|
||||
@@ -775,11 +769,11 @@ declare type ____TextStyle_InternalBase = {
|
||||
readonly writingDirection?: "auto" | "ltr" | "rtl"
|
||||
}
|
||||
declare type ____TextStyle_InternalCore = Readonly<
|
||||
____ViewStyle_Internal & ____TextStyle_InternalBase
|
||||
ViewStyle & ____TextStyle_InternalBase
|
||||
>
|
||||
declare type ____TextStyle_InternalOverrides = {}
|
||||
declare type ____TextStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____TextStyle_Internal>>
|
||||
Readonly<Partial<TextStyle>>
|
||||
>
|
||||
declare type ____TransformStyle_Internal = {
|
||||
readonly transform?:
|
||||
@@ -844,9 +838,6 @@ declare type ____TransformStyle_Internal = {
|
||||
readonly transformOrigin?:
|
||||
[number | string, number | string, number | string] | string
|
||||
}
|
||||
declare type ____ViewStyle_Internal = Readonly<
|
||||
____ViewStyle_InternalCore & ____ViewStyle_InternalOverrides
|
||||
>
|
||||
declare type ____ViewStyle_InternalBase = {
|
||||
readonly backfaceVisibility?: "hidden" | "visible"
|
||||
readonly backgroundColor?: ____ColorValue_Internal
|
||||
@@ -907,7 +898,7 @@ declare type ____ViewStyle_InternalCore = Readonly<
|
||||
>
|
||||
declare type ____ViewStyle_InternalOverrides = {}
|
||||
declare type ____ViewStyleProp_Internal = StyleProp<
|
||||
Readonly<Partial<____ViewStyle_Internal>>
|
||||
Readonly<Partial<ViewStyle>>
|
||||
>
|
||||
declare class _TextInputInstance extends ReactNativeElement_default {
|
||||
clear(): void
|
||||
@@ -982,8 +973,19 @@ declare type AccessibilityEventTypes =
|
||||
"click" | "focus" | "viewHoverEnter" | "windowStateChange"
|
||||
declare type AccessibilityInfo = typeof AccessibilityInfo
|
||||
declare interface AccessibilityProps extends Readonly<
|
||||
AccessibilityPropsAndroid & AccessibilityPropsIOS
|
||||
> {
|
||||
AccessibilityPropsAndroid & AccessibilityPropsIOS & AccessibilityPropsCore
|
||||
> {}
|
||||
declare type AccessibilityPropsAndroid = {
|
||||
readonly accessibilityLabelledBy?:
|
||||
(Array<string> | undefined) | (string | undefined)
|
||||
readonly accessibilityLiveRegion?: "assertive" | "none" | "polite"
|
||||
readonly "aria-labelledby"?: string
|
||||
readonly "aria-live"?: "assertive" | "off" | "polite"
|
||||
readonly importantForAccessibility?:
|
||||
"auto" | "no-hide-descendants" | "no" | "yes"
|
||||
readonly screenReaderFocusable?: boolean
|
||||
}
|
||||
declare type AccessibilityPropsCore = {
|
||||
readonly accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
|
||||
readonly accessibilityHint?: string
|
||||
readonly accessibilityLabel?: string
|
||||
@@ -1004,16 +1006,6 @@ declare interface AccessibilityProps extends Readonly<
|
||||
readonly "aria-valuetext"?: AccessibilityValue["text"]
|
||||
readonly role?: Role
|
||||
}
|
||||
declare type AccessibilityPropsAndroid = {
|
||||
readonly accessibilityLabelledBy?:
|
||||
(Array<string> | undefined) | (string | undefined)
|
||||
readonly accessibilityLiveRegion?: "assertive" | "none" | "polite"
|
||||
readonly "aria-labelledby"?: string
|
||||
readonly "aria-live"?: "assertive" | "off" | "polite"
|
||||
readonly importantForAccessibility?:
|
||||
"auto" | "no-hide-descendants" | "no" | "yes"
|
||||
readonly screenReaderFocusable?: boolean
|
||||
}
|
||||
declare type AccessibilityPropsIOS = {
|
||||
readonly accessibilityElementsHidden?: boolean
|
||||
readonly accessibilityIgnoresInvertColors?: boolean
|
||||
@@ -1104,8 +1096,9 @@ declare type ActivityIndicatorIOSProps = {
|
||||
readonly hidesWhenStopped?: boolean
|
||||
}
|
||||
declare interface ActivityIndicatorProps extends Readonly<
|
||||
ViewProps & ActivityIndicatorIOSProps
|
||||
> {
|
||||
ViewProps & ActivityIndicatorIOSProps & ActivityIndicatorPropsCore
|
||||
> {}
|
||||
declare type ActivityIndicatorPropsCore = {
|
||||
readonly animating?: boolean
|
||||
readonly color?: ColorValue
|
||||
readonly size?: IndicatorSize
|
||||
@@ -1660,7 +1653,8 @@ declare type Builtin = (
|
||||
) => Date | Error | RegExp | unknown
|
||||
declare type Button = typeof Button
|
||||
declare type ButtonInstance = React.ComponentRef<typeof NativeTouchable>
|
||||
declare interface ButtonProps {
|
||||
declare interface ButtonProps extends ButtonPropsCore {}
|
||||
declare type ButtonPropsCore = {
|
||||
readonly accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
|
||||
readonly accessibilityHint?: string
|
||||
readonly accessibilityLabel?: string
|
||||
@@ -2424,8 +2418,9 @@ declare class ImageBackground extends React.Component<ImageBackgroundProps> {
|
||||
}
|
||||
declare type ImageBackgroundInstance = ImageBackground
|
||||
declare interface ImageBackgroundProps extends Readonly<
|
||||
Omit<ImageProps, "children" | "style">
|
||||
> {
|
||||
Omit<ImageProps, "children" | "style"> & ImageBackgroundPropsCore
|
||||
> {}
|
||||
declare type ImageBackgroundPropsCore = {
|
||||
readonly children?: React.ReactNode
|
||||
readonly imageRef?: React.Ref<React.ComponentRef<ImageType>>
|
||||
readonly imageStyle?: ImageStyleProp
|
||||
@@ -2492,10 +2487,8 @@ declare type ImageProgressEventIOS = NativeSyntheticEvent<
|
||||
Readonly<ImageProgressEventDataIOS>
|
||||
>
|
||||
declare interface ImageProps extends Readonly<
|
||||
ImagePropsIOS & ImagePropsAndroid & Omit<ImagePropsBase, "style">
|
||||
> {
|
||||
readonly style?: ImageStyleProp
|
||||
}
|
||||
ImagePropsIOS & ImagePropsAndroid & ImagePropsBase & ImagePropsCore
|
||||
> {}
|
||||
declare type ImagePropsAndroid = {
|
||||
readonly fadeDuration?: number
|
||||
readonly loadingIndicatorSource?: number | Readonly<ImageURISource>
|
||||
@@ -2505,16 +2498,19 @@ declare type ImagePropsAndroid = {
|
||||
}
|
||||
declare interface ImagePropsBase extends Readonly<
|
||||
Omit<
|
||||
Omit<ViewProps, "style">,
|
||||
ViewProps,
|
||||
| "accessibilityLabel"
|
||||
| "accessible"
|
||||
| "aria-label"
|
||||
| "aria-labelledby"
|
||||
| "children"
|
||||
| "onLayout"
|
||||
| "style"
|
||||
| "testID"
|
||||
>
|
||||
> {
|
||||
> &
|
||||
ImagePropsBaseCore
|
||||
> {}
|
||||
declare type ImagePropsBaseCore = {
|
||||
readonly accessibilityLabel?: string
|
||||
readonly accessible?: boolean
|
||||
readonly alt?: string
|
||||
@@ -2548,6 +2544,9 @@ declare interface ImagePropsBase extends Readonly<
|
||||
readonly tintColor?: ColorValue
|
||||
readonly width?: number
|
||||
}
|
||||
declare type ImagePropsCore = {
|
||||
readonly style?: ImageStyleProp
|
||||
}
|
||||
declare type ImagePropsIOS = {
|
||||
readonly defaultSource?: ImageSource
|
||||
readonly onPartialLoad?: () => void
|
||||
@@ -2564,7 +2563,9 @@ declare type ImageSize = {
|
||||
declare type ImageSource =
|
||||
ImageRequireSource | ImageURISource | ReadonlyArray<ImageURISource>
|
||||
declare type ImageSourcePropType = ImageSource
|
||||
declare interface ImageStyle extends ____ImageStyle_Internal {}
|
||||
declare interface ImageStyle extends Readonly<
|
||||
____ImageStyle_InternalCore & ____ImageStyle_InternalOverrides
|
||||
> {}
|
||||
declare type ImageStyleProp = ____ImageStyleProp_Internal
|
||||
declare type ImageType = ImageAndroid | ImageIOS
|
||||
declare interface ImageURISource {
|
||||
@@ -2606,7 +2607,8 @@ declare class Info {
|
||||
}
|
||||
declare type InnerViewInstance = React.ComponentRef<typeof View>
|
||||
declare type InputAccessoryView = typeof InputAccessoryView
|
||||
declare interface InputAccessoryViewProps {
|
||||
declare interface InputAccessoryViewProps extends InputAccessoryViewPropsCore {}
|
||||
declare type InputAccessoryViewPropsCore = {
|
||||
readonly backgroundColor?: ColorValue
|
||||
readonly children: React.ReactNode
|
||||
readonly nativeID?: string
|
||||
@@ -2729,7 +2731,10 @@ declare class KeyboardAvoidingView extends React.Component<
|
||||
render(): React.ReactNode
|
||||
}
|
||||
declare type KeyboardAvoidingViewInstance = KeyboardAvoidingView
|
||||
declare interface KeyboardAvoidingViewProps extends Readonly<ViewProps> {
|
||||
declare interface KeyboardAvoidingViewProps extends Readonly<
|
||||
ViewProps & KeyboardAvoidingViewPropsCore
|
||||
> {}
|
||||
declare type KeyboardAvoidingViewPropsCore = {
|
||||
readonly behavior?: "height" | "padding" | "position"
|
||||
readonly contentContainerStyle?: ViewStyleProp
|
||||
readonly enabled?: boolean
|
||||
@@ -3007,7 +3012,8 @@ declare type Message = {
|
||||
}>
|
||||
}
|
||||
declare type Modal = typeof Modal
|
||||
declare interface ModalBaseProps {
|
||||
declare interface ModalBaseProps extends ModalBasePropsCore {}
|
||||
declare type ModalBasePropsCore = {
|
||||
animationType?: "fade" | "none" | "slide"
|
||||
backdropColor?: ColorValue
|
||||
modalRef?: React.Ref<ModalInstance>
|
||||
@@ -3667,7 +3673,8 @@ declare type PressableInstance = HostInstance
|
||||
declare interface PressableProps extends Readonly<
|
||||
Omit<ViewProps, "onMouseEnter" | "onMouseLeave"> & PressableBaseProps
|
||||
> {}
|
||||
declare interface PressableStateCallbackType {
|
||||
declare interface PressableStateCallbackType extends PressableStateCallbackTypeCore {}
|
||||
declare type PressableStateCallbackTypeCore = {
|
||||
readonly pressed: boolean
|
||||
}
|
||||
declare type PressRetentionOffset = {
|
||||
@@ -5193,7 +5200,9 @@ declare type TextPropsIOS = {
|
||||
lineBreakStrategyIOS?: "hangul-word" | "none" | "push-out" | "standard"
|
||||
suppressHighlighting?: boolean
|
||||
}
|
||||
declare interface TextStyle extends ____TextStyle_Internal {}
|
||||
declare interface TextStyle extends Readonly<
|
||||
____TextStyle_InternalCore & ____TextStyle_InternalOverrides
|
||||
> {}
|
||||
declare type TextStyleProp = ____TextStyleProp_Internal
|
||||
declare type Timespan = {
|
||||
endExtras?: Extras
|
||||
@@ -5330,37 +5339,38 @@ declare function TouchableWithoutFeedback(
|
||||
props: TouchableWithoutFeedbackProps,
|
||||
): React.ReactNode
|
||||
declare interface TouchableWithoutFeedbackProps extends Readonly<
|
||||
TouchableWithoutFeedbackPropsAndroid &
|
||||
TouchableWithoutFeedbackPropsCore &
|
||||
TouchableWithoutFeedbackPropsAndroid &
|
||||
TouchableWithoutFeedbackPropsIOS &
|
||||
AccessibilityProps
|
||||
> {
|
||||
readonly children?: React.ReactNode
|
||||
readonly delayLongPress?: number
|
||||
readonly delayPressIn?: number
|
||||
readonly delayPressOut?: number
|
||||
readonly disabled?: boolean
|
||||
readonly focusable?: boolean
|
||||
readonly hitSlop?: EdgeInsetsOrSizeProp
|
||||
readonly id?: string
|
||||
readonly importantForAccessibility?:
|
||||
"auto" | "no-hide-descendants" | "no" | "yes"
|
||||
readonly nativeID?: string
|
||||
readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown
|
||||
readonly onBlur?: (event: BlurEvent) => unknown
|
||||
readonly onFocus?: (event: FocusEvent) => unknown
|
||||
readonly onLayout?: (event: LayoutChangeEvent) => unknown
|
||||
readonly onLongPress?: (event: GestureResponderEvent) => unknown
|
||||
readonly onPress?: (event: GestureResponderEvent) => unknown
|
||||
readonly onPressIn?: (event: GestureResponderEvent) => unknown
|
||||
readonly onPressOut?: (event: GestureResponderEvent) => unknown
|
||||
readonly pressRetentionOffset?: EdgeInsetsOrSizeProp
|
||||
readonly rejectResponderTermination?: boolean
|
||||
readonly style?: ViewStyleProp
|
||||
readonly testID?: string
|
||||
}
|
||||
> {}
|
||||
declare type TouchableWithoutFeedbackPropsAndroid = {
|
||||
touchSoundDisabled?: boolean
|
||||
}
|
||||
declare type TouchableWithoutFeedbackPropsCore = {
|
||||
children?: React.ReactNode
|
||||
delayLongPress?: number
|
||||
delayPressIn?: number
|
||||
delayPressOut?: number
|
||||
disabled?: boolean
|
||||
focusable?: boolean
|
||||
hitSlop?: EdgeInsetsOrSizeProp
|
||||
id?: string
|
||||
importantForAccessibility?: "auto" | "no-hide-descendants" | "no" | "yes"
|
||||
nativeID?: string
|
||||
onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown
|
||||
onBlur?: (event: BlurEvent) => unknown
|
||||
onFocus?: (event: FocusEvent) => unknown
|
||||
onLayout?: (event: LayoutChangeEvent) => unknown
|
||||
onLongPress?: (event: GestureResponderEvent) => unknown
|
||||
onPress?: (event: GestureResponderEvent) => unknown
|
||||
onPressIn?: (event: GestureResponderEvent) => unknown
|
||||
onPressOut?: (event: GestureResponderEvent) => unknown
|
||||
pressRetentionOffset?: EdgeInsetsOrSizeProp
|
||||
rejectResponderTermination?: boolean
|
||||
style?: ViewStyleProp
|
||||
testID?: string
|
||||
}
|
||||
declare type TouchableWithoutFeedbackPropsIOS = {}
|
||||
declare type TouchEventProps = {
|
||||
readonly onTouchCancel?: (e: GestureResponderEvent) => void
|
||||
@@ -5569,7 +5579,9 @@ declare type ViewPropsAndroid = {
|
||||
declare type ViewPropsIOS = {
|
||||
readonly shouldRasterizeIOS?: boolean
|
||||
}
|
||||
declare interface ViewStyle extends ____ViewStyle_Internal {}
|
||||
declare interface ViewStyle extends Readonly<
|
||||
____ViewStyle_InternalCore & ____ViewStyle_InternalOverrides
|
||||
> {}
|
||||
declare type ViewStyleProp = ____ViewStyleProp_Internal
|
||||
declare type VirtualizedList = typeof VirtualizedList
|
||||
declare class VirtualizedList_default extends StateSafePureComponent_default<
|
||||
@@ -5741,24 +5753,24 @@ export {
|
||||
AccessibilityActionEvent, // a0d4daa0
|
||||
AccessibilityActionInfo, // db47a917
|
||||
AccessibilityInfo, // 23a3aa9b
|
||||
AccessibilityProps, // b703f8d9
|
||||
AccessibilityProps, // db9967d1
|
||||
AccessibilityRole, // f2f2e066
|
||||
AccessibilityState, // b0c2b3f7
|
||||
AccessibilityValue, // cf8bcb74
|
||||
ActionSheetIOS, // b558559e
|
||||
ActionSheetIOSOptions, // 1756eb5a
|
||||
ActivityIndicator, // 7bb76795
|
||||
ActivityIndicator, // 35880f07
|
||||
ActivityIndicatorInstance, // a82dd4e7
|
||||
ActivityIndicatorProps, // e3c81e37
|
||||
ActivityIndicatorProps, // 1f6982d0
|
||||
Alert, // a398a509
|
||||
AlertButton, // bf1a3b60
|
||||
AlertButtonStyle, // ec9fb242
|
||||
AlertOptions, // 8a116d2a
|
||||
AlertType, // 5ab91217
|
||||
AndroidKeyboardEvent, // e03becc8
|
||||
Animated, // b73ca27a
|
||||
Animated, // 09e033b6
|
||||
AppConfig, // 35c0ca70
|
||||
AppRegistry, // eb82174d
|
||||
AppRegistry, // 4edd2ed3
|
||||
AppState, // 12012be5
|
||||
AppStateEvent, // 80f034c3
|
||||
AppStateStatus, // 447e5ef2
|
||||
@@ -5770,9 +5782,9 @@ export {
|
||||
BackPressEventName, // 4620fb76
|
||||
BlurEvent, // 4ba4f941
|
||||
BoxShadowValue, // b679703f
|
||||
Button, // 1618c5dc
|
||||
ButtonInstance, // b62f6c43
|
||||
ButtonProps, // 21c5780c
|
||||
Button, // 21ca0b0c
|
||||
ButtonInstance, // 1420469f
|
||||
ButtonProps, // ac8c2275
|
||||
Clipboard, // 41addb89
|
||||
CodegenTypes, // ab4986cc
|
||||
ColorSchemeName, // 6615edd6
|
||||
@@ -5790,9 +5802,9 @@ export {
|
||||
DimensionsPayload, // 653bc26c
|
||||
DisplayMetrics, // 1dc35cef
|
||||
DisplayMetricsAndroid, // 872e62eb
|
||||
DrawerLayoutAndroid, // 10f3ab23
|
||||
DrawerLayoutAndroid, // 8afda155
|
||||
DrawerLayoutAndroidInstance, // aa243cbf
|
||||
DrawerLayoutAndroidProps, // 8144971b
|
||||
DrawerLayoutAndroidProps, // 34a48ed7
|
||||
DrawerSlideEvent, // c4ab8fba
|
||||
DropShadowValue, // e9df2606
|
||||
DynamicColorIOS, // d96c228c
|
||||
@@ -5808,9 +5820,9 @@ export {
|
||||
EventSubscription, // b8d084aa
|
||||
ExtendedExceptionData, // 5a6ccf5a
|
||||
FilterFunction, // bf24c0e3
|
||||
FlatList, // 31e4dbb8
|
||||
FlatListInstance, // e256df59
|
||||
FlatListProps, // d134a60c
|
||||
FlatList, // 6166d7cc
|
||||
FlatListInstance, // c60f0b77
|
||||
FlatListProps, // fce7aa33
|
||||
FocusEvent, // 850f1517
|
||||
FontVariant, // 7c7558bb
|
||||
GestureResponderEvent, // 14d3e77a
|
||||
@@ -5821,17 +5833,17 @@ export {
|
||||
IEventEmitter, // fbef6131
|
||||
IOSKeyboardEvent, // e67bfe3a
|
||||
IgnorePattern, // ec6f6ece
|
||||
Image, // 70beaf51
|
||||
ImageBackground, // 125f114f
|
||||
ImageBackgroundInstance, // b32a44b1
|
||||
ImageBackgroundProps, // 58c484ed
|
||||
Image, // 4993d598
|
||||
ImageBackground, // ae70e62b
|
||||
ImageBackgroundInstance, // 94ac9674
|
||||
ImageBackgroundProps, // e4415bdf
|
||||
ImageErrorEvent, // 978933f4
|
||||
ImageInstance, // 9a100753
|
||||
ImageLoadEvent, // 77f0b718
|
||||
ImageProgressEventIOS, // 445331a4
|
||||
ImageProps, // 0b057370
|
||||
ImageProps, // c2c6542a
|
||||
ImagePropsAndroid, // ee00e1d5
|
||||
ImagePropsBase, // 360c2972
|
||||
ImagePropsBase, // e8c813d3
|
||||
ImagePropsIOS, // 9e19c85d
|
||||
ImageRequireSource, // 681d683b
|
||||
ImageResizeMode, // d51106e2
|
||||
@@ -5839,19 +5851,19 @@ export {
|
||||
ImageSize, // 1c47cf88
|
||||
ImageSource, // ea31cf4a
|
||||
ImageSourcePropType, // f522e093
|
||||
ImageStyle, // 23278d38
|
||||
ImageStyle, // 85dc694a
|
||||
ImageURISource, // 443d047c
|
||||
InputAccessoryView, // 69da97d8
|
||||
InputAccessoryViewProps, // 6c4ba417
|
||||
InputAccessoryView, // ab6e2a66
|
||||
InputAccessoryViewProps, // 73685b83
|
||||
InputModeOptions, // 4e8581b9
|
||||
Insets, // e7fe432a
|
||||
KeyDownEvent, // 5b147614
|
||||
KeyEvent, // 20fa4267
|
||||
KeyUpEvent, // 57f832c5
|
||||
Keyboard, // 49414c97
|
||||
KeyboardAvoidingView, // 86ce3237
|
||||
KeyboardAvoidingViewInstance, // 39e5e0cb
|
||||
KeyboardAvoidingViewProps, // 5ea2df10
|
||||
KeyboardAvoidingView, // a4f59a6a
|
||||
KeyboardAvoidingViewInstance, // a5422c5e
|
||||
KeyboardAvoidingViewProps, // 3516e037
|
||||
KeyboardEvent, // c3f895d4
|
||||
KeyboardEventEasing, // af4091c8
|
||||
KeyboardEventName, // 59299ad6
|
||||
@@ -5876,10 +5888,10 @@ export {
|
||||
MeasureInWindowOnSuccessCallback, // a285f598
|
||||
MeasureLayoutOnSuccessCallback, // 3592502a
|
||||
MeasureOnSuccessCallback, // 82824e59
|
||||
Modal, // ddb43746
|
||||
ModalBaseProps, // c294cc46
|
||||
Modal, // d02a82e4
|
||||
ModalBaseProps, // f42d5e75
|
||||
ModalInstance, // d466ce77
|
||||
ModalProps, // a073d560
|
||||
ModalProps, // fb675cc4
|
||||
ModalPropsAndroid, // 515fb173
|
||||
ModalPropsIOS, // 664ecb7e
|
||||
ModeChangeEvent, // f64bf69d
|
||||
@@ -5915,15 +5927,15 @@ export {
|
||||
PointerEvent, // ff599afe
|
||||
PressabilityConfig, // fea539a5
|
||||
PressabilityEventHandlers, // c222648b
|
||||
Pressable, // 73cbe498
|
||||
Pressable, // 2ebf23a3
|
||||
PressableAndroidRippleConfig, // ee32eaca
|
||||
PressableInstance, // eebfe911
|
||||
PressableProps, // 573ac60a
|
||||
PressableStateCallbackType, // 5e0cfa78
|
||||
PressableProps, // d3b90ef3
|
||||
PressableStateCallbackType, // f83728cd
|
||||
ProcessedColorValue, // 33f74304
|
||||
ProgressBarAndroid, // db8f6a6b
|
||||
ProgressBarAndroid, // b8ae77e8
|
||||
ProgressBarAndroidInstance, // ab545ef1
|
||||
ProgressBarAndroidProps, // 6484d368
|
||||
ProgressBarAndroidProps, // 9b7241c1
|
||||
PublicRootInstance, // 8040afd7
|
||||
PublicTextInstance, // 6937c7bf
|
||||
PushNotificationEventName, // 84e7e150
|
||||
@@ -5931,9 +5943,9 @@ export {
|
||||
PushNotificationPermissions, // c2e7ae4f
|
||||
Rationale, // 5df1b1c1
|
||||
ReactNativeVersion, // abd76827
|
||||
RefreshControl, // 1fc5c032
|
||||
RefreshControlInstance, // 7cef228c
|
||||
RefreshControlProps, // c03c6dd3
|
||||
RefreshControl, // c4dc78df
|
||||
RefreshControlInstance, // 14c393da
|
||||
RefreshControlProps, // 76a43e28
|
||||
RefreshControlPropsAndroid, // 8ac931ca
|
||||
RefreshControlPropsIOS, // 72a36381
|
||||
Registry, // 6c39216d
|
||||
@@ -5942,27 +5954,27 @@ export {
|
||||
Role, // af7b889d
|
||||
RootTag, // 3cd10504
|
||||
RootTagContext, // 38bfc8f6
|
||||
RootViewStyleProvider, // a4547094
|
||||
RootViewStyleProvider, // eaff83cc
|
||||
Runnable, // 594dd93a
|
||||
Runnables, // 4367c557
|
||||
SafeAreaView, // 2a5620cd
|
||||
SafeAreaView, // eb3edf8f
|
||||
SafeAreaViewInstance, // 21dba39c
|
||||
ScaledSize, // 07e417c7
|
||||
ScrollEvent, // d7abdd0a
|
||||
ScrollResponderType, // 4fb54e25
|
||||
ScrollResponderType, // 28dbceda
|
||||
ScrollToLocationParamsType, // d7ecdad1
|
||||
ScrollView, // 74f481ff
|
||||
ScrollViewImperativeMethods, // 308dd401
|
||||
ScrollViewInstance, // b86e49e8
|
||||
ScrollViewProps, // 3bcd863e
|
||||
ScrollView, // d006f1d5
|
||||
ScrollViewImperativeMethods, // 6fa109b3
|
||||
ScrollViewInstance, // b3717858
|
||||
ScrollViewProps, // ba13218f
|
||||
ScrollViewPropsAndroid, // 02f3df2e
|
||||
ScrollViewPropsIOS, // 807cb4f6
|
||||
ScrollViewScrollToOptions, // 3313411e
|
||||
SectionBase, // 9f13db00
|
||||
SectionList, // f7750d02
|
||||
SectionList, // f6c8a865
|
||||
SectionListData, // 1a4de01a
|
||||
SectionListInstance, // 6f7c0fa0
|
||||
SectionListProps, // d1569771
|
||||
SectionListInstance, // 3a4f983c
|
||||
SectionListProps, // 37613df4
|
||||
SectionListRenderItem, // 715b2086
|
||||
SectionListRenderItemInfo, // 4a48a922
|
||||
Separators, // 6a45f7e3
|
||||
@@ -5979,19 +5991,19 @@ export {
|
||||
StatusBarProps, // c2a44d88
|
||||
StatusBarStyle, // 78f53eea
|
||||
StyleProp, // fa0e9b4a
|
||||
StyleSheet, // 6a67f398
|
||||
StyleSheet, // df1ba47c
|
||||
SubmitBehavior, // c4ddf490
|
||||
Switch, // cf0d6ce5
|
||||
Switch, // 7e2b771a
|
||||
SwitchChangeEvent, // 899635b1
|
||||
SwitchInstance, // 3c50eec5
|
||||
SwitchProps, // 9efb522c
|
||||
SwitchProps, // 1de46724
|
||||
Systrace, // 626d178c
|
||||
TVViewPropsIOS, // 330ce7b5
|
||||
TargetedEvent, // 16e98910
|
||||
TaskProvider, // 266dedf2
|
||||
Text, // 3ccd8020
|
||||
Text, // ac56bf90
|
||||
TextContentType, // 239b3ecc
|
||||
TextInput, // 89af456b
|
||||
TextInput, // 38d9b4cf
|
||||
TextInputAndroidProps, // 9ebbc103
|
||||
TextInputBlurEvent, // b77af40e
|
||||
TextInputChangeEvent, // f55eef98
|
||||
@@ -6001,44 +6013,44 @@ export {
|
||||
TextInputIOSProps, // fb3c9327
|
||||
TextInputInstance, // 5a0c0e0d
|
||||
TextInputKeyPressEvent, // 546c5d07
|
||||
TextInputProps, // a93c2e69
|
||||
TextInputProps, // 87d0121d
|
||||
TextInputSelectionChangeEvent, // e58f2abc
|
||||
TextInputSubmitEditingEvent, // 6bcb2aa5
|
||||
TextInstance, // 05463a96
|
||||
TextLayoutEvent, // 3f54186f
|
||||
TextProps, // 2e3336ca
|
||||
TextStyle, // d7678842
|
||||
TextProps, // 9407ed78
|
||||
TextStyle, // 898adfd1
|
||||
ToastAndroid, // 88a8969a
|
||||
TouchableHighlight, // edab1b07
|
||||
TouchableHighlight, // 2be0ef10
|
||||
TouchableHighlightInstance, // b510c0eb
|
||||
TouchableHighlightProps, // 08cd59e1
|
||||
TouchableNativeFeedback, // e2791ad5
|
||||
TouchableNativeFeedbackInstance, // ce1ad7e9
|
||||
TouchableNativeFeedbackProps, // ffc9c1d4
|
||||
TouchableOpacity, // 46c89652
|
||||
TouchableHighlightProps, // ff78d31e
|
||||
TouchableNativeFeedback, // 4797811e
|
||||
TouchableNativeFeedbackInstance, // 0e808653
|
||||
TouchableNativeFeedbackProps, // 0976e241
|
||||
TouchableOpacity, // 665f9e6a
|
||||
TouchableOpacityInstance, // b186055b
|
||||
TouchableOpacityProps, // d7c93220
|
||||
TouchableWithoutFeedback, // da544b16
|
||||
TouchableWithoutFeedbackProps, // a14626e7
|
||||
TouchableOpacityProps, // 8a5d6cb9
|
||||
TouchableWithoutFeedback, // 630a4cef
|
||||
TouchableWithoutFeedbackProps, // e8d95570
|
||||
TransformsStyle, // 65e70f18
|
||||
TurboModule, // dfe29706
|
||||
TurboModuleRegistry, // 4ace6db2
|
||||
UIManager, // afbcdf05
|
||||
UTFSequence, // ad625158
|
||||
Vibration, // 31e4bbf8
|
||||
View, // 14779d0c
|
||||
View, // 97793c47
|
||||
ViewInstance, // ffde5573
|
||||
ViewProps, // 46cb2061
|
||||
ViewProps, // 329828d7
|
||||
ViewPropsAndroid, // 55e81851
|
||||
ViewPropsIOS, // 58ee19bf
|
||||
ViewStyle, // e75eec1e
|
||||
ViewStyle, // 4e2746d6
|
||||
VirtualViewMode, // 6be59722
|
||||
VirtualizedList, // 68c7345e
|
||||
VirtualizedListInstance, // 423ee7c0
|
||||
VirtualizedListProps, // 89659fe0
|
||||
VirtualizedListProps, // dacc8843
|
||||
VirtualizedSectionList, // 9fd9cd61
|
||||
VirtualizedSectionListInstance, // 12b706d5
|
||||
VirtualizedSectionListProps, // 52c34787
|
||||
VirtualizedSectionListProps, // c9c8ed40
|
||||
WrapperComponentProvider, // 9ef54e61
|
||||
codegenNativeCommands, // 628a7c0a
|
||||
codegenNativeComponent, // 520daa94
|
||||
|
||||
Reference in new issue
Block a user