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

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

public extension Alignment {
  /**
   * Get a Alignment for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "topLeft":
        self = .topleft
      case "topCenter":
        self = .topcenter
      case "topRight":
        self = .topright
      case "centerLeft":
        self = .centerleft
      case "center":
        self = .center
      case "centerRight":
        self = .centerright
      case "bottomLeft":
        self = .bottomleft
      case "bottomCenter":
        self = .bottomcenter
      case "bottomRight":
        self = .bottomright
      default:
        return nil
    }
  }

  /**
   * Get the String value this Alignment represents.
   */
  var stringValue: String {
    switch self {
      case .topleft:
        return "topLeft"
      case .topcenter:
        return "topCenter"
      case .topright:
        return "topRight"
      case .centerleft:
        return "centerLeft"
      case .center:
        return "center"
      case .centerright:
        return "centerRight"
      case .bottomleft:
        return "bottomLeft"
      case .bottomcenter:
        return "bottomCenter"
      case .bottomright:
        return "bottomRight"
    }
  }
}
