//
//  ImageViewModel.swift
//  MVMCoreUI
//
//  Created by Ryan on 11/20/19.
//  Copyright © 2019 Verizon Wireless. All rights reserved.
//


@objcMembers open class ImageViewModel: MoleculeModelProtocol {
    //--------------------------------------------------
    // MARK: - Properties
    //--------------------------------------------------
    
    open class var identifier: String { "image" }
    
    public var backgroundColor: Color?
    public var moleculeName: String = ImageViewModel.identifier
    public var image: String
    public var accessibilityText: String?
    public var fallbackImage: String?
    public var imageFormat: String?
    public var width: CGFloat?
    public var height: CGFloat?
    public var contentMode: UIView.ContentMode?
    public var localBundle: Bundle?
    public var cornerRadius: CGFloat?
    public var clipsImage: Bool?
    
    //--------------------------------------------------
    // MARK: - Initializer
    //--------------------------------------------------
    
    public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) {
        self.image = image
        self.imageFormat = imageFormat
        self.width = width
        self.height = height
    }
    
    //--------------------------------------------------
    // MARK: - Keys
    //--------------------------------------------------
    
    private enum CodingKeys: String, CodingKey {
        case moleculeName
        case backgroundColor
        case image
        case accessibilityText
        case fallbackImage
        case imageFormat
        case width
        case height
        case contentMode
        case cornerRadius
        case clipsImage
    }
}
