mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(core): type collisions with namespace (#8809)
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Image as ImageDefinition, Stretch } from '.';
|
||||
import { Image as ImageDefinition } from '.';
|
||||
import { View, CSSType } from '../core/view';
|
||||
import { booleanConverter } from '../core/view-base';
|
||||
import { Enums } from '../enums';
|
||||
import { ImageAsset } from '../../image-asset';
|
||||
import { ImageSource } from '../../image-source';
|
||||
import { isDataURI, isFontIconURI, isFileOrResourcePath, RESOURCE_PREFIX } from '../../utils';
|
||||
import { Color } from '../../color';
|
||||
import { Style } from '../styling/style';
|
||||
import { Length } from '../styling/style-properties';
|
||||
import { Length, LengthType } from '../styling/style-properties';
|
||||
import { Property, InheritedCssProperty } from '../core/properties';
|
||||
import { Trace } from '../../trace';
|
||||
|
||||
@@ -15,10 +16,10 @@ export abstract class ImageBase extends View implements ImageDefinition {
|
||||
public imageSource: ImageSource;
|
||||
public src: string | ImageSource;
|
||||
public isLoading: boolean;
|
||||
public stretch: Stretch;
|
||||
public stretch: Enums.ImageStretchType;
|
||||
public loadMode: 'sync' | 'async';
|
||||
public decodeWidth: Length;
|
||||
public decodeHeight: Length;
|
||||
public decodeWidth: LengthType;
|
||||
public decodeHeight: LengthType;
|
||||
|
||||
get tintColor(): Color {
|
||||
return this.style.tintColor;
|
||||
@@ -143,7 +144,7 @@ export const isLoadingProperty = new Property<ImageBase, boolean>({
|
||||
});
|
||||
isLoadingProperty.register(ImageBase);
|
||||
|
||||
export const stretchProperty = new Property<ImageBase, Stretch>({
|
||||
export const stretchProperty = new Property<ImageBase, Enums.ImageStretchType>({
|
||||
name: 'stretch',
|
||||
defaultValue: 'aspectFit',
|
||||
affectsLayout: global.isIOS,
|
||||
@@ -158,14 +159,14 @@ export const tintColorProperty = new InheritedCssProperty<Style, Color>({
|
||||
});
|
||||
tintColorProperty.register(Style);
|
||||
|
||||
export const decodeHeightProperty = new Property<ImageBase, Length>({
|
||||
export const decodeHeightProperty = new Property<ImageBase, LengthType>({
|
||||
name: 'decodeHeight',
|
||||
defaultValue: { value: 0, unit: 'dip' },
|
||||
valueConverter: Length.parse,
|
||||
});
|
||||
decodeHeightProperty.register(ImageBase);
|
||||
|
||||
export const decodeWidthProperty = new Property<ImageBase, Length>({
|
||||
export const decodeWidthProperty = new Property<ImageBase, LengthType>({
|
||||
name: 'decodeWidth',
|
||||
defaultValue: { value: 0, unit: 'dip' },
|
||||
valueConverter: Length.parse,
|
||||
|
||||
Reference in New Issue
Block a user