react-native-tvos 0.87.1-0 → 0.87.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +2 -2
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +96 -0
- package/types_generated/Libraries/Alert/Alert.d.ts +92 -0
- package/types_generated/Libraries/Animated/Animated.d.ts +14 -0
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +30 -0
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +191 -0
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +232 -0
- package/types_generated/Libraries/Animated/AnimatedPlatformConfig.d.ts +13 -0
- package/types_generated/Libraries/Animated/Easing.d.ts +172 -0
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +35 -0
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +42 -0
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +130 -0
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +54 -0
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedImage.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +23 -0
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedText.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedView.d.ts +19 -0
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +44 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedAddition.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +80 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDiffClamp.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDivision.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +38 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedModulo.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedMultiplication.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +50 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +30 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedStyle.d.ts +32 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedSubtraction.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedTracking.d.ts +21 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValue.d.ts +126 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValueXY.d.ts +135 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedWithChildren.d.ts +15 -0
- package/types_generated/Libraries/Animated/useAnimatedColor.d.ts +16 -0
- package/types_generated/Libraries/Animated/useAnimatedValue.d.ts +15 -0
- package/types_generated/Libraries/Animated/useAnimatedValueXY.d.ts +18 -0
- package/types_generated/Libraries/AppState/AppState.d.ts +82 -0
- package/types_generated/Libraries/BatchedBridge/BatchedBridge.d.ts +17 -0
- package/types_generated/Libraries/BatchedBridge/MessageQueue.d.ts +39 -0
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +27 -0
- package/types_generated/Libraries/Blob/Blob.d.ts +80 -0
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +27 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +223 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.d.ts +20 -0
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +133 -0
- package/types_generated/Libraries/Components/Button.d.ts +167 -0
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +43 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +17 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.d.ts +27 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +157 -0
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +115 -0
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +82 -0
- package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +23 -0
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +170 -0
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +48 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +32 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +67 -0
- package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +96 -0
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +31 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +723 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewContext.d.ts +24 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +36 -0
- package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +189 -0
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +143 -0
- package/types_generated/Libraries/Components/TV/TVEventControl.d.ts +23 -0
- package/types_generated/Libraries/Components/TV/TVEventHandler.d.ts +34 -0
- package/types_generated/Libraries/Components/TV/TVFocusGuideView.d.ts +96 -0
- package/types_generated/Libraries/Components/TV/TVTextScrollView.d.ts +97 -0
- package/types_generated/Libraries/Components/TV/TVViewPropTypes.d.ts +123 -0
- package/types_generated/Libraries/Components/TV/tagForComponentOrHandle.d.ts +24 -0
- package/types_generated/Libraries/Components/TV/useTVEventHandler.d.ts +20 -0
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +37 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +162 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +1020 -0
- package/types_generated/Libraries/Components/TextInput/TextInputState.d.ts +54 -0
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +99 -0
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +62 -0
- package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +155 -0
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +47 -0
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +121 -0
- package/types_generated/Libraries/Components/View/View.d.ts +34 -0
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +426 -0
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +38 -0
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +412 -0
- package/types_generated/Libraries/Core/Devtools/symbolicateStackTrace.d.ts +27 -0
- package/types_generated/Libraries/Core/ExceptionsManager.d.ts +43 -0
- package/types_generated/Libraries/Core/ExtendedError.d.ts +26 -0
- package/types_generated/Libraries/Core/NativeExceptionsManager.d.ts +17 -0
- package/types_generated/Libraries/Core/RawEventEmitter.d.ts +26 -0
- package/types_generated/Libraries/Core/ReactFiberErrorDialog.d.ts +27 -0
- package/types_generated/Libraries/Core/ReactNativeVersion.d.ts +48 -0
- package/types_generated/Libraries/Core/registerCallableModule.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +75 -0
- package/types_generated/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +19 -0
- package/types_generated/Libraries/EventEmitter/RCTEventEmitter.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +24 -0
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +60 -0
- package/types_generated/Libraries/Image/Image.d.ts +18 -0
- package/types_generated/Libraries/Image/ImageBackground.d.ts +55 -0
- package/types_generated/Libraries/Image/ImageProps.d.ts +462 -0
- package/types_generated/Libraries/Image/ImageResizeMode.d.ts +17 -0
- package/types_generated/Libraries/Image/ImageSource.d.ts +94 -0
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +62 -0
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +234 -0
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +87 -0
- package/types_generated/Libraries/Linking/Linking.d.ts +76 -0
- package/types_generated/Libraries/Lists/FlatList.d.ts +316 -0
- package/types_generated/Libraries/Lists/SectionList.d.ts +177 -0
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +21 -0
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +21 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +78 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +71 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxSymbolication.d.ts +17 -0
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +49 -0
- package/types_generated/Libraries/LogBox/LogBox.d.ts +32 -0
- package/types_generated/Libraries/Modal/Modal.d.ts +145 -0
- package/types_generated/Libraries/NativeComponent/NativeComponentRegistry.d.ts +50 -0
- package/types_generated/Libraries/Network/FormData.d.ts +56 -0
- package/types_generated/Libraries/Network/RCTNetworking.d.ts +25 -0
- package/types_generated/Libraries/Network/RCTNetworkingEventDefinitions.flow.d.ts +22 -0
- package/types_generated/Libraries/Network/XMLHttpRequest.d.ts +114 -0
- package/types_generated/Libraries/Network/convertRequestBody.d.ts +21 -0
- package/types_generated/Libraries/Performance/Systrace.d.ts +71 -0
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +139 -0
- package/types_generated/Libraries/Pressability/Pressability.d.ts +241 -0
- package/types_generated/Libraries/Pressability/usePressability.d.ts +27 -0
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +327 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.d.ts +14 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +43 -0
- package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +120 -0
- package/types_generated/Libraries/ReactNative/DisplayMode.d.ts +24 -0
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +42 -0
- package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +57 -0
- package/types_generated/Libraries/ReactNative/NativeI18nManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/NativeUIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.d.ts +31 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.d.ts +15 -0
- package/types_generated/Libraries/ReactNative/RendererImplementation.d.ts +36 -0
- package/types_generated/Libraries/ReactNative/RendererProxy.d.ts +13 -0
- package/types_generated/Libraries/ReactNative/RootTag.d.ts +22 -0
- package/types_generated/Libraries/ReactNative/UIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/requireNativeComponent.d.ts +25 -0
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +17 -0
- package/types_generated/Libraries/Renderer/shims/ReactFabric.d.ts +17 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +155 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.d.ts +41 -0
- package/types_generated/Libraries/Settings/Settings.d.ts +21 -0
- package/types_generated/Libraries/Share/Share.d.ts +82 -0
- package/types_generated/Libraries/StyleSheet/EdgeInsetsPropType.d.ts +15 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +23 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +27 -0
- package/types_generated/Libraries/StyleSheet/PointPropType.d.ts +16 -0
- package/types_generated/Libraries/StyleSheet/Rect.d.ts +22 -0
- package/types_generated/Libraries/StyleSheet/StyleSheet.d.ts +153 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +94 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +872 -0
- package/types_generated/Libraries/StyleSheet/flattenStyle.d.ts +19 -0
- package/types_generated/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.d.ts +17 -0
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +76 -0
- package/types_generated/Libraries/StyleSheet/processColor.d.ts +18 -0
- package/types_generated/Libraries/Text/Text.d.ts +34 -0
- package/types_generated/Libraries/Text/TextAncestorContext.d.ts +20 -0
- package/types_generated/Libraries/Text/TextNativeComponent.d.ts +41 -0
- package/types_generated/Libraries/Text/TextProps.d.ts +175 -0
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +35 -0
- package/types_generated/Libraries/TurboModule/TurboModuleRegistry.d.ts +15 -0
- package/types_generated/Libraries/Types/CodegenTypes.d.ts +24 -0
- package/types_generated/Libraries/Types/CodegenTypesNamespace.d.ts +14 -0
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +361 -0
- package/types_generated/Libraries/Types/RootTagTypes.d.ts +13 -0
- package/types_generated/Libraries/Types/UIManagerJSInterface.d.ts +17 -0
- package/types_generated/Libraries/UTFSequence.d.ts +39 -0
- package/types_generated/Libraries/Utilities/Appearance.d.ts +43 -0
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +43 -0
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +41 -0
- package/types_generated/Libraries/Utilities/DeviceInfo.d.ts +17 -0
- package/types_generated/Libraries/Utilities/Dimensions.d.ts +60 -0
- package/types_generated/Libraries/Utilities/NativeAppearance.d.ts +17 -0
- package/types_generated/Libraries/Utilities/NativeDeviceInfo.d.ts +14 -0
- package/types_generated/Libraries/Utilities/PixelRatio.d.ts +113 -0
- package/types_generated/Libraries/Utilities/Platform.d.ts +20 -0
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +193 -0
- package/types_generated/Libraries/Utilities/codegenNativeCommands.d.ts +19 -0
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +24 -0
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +33 -0
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +19 -0
- package/types_generated/Libraries/Utilities/useColorScheme.d.ts +25 -0
- package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +21 -0
- package/types_generated/Libraries/Vibration/Vibration.d.ts +37 -0
- package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +39 -0
- package/types_generated/Libraries/vendor/emitter/EventEmitter.d.ts +67 -0
- package/types_generated/index.d.ts +190 -0
- package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
- package/types_generated/src/private/components/virtualcollection/FlingConstants.d.ts +20 -0
- package/types_generated/src/private/components/virtualcollection/Virtual.d.ts +46 -0
- package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +81 -0
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +23 -0
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumnGenerator.d.ts +17 -0
- package/types_generated/src/private/components/virtualcollection/dom/getScrollParent.d.ts +21 -0
- package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +23 -0
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +75 -0
- package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +107 -0
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +107 -0
- package/types_generated/src/private/devsupport/devmenu/DevMenu.d.ts +28 -0
- package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +27 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +46 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +45 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeI18nManager.d.ts +27 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +109 -0
- package/types_generated/src/private/styles/composeStyles.d.ts +19 -0
- package/types_generated/src/private/types/HostComponent.d.ts +19 -0
- package/types_generated/src/private/types/HostInstance.d.ts +57 -0
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +27 -0
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +50 -0
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +36 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +35 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +89 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +32 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +56 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +131 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +26 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/NodeInternals.d.ts +36 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.d.ts +23 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.d.ts +22 -0
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +229 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +24 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +27 -0
- package/types_generated/src/private/webapis/geometry/DOMRect.d.ts +46 -0
- package/types_generated/src/private/webapis/geometry/DOMRectReadOnly.d.ts +73 -0
- package/types_generated/src/private/webapis/utils/ArrayLikeUtils.d.ts +27 -0
- package/types_generated/src/react-private-interface.d.ts +33 -0
- package/types_generated/tsconfig.json +3 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @generated SignedSource<<c37e4c04ec1c964faaa072452e43f430>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/Image/ImageProps.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { ViewProps } from "../Components/View/ViewPropTypes";
|
|
14
|
+
import type { EdgeInsetsProp } from "../StyleSheet/EdgeInsetsPropType";
|
|
15
|
+
import type { ColorValue, ImageStyleProp, ViewStyleProp } from "../StyleSheet/StyleSheet";
|
|
16
|
+
import type { LayoutChangeEvent, NativeSyntheticEvent } from "../Types/CoreEventTypes";
|
|
17
|
+
import type { ImageResizeMode } from "./ImageResizeMode";
|
|
18
|
+
import type { ImageSource, ImageURISource } from "./ImageSource";
|
|
19
|
+
import type { ImageType } from "./ImageTypes.flow";
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
export type ImageSourcePropType = ImageSource;
|
|
22
|
+
type ImageProgressEventDataIOS = {
|
|
23
|
+
loaded: number;
|
|
24
|
+
total: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @see ImagePropsIOS.onProgress
|
|
28
|
+
*/
|
|
29
|
+
export type ImageProgressEventIOS = NativeSyntheticEvent<Readonly<ImageProgressEventDataIOS>>;
|
|
30
|
+
type ImageErrorEventData = {
|
|
31
|
+
error: string;
|
|
32
|
+
};
|
|
33
|
+
export type ImageErrorEvent = NativeSyntheticEvent<Readonly<ImageErrorEventData>>;
|
|
34
|
+
type ImageLoadEventData = {
|
|
35
|
+
source: {
|
|
36
|
+
height: number;
|
|
37
|
+
width: number;
|
|
38
|
+
uri: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ImageLoadEvent = NativeSyntheticEvent<Readonly<ImageLoadEventData>>;
|
|
42
|
+
export type ImagePropsIOS = Readonly<{
|
|
43
|
+
/**
|
|
44
|
+
* A static image to display while loading the image source.
|
|
45
|
+
*
|
|
46
|
+
* @platform ios
|
|
47
|
+
*/
|
|
48
|
+
defaultSource?: ImageSource | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Invoked when a partial load of the image is complete. Definition of what
|
|
51
|
+
* constitutes a "partial load" is loader specific though this is meant for
|
|
52
|
+
* progressive JPEG loads.
|
|
53
|
+
*
|
|
54
|
+
* @platform ios
|
|
55
|
+
*/
|
|
56
|
+
onPartialLoad?: (() => void) | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Invoked on download progress.
|
|
59
|
+
*
|
|
60
|
+
* @platform ios
|
|
61
|
+
*/
|
|
62
|
+
onProgress?: ((event: ImageProgressEventIOS) => void) | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
export type ImagePropsAndroid = Readonly<{
|
|
65
|
+
/**
|
|
66
|
+
* Resource used to render a loading indicator for the image, displayed
|
|
67
|
+
* until the image is ready to be displayed.
|
|
68
|
+
*
|
|
69
|
+
* @platform android
|
|
70
|
+
*/
|
|
71
|
+
loadingIndicatorSource?: (number | Readonly<ImageURISource>) | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* When `true`, enables progressive JPEG streaming.
|
|
74
|
+
*
|
|
75
|
+
* @default `false`
|
|
76
|
+
* @platform android
|
|
77
|
+
*/
|
|
78
|
+
progressiveRenderingEnabled?: boolean | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Duration of the fade-in animation in milliseconds.
|
|
81
|
+
*
|
|
82
|
+
* @default `300`
|
|
83
|
+
* @platform android
|
|
84
|
+
*/
|
|
85
|
+
fadeDuration?: number | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The mechanism that should be used to resize the image when the image's
|
|
88
|
+
* dimensions differ from the image view's dimensions.
|
|
89
|
+
*
|
|
90
|
+
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
|
91
|
+
*
|
|
92
|
+
* - `resize`: A software operation which changes the encoded image in memory
|
|
93
|
+
* before it gets decoded. This should be used instead of `scale` when the
|
|
94
|
+
* image is much larger than the view.
|
|
95
|
+
*
|
|
96
|
+
* - `scale`: The image gets drawn downscaled or upscaled. Compared to
|
|
97
|
+
* `resize`, `scale` is faster (usually hardware accelerated) and produces
|
|
98
|
+
* higher quality images. This should be used if the image is smaller than
|
|
99
|
+
* the view. It should also be used if the image is slightly bigger than
|
|
100
|
+
* the view.
|
|
101
|
+
*
|
|
102
|
+
* - `none`: No sampling is performed and the image is displayed in its full
|
|
103
|
+
* resolution. This should only be used in rare circumstances because it is
|
|
104
|
+
* considered unsafe as Android throws a runtime exception when trying to
|
|
105
|
+
* render images that consume too much memory.
|
|
106
|
+
*
|
|
107
|
+
* @default `'auto'`
|
|
108
|
+
* @platform android
|
|
109
|
+
*/
|
|
110
|
+
resizeMethod?: ("auto" | "resize" | "scale" | "none") | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* When `resizeMethod` is set to `resize`, the destination dimensions are
|
|
113
|
+
* multiplied by this value. The `scale` method is used to perform the
|
|
114
|
+
* remainder of the resize. This is used to produce higher quality images
|
|
115
|
+
* when resizing to small dimensions.
|
|
116
|
+
*
|
|
117
|
+
* @default `1.0`
|
|
118
|
+
* @platform android
|
|
119
|
+
*/
|
|
120
|
+
resizeMultiplier?: number | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export interface ImagePropsBase extends Readonly<Omit<Omit<ViewProps, "style">, keyof {
|
|
123
|
+
/**
|
|
124
|
+
* When `true`, indicates the image is an accessibility element.
|
|
125
|
+
*/
|
|
126
|
+
accessible?: boolean | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Internal prop to set an "Analytics Tag" that can will be set on the Image.
|
|
129
|
+
*/
|
|
130
|
+
internal_analyticTag?: string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* The text that's read by the screen reader when the user interacts with
|
|
133
|
+
* the image.
|
|
134
|
+
*/
|
|
135
|
+
accessibilityLabel?: string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Alias for `accessibilityLabel`.
|
|
138
|
+
*/
|
|
139
|
+
"aria-label"?: string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Represents the `nativeID` of the associated label. When the assistive
|
|
142
|
+
* technology focuses on the component with this prop.
|
|
143
|
+
*
|
|
144
|
+
* @platform android
|
|
145
|
+
*/
|
|
146
|
+
"aria-labelledby"?: string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Alternative text description of the image, read by the screen reader
|
|
149
|
+
* when the user interacts with it. Automatically marks the element as
|
|
150
|
+
* accessible.
|
|
151
|
+
*/
|
|
152
|
+
alt?: string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* The blur radius of the blur filter added to the image. On iOS, needs to
|
|
155
|
+
* be more than 5.
|
|
156
|
+
*/
|
|
157
|
+
blurRadius?: number | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* When the image is resized, the corners of the size specified by
|
|
160
|
+
* `capInsets` stay a fixed size, but the center content and borders of
|
|
161
|
+
* the image are stretched. This is useful for creating resizable rounded
|
|
162
|
+
* buttons, shadows, and other resizable assets.
|
|
163
|
+
*
|
|
164
|
+
* @platform ios
|
|
165
|
+
*/
|
|
166
|
+
capInsets?: EdgeInsetsProp | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* CORS mode for fetching the image resource. When unset, the image
|
|
169
|
+
* request is made without the CORS header.
|
|
170
|
+
*
|
|
171
|
+
* @default `'anonymous'`
|
|
172
|
+
*/
|
|
173
|
+
crossOrigin?: ("anonymous" | "use-credentials") | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Height of the image component.
|
|
176
|
+
*/
|
|
177
|
+
height?: number | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Width of the image component.
|
|
180
|
+
*/
|
|
181
|
+
width?: number | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Invoked on load error.
|
|
184
|
+
*/
|
|
185
|
+
onError?: ((event: ImageErrorEvent) => void) | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Invoked on mount and on layout changes.
|
|
188
|
+
*/
|
|
189
|
+
onLayout?: ((event: LayoutChangeEvent) => unknown) | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Invoked when load completes successfully.
|
|
192
|
+
*/
|
|
193
|
+
onLoad?: ((event: ImageLoadEvent) => void) | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Invoked when load either succeeds or fails.
|
|
196
|
+
*/
|
|
197
|
+
onLoadEnd?: (() => void) | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Invoked on load start.
|
|
200
|
+
*/
|
|
201
|
+
onLoadStart?: (() => void) | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* The image source (either a remote URL or a local file resource).
|
|
204
|
+
*
|
|
205
|
+
* This prop can also contain several remote URLs, specified together with
|
|
206
|
+
* their width and height and potentially with scale/other URI arguments.
|
|
207
|
+
* The native side then chooses the best URI to display based on the
|
|
208
|
+
* measured size of the image container. A `cache` property can be added to
|
|
209
|
+
* control how networked request interacts with the local cache.
|
|
210
|
+
*
|
|
211
|
+
* The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,
|
|
212
|
+
* `webp` (Android only), and `psd` (iOS only).
|
|
213
|
+
*/
|
|
214
|
+
source?: ImageSource | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Which referrer to use when fetching the image resource.
|
|
217
|
+
*
|
|
218
|
+
* @default `'strict-origin-when-cross-origin'`
|
|
219
|
+
*/
|
|
220
|
+
referrerPolicy?: ("no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url") | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Determines how to resize the image when the frame doesn't match the raw
|
|
223
|
+
* image dimensions.
|
|
224
|
+
*
|
|
225
|
+
* - `cover`: Scale the image uniformly (maintain the image's aspect ratio)
|
|
226
|
+
* so that both dimensions (width and height) of the image are equal to
|
|
227
|
+
* or larger than the corresponding dimension of the view (minus padding).
|
|
228
|
+
*
|
|
229
|
+
* - `contain`: Scale the image uniformly (maintain the image's aspect
|
|
230
|
+
* ratio) so that both dimensions (width and height) of the image are
|
|
231
|
+
* equal to or less than the corresponding dimension of the view (minus
|
|
232
|
+
* padding).
|
|
233
|
+
*
|
|
234
|
+
* - `stretch`: Scale width and height independently. This may change the
|
|
235
|
+
* aspect ratio of the source.
|
|
236
|
+
*
|
|
237
|
+
* - `repeat`: Repeat the image to cover the frame of the view. The image
|
|
238
|
+
* keeps its size and aspect ratio (iOS only).
|
|
239
|
+
*
|
|
240
|
+
* - `center`: Scale the image down so that it is completely visible, if
|
|
241
|
+
* bigger than the area of the view. The image is not scaled up.
|
|
242
|
+
*
|
|
243
|
+
* - `none`: Do not resize the image. The image is displayed at its
|
|
244
|
+
* intrinsic size.
|
|
245
|
+
*
|
|
246
|
+
* @default `'cover'`
|
|
247
|
+
*/
|
|
248
|
+
resizeMode?: ImageResizeMode | undefined;
|
|
249
|
+
testID?: string | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* Changes the color of all non-transparent pixels to the `tintColor`.
|
|
252
|
+
*/
|
|
253
|
+
tintColor?: ColorValue | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* A remote URL string for the image resource. Takes precedence over
|
|
256
|
+
* `source`.
|
|
257
|
+
*/
|
|
258
|
+
src?: string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Comma-separated list of candidate image sources with pixel density
|
|
261
|
+
* descriptors.
|
|
262
|
+
*/
|
|
263
|
+
srcSet?: string | undefined;
|
|
264
|
+
children?: never | undefined;
|
|
265
|
+
}>> {
|
|
266
|
+
/**
|
|
267
|
+
* When `true`, indicates the image is an accessibility element.
|
|
268
|
+
*/
|
|
269
|
+
readonly accessible?: boolean | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Internal prop to set an "Analytics Tag" that can will be set on the Image.
|
|
272
|
+
*/
|
|
273
|
+
readonly internal_analyticTag?: string | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* The text that's read by the screen reader when the user interacts with
|
|
276
|
+
* the image.
|
|
277
|
+
*/
|
|
278
|
+
readonly accessibilityLabel?: string | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* Alias for `accessibilityLabel`.
|
|
281
|
+
*/
|
|
282
|
+
readonly "aria-label"?: string | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* Represents the `nativeID` of the associated label. When the assistive
|
|
285
|
+
* technology focuses on the component with this prop.
|
|
286
|
+
*
|
|
287
|
+
* @platform android
|
|
288
|
+
*/
|
|
289
|
+
readonly "aria-labelledby"?: string | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Alternative text description of the image, read by the screen reader
|
|
292
|
+
* when the user interacts with it. Automatically marks the element as
|
|
293
|
+
* accessible.
|
|
294
|
+
*/
|
|
295
|
+
readonly alt?: string | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* The blur radius of the blur filter added to the image. On iOS, needs to
|
|
298
|
+
* be more than 5.
|
|
299
|
+
*/
|
|
300
|
+
readonly blurRadius?: number | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* When the image is resized, the corners of the size specified by
|
|
303
|
+
* `capInsets` stay a fixed size, but the center content and borders of
|
|
304
|
+
* the image are stretched. This is useful for creating resizable rounded
|
|
305
|
+
* buttons, shadows, and other resizable assets.
|
|
306
|
+
*
|
|
307
|
+
* @platform ios
|
|
308
|
+
*/
|
|
309
|
+
readonly capInsets?: EdgeInsetsProp | undefined;
|
|
310
|
+
/**
|
|
311
|
+
* CORS mode for fetching the image resource. When unset, the image
|
|
312
|
+
* request is made without the CORS header.
|
|
313
|
+
*
|
|
314
|
+
* @default `'anonymous'`
|
|
315
|
+
*/
|
|
316
|
+
readonly crossOrigin?: ("anonymous" | "use-credentials") | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* Height of the image component.
|
|
319
|
+
*/
|
|
320
|
+
readonly height?: number | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* Width of the image component.
|
|
323
|
+
*/
|
|
324
|
+
readonly width?: number | undefined;
|
|
325
|
+
/**
|
|
326
|
+
* Invoked on load error.
|
|
327
|
+
*/
|
|
328
|
+
readonly onError?: ((event: ImageErrorEvent) => void) | undefined;
|
|
329
|
+
/**
|
|
330
|
+
* Invoked on mount and on layout changes.
|
|
331
|
+
*/
|
|
332
|
+
readonly onLayout?: ((event: LayoutChangeEvent) => unknown) | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Invoked when load completes successfully.
|
|
335
|
+
*/
|
|
336
|
+
readonly onLoad?: ((event: ImageLoadEvent) => void) | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* Invoked when load either succeeds or fails.
|
|
339
|
+
*/
|
|
340
|
+
readonly onLoadEnd?: (() => void) | undefined;
|
|
341
|
+
/**
|
|
342
|
+
* Invoked on load start.
|
|
343
|
+
*/
|
|
344
|
+
readonly onLoadStart?: (() => void) | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* The image source (either a remote URL or a local file resource).
|
|
347
|
+
*
|
|
348
|
+
* This prop can also contain several remote URLs, specified together with
|
|
349
|
+
* their width and height and potentially with scale/other URI arguments.
|
|
350
|
+
* The native side then chooses the best URI to display based on the
|
|
351
|
+
* measured size of the image container. A `cache` property can be added to
|
|
352
|
+
* control how networked request interacts with the local cache.
|
|
353
|
+
*
|
|
354
|
+
* The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,
|
|
355
|
+
* `webp` (Android only), and `psd` (iOS only).
|
|
356
|
+
*/
|
|
357
|
+
readonly source?: ImageSource | undefined;
|
|
358
|
+
/**
|
|
359
|
+
* Which referrer to use when fetching the image resource.
|
|
360
|
+
*
|
|
361
|
+
* @default `'strict-origin-when-cross-origin'`
|
|
362
|
+
*/
|
|
363
|
+
readonly referrerPolicy?: ("no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url") | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Determines how to resize the image when the frame doesn't match the raw
|
|
366
|
+
* image dimensions.
|
|
367
|
+
*
|
|
368
|
+
* - `cover`: Scale the image uniformly (maintain the image's aspect ratio)
|
|
369
|
+
* so that both dimensions (width and height) of the image are equal to
|
|
370
|
+
* or larger than the corresponding dimension of the view (minus padding).
|
|
371
|
+
*
|
|
372
|
+
* - `contain`: Scale the image uniformly (maintain the image's aspect
|
|
373
|
+
* ratio) so that both dimensions (width and height) of the image are
|
|
374
|
+
* equal to or less than the corresponding dimension of the view (minus
|
|
375
|
+
* padding).
|
|
376
|
+
*
|
|
377
|
+
* - `stretch`: Scale width and height independently. This may change the
|
|
378
|
+
* aspect ratio of the source.
|
|
379
|
+
*
|
|
380
|
+
* - `repeat`: Repeat the image to cover the frame of the view. The image
|
|
381
|
+
* keeps its size and aspect ratio (iOS only).
|
|
382
|
+
*
|
|
383
|
+
* - `center`: Scale the image down so that it is completely visible, if
|
|
384
|
+
* bigger than the area of the view. The image is not scaled up.
|
|
385
|
+
*
|
|
386
|
+
* - `none`: Do not resize the image. The image is displayed at its
|
|
387
|
+
* intrinsic size.
|
|
388
|
+
*
|
|
389
|
+
* @default `'cover'`
|
|
390
|
+
*/
|
|
391
|
+
readonly resizeMode?: ImageResizeMode | undefined;
|
|
392
|
+
readonly testID?: string | undefined;
|
|
393
|
+
/**
|
|
394
|
+
* Changes the color of all non-transparent pixels to the `tintColor`.
|
|
395
|
+
*/
|
|
396
|
+
readonly tintColor?: ColorValue | undefined;
|
|
397
|
+
/**
|
|
398
|
+
* A remote URL string for the image resource. Takes precedence over
|
|
399
|
+
* `source`.
|
|
400
|
+
*/
|
|
401
|
+
readonly src?: string | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* Comma-separated list of candidate image sources with pixel density
|
|
404
|
+
* descriptors.
|
|
405
|
+
*/
|
|
406
|
+
readonly srcSet?: string | undefined;
|
|
407
|
+
readonly children?: never | undefined;
|
|
408
|
+
}
|
|
409
|
+
export type ImageProps = Readonly<Omit<ImagePropsIOS, keyof ImagePropsAndroid | keyof ImagePropsBase | keyof {
|
|
410
|
+
/**
|
|
411
|
+
* Style applied to the `Image` component.
|
|
412
|
+
*/
|
|
413
|
+
style?: ImageStyleProp | undefined;
|
|
414
|
+
}> & Omit<ImagePropsAndroid, keyof ImagePropsBase | keyof {
|
|
415
|
+
/**
|
|
416
|
+
* Style applied to the `Image` component.
|
|
417
|
+
*/
|
|
418
|
+
style?: ImageStyleProp | undefined;
|
|
419
|
+
}> & Omit<ImagePropsBase, keyof {
|
|
420
|
+
/**
|
|
421
|
+
* Style applied to the `Image` component.
|
|
422
|
+
*/
|
|
423
|
+
style?: ImageStyleProp | undefined;
|
|
424
|
+
}> & {
|
|
425
|
+
/**
|
|
426
|
+
* Style applied to the `Image` component.
|
|
427
|
+
*/
|
|
428
|
+
style?: ImageStyleProp | undefined;
|
|
429
|
+
}>;
|
|
430
|
+
export interface ImageBackgroundProps extends Readonly<Omit<ImageProps, keyof {
|
|
431
|
+
children?: React.ReactNode | undefined;
|
|
432
|
+
/**
|
|
433
|
+
* Style applied to the outer `View` wrapper. Accepts `ViewStyle` props
|
|
434
|
+
* rather than `ImageStyle` props.
|
|
435
|
+
*/
|
|
436
|
+
style?: ViewStyleProp | undefined;
|
|
437
|
+
/**
|
|
438
|
+
* Style applied to the inner `Image` component.
|
|
439
|
+
*/
|
|
440
|
+
imageStyle?: ImageStyleProp | undefined;
|
|
441
|
+
/**
|
|
442
|
+
* A ref setter assigned the element node of the inner `Image` component
|
|
443
|
+
* when mounted.
|
|
444
|
+
*/
|
|
445
|
+
imageRef?: React.Ref<React.ComponentRef<ImageType>> | undefined;
|
|
446
|
+
}>> {
|
|
447
|
+
readonly children?: React.ReactNode | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* Style applied to the outer `View` wrapper. Accepts `ViewStyle` props
|
|
450
|
+
* rather than `ImageStyle` props.
|
|
451
|
+
*/
|
|
452
|
+
readonly style?: ViewStyleProp | undefined;
|
|
453
|
+
/**
|
|
454
|
+
* Style applied to the inner `Image` component.
|
|
455
|
+
*/
|
|
456
|
+
readonly imageStyle?: ImageStyleProp | undefined;
|
|
457
|
+
/**
|
|
458
|
+
* A ref setter assigned the element node of the inner `Image` component
|
|
459
|
+
* when mounted.
|
|
460
|
+
*/
|
|
461
|
+
readonly imageRef?: React.Ref<React.ComponentRef<ImageType>> | undefined;
|
|
462
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @generated SignedSource<<d2a1976ea0d5cd19ca2eb0f425b0ad28>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/Image/ImageResizeMode.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ImageResizeMode defines valid values for different image resizing modes set
|
|
15
|
+
* via the `resizeMode` style property on `<Image>`.
|
|
16
|
+
*/
|
|
17
|
+
export type ImageResizeMode = "center" | "contain" | "cover" | "repeat" | "stretch" | "none";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @generated SignedSource<<0dc503edc33fdb75bdf3f12b3e173f48>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/Image/ImageSource.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This type is intentionally inexact in order to permit call sites that supply
|
|
15
|
+
* extra properties.
|
|
16
|
+
*/
|
|
17
|
+
export interface ImageURISource {
|
|
18
|
+
/**
|
|
19
|
+
* `uri` is a string representing the resource identifier for the image, which
|
|
20
|
+
* could be an http address, a local file path, or the name of a static image
|
|
21
|
+
* resource (which should be wrapped in the `require('./path/to/image.png')`
|
|
22
|
+
* function).
|
|
23
|
+
*/
|
|
24
|
+
readonly uri?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `bundle` is the iOS asset bundle which the image is included in. This
|
|
27
|
+
* will default to [NSBundle mainBundle] if not set.
|
|
28
|
+
* @platform ios
|
|
29
|
+
*/
|
|
30
|
+
readonly bundle?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* `method` is the HTTP Method to use. Defaults to GET if not specified.
|
|
33
|
+
*/
|
|
34
|
+
readonly method?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* `headers` is an object representing the HTTP headers to send along with the
|
|
37
|
+
* request for a remote image.
|
|
38
|
+
*/
|
|
39
|
+
readonly headers?: {
|
|
40
|
+
[$$Key$$: string]: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* `body` is the HTTP body to send with the request. This must be a valid
|
|
44
|
+
* UTF-8 string, and will be sent exactly as specified, with no
|
|
45
|
+
* additional encoding (e.g. URL-escaping or base64) applied.
|
|
46
|
+
*/
|
|
47
|
+
readonly body?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* `cache` determines how the requests handles potentially cached
|
|
50
|
+
* responses.
|
|
51
|
+
*
|
|
52
|
+
* - `default`: Use the native platforms default strategy. `useProtocolCachePolicy` on iOS.
|
|
53
|
+
*
|
|
54
|
+
* - `reload`: The data for the URL will be loaded from the originating source.
|
|
55
|
+
* No existing cache data should be used to satisfy a URL load request.
|
|
56
|
+
*
|
|
57
|
+
* - `force-cache`: The existing cached data will be used to satisfy the request,
|
|
58
|
+
* regardless of its age or expiration date. If there is no existing data in the cache
|
|
59
|
+
* corresponding the request, the data is loaded from the originating source.
|
|
60
|
+
*
|
|
61
|
+
* - `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of
|
|
62
|
+
* its age or expiration date. If there is no existing data in the cache corresponding
|
|
63
|
+
* to a URL load request, no attempt is made to load the data from the originating source,
|
|
64
|
+
* and the load is considered to have failed.
|
|
65
|
+
*/
|
|
66
|
+
readonly cache?: ("default" | "reload" | "force-cache" | "only-if-cached") | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* `width` and `height` can be specified if known at build time, in which case
|
|
69
|
+
* these will be used to set the default `<Image/>` component dimensions.
|
|
70
|
+
*/
|
|
71
|
+
readonly width?: number | undefined;
|
|
72
|
+
readonly height?: number | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* `scale` is used to indicate the scale factor of the image. Defaults to 1.0 if
|
|
75
|
+
* unspecified, meaning that one image pixel equates to one display point / DIP.
|
|
76
|
+
*/
|
|
77
|
+
readonly scale?: number | undefined;
|
|
78
|
+
}
|
|
79
|
+
export type ImageRequireSource = number;
|
|
80
|
+
export type ImageSource = ImageRequireSource | ImageURISource | ReadonlyArray<ImageURISource>;
|
|
81
|
+
type ImageSourceProperties = {
|
|
82
|
+
body?: string | undefined;
|
|
83
|
+
bundle?: string | undefined;
|
|
84
|
+
cache?: ("default" | "reload" | "force-cache" | "only-if-cached") | undefined;
|
|
85
|
+
headers?: {
|
|
86
|
+
[$$Key$$: string]: string;
|
|
87
|
+
} | undefined;
|
|
88
|
+
height?: number | undefined;
|
|
89
|
+
method?: string | undefined;
|
|
90
|
+
scale?: number | undefined;
|
|
91
|
+
uri?: string | undefined;
|
|
92
|
+
width?: number | undefined;
|
|
93
|
+
};
|
|
94
|
+
export declare function getImageSourceProperties(imageSource: ImageURISource): Readonly<ImageSourceProperties>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @generated SignedSource<<f7bbf6cd29a66b7256b815ff38ab71b9>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/Image/ImageTypes.flow.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { HostInstance } from "../..";
|
|
14
|
+
import type { RootTag } from "../Types/RootTagTypes";
|
|
15
|
+
import type { ResolvedAssetSource } from "./AssetSourceResolver";
|
|
16
|
+
import type { ImageProps as ImagePropsType } from "./ImageProps";
|
|
17
|
+
import type { ImageSource } from "./ImageSource";
|
|
18
|
+
import * as React from "react";
|
|
19
|
+
export type ImageInstance = HostInstance;
|
|
20
|
+
export type ImageSize = {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
export type ImageResolvedAssetSource = ResolvedAssetSource;
|
|
25
|
+
type ImageComponentStaticsIOS = Readonly<{
|
|
26
|
+
getSize(uri: string): Promise<ImageSize>;
|
|
27
|
+
getSize(uri: string, success: (width: number, height: number) => void, failure?: (error: unknown) => void): void;
|
|
28
|
+
getSizeWithHeaders(uri: string, headers: {
|
|
29
|
+
[$$Key$$: string]: string;
|
|
30
|
+
}): Promise<ImageSize>;
|
|
31
|
+
getSizeWithHeaders(uri: string, headers: {
|
|
32
|
+
[$$Key$$: string]: string;
|
|
33
|
+
}, success: (width: number, height: number) => void, failure?: (error: unknown) => void): void;
|
|
34
|
+
prefetch(url: string): Promise<boolean>;
|
|
35
|
+
prefetchWithMetadata(url: string, queryRootName: string, rootTag?: RootTag | undefined): Promise<boolean>;
|
|
36
|
+
queryCache(urls: Array<string>): Promise<{
|
|
37
|
+
[url: string]: "memory" | "disk" | "disk/memory";
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* @see https://reactnative.dev/docs/image#resolveassetsource
|
|
41
|
+
*/
|
|
42
|
+
resolveAssetSource(source: ImageSource): ImageResolvedAssetSource | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
type ImageComponentStaticsAndroid = Readonly<Omit<ImageComponentStaticsIOS, keyof {
|
|
45
|
+
abortPrefetch(requestId: number): void;
|
|
46
|
+
}> & {
|
|
47
|
+
abortPrefetch(requestId: number): void;
|
|
48
|
+
}>;
|
|
49
|
+
export type AbstractImageAndroid = (props: Omit<ImagePropsType, keyof {
|
|
50
|
+
ref?: React.Ref<HostInstance> | undefined;
|
|
51
|
+
}> & {
|
|
52
|
+
ref?: React.Ref<HostInstance> | undefined;
|
|
53
|
+
}) => React.ReactNode;
|
|
54
|
+
export type ImageAndroid = AbstractImageAndroid & ImageComponentStaticsAndroid;
|
|
55
|
+
export type AbstractImageIOS = (props: Omit<ImagePropsType, keyof {
|
|
56
|
+
ref?: React.Ref<HostInstance> | undefined;
|
|
57
|
+
}> & {
|
|
58
|
+
ref?: React.Ref<HostInstance> | undefined;
|
|
59
|
+
}) => React.ReactNode;
|
|
60
|
+
export type ImageIOS = AbstractImageIOS & ImageComponentStaticsIOS;
|
|
61
|
+
export type ImageType = ImageIOS | ImageAndroid;
|
|
62
|
+
export type { ImageProps } from "./ImageProps";
|