diff --git a/packages/react-native/Libraries/Image/Image.android.js b/packages/react-native/Libraries/Image/Image.android.js index 18a1c3fa9e848d..88f3dff495803e 100644 --- a/packages/react-native/Libraries/Image/Image.android.js +++ b/packages/react-native/Libraries/Image/Image.android.js @@ -112,7 +112,7 @@ export type ImageComponentStatics = $ReadOnly<{| getSizeWithHeaders: typeof getSizeWithHeaders, prefetch: typeof prefetch, prefetchWithMetadata: typeof prefetchWithMetadata, - abortPrefetch: typeof abortPrefetch, + abortPrefetch?: typeof abortPrefetch, queryCache: typeof queryCache, resolveAssetSource: typeof resolveAssetSource, |}>; diff --git a/packages/react-native/Libraries/Image/Image.ios.js b/packages/react-native/Libraries/Image/Image.ios.js index ab1f443c633773..7493045eb6690a 100644 --- a/packages/react-native/Libraries/Image/Image.ios.js +++ b/packages/react-native/Libraries/Image/Image.ios.js @@ -91,6 +91,7 @@ export type ImageComponentStatics = $ReadOnly<{| getSizeWithHeaders: typeof getSizeWithHeaders, prefetch: typeof prefetch, prefetchWithMetadata: typeof prefetchWithMetadata, + abortPrefetch?: number => void, queryCache: typeof queryCache, resolveAssetSource: typeof resolveAssetSource, |}>; diff --git a/packages/react-native/Libraries/Network/RCTNetworking.android.js b/packages/react-native/Libraries/Network/RCTNetworking.android.js index 69458bc76cd538..f45d2e284036e3 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.android.js +++ b/packages/react-native/Libraries/Network/RCTNetworking.android.js @@ -9,6 +9,7 @@ */ import type {RequestBody} from './convertRequestBody'; +import type {NativeResponseType} from './XMLHttpRequest'; // Do not require the native RCTNetworking module directly! Use this wrapper module instead. // It will add the necessary requestId, so that you don't have to generate it yourself. @@ -54,7 +55,7 @@ class RCTNetworking extends NativeEventEmitter<$FlowFixMe> { url: string, headers: Object, data: RequestBody, - responseType: 'text' | 'base64', + responseType: NativeResponseType, incrementalUpdates: boolean, timeout: number, callback: (requestId: number) => mixed, diff --git a/packages/rn-tester/js/examples/Text/TextExample.android.js b/packages/rn-tester/js/examples/Text/TextExample.android.js index 018f1bd28b335f..a5e8966f15ca2c 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.android.js +++ b/packages/rn-tester/js/examples/Text/TextExample.android.js @@ -10,6 +10,7 @@ 'use strict'; +import type {RNTesterModule} from '../../types/RNTesterTypes'; import TextAdjustsDynamicLayoutExample from './TextAdjustsDynamicLayoutExample'; const RNTesterBlock = require('../../components/RNTesterBlock'); @@ -981,11 +982,7 @@ function TextBaseLineLayoutExample(props: {}): React.Node { ); } -exports.title = 'Text'; -exports.documentationURL = 'https://reactnative.dev/docs/text'; -exports.category = 'Basic'; -exports.description = 'Base component for rendering styled text.'; -exports.examples = [ +const examples = [ { title: 'Basic text', render: function (): React.Element { @@ -1031,3 +1028,12 @@ exports.examples = [ }, }, ]; + +module.exports = ({ + title: 'Text', + documentationURL: 'https://reactnative.dev/docs/text', + category: 'Basic', + description: 'Base component for rendering styled text.', + displayName: 'TextExample', + examples, +}: RNTesterModule); diff --git a/packages/rn-tester/js/examples/Text/TextExample.ios.js b/packages/rn-tester/js/examples/Text/TextExample.ios.js index 00e387b53c7bba..473c9411a868f7 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.ios.js +++ b/packages/rn-tester/js/examples/Text/TextExample.ios.js @@ -10,6 +10,8 @@ 'use strict'; +import type {RNTesterModule} from '../../types/RNTesterTypes'; + const React = require('react'); const TextAncestor = require('react-native/Libraries/Text/TextAncestor'); const TextInlineView = require('../../components/TextInlineView'); @@ -546,12 +548,7 @@ class TextWithCapBaseBox extends React.Component< } } -exports.title = 'Text'; -exports.documentationURL = 'https://reactnative.dev/docs/text'; -exports.category = 'Basic'; -exports.description = 'Base component for rendering styled text.'; -exports.displayName = 'TextExample'; -exports.examples = [ +const examples = [ { title: 'Wrap', render: function (): React.Node { @@ -1332,3 +1329,12 @@ exports.examples = [ }, }, ]; + +module.exports = ({ + title: 'Text', + documentationURL: 'https://reactnative.dev/docs/text', + category: 'Basic', + description: 'Base component for rendering styled text.', + displayName: 'TextExample', + examples, +}: RNTesterModule); diff --git a/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js b/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js index 45e9f8623c7bd3..5d89b2cdac838b 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js @@ -16,7 +16,10 @@ const {Text, TextInput, View, StyleSheet, Switch} = require('react-native'); const TextInputSharedExamples = require('./TextInputSharedExamples.js'); -import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; +import type { + RNTesterModule, + RNTesterModuleExample, +} from '../../types/RNTesterTypes'; class ToggleDefaultPaddingExample extends React.Component< $FlowFixMeProps, @@ -151,11 +154,7 @@ const styles = StyleSheet.create({ }, }); -exports.title = 'TextInput'; -exports.documentationURL = 'https://reactnative.dev/docs/textinput'; -exports.category = 'Basic'; -exports.description = 'Single and multi-line text inputs.'; -exports.examples = ([ +const examples: Array = [ ...TextInputSharedExamples, { title: 'Colors and text inputs', @@ -531,4 +530,13 @@ exports.examples = ([ return ; }, }, -]: Array); +]; + +module.exports = ({ + displayName: (undefined: ?string), + title: 'TextInput', + documentationURL: 'https://reactnative.dev/docs/textinput', + category: 'Basic', + description: 'Single and multi-line text inputs.', + examples, +}: RNTesterModule); diff --git a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js index bb8ce78e864f0f..ef048e100af715 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js @@ -26,7 +26,10 @@ import type {KeyboardType} from 'react-native/Libraries/Components/TextInput/Tex const TextInputSharedExamples = require('./TextInputSharedExamples.js'); -import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; +import type { + RNTesterModule, + RNTesterModuleExample, +} from '../../types/RNTesterTypes'; class WithLabel extends React.Component<$FlowFixMeProps> { render(): React.Node { @@ -322,12 +325,7 @@ const styles = StyleSheet.create({ }, }); -exports.displayName = (undefined: ?string); -exports.title = 'TextInput'; -exports.documentationURL = 'https://reactnative.dev/docs/textinput'; -exports.category = 'Basic'; -exports.description = 'Single and multi-line text inputs.'; -exports.examples = ([ +const examples: Array = [ ...TextInputSharedExamples, { title: 'Live Re-Write (ひ -> 日)', @@ -940,4 +938,13 @@ exports.examples = ([ ); }, }, -]: Array); +]; + +module.exports = ({ + displayName: (undefined: ?string), + title: 'TextInput', + documentationURL: 'https://reactnative.dev/docs/textinput', + category: 'Basic', + description: 'Single and multi-line text inputs.', + examples, +}: RNTesterModule);