Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/react-native/Libraries/Image/ImageInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
* @format
*/

import type {
AbstractImageAndroid,
AbstractImageIOS,
ImageType as ImageComponent,
} from './ImageTypes.flow';
import type {HostInstance} from '../..';
import type {AbstractImageAndroid, AbstractImageIOS} from './ImageTypes.flow';

import useMergeRefs from '../Utilities/useMergeRefs';
import * as React from 'react';
Expand All @@ -33,7 +30,7 @@ export function unstable_getImageComponentDecorator(): ?ImageComponentDecorator
return injectedImageComponentDecorator;
}

type ImageInstance = React.ElementRef<ImageComponent>;
type ImageInstance = HostInstance;

type ImageAttachedCallback = (
imageInstance: ImageInstance,
Expand Down
10 changes: 3 additions & 7 deletions packages/react-native/Libraries/Image/ImageTypes.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
* @format
*/

import type {HostInstance} from '../..';
import type {RootTag} from '../Types/RootTagTypes';
import type {ResolvedAssetSource} from './AssetSourceResolver';
import type {ImageProps as ImagePropsType} from './ImageProps';
import type {ImageSource} from './ImageSource';
import typeof ImageViewNativeComponent from './ImageViewNativeComponent';
import typeof TextInlineImageNativeComponent from './TextInlineImageNativeComponent';

import * as React from 'react';

Expand Down Expand Up @@ -67,17 +66,14 @@ type ImageComponentStaticsAndroid = $ReadOnly<{
}>;

export type AbstractImageAndroid = component(
ref?: React.RefSetter<
| React.ElementRef<TextInlineImageNativeComponent>
| React.ElementRef<ImageViewNativeComponent>,
>,
ref?: React.RefSetter<HostInstance>,
...props: ImagePropsType
);

export type ImageAndroid = AbstractImageAndroid & ImageComponentStaticsAndroid;

export type AbstractImageIOS = component(
ref?: React.RefSetter<React.ElementRef<ImageViewNativeComponent>>,
ref?: React.RefSetter<HostInstance>,
...props: ImagePropsType
);

Expand Down
70 changes: 8 additions & 62 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<<377660a4dc9f8c721ebcd64f759637ac>>
* @generated SignedSource<<69d6b949e011e87bf0e3b81098fed285>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down Expand Up @@ -77,7 +77,6 @@ declare const $$AnimatedView: AnimatedComponentType<
React.ComponentRef<typeof View>
>
declare const $$flattenStyle: typeof flattenStyle_default
declare const $$ImageViewNativeComponent: typeof ImageViewNativeComponent_default
declare const $$index: {
keyExtractor: typeof keyExtractor
get FillRateHelper(): FillRateHelperT
Expand All @@ -92,7 +91,6 @@ declare const $$ProgressBarAndroidNativeComponent: HostComponent<AndroidProgress
declare const $$ScrollViewContext: typeof ScrollViewContext_default
declare const $$ScrollViewNativeComponent: typeof ScrollViewNativeComponent_default
declare const $$SwitchNativeComponent: ComponentType
declare const $$TextInlineImageNativeComponent: typeof TextInlineImage_default
declare const $$ViewNativeComponent: typeof ViewNativeComponent_default
declare const absoluteFill: AbsoluteFillStyle
declare const absoluteFillObject: AbsoluteFillStyle
Expand Down Expand Up @@ -254,7 +252,6 @@ declare const I18nManager: {
swapLeftAndRightInRTL: (flipStyles: boolean) => void
}
declare const Image: ImageType
declare const ImageViewNativeComponent_default: HostComponent<ImageHostComponentProps>
declare const InputAccessoryView: typeof InputAccessoryView_default
declare const InputAccessoryView_default: React.ComponentType<InputAccessoryViewProps>
declare const InteractionManager: typeof InteractionManagerStub_default
Expand Down Expand Up @@ -465,7 +462,6 @@ declare const TextImpl_default: (
ref?: React.Ref<TextForwardRef>
},
) => React.ReactNode
declare const TextInlineImage_default: HostComponent<RCTTextInlineImageNativeProps>
declare const TextInput: TextInputType
declare const timing: typeof $$AnimatedImplementation.timing
declare const timingImpl: (
Expand Down Expand Up @@ -1013,7 +1009,6 @@ declare type $$AnimatedSectionList = typeof $$AnimatedSectionList
declare type $$AnimatedText = typeof $$AnimatedText
declare type $$AnimatedView = typeof $$AnimatedView
declare type $$flattenStyle = typeof $$flattenStyle
declare type $$ImageViewNativeComponent = typeof $$ImageViewNativeComponent
declare type $$index = typeof $$index
declare type $$NativeDeviceInfo = typeof $$NativeDeviceInfo
declare type $$NativeDialogManagerAndroid = typeof $$NativeDialogManagerAndroid
Expand All @@ -1022,8 +1017,6 @@ declare type $$ProgressBarAndroidNativeComponent =
declare type $$ScrollViewContext = typeof $$ScrollViewContext
declare type $$ScrollViewNativeComponent = typeof $$ScrollViewNativeComponent
declare type $$SwitchNativeComponent = typeof $$SwitchNativeComponent
declare type $$TextInlineImageNativeComponent =
typeof $$TextInlineImageNativeComponent
declare type $$ViewNativeComponent = typeof $$ViewNativeComponent
declare type absoluteFill = typeof absoluteFill
declare type absoluteFillObject = typeof absoluteFillObject
Expand All @@ -1036,15 +1029,12 @@ declare type AbsoluteFillStyle = {
}
declare type AbstractImageAndroid = (
props: ImageProps & {
ref?: React.Ref<
| React.ComponentRef<ImageViewNativeComponent>
| React.ComponentRef<TextInlineImageNativeComponent>
>
ref?: React.Ref<HostInstance>
},
) => React.ReactNode
declare type AbstractImageIOS = (
props: ImageProps & {
ref?: React.Ref<React.ComponentRef<ImageViewNativeComponent>>
ref?: React.Ref<HostInstance>
},
) => React.ReactNode
declare type AccessibilityActionEvent = NativeSyntheticEvent<{
Expand Down Expand Up @@ -1899,7 +1889,7 @@ declare type ContentAvailable = 1 | null | void
declare type Context = {
readonly cellKey: string | undefined
readonly horizontal: boolean | undefined
readonly getOutermostParentListRef: () => React.ComponentRef<VirtualizedListT_2>
readonly getOutermostParentListRef: () => VirtualizedList_default
readonly getScrollMetrics: () => {
contentLength: number
dOffset: number
Expand All @@ -1912,10 +1902,10 @@ declare type Context = {
}
readonly registerAsNestedChild: ($$PARAM_0$$: {
cellKey: string
ref: React.ComponentRef<VirtualizedListT_2>
ref: VirtualizedList_default
}) => void
readonly unregisterAsNestedChild: ($$PARAM_0$$: {
ref: React.ComponentRef<VirtualizedListT_2>
ref: VirtualizedList_default
}) => void
}
declare function counterEvent(eventName: EventName, value: number): void
Expand All @@ -1940,7 +1930,6 @@ declare function createPublicTextInstance(
): ReadOnlyText_default
declare type createPublicTextInstanceT = typeof createPublicTextInstance
declare type CursorValue = "auto" | "pointer"
declare type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal
declare type DataDetectorTypesType =
| "address"
| "all"
Expand Down Expand Up @@ -2594,30 +2583,6 @@ declare type ImageErrorEvent = NativeSyntheticEvent<
declare type ImageErrorEventData = {
error: string
}
declare type ImageHostComponentProps = Readonly<
ImageProps &
Omit<ViewProps, "style"> & {
defaultSource?: (ImageSource | undefined) | (string | undefined)
headers?: {
[$$Key$$: string]: string
}
loadingIndicatorSrc?: string
shouldNotifyLoadEvents?: boolean
src?:
| (
| ReadonlyArray<
| undefined
| {
readonly uri?: string
}
>
| undefined
)
| (ResolvedAssetSource | undefined)
style?: DangerouslyImpreciseStyle | ImageStyleProp
tintColor?: ColorValue
}
>
declare type ImageIOS = AbstractImageIOS & ImageComponentStaticsIOS
declare type ImageLoadEvent = NativeSyntheticEvent<Readonly<ImageLoadEventData>>
declare type ImageLoadEventData = {
Expand Down Expand Up @@ -2732,7 +2697,6 @@ declare interface ImageURISource {
readonly uri?: string
readonly width?: number
}
declare type ImageViewNativeComponent = typeof $$ImageViewNativeComponent
declare type IndeterminateProgressBarAndroidStyleAttrProp = {
indeterminate: true
styleAttr:
Expand Down Expand Up @@ -3971,21 +3935,6 @@ declare type RCTNetworkingEventDefinitions = {
]
readonly didSendNetworkData: [[number, number, number]]
}
declare type RCTTextInlineImageNativeProps = Readonly<
ViewProps & {
headers?: {
[$$Key$$: string]: string
}
resizeMode?: ImageResizeMode
src?: ReadonlyArray<
| undefined
| {
readonly uri?: string
}
>
tintColor?: ColorValue
}
>
declare class ReactNativeDocument_default extends ReadOnlyNode_default {
get childElementCount(): number
get children(): HTMLCollection_default<ReadOnlyElement_default>
Expand Down Expand Up @@ -5161,8 +5110,6 @@ declare type TextContentType =
declare type TextForwardRef = React.ComponentRef<
typeof NativeText | typeof NativeVirtualText
>
declare type TextInlineImageNativeComponent =
typeof $$TextInlineImageNativeComponent
declare type TextInput = typeof TextInput
declare type TextInputAndroidProps = {
readonly cursorColor?: ColorValue
Expand Down Expand Up @@ -5856,7 +5803,6 @@ declare type VirtualizedListProps = ScrollViewProps &
RequiredVirtualizedListProps &
OptionalVirtualizedListProps
declare type VirtualizedListT = typeof VirtualizedList_default
declare type VirtualizedListT_2 = typeof VirtualizedList_default
declare type VirtualizedListType = typeof $$index.VirtualizedList
declare type VirtualizedSectionList = typeof VirtualizedSectionList
declare type VirtualizedSectionListProps<
Expand Down Expand Up @@ -6026,8 +5972,8 @@ export {
IOSKeyboardEvent, // e67bfe3a
IgnorePattern, // ec6f6ece
Image, // 04474205
ImageBackground, // e74abb26
ImageBackgroundProps, // cadc2fba
ImageBackground, // 489b1c17
ImageBackgroundProps, // 1b209e36
ImageErrorEvent, // b7b2ae63
ImageLoadEvent, // 5baae813
ImageProgressEventIOS, // adb35052
Expand Down
11 changes: 4 additions & 7 deletions packages/virtualized-lists/Lists/VirtualizedListContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @format
*/

import typeof VirtualizedListT from './VirtualizedList';
import type VirtualizedList from './VirtualizedList';

import * as React from 'react';
import {createContext, useContext, useMemo} from 'react';
Expand All @@ -26,12 +26,9 @@ type Context = $ReadOnly<{
zoomScale: number,
},
horizontal: ?boolean,
getOutermostParentListRef: () => React.ElementRef<VirtualizedListT>,
registerAsNestedChild: ({
cellKey: string,
ref: React.ElementRef<VirtualizedListT>,
}) => void,
unregisterAsNestedChild: ({ref: React.ElementRef<VirtualizedListT>}) => void,
getOutermostParentListRef: () => VirtualizedList,
registerAsNestedChild: ({cellKey: string, ref: VirtualizedList}) => void,
unregisterAsNestedChild: ({ref: VirtualizedList}) => void,
}>;

export const VirtualizedListContext: React.Context<?Context> =
Expand Down
Loading