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



/**
 * An Swift enum with associated values representing a Variant/Union type.
 * JS type: `boolean | string | number`
 */
@frozen
public enum Variant_Bool_String_Double {
  case first(Bool)
  case second(String)
  case third(Double)
}

public extension Variant_Bool_String_Double {
  func asType<T>(_ type: T.Type = T.self) -> T? {
    switch self {
      case .first(let value): return value as? T
      case .second(let value): return value as? T
      case .third(let value): return value as? T
    }
  }
  func isType<T>(_ type: T.Type = T.self) -> Bool {
    return self.asType(type) != nil
  }
}
