UNPKG

react-native-svg

Version:
67 lines (61 loc) 1.68 kB
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 { Float, Int32, WithDefault, } from 'react-native/Libraries/Types/CodegenTypes'; import type { ViewProps } from './utils'; interface SvgNodeCommonProps { name?: string; opacity?: WithDefault<Float, 1.0>; matrix?: ReadonlyArray<Float>; mask?: string; markerStart?: string; markerMid?: string; markerEnd?: string; clipPath?: string; clipRule?: WithDefault<Int32, 0>; responsible?: boolean; display?: string; pointerEvents?: string; } type ColorStruct = Readonly<{ type?: WithDefault<Int32, -1>; payload?: ColorValue; brushRef?: string; }>; interface SvgRenderableCommonProps { fill?: ColorStruct; fillOpacity?: WithDefault<Float, 1.0>; fillRule?: WithDefault<Int32, 1>; stroke?: ColorStruct; strokeOpacity?: WithDefault<Float, 1.0>; strokeWidth?: WithDefault<string, '1'>; strokeLinecap?: WithDefault<Int32, 0>; strokeLinejoin?: WithDefault<Int32, 0>; strokeDasharray?: ReadonlyArray<string>; strokeDashoffset?: Float; strokeMiterlimit?: Float; vectorEffect?: WithDefault<Int32, 0>; propList?: ReadonlyArray<string>; } interface NativeProps extends ViewProps, SvgNodeCommonProps, SvgRenderableCommonProps { x?: string; y?: string; width?: string; height?: string; src?: ImageSource | null; align?: string; meetOrSlice?: Int32; } export default codegenNativeComponent<NativeProps>('RNSVGImage', { interfaceOnly: true, });