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

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

public extension PermissionStatus {
  /**
   * Get a PermissionStatus for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "denied":
        self = .denied
      case "granted":
        self = .granted
      case "undetermined":
        self = .undetermined
      default:
        return nil
    }
  }

  /**
   * Get the String value this PermissionStatus represents.
   */
  var stringValue: String {
    switch self {
      case .denied:
        return "denied"
      case .granted:
        return "granted"
      case .undetermined:
        return "undetermined"
    }
  }
}
