<commit_before>﻿import { Image as ImageDefinition, Stretch } from ".";
import { View, Property, InheritedCssProperty, Style, Color, isIOS, booleanConverter } from "../core/view";
import { ImageAsset } from "../../image-asset";
import { ImageSource, fromAsset, fromNativeSource, fromUrl } from "../../image-source";
import { isDataURI, isFileOrResourcePath, RESOURCE_PREFIX } from "../../utils/utils";

export * from "../core/view";
export { ImageSource, fromAsset, fromNativeSource, fromUrl, isDataURI, isFileOrResourcePath, RESOURCE_PREFIX };

export abstract class ImageBase extends View implements ImageDefinition {
    public imageSource: ImageSource;
    public src: string | ImageSource;
    public isLoading: boolean;
    public stretch: Stretch;
    public loadMode: "sync" | "async";

    get tintColor(): Color {
        return this.style.tintColor;
    }
    set tintColor(value: Color) {
        this.style.tintColor = value;
    }

    /**
     * @internal
     */
    public _createImageSourceFromSrc(): void {
        let value = this.src;
        let originalValue = value;
        let sync = this.loadMode === "sync";
        if (typeof value === "string") {
            value = value.trim();
            this.imageSource = null;
            this["_url"] = value;

            this.isLoading = true;

            let source = new ImageSource();
            let imageLoaded = () => {
                let currentValue = this.src;<commit_msg>Binding Image's src to 'res://icon' fails as bindings wrap string in String<commit_after>﻿import { Image as ImageDefinition, Stretch } from ".";
import { View, Property, InheritedCssProperty, Style, Color, isIOS, booleanConverter } from "../core/view";
import { ImageAsset } from "../../image-asset";
import { ImageSource, fromAsset, fromNativeSource, fromUrl } from "../../image-source";
import { isDataURI, isFileOrResourcePath, RESOURCE_PREFIX } from "../../utils/utils";

export * from "../core/view";
export { ImageSource, fromAsset, fromNativeSource, fromUrl, isDataURI, isFileOrResourcePath, RESOURCE_PREFIX };

export abstract class ImageBase extends View implements ImageDefinition {
    public imageSource: ImageSource;
    public src: string | ImageSource;
    public isLoading: boolean;
    public stretch: Stretch;
    public loadMode: "sync" | "async";

    get tintColor(): Color {
        return this.style.tintColor;
    }
    set tintColor(value: Color) {
        this.style.tintColor = value;
    }

    /**
     * @internal
     */
    public _createImageSourceFromSrc(): void {
        let value = this.src;
        let originalValue = value;
        let sync = this.loadMode === "sync";
        if (typeof value === "string" || value instanceof String) {
            value = value.trim();
            this.imageSource = null;
            this["_url"] = value;

            this.isLoading = true;

            let source = new ImageSource();
            let imageLoaded = () => {
                let currentValue = this.src;
{'fraction_non_alphanumeric': 0.12262579140286571, 'fraction_numerical': 0.0, 'mean_word_length': 2.7338308457711444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '812097', 'n_tokens_mistral': 824, 'n_tokens_neox': 808, 'n_words': 241}