///
/// Fit.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

/**
 * Represents the JS enum `Fit`, backed by a C++ enum.
 */
public typealias Fit = margelo.nitro.rive.Fit

public extension Fit {
  /**
   * Get a Fit for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "Fill":
        self = .fill
      case "Contain":
        self = .contain
      case "Cover":
        self = .cover
      case "FitWidth":
        self = .fitwidth
      case "FitHeight":
        self = .fitheight
      case "None":
        self = .none
      case "ScaleDown":
        self = .scaledown
      case "Layout":
        self = .layout
      default:
        return nil
    }
  }

  /**
   * Get the String value this Fit represents.
   */
  var stringValue: String {
    switch self {
      case .fill:
        return "Fill"
      case .contain:
        return "Contain"
      case .cover:
        return "Cover"
      case .fitwidth:
        return "FitWidth"
      case .fitheight:
        return "FitHeight"
      case .none:
        return "None"
      case .scaledown:
        return "ScaleDown"
      case .layout:
        return "Layout"
    }
  }
}
