Nimrod.Writers.EnumToTypeScript.EnumToTypeScript C# (CSharp) Method

EnumToTypeScript() public method

public EnumToTypeScript ( TypeScriptType type, bool strictNullCheck ) : System
type TypeScriptType
strictNullCheck bool
return System
        public EnumToTypeScript(TypeScriptType type, bool strictNullCheck)
            : base(type, strictNullCheck)
        {
            if (!this.Type.Type.IsEnum)
            {
                throw new ArgumentException($"{this.Type.Name} is not an System.Enum.", nameof(type));
            }
            var underlyingType = Enum.GetUnderlyingType(this.Type.Type);
            if (underlyingType != typeof(int))
            {
                throw new NotSupportedException($"Unsupported underlying type for enums in typescript [{underlyingType}]. Only ints are supported.");
            }
        }
        public override IEnumerable<Type> GetImports() => new List<Type>();