import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; // TODO: import ImageSource from codegen types when it is available import type { ColorValue, ImageSourcePropType as ImageSource, } from 'react-native'; import type { DirectEventHandler, Float, Int32, WithDefault, } from 'react-native/Libraries/Types/CodegenTypes'; import type { ViewProps } from './utils'; import type { UnsafeMixed } from './codegenUtils'; import { NumberProp } from '../lib/extract/types'; export type ImageLoadEventData = { source: { width: Float; height: Float; uri: string; }; }; interface SvgNodeCommonProps { name?: string; opacity?: WithDefault; matrix?: ReadonlyArray; mask?: string; markerStart?: string; markerMid?: string; markerEnd?: string; clipPath?: string; clipRule?: WithDefault; responsible?: boolean; display?: string; pointerEvents?: string; } type ColorStruct = Readonly<{ type?: WithDefault; payload?: ColorValue; brushRef?: string; }>; interface SvgRenderableCommonProps { color?: ColorValue; fill?: UnsafeMixed; fillOpacity?: WithDefault; fillRule?: WithDefault; stroke?: UnsafeMixed; strokeOpacity?: WithDefault; strokeWidth?: UnsafeMixed; strokeLinecap?: WithDefault; strokeLinejoin?: WithDefault; strokeDasharray?: UnsafeMixed | NumberProp>; strokeDashoffset?: Float; strokeMiterlimit?: Float; vectorEffect?: WithDefault; propList?: ReadonlyArray; filter?: string; } interface NativeProps extends ViewProps, SvgNodeCommonProps, SvgRenderableCommonProps { x?: UnsafeMixed; y?: UnsafeMixed; width?: UnsafeMixed; height?: UnsafeMixed; src?: ImageSource | null; align?: string; meetOrSlice?: Int32; onLoad?: DirectEventHandler; } export default codegenNativeComponent('RNSVGImage', { interfaceOnly: true, });