mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
fix: make image props extend CommonPathProps (#2007)
Since `Image` can use all the props provided by `CommonPathProps` type, we extend it with adding image-specific props. Co-authored-by: Umesh Dangrecha <umeshdangrecha240@gmail.com> Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
This commit is contained in:
+2
-16
@@ -6,25 +6,13 @@ import {
|
|||||||
stringifyPropsForFabric,
|
stringifyPropsForFabric,
|
||||||
withoutXY,
|
withoutXY,
|
||||||
} from '../lib/extract/extractProps';
|
} from '../lib/extract/extractProps';
|
||||||
import type {
|
import type { CommonPathProps, NumberProp } from '../lib/extract/types';
|
||||||
ClipProps,
|
|
||||||
CommonMaskProps,
|
|
||||||
NativeProps,
|
|
||||||
NumberProp,
|
|
||||||
ResponderProps,
|
|
||||||
TouchableProps,
|
|
||||||
} from '../lib/extract/types';
|
|
||||||
import Shape from './Shape';
|
import Shape from './Shape';
|
||||||
import RNSVGImage from '../fabric/ImageNativeComponent';
|
import RNSVGImage from '../fabric/ImageNativeComponent';
|
||||||
|
|
||||||
const spacesRegExp = /\s+/;
|
const spacesRegExp = /\s+/;
|
||||||
|
|
||||||
export interface ImageProps
|
export interface ImageProps extends CommonPathProps {
|
||||||
extends ResponderProps,
|
|
||||||
CommonMaskProps,
|
|
||||||
ClipProps,
|
|
||||||
TouchableProps,
|
|
||||||
NativeProps {
|
|
||||||
x?: NumberProp;
|
x?: NumberProp;
|
||||||
y?: NumberProp;
|
y?: NumberProp;
|
||||||
width?: NumberProp;
|
width?: NumberProp;
|
||||||
@@ -33,8 +21,6 @@ export interface ImageProps
|
|||||||
href?: RNImageProps['source'] | string;
|
href?: RNImageProps['source'] | string;
|
||||||
preserveAspectRatio?: string;
|
preserveAspectRatio?: string;
|
||||||
opacity?: NumberProp;
|
opacity?: NumberProp;
|
||||||
clipPath?: string;
|
|
||||||
id?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class SvgImage extends Shape<ImageProps> {
|
export default class SvgImage extends Shape<ImageProps> {
|
||||||
|
|||||||
Reference in New Issue
Block a user