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. ## Changelog: [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
This commit is contained in:
1 parent
ca92618211
commit
447ccd1ddb
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,
|
||||
@@ -535,16 +535,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,
|
||||
}>;
|
||||
@@ -1055,17 +1056,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,
|
||||
@@ -1073,13 +1075,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,
|
||||
@@ -1103,13 +1106,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<<de4784287f01d64940f12c9eb85e4b01>>
|
||||
* @generated SignedSource<<b9b585fcbb02d3993acbc3e73d30c3e3>>
|
||||
*
|
||||
* This file was generated by scripts/js-api/build-types/index.js.
|
||||
*/
|
||||
@@ -519,7 +519,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
|
||||
@@ -618,11 +618,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
|
||||
@@ -632,7 +629,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?:
|
||||
@@ -743,9 +740,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
|
||||
@@ -777,11 +771,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?:
|
||||
@@ -846,9 +840,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
|
||||
@@ -909,7 +900,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
|
||||
@@ -984,8 +975,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
|
||||
@@ -1006,16 +1008,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
|
||||
@@ -1106,8 +1098,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
|
||||
@@ -1662,7 +1655,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
|
||||
@@ -2425,8 +2419,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
|
||||
@@ -2493,10 +2488,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>
|
||||
@@ -2506,16 +2499,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
|
||||
@@ -2549,6 +2545,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
|
||||
@@ -2565,7 +2564,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 {
|
||||
@@ -2607,7 +2608,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
|
||||
@@ -2730,7 +2732,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
|
||||
@@ -3008,7 +3013,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>
|
||||
@@ -3668,7 +3674,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
|
||||
@@ -5583,7 +5593,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<
|
||||
@@ -5755,24 +5767,24 @@ export {
|
||||
AccessibilityActionEvent, // ca0e86fd
|
||||
AccessibilityActionInfo, // db47a917
|
||||
AccessibilityInfo, // d92c5eae
|
||||
AccessibilityProps, // b703f8d9
|
||||
AccessibilityProps, // db9967d1
|
||||
AccessibilityRole, // f2f2e066
|
||||
AccessibilityState, // b0c2b3f7
|
||||
AccessibilityValue, // cf8bcb74
|
||||
ActionSheetIOS, // b558559e
|
||||
ActionSheetIOSOptions, // 1756eb5a
|
||||
ActivityIndicator, // b277b353
|
||||
ActivityIndicator, // c26e203c
|
||||
ActivityIndicatorInstance, // 1b5e0dd5
|
||||
ActivityIndicatorProps, // 96fccd3d
|
||||
ActivityIndicatorProps, // 329be4ac
|
||||
Alert, // a398a509
|
||||
AlertButton, // bf1a3b60
|
||||
AlertButtonStyle, // ec9fb242
|
||||
AlertOptions, // 8a116d2a
|
||||
AlertType, // 5ab91217
|
||||
AndroidKeyboardEvent, // e03becc8
|
||||
Animated, // 181759d3
|
||||
Animated, // 0f1a0259
|
||||
AppConfig, // 35c0ca70
|
||||
AppRegistry, // 8ea6b37b
|
||||
AppRegistry, // edec2a30
|
||||
AppState, // 12012be5
|
||||
AppStateEvent, // 80f034c3
|
||||
AppStateStatus, // 447e5ef2
|
||||
@@ -5784,9 +5796,9 @@ export {
|
||||
BackPressEventName, // 4620fb76
|
||||
BlurEvent, // d5e68e96
|
||||
BoxShadowValue, // b679703f
|
||||
Button, // c7c9c20d
|
||||
ButtonInstance, // 1ac1695e
|
||||
ButtonProps, // 0fd1315d
|
||||
Button, // d206ac5f
|
||||
ButtonInstance, // eb97aec0
|
||||
ButtonProps, // 563c2a2f
|
||||
Clipboard, // 41addb89
|
||||
CodegenTypes, // 9067fd06
|
||||
ColorSchemeName, // 6615edd6
|
||||
@@ -5804,9 +5816,9 @@ export {
|
||||
DimensionsPayload, // 653bc26c
|
||||
DisplayMetrics, // 1dc35cef
|
||||
DisplayMetricsAndroid, // 872e62eb
|
||||
DrawerLayoutAndroid, // 2f354039
|
||||
DrawerLayoutAndroid, // cd0272d1
|
||||
DrawerLayoutAndroidInstance, // aa243cbf
|
||||
DrawerLayoutAndroidProps, // bfafa682
|
||||
DrawerLayoutAndroidProps, // 491e918a
|
||||
DrawerSlideEvent, // 38213685
|
||||
DropShadowValue, // e9df2606
|
||||
DynamicColorIOS, // d96c228c
|
||||
@@ -5822,9 +5834,9 @@ export {
|
||||
EventSubscription, // b8d084aa
|
||||
ExtendedExceptionData, // 5a6ccf5a
|
||||
FilterFunction, // bf24c0e3
|
||||
FlatList, // 8bf12d5f
|
||||
FlatListInstance, // 2c17602d
|
||||
FlatListProps, // 18c0f269
|
||||
FlatList, // 0310fdb6
|
||||
FlatListInstance, // e0fdaa52
|
||||
FlatListProps, // dc08b4b1
|
||||
FocusEvent, // f2e4363d
|
||||
FontVariant, // 7c7558bb
|
||||
GestureResponderEvent, // 5cd2a663
|
||||
@@ -5835,17 +5847,17 @@ export {
|
||||
IEventEmitter, // fbef6131
|
||||
IOSKeyboardEvent, // e67bfe3a
|
||||
IgnorePattern, // ec6f6ece
|
||||
Image, // f9f3a813
|
||||
ImageBackground, // e022e047
|
||||
ImageBackgroundInstance, // 73a121ea
|
||||
ImageBackgroundProps, // e4243adc
|
||||
Image, // a086a246
|
||||
ImageBackground, // 627f52e5
|
||||
ImageBackgroundInstance, // 867f518d
|
||||
ImageBackgroundProps, // d787f734
|
||||
ImageErrorEvent, // b6227714
|
||||
ImageInstance, // df709524
|
||||
ImageLoadEvent, // 31709c38
|
||||
ImageProgressEventIOS, // 9243d460
|
||||
ImageProps, // 3b7b8f9f
|
||||
ImageProps, // c3de80fb
|
||||
ImagePropsAndroid, // ee00e1d5
|
||||
ImagePropsBase, // ad67039c
|
||||
ImagePropsBase, // 32741b7f
|
||||
ImagePropsIOS, // 1998f91a
|
||||
ImageRequireSource, // 681d683b
|
||||
ImageResizeMode, // d51106e2
|
||||
@@ -5853,19 +5865,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, // a12d46ea
|
||||
KeyEvent, // 20fa4267
|
||||
KeyUpEvent, // 0b5d0144
|
||||
Keyboard, // 49414c97
|
||||
KeyboardAvoidingView, // b67ff677
|
||||
KeyboardAvoidingViewInstance, // 55c2ec96
|
||||
KeyboardAvoidingViewProps, // 5619c852
|
||||
KeyboardAvoidingView, // 1744521b
|
||||
KeyboardAvoidingViewInstance, // 15c3d21e
|
||||
KeyboardAvoidingViewProps, // cda19922
|
||||
KeyboardEvent, // c3f895d4
|
||||
KeyboardEventEasing, // af4091c8
|
||||
KeyboardEventName, // 59299ad6
|
||||
@@ -5890,10 +5902,10 @@ export {
|
||||
MeasureInWindowOnSuccessCallback, // a285f598
|
||||
MeasureLayoutOnSuccessCallback, // 3592502a
|
||||
MeasureOnSuccessCallback, // 82824e59
|
||||
Modal, // 04a7e37e
|
||||
ModalBaseProps, // 46299375
|
||||
Modal, // ee56dff1
|
||||
ModalBaseProps, // a6e4334f
|
||||
ModalInstance, // 0f04c1bf
|
||||
ModalProps, // 2a8d1149
|
||||
ModalProps, // 3e80b2d1
|
||||
ModalPropsAndroid, // 515fb173
|
||||
ModalPropsIOS, // a65a8f5c
|
||||
ModeChangeEvent, // ccf30dc4
|
||||
@@ -5929,15 +5941,15 @@ export {
|
||||
PointerEvent, // a506d9d7
|
||||
PressabilityConfig, // 0fd655fe
|
||||
PressabilityEventHandlers, // be359ba3
|
||||
Pressable, // b3d7b392
|
||||
Pressable, // f5c95a14
|
||||
PressableAndroidRippleConfig, // ee32eaca
|
||||
PressableInstance, // ed26f040
|
||||
PressableProps, // 106095be
|
||||
PressableStateCallbackType, // 5e0cfa78
|
||||
PressableProps, // 063d8c2f
|
||||
PressableStateCallbackType, // f83728cd
|
||||
ProcessedColorValue, // 33f74304
|
||||
ProgressBarAndroid, // 1215fada
|
||||
ProgressBarAndroid, // c807c0a6
|
||||
ProgressBarAndroidInstance, // f17242be
|
||||
ProgressBarAndroidProps, // bd874609
|
||||
ProgressBarAndroidProps, // 02bc1abf
|
||||
PublicRootInstance, // 8040afd7
|
||||
PublicTextInstance, // f9adf69a
|
||||
PushNotificationEventName, // 84e7e150
|
||||
@@ -5945,9 +5957,9 @@ export {
|
||||
PushNotificationPermissions, // c2e7ae4f
|
||||
Rationale, // 5df1b1c1
|
||||
ReactNativeVersion, // abd76827
|
||||
RefreshControl, // 8eede12e
|
||||
RefreshControlInstance, // 8ed314f0
|
||||
RefreshControlProps, // 52ce277e
|
||||
RefreshControl, // 8fe2a42d
|
||||
RefreshControlInstance, // 8aa4a6b9
|
||||
RefreshControlProps, // 8aed873e
|
||||
RefreshControlPropsAndroid, // 8ac931ca
|
||||
RefreshControlPropsIOS, // 72a36381
|
||||
Registry, // 6c39216d
|
||||
@@ -5956,27 +5968,27 @@ export {
|
||||
Role, // af7b889d
|
||||
RootTag, // 3cd10504
|
||||
RootTagContext, // 38bfc8f6
|
||||
RootViewStyleProvider, // a29fccf7
|
||||
RootViewStyleProvider, // d5909148
|
||||
Runnable, // 594dd93a
|
||||
Runnables, // 4367c557
|
||||
SafeAreaView, // f9d41d3c
|
||||
SafeAreaView, // 25729076
|
||||
SafeAreaViewInstance, // 2b5d4391
|
||||
ScaledSize, // 07e417c7
|
||||
ScrollEvent, // 956fdb27
|
||||
ScrollResponderType, // 4fd56fba
|
||||
ScrollResponderType, // 9125e854
|
||||
ScrollToLocationParamsType, // d7ecdad1
|
||||
ScrollView, // 51147fd2
|
||||
ScrollViewImperativeMethods, // 05376b0c
|
||||
ScrollViewInstance, // aa968f57
|
||||
ScrollViewProps, // 5617710e
|
||||
ScrollView, // 0b86db09
|
||||
ScrollViewImperativeMethods, // cd84ceba
|
||||
ScrollViewInstance, // 9ef84dc0
|
||||
ScrollViewProps, // b1e4c530
|
||||
ScrollViewPropsAndroid, // 02f3df2e
|
||||
ScrollViewPropsIOS, // c378379b
|
||||
ScrollViewScrollToOptions, // 3313411e
|
||||
SectionBase, // 9f13db00
|
||||
SectionList, // d0494ce2
|
||||
SectionList, // f5d7910c
|
||||
SectionListData, // 1a4de01a
|
||||
SectionListInstance, // ee88eca2
|
||||
SectionListProps, // 8c9eaa98
|
||||
SectionListInstance, // 6be3310d
|
||||
SectionListProps, // d9205401
|
||||
SectionListRenderItem, // 715b2086
|
||||
SectionListRenderItemInfo, // 4a48a922
|
||||
Separators, // 6a45f7e3
|
||||
@@ -5993,19 +6005,19 @@ export {
|
||||
StatusBarProps, // c2a44d88
|
||||
StatusBarStyle, // 78f53eea
|
||||
StyleProp, // fa0e9b4a
|
||||
StyleSheet, // 5fbab16f
|
||||
StyleSheet, // 8bb13f55
|
||||
SubmitBehavior, // c4ddf490
|
||||
Switch, // 50489cd1
|
||||
Switch, // 1f9fd5fe
|
||||
SwitchChangeEvent, // 3b472666
|
||||
SwitchInstance, // 73dce99f
|
||||
SwitchProps, // a6f8389f
|
||||
SwitchProps, // 0cf0ca94
|
||||
Systrace, // 626d178c
|
||||
TVViewPropsIOS, // 330ce7b5
|
||||
TargetedEvent, // 16e98910
|
||||
TaskProvider, // 266dedf2
|
||||
Text, // d023b11d
|
||||
Text, // 39a4d091
|
||||
TextContentType, // 239b3ecc
|
||||
TextInput, // b7d29fe7
|
||||
TextInput, // c5051f93
|
||||
TextInputAndroidProps, // 9ebbc103
|
||||
TextInputBlurEvent, // b4c7a58c
|
||||
TextInputChangeEvent, // 92363e10
|
||||
@@ -6015,46 +6027,46 @@ export {
|
||||
TextInputIOSProps, // fb3c9327
|
||||
TextInputInstance, // 53fe7b73
|
||||
TextInputKeyPressEvent, // cbbc322a
|
||||
TextInputProps, // 21d5b23c
|
||||
TextInputProps, // 98ed4f48
|
||||
TextInputSelectionChangeEvent, // 4a8f10c2
|
||||
TextInputSubmitEditingEvent, // e811fdbd
|
||||
TextInstance, // 7c7e2069
|
||||
TextLayoutEvent, // 1a21e24a
|
||||
TextProps, // c24f3189
|
||||
TextStyle, // d7678842
|
||||
TextProps, // e4fdaaad
|
||||
TextStyle, // 898adfd1
|
||||
ToastAndroid, // 88a8969a
|
||||
TouchableHighlight, // 29899b1e
|
||||
TouchableHighlight, // dfe22b5e
|
||||
TouchableHighlightInstance, // 811af7ca
|
||||
TouchableHighlightProps, // 676efc95
|
||||
TouchableNativeFeedback, // 2b44a237
|
||||
TouchableNativeFeedbackInstance, // ef9df700
|
||||
TouchableNativeFeedbackProps, // f203c5e2
|
||||
TouchableOpacity, // f7e6d799
|
||||
TouchableHighlightProps, // 5f4cfc79
|
||||
TouchableNativeFeedback, // 5f193fd5
|
||||
TouchableNativeFeedbackInstance, // 373fa09b
|
||||
TouchableNativeFeedbackProps, // 0b5f505c
|
||||
TouchableOpacity, // 23a4c4d8
|
||||
TouchableOpacityInstance, // 0cd8a347
|
||||
TouchableOpacityProps, // 4d4f3eba
|
||||
TouchableWithoutFeedback, // d8af50d6
|
||||
TouchableWithoutFeedbackProps, // da2851a4
|
||||
TouchableOpacityProps, // 80e07098
|
||||
TouchableWithoutFeedback, // a397bd6c
|
||||
TouchableWithoutFeedbackProps, // 9dfdc3eb
|
||||
TransformsStyle, // 65e70f18
|
||||
TurboModule, // dfe29706
|
||||
TurboModuleRegistry, // 4ace6db2
|
||||
UIManager, // 6a18fc05
|
||||
UTFSequence, // ad625158
|
||||
Vibration, // 31e4bbf8
|
||||
View, // c1c2f3b1
|
||||
View, // f2cbdff6
|
||||
ViewInstance, // 0283d2fc
|
||||
ViewProps, // f7fa56c4
|
||||
ViewProps, // 42f4a247
|
||||
ViewPropsAndroid, // 46410bb6
|
||||
ViewPropsIOS, // 58ee19bf
|
||||
ViewStyle, // e75eec1e
|
||||
ViewStyle, // 4e2746d6
|
||||
ViewabilityConfig, // eb3f7ed8
|
||||
ViewabilityConfigCallbackPair, // bdd0788c
|
||||
VirtualViewMode, // 6be59722
|
||||
VirtualizedList, // 68c7345e
|
||||
VirtualizedListInstance, // 423ee7c0
|
||||
VirtualizedListProps, // b1c5167b
|
||||
VirtualizedListProps, // 2adf5953
|
||||
VirtualizedSectionList, // 9fd9cd61
|
||||
VirtualizedSectionListInstance, // 12b706d5
|
||||
VirtualizedSectionListProps, // cc206896
|
||||
VirtualizedSectionListProps, // 6fa4cb18
|
||||
WrapperComponentProvider, // 9b4247f6
|
||||
codegenNativeCommands, // 322f3f4e
|
||||
codegenNativeComponent, // e8334853
|
||||
|
||||
Reference in new issue
Block a user