fix(core): improve strong type src of Image (#10265)

This commit is contained in:
Juan de Dios Martínez Vallejo
2023-04-11 07:59:57 +02:00
committed by GitHub
parent 2b64e179a5
commit f54966707d
4 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import { ImageBase, stretchProperty, imageSourceProperty, tintColorProperty, srcProperty } from './image-common';
import { ImageSource } from '../../image-source';
import { ImageAsset } from '../../image-asset';
import { Color } from '../../color';
import { Trace } from '../../trace';
import { layout, queueGC } from '../../utils';
@ -190,7 +191,7 @@ export class Image extends ImageBase {
this._setNativeImage(value ? value.ios : null);
}
[srcProperty.setNative](value: any) {
[srcProperty.setNative](value: string | ImageSource | ImageAsset) {
this._createImageSourceFromSrc(value);
}
}