|
| 1 | +using CSharpToJavaScript.Utils; |
| 2 | + |
| 3 | +namespace CSharpToJavaScript.APIs.JS |
| 4 | +{ |
| 5 | + //https://262.ecma-international.org/14.0/#sec-number-objects |
| 6 | + [To(ToAttribute.Default)] |
| 7 | + public partial class Number : NumberPrototype |
| 8 | + { |
| 9 | + public dynamic Value { get; set; } |
| 10 | + public static implicit operator Number(double value) { return new Number { Value = value }; } |
| 11 | + public static implicit operator double(Number value) { return new Number { Value = value }; } |
| 12 | + |
| 13 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 14 | + public static NumberPrototype Prototype { get; } = new(); |
| 15 | + |
| 16 | + public const double EPSILON = 2.2204460492503130808472633361816 * 10-16; |
| 17 | + public const double MAX_SAFE_INTEGER = 9007199254740992; |
| 18 | + public const double MAX_VALUE = 1.7976931348623157 * 10308; |
| 19 | + public const double MIN_SAFE_INTEGER = -9007199254740991; |
| 20 | + public const double MIN_VALUE = 5 * 10 -324; |
| 21 | + public GlobalObject.NaN NaN = new(); |
| 22 | + public const double NEGATIVE_INFINITY = double.NegativeInfinity; |
| 23 | + public const double POSITIVE_INFINITY = double.PositiveInfinity; |
| 24 | + |
| 25 | + public Number() { } |
| 26 | + public Number(double value) { } |
| 27 | + |
| 28 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 29 | + public bool IsFinite(double number) |
| 30 | + { |
| 31 | + throw new System.NotImplementedException(); |
| 32 | + } |
| 33 | + |
| 34 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 35 | + public bool IsInteger(double number) |
| 36 | + { |
| 37 | + throw new System.NotImplementedException(); |
| 38 | + } |
| 39 | + |
| 40 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 41 | + public bool IsNaN(double number) |
| 42 | + { |
| 43 | + throw new System.NotImplementedException(); |
| 44 | + } |
| 45 | + |
| 46 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 47 | + public bool IsSafeInteger(double number) |
| 48 | + { |
| 49 | + throw new System.NotImplementedException(); |
| 50 | + } |
| 51 | + |
| 52 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 53 | + public float ParseFloat(string str) |
| 54 | + { |
| 55 | + throw new System.NotImplementedException(); |
| 56 | + } |
| 57 | + |
| 58 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 59 | + public int ParseInt(string str, dynamic radix) |
| 60 | + { |
| 61 | + throw new System.NotImplementedException(); |
| 62 | + } |
| 63 | + } |
| 64 | + [To(ToAttribute.FirstCharToLowerCase)] |
| 65 | + public class NumberPrototype |
| 66 | + { |
| 67 | + public string ToExponential(dynamic fractionDigits) |
| 68 | + { |
| 69 | + throw new System.NotImplementedException(); |
| 70 | + } |
| 71 | + public string ToFixed(dynamic fractionDigits) |
| 72 | + { |
| 73 | + throw new System.NotImplementedException(); |
| 74 | + } |
| 75 | + public string ToLocaleString(dynamic? reserved1 = null, dynamic? reserved2 = null) |
| 76 | + { |
| 77 | + throw new System.NotImplementedException(); |
| 78 | + } |
| 79 | + public string ToPrecision(dynamic precision) |
| 80 | + { |
| 81 | + throw new System.NotImplementedException(); |
| 82 | + } |
| 83 | + public string ToString(dynamic? radix = null) |
| 84 | + { |
| 85 | + throw new System.NotImplementedException(); |
| 86 | + } |
| 87 | + public float ValueOf() |
| 88 | + { |
| 89 | + throw new System.NotImplementedException(); |
| 90 | + } |
| 91 | + } |
| 92 | +} |
0 commit comments