import * as React from 'react'; import { Image } from 'react-native'; import { type TransitionStatus } from '../../internals/useTransitionStatus'; import type { AvatarRootState, ImageLoadingStatus } from '../root/AvatarRoot'; import type { ZestUIComponentProps } from '../../types'; /** * The image to be displayed in the avatar. * Renders an ``. * * **Diverges from the web deliberately.** Upstream preloads the image with a * detached `new Image()` and does not mount the `` until it has loaded. A * React Native `` only fetches once it is mounted, so there is nothing to * preload with — this part stays mounted from the start and reports what it is * doing through `imageLoadingStatus` on the state object. Hiding it until it has * loaded is therefore the consumer's call (and `transitionStatus` is published * for fading it in — see the animation contract). * * **Uses React Native's `Image`, which does not cache across mounts.** Remote * avatars therefore refetch whenever this part remounts. zest cannot fix that * for you: `expo-image` is a native module whose entry point runs * `initObserveIntegrationIfNeeded()` **at import time**, and `src/index.ts` * re-exports this file — so importing it here would drag expo-image into every * consumer's bundle, including one that only ever renders a `Button`, and crash * any app without expo-modules-core. Swap the element instead — the `render` * prop replaces it wholesale, and every prop below is forwarded untouched: * * ```tsx * import { Image as ExpoImage } from 'expo-image'; * * } /> * ``` * * `expo-image` spells `resizeMode` as `contentFit`; the rest of the props used * here (`source`, `onLoadStart`, `onLoad`, `onError`) carry over as-is. */ export declare function AvatarImage(componentProps: AvatarImage.Props): React.ReactElement>; export interface AvatarImageState extends AvatarRootState { /** * The transition status of the component. */ transitionStatus: TransitionStatus; } export interface AvatarImageProps extends ZestUIComponentProps { /** * Callback fired when the loading status changes. */ onLoadingStatusChange?: ((status: ImageLoadingStatus) => void) | undefined; } export declare namespace AvatarImage { type State = AvatarImageState; type Props = AvatarImageProps; } //# sourceMappingURL=AvatarImage.d.ts.map