Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3350535
D10026.id33671.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10026.id33671.diff
View Options
diff --git a/native/media/encrypted-image.react.js b/native/media/encrypted-image.react.js
--- a/native/media/encrypted-image.react.js
+++ b/native/media/encrypted-image.react.js
@@ -10,6 +10,7 @@
import { decryptBase64, decryptMedia } from './encryption-utils.js';
import LoadableImage from './loadable-image.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type BaseProps = {
@@ -34,7 +35,7 @@
} = props;
const mediaCache = React.useContext(MediaCacheContext);
- const [source, setSource] = React.useState(null);
+ const [source, setSource] = React.useState<?ImageSource>(null);
const connection = useSelector(connectionSelector(ashoatKeyserverID));
invariant(connection, 'keyserver missing from keyserverStore');
diff --git a/native/media/loadable-image.react.js b/native/media/loadable-image.react.js
--- a/native/media/loadable-image.react.js
+++ b/native/media/loadable-image.react.js
@@ -4,9 +4,9 @@
import { Image } from 'expo-image';
import * as React from 'react';
import { View, ActivityIndicator } from 'react-native';
-import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
import { useStyles } from '../themes/colors.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type Props = {
diff --git a/native/media/remote-image.react.js b/native/media/remote-image.react.js
--- a/native/media/remote-image.react.js
+++ b/native/media/remote-image.react.js
@@ -2,7 +2,6 @@
import invariant from 'invariant';
import * as React from 'react';
-import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
import { connectionSelector } from 'lib/selectors/keyserver-selectors.js';
import { type ConnectionStatus } from 'lib/types/socket-types.js';
@@ -10,6 +9,7 @@
import LoadableImage from './loadable-image.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type BaseProps = {
diff --git a/native/types/react-native.js b/native/types/react-native.js
--- a/native/types/react-native.js
+++ b/native/types/react-native.js
@@ -2,6 +2,7 @@
import AnimatedInterpolation from 'react-native/Libraries/Animated/nodes/AnimatedInterpolation.js';
import type ReactNativeAnimatedValue from 'react-native/Libraries/Animated/nodes/AnimatedValue.js';
+import type { ImageSource } from 'react-native/Libraries/Image/ImageSource.js';
import type { ViewToken } from 'react-native/Libraries/Lists/ViewabilityHelper.js';
import type { ____ViewStyle_Internal } from 'react-native/Libraries/StyleSheet/StyleSheetTypes.js';
@@ -46,3 +47,5 @@
export type { AnimatedInterpolation };
export type ViewStyleObj = ____ViewStyle_Internal;
+
+export type { ImageSource };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 10:59 PM (19 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572132
Default Alt Text
D10026.id33671.diff (2 KB)
Attached To
Mode
D10026: [Flow202][native][skip-ci] [42/x] Move ImageSource types to native/types/react-native.js and use it to parameterize ref
Attached
Detach File
Event Timeline
Log In to Comment