@typescriptify/sweph 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/package.json +6 -2
  2. package/originalCode/.eslintrc.json +0 -124
  3. package/originalCode/.gitattributes +0 -2
  4. package/originalCode/.github/FUNDING.yml +0 -5
  5. package/originalCode/.github/workflows/test.yml +0 -35
  6. package/originalCode/LICENSE +0 -840
  7. package/originalCode/README.md +0 -91
  8. package/originalCode/binding.gyp +0 -41
  9. package/originalCode/constants.js +0 -366
  10. package/originalCode/docs.gif +0 -0
  11. package/originalCode/index.d.ts +0 -5115
  12. package/originalCode/index.js +0 -7
  13. package/originalCode/index.mjs +0 -109
  14. package/originalCode/package.json +0 -55
  15. package/originalCode/src/functions/azalt.cpp +0 -39
  16. package/originalCode/src/functions/azalt_rev.cpp +0 -35
  17. package/originalCode/src/functions/calc.cpp +0 -29
  18. package/originalCode/src/functions/calc_pctr.cpp +0 -31
  19. package/originalCode/src/functions/calc_ut.cpp +0 -29
  20. package/originalCode/src/functions/close.cpp +0 -6
  21. package/originalCode/src/functions/cotrans.cpp +0 -26
  22. package/originalCode/src/functions/cotrans_sp.cpp +0 -26
  23. package/originalCode/src/functions/cs2degstr.cpp +0 -19
  24. package/originalCode/src/functions/cs2lonlatstr.cpp +0 -23
  25. package/originalCode/src/functions/cs2timestr.cpp +0 -23
  26. package/originalCode/src/functions/csnorm.cpp +0 -15
  27. package/originalCode/src/functions/csroundsec.cpp +0 -15
  28. package/originalCode/src/functions/d2l.cpp +0 -15
  29. package/originalCode/src/functions/date_conversion.cpp +0 -30
  30. package/originalCode/src/functions/day_of_week.cpp +0 -15
  31. package/originalCode/src/functions/degnorm.cpp +0 -15
  32. package/originalCode/src/functions/deltat.cpp +0 -15
  33. package/originalCode/src/functions/deltat_ex.cpp +0 -24
  34. package/originalCode/src/functions/difcs2n.cpp +0 -19
  35. package/originalCode/src/functions/difcsn.cpp +0 -19
  36. package/originalCode/src/functions/difdeg2n.cpp +0 -19
  37. package/originalCode/src/functions/difdegn.cpp +0 -19
  38. package/originalCode/src/functions/fixstar.cpp +0 -32
  39. package/originalCode/src/functions/fixstar2.cpp +0 -32
  40. package/originalCode/src/functions/fixstar2_mag.cpp +0 -28
  41. package/originalCode/src/functions/fixstar2_ut.cpp +0 -32
  42. package/originalCode/src/functions/fixstar_mag.cpp +0 -28
  43. package/originalCode/src/functions/fixstar_ut.cpp +0 -32
  44. package/originalCode/src/functions/gauquelin_sector.cpp +0 -44
  45. package/originalCode/src/functions/get_ayanamsa.cpp +0 -15
  46. package/originalCode/src/functions/get_ayanamsa_ex.cpp +0 -27
  47. package/originalCode/src/functions/get_ayanamsa_ex_ut.cpp +0 -27
  48. package/originalCode/src/functions/get_ayanamsa_name.cpp +0 -19
  49. package/originalCode/src/functions/get_ayanamsa_ut.cpp +0 -15
  50. package/originalCode/src/functions/get_current_file_data.cpp +0 -28
  51. package/originalCode/src/functions/get_library_path.cpp +0 -8
  52. package/originalCode/src/functions/get_orbital_elements.cpp +0 -29
  53. package/originalCode/src/functions/get_planet_name.cpp +0 -19
  54. package/originalCode/src/functions/get_tid_acc.cpp +0 -7
  55. package/originalCode/src/functions/heliacal_pheno_ut.cpp +0 -52
  56. package/originalCode/src/functions/heliacal_ut.cpp +0 -52
  57. package/originalCode/src/functions/helio_cross.cpp +0 -33
  58. package/originalCode/src/functions/helio_cross_ut.cpp +0 -33
  59. package/originalCode/src/functions/house_name.cpp +0 -20
  60. package/originalCode/src/functions/house_pos.cpp +0 -36
  61. package/originalCode/src/functions/houses.cpp +0 -35
  62. package/originalCode/src/functions/houses_armc.cpp +0 -38
  63. package/originalCode/src/functions/houses_armc_ex2.cpp +0 -47
  64. package/originalCode/src/functions/houses_ex.cpp +0 -37
  65. package/originalCode/src/functions/houses_ex2.cpp +0 -46
  66. package/originalCode/src/functions/jdet_to_utc.cpp +0 -38
  67. package/originalCode/src/functions/jdut1_to_utc.cpp +0 -38
  68. package/originalCode/src/functions/julday.cpp +0 -25
  69. package/originalCode/src/functions/lat_to_lmt.cpp +0 -27
  70. package/originalCode/src/functions/lmt_to_lat.cpp +0 -27
  71. package/originalCode/src/functions/lun_eclipse_how.cpp +0 -34
  72. package/originalCode/src/functions/lun_eclipse_when.cpp +0 -31
  73. package/originalCode/src/functions/lun_eclipse_when_loc.cpp +0 -39
  74. package/originalCode/src/functions/lun_occult_when_glob.cpp +0 -35
  75. package/originalCode/src/functions/lun_occult_when_loc.cpp +0 -43
  76. package/originalCode/src/functions/lun_occult_where.cpp +0 -34
  77. package/originalCode/src/functions/mooncross.cpp +0 -26
  78. package/originalCode/src/functions/mooncross_node.cpp +0 -30
  79. package/originalCode/src/functions/mooncross_node_ut.cpp +0 -30
  80. package/originalCode/src/functions/mooncross_ut.cpp +0 -26
  81. package/originalCode/src/functions/nod_aps.cpp +0 -42
  82. package/originalCode/src/functions/nod_aps_ut.cpp +0 -42
  83. package/originalCode/src/functions/orbit_max_min_true_distance.cpp +0 -37
  84. package/originalCode/src/functions/pheno.cpp +0 -29
  85. package/originalCode/src/functions/pheno_ut.cpp +0 -29
  86. package/originalCode/src/functions/radnorm.cpp +0 -15
  87. package/originalCode/src/functions/refrac.cpp +0 -23
  88. package/originalCode/src/functions/refrac_extended.cpp +0 -32
  89. package/originalCode/src/functions/revjul.cpp +0 -33
  90. package/originalCode/src/functions/rise_trans.cpp +0 -44
  91. package/originalCode/src/functions/rise_trans_true_hor.cpp +0 -46
  92. package/originalCode/src/functions/set_delta_t_userdef.cpp +0 -14
  93. package/originalCode/src/functions/set_ephe_path.cpp +0 -14
  94. package/originalCode/src/functions/set_jpl_file.cpp +0 -14
  95. package/originalCode/src/functions/set_sid_mode.cpp +0 -20
  96. package/originalCode/src/functions/set_tid_acc.cpp +0 -14
  97. package/originalCode/src/functions/set_topo.cpp +0 -20
  98. package/originalCode/src/functions/sidtime.cpp +0 -15
  99. package/originalCode/src/functions/sidtime0.cpp +0 -21
  100. package/originalCode/src/functions/sol_eclipse_how.cpp +0 -34
  101. package/originalCode/src/functions/sol_eclipse_when_glob.cpp +0 -31
  102. package/originalCode/src/functions/sol_eclipse_when_loc.cpp +0 -39
  103. package/originalCode/src/functions/sol_eclipse_where.cpp +0 -30
  104. package/originalCode/src/functions/solcross.cpp +0 -26
  105. package/originalCode/src/functions/solcross_ut.cpp +0 -26
  106. package/originalCode/src/functions/split_deg.cpp +0 -35
  107. package/originalCode/src/functions/time_equ.cpp +0 -25
  108. package/originalCode/src/functions/utc_time_zone.cpp +0 -48
  109. package/originalCode/src/functions/utc_to_jd.cpp +0 -37
  110. package/originalCode/src/functions/version.cpp +0 -8
  111. package/originalCode/src/functions/vis_limit_mag.cpp +0 -50
  112. package/originalCode/src/sweph.cpp +0 -150
  113. package/originalCode/src/sweph.h +0 -119
  114. package/originalCode/swisseph/swecl.c +0 -6428
  115. package/originalCode/swisseph/swedate.c +0 -588
  116. package/originalCode/swisseph/swedate.h +0 -81
  117. package/originalCode/swisseph/swehel.c +0 -3511
  118. package/originalCode/swisseph/swehouse.c +0 -3143
  119. package/originalCode/swisseph/swehouse.h +0 -98
  120. package/originalCode/swisseph/swejpl.c +0 -958
  121. package/originalCode/swisseph/swejpl.h +0 -103
  122. package/originalCode/swisseph/swemmoon.c +0 -1930
  123. package/originalCode/swisseph/swemplan.c +0 -967
  124. package/originalCode/swisseph/swemptab.h +0 -10640
  125. package/originalCode/swisseph/swenut2000a.h +0 -2819
  126. package/originalCode/swisseph/sweodef.h +0 -326
  127. package/originalCode/swisseph/sweph.c +0 -8614
  128. package/originalCode/swisseph/sweph.h +0 -849
  129. package/originalCode/swisseph/swephexp.h +0 -1020
  130. package/originalCode/swisseph/swephlib.c +0 -4634
  131. package/originalCode/swisseph/swephlib.h +0 -189
@@ -1,19 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 2, "Expecting 2 arguments: deg, deg" },
5
- { NUMBER, "Argument 1 should be a number - decimal degrees" },
6
- { NUMBER, "Argument 2 should be a number - decimal degrees" }
7
- };
8
-
9
- Napi::Value sweph_difdeg2n(const Napi::CallbackInfo& info) {
10
- Napi::Env env = info.Env();
11
- if(!sweph_type_check(args, info)) {
12
- return env.Null();
13
- }
14
- double dif = swe_difdeg2n(
15
- info[0].As<Napi::Number>().DoubleValue(),
16
- info[1].As<Napi::Number>().DoubleValue()
17
- );
18
- return Napi::Number::New(env, dif);
19
- }
@@ -1,19 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 2, "Expecting 2 arguments: deg, deg" },
5
- { NUMBER, "Argument 1 should be a number - decimal degrees" },
6
- { NUMBER, "Argument 2 should be a number - decimal degrees" }
7
- };
8
-
9
- Napi::Value sweph_difdegn(const Napi::CallbackInfo& info) {
10
- Napi::Env env = info.Env();
11
- if(!sweph_type_check(args, info)) {
12
- return env.Null();
13
- }
14
- double dif = swe_difdegn(
15
- info[0].As<Napi::Number>().DoubleValue(),
16
- info[1].As<Napi::Number>().DoubleValue()
17
- );
18
- return Napi::Number::New(env, dif);
19
- }
@@ -1,32 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 3, "Expecting 3 arguments: star, tjd_et, iflag" },
5
- { STRING, "Argument 1 should be a string - star ID" },
6
- { NUMBER, "Argument 2 should be a number - julian day in ephemeris/terrestrial time" },
7
- { NUMBER, "Argument 3 should be a number - calculation flag" }
8
- };
9
-
10
- Napi::Value sweph_fixstar(const Napi::CallbackInfo& info) {
11
- Napi::Env env = info.Env();
12
- if(!sweph_type_check(args, info)) {
13
- return env.Null();
14
- }
15
- double xx [6];
16
- char serr [AS_MAXCH] = "";
17
- char star [AS_MAXCH];
18
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
- int32 flag = swe_fixstar(
20
- star,
21
- info[1].As<Napi::Number>().Int32Value(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- xx,
24
- serr
25
- );
26
- Napi::Object obj = Napi::Object::New(env);
27
- obj["flag"] = flag;
28
- obj["error"] = serr;
29
- obj["name"] = star;
30
- obj["data"] = sweph_js_array_converter(xx, 6, env);
31
- return obj;
32
- }
@@ -1,32 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 3, "Expecting 3 arguments: star, tjd_et, iflag" },
5
- { STRING, "Argument 1 should be a string - star ID" },
6
- { NUMBER, "Argument 2 should be a number - julian day in ephemeris/terrestrial time" },
7
- { NUMBER, "Argument 3 should be a number - calculation flag" }
8
- };
9
-
10
- Napi::Value sweph_fixstar2(const Napi::CallbackInfo& info) {
11
- Napi::Env env = info.Env();
12
- if(!sweph_type_check(args, info)) {
13
- return env.Null();
14
- }
15
- double xx [6];
16
- char serr [AS_MAXCH] = "";
17
- char star [AS_MAXCH];
18
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
- int32 flag = swe_fixstar2(
20
- star,
21
- info[1].As<Napi::Number>().Int32Value(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- xx,
24
- serr
25
- );
26
- Napi::Object obj = Napi::Object::New(env);
27
- obj["flag"] = flag;
28
- obj["error"] = serr;
29
- obj["name"] = star;
30
- obj["data"] = sweph_js_array_converter(xx, 6, env);
31
- return obj;
32
- }
@@ -1,28 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: star" },
5
- { STRING, "Argument 1 should be a string - star ID" }
6
- };
7
-
8
- Napi::Value sweph_fixstar2_mag(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- double mag;
14
- char serr [AS_MAXCH] = "";
15
- char star [AS_MAXCH];
16
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
17
- int32 flag = swe_fixstar2_mag(
18
- star,
19
- &mag,
20
- serr
21
- );
22
- Napi::Object obj = Napi::Object::New(env);
23
- obj["flag"] = flag;
24
- obj["error"] = serr;
25
- obj["name"] = star;
26
- obj["data"] = mag;
27
- return obj;
28
- }
@@ -1,32 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 3, "Expecting 3 arguments: star, tjd_ut, iflag" },
5
- { STRING, "Argument 1 should be a string - star ID" },
6
- { NUMBER, "Argument 2 should be a number - julian day in universal time" },
7
- { NUMBER, "Argument 3 should be a number - calculation flag" }
8
- };
9
-
10
- Napi::Value sweph_fixstar2_ut(const Napi::CallbackInfo& info) {
11
- Napi::Env env = info.Env();
12
- if(!sweph_type_check(args, info)) {
13
- return env.Null();
14
- }
15
- double xx [6];
16
- char serr [AS_MAXCH] = "";
17
- char star [AS_MAXCH];
18
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
- int32 flag = swe_fixstar2_ut(
20
- star,
21
- info[1].As<Napi::Number>().Int32Value(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- xx,
24
- serr
25
- );
26
- Napi::Object obj = Napi::Object::New(env);
27
- obj["flag"] = flag;
28
- obj["error"] = serr;
29
- obj["name"] = star;
30
- obj["data"] = sweph_js_array_converter(xx, 6, env);
31
- return obj;
32
- }
@@ -1,28 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: star" },
5
- { STRING, "Argument 1 should be a string - star ID" }
6
- };
7
-
8
- Napi::Value sweph_fixstar_mag(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- double mag;
14
- char serr [AS_MAXCH] = "";
15
- char star [AS_MAXCH];
16
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
17
- int32 flag = swe_fixstar_mag(
18
- star,
19
- &mag,
20
- serr
21
- );
22
- Napi::Object obj = Napi::Object::New(env);
23
- obj["flag"] = flag;
24
- obj["error"] = serr;
25
- obj["name"] = star;
26
- obj["data"] = mag;
27
- return obj;
28
- }
@@ -1,32 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 3, "Expecting 3 arguments: star, tjd_ut, iflag" },
5
- { STRING, "Argument 1 should be a string - star ID" },
6
- { NUMBER, "Argument 2 should be a number - julian day in universal time" },
7
- { NUMBER, "Argument 3 should be a number - calculation flag" }
8
- };
9
-
10
- Napi::Value sweph_fixstar_ut(const Napi::CallbackInfo& info) {
11
- Napi::Env env = info.Env();
12
- if(!sweph_type_check(args, info)) {
13
- return env.Null();
14
- }
15
- double xx [6];
16
- char serr [AS_MAXCH] = "";
17
- char star [AS_MAXCH];
18
- strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
- int32 flag = swe_fixstar_ut(
20
- star,
21
- info[1].As<Napi::Number>().Int32Value(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- xx,
24
- serr
25
- );
26
- Napi::Object obj = Napi::Object::New(env);
27
- obj["flag"] = flag;
28
- obj["error"] = serr;
29
- obj["name"] = star;
30
- obj["data"] = sweph_js_array_converter(xx, 6, env);
31
- return obj;
32
- }
@@ -1,44 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 8, "Expecting 8 arguments: tjd_ut, ipl, starname, iflag, imeth, geopos, atpress, attemp" },
5
- { NUMBER, "Argument 1 should be a number - julian day in universal time" },
6
- { NUMBER, "Argument 2 should be a number - planet ID" },
7
- { STRINGNULL, "Argument 3 should be a string or null - star ID if any" },
8
- { NUMBER, "Argument 4 should be a number - calculation flag" },
9
- { NUMBER, "Argument 5 should be a number - calculation method" },
10
- { ARRAY, "Argument 6 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
11
- { NUMBER, "Argument 7 should be a number - atmospheric pressure in mbar/hpa" },
12
- { NUMBER, "Argument 8 should be a number - atmospheric temperature in celsius" }
13
- };
14
-
15
- Napi::Value sweph_gauquelin_sector(const Napi::CallbackInfo& info) {
16
- Napi::Env env = info.Env();
17
- if(!sweph_type_check(args, info)) {
18
- return env.Null();
19
- }
20
- double geopos [3];
21
- if(!sweph_double_array_converter(geopos, 3, info[5])) {
22
- Napi::TypeError::New(env, args[6].second).ThrowAsJavaScriptException();
23
- return env.Null();
24
- }
25
- double sect;
26
- char serr [AS_MAXCH] = "";
27
- int32 flag = swe_gauquelin_sector(
28
- info[0].As<Napi::Number>().DoubleValue(),
29
- info[1].As<Napi::Number>().Int32Value(),
30
- info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
31
- info[3].As<Napi::Number>().Int32Value(),
32
- info[4].As<Napi::Number>().Int32Value(),
33
- geopos,
34
- info[6].As<Napi::Number>().DoubleValue(),
35
- info[7].As<Napi::Number>().DoubleValue(),
36
- &sect,
37
- serr
38
- );
39
- Napi::Object obj = Napi::Object::New(env);
40
- obj["flag"] = flag;
41
- obj["error"] = serr;
42
- obj["data"] = sect;
43
- return obj;
44
- }
@@ -1,15 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: tjd_et" },
5
- { NUMBER, "Argument 1 should be a number - julian day in ephemeris/terrestrial time" }
6
- };
7
-
8
- Napi::Value sweph_get_ayanamsa(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- double val = swe_get_ayanamsa(info[0].As<Napi::Number>().DoubleValue());
14
- return Napi::Number::New(env, val);
15
- }
@@ -1,27 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 2, "Expecting 2 argument: tjd_et, ephe_flag" },
5
- { NUMBER, "Argument 1 should be a number - julian day in ephemeris/terrestrial time" },
6
- { NUMBER, "Argument 2 should be a number - ephemeris flag" }
7
- };
8
-
9
- Napi::Value sweph_get_ayanamsa_ex(const Napi::CallbackInfo& info) {
10
- Napi::Env env = info.Env();
11
- if(!sweph_type_check(args, info)) {
12
- return env.Null();
13
- }
14
- double aya;
15
- char serr [AS_MAXCH] = "";
16
- int32 flag = swe_get_ayanamsa_ex(
17
- info[0].As<Napi::Number>().DoubleValue(),
18
- info[1].As<Napi::Number>().Int32Value(),
19
- &aya,
20
- serr
21
- );
22
- Napi::Object obj = Napi::Object::New(env);
23
- obj["flag"] = flag;
24
- obj["error"] = serr;
25
- obj["data"] = aya;
26
- return obj;
27
- }
@@ -1,27 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 2, "Expecting 2 argument: tjd_ut, ephe_flag" },
5
- { NUMBER, "Argument 1 should be a number - julian day in universal time" },
6
- { NUMBER, "Argument 2 should be a number - ephemeris flag" }
7
- };
8
-
9
- Napi::Value sweph_get_ayanamsa_ex_ut(const Napi::CallbackInfo& info) {
10
- Napi::Env env = info.Env();
11
- if(!sweph_type_check(args, info)) {
12
- return env.Null();
13
- }
14
- double aya;
15
- char serr [AS_MAXCH] = "";
16
- int32 flag = swe_get_ayanamsa_ex_ut(
17
- info[0].As<Napi::Number>().DoubleValue(),
18
- info[1].As<Napi::Number>().Int32Value(),
19
- &aya,
20
- serr
21
- );
22
- Napi::Object obj = Napi::Object::New(env);
23
- obj["flag"] = flag;
24
- obj["error"] = serr;
25
- obj["data"] = aya;
26
- return obj;
27
- }
@@ -1,19 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: aya" },
5
- { NUMBER, "Argument 1 should be a number - ayanamsa ID" }
6
- };
7
-
8
- Napi::Value sweph_get_ayanamsa_name(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- const char* name = swe_get_ayanamsa_name(info[0].As<Napi::Number>().Int32Value());
14
- if(name == NULL) {
15
- Napi::TypeError::New(env, "Invalid ayanamsa").ThrowAsJavaScriptException();
16
- return env.Null();
17
- }
18
- return Napi::String::New(env, name);
19
- }
@@ -1,15 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: tjd_ut" },
5
- { NUMBER, "Argument 1 should be a number - julian day in universal time" }
6
- };
7
-
8
- Napi::Value sweph_get_ayanamsa_ut(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- double val = swe_get_ayanamsa_ut(info[0].As<Napi::Number>().DoubleValue());
14
- return Napi::Number::New(env, val);
15
- }
@@ -1,28 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: ifno" },
5
- { NUMBER, "Argument 1 should be a number - file type" }
6
- };
7
-
8
- Napi::Value sweph_get_current_file_data(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- double tfstart;
14
- double tfend;
15
- int denum;
16
- const char *path = swe_get_current_file_data(
17
- info[0].As<Napi::Number>().Int32Value(),
18
- &tfstart,
19
- &tfend,
20
- &denum
21
- );
22
- Napi::Object obj = Napi::Object::New(env);
23
- obj["path"] = path;
24
- obj["start"] = tfstart;
25
- obj["end"] = tfend;
26
- obj["denum"] = denum;
27
- return obj;
28
- }
@@ -1,8 +0,0 @@
1
- #include <sweph.h>
2
-
3
- Napi::String sweph_get_library_path(const Napi::CallbackInfo& info) {
4
- Napi::Env env = info.Env();
5
- char path [AS_MAXCH];
6
- swe_get_library_path(path);
7
- return Napi::String::New(env, path);
8
- }
@@ -1,29 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 3, "Expecting 3 arguments: tjd_et, ipl, iflag" },
5
- { NUMBER, "Argument 1 should be a number - julian day ephemeris/terrestrial time" },
6
- { NUMBER, "Argument 2 should be a number - object ID" },
7
- { NUMBER, "Argument 3 should be a number - calculation flag" }
8
- };
9
-
10
- Napi::Value sweph_get_orbital_elements(const Napi::CallbackInfo& info) {
11
- Napi::Env env = info.Env();
12
- if(!sweph_type_check(args, info)) {
13
- return env.Null();
14
- }
15
- double ret [50];
16
- char serr [AS_MAXCH] = "";
17
- int32 flag = swe_get_orbital_elements(
18
- info[0].As<Napi::Number>().DoubleValue(),
19
- info[1].As<Napi::Number>().Int32Value(),
20
- info[2].As<Napi::Number>().Int32Value(),
21
- ret,
22
- serr
23
- );
24
- Napi::Object obj = Napi::Object::New(env);
25
- obj["flag"] = flag;
26
- obj["error"] = serr;
27
- obj["data"] = sweph_js_array_converter(ret, 17, env);
28
- return obj;
29
- }
@@ -1,19 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 1, "Expecting 1 argument: ipl" },
5
- { NUMBER, "Argument 1 should be a number - object ID" }
6
- };
7
-
8
- Napi::Value sweph_get_planet_name(const Napi::CallbackInfo& info) {
9
- Napi::Env env = info.Env();
10
- if(!sweph_type_check(args, info)) {
11
- return env.Null();
12
- }
13
- char planet [AS_MAXCH];
14
- swe_get_planet_name(
15
- info[0].As<Napi::Number>().Int32Value(),
16
- planet
17
- );
18
- return Napi::String::New(env, planet);
19
- }
@@ -1,7 +0,0 @@
1
- #include <sweph.h>
2
-
3
- Napi::Number sweph_get_tid_acc(const Napi::CallbackInfo& info) {
4
- Napi::Env env = info.Env();
5
- double val = swe_get_tid_acc();
6
- return Napi::Number::New(env, val);
7
- }
@@ -1,52 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 7, "Expecting 7 arguments: tjd_ut, dgeo, datm, dobs, object_name, event_type, hel_flag" },
5
- { NUMBER, "Argument 1 should be a number - julian day in universal time" },
6
- { ARRAY, "Argument 2 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
7
- { ARRAY, "Argument 3 should be an array of 4 numbers - atmospheric conditions [pressure, temperature, humidity, meteorological range]" },
8
- { ARRAY, "Argument 4 should be an array of 6 numbers - observer description [age, sellen ratio, optical type, optical magnification, optical aperture, optical transmission]" },
9
- { STRING, "Argument 5 should be a string - name of fixed star or planet" },
10
- { NUMBER, "Argument 6 should be a number - event type" },
11
- { NUMBER, "Argument 7 should be a number - calculation flag" }
12
- };
13
-
14
- Napi::Value sweph_heliacal_pheno_ut(const Napi::CallbackInfo& info) {
15
- Napi::Env env = info.Env();
16
- if(!sweph_type_check(args, info)) {
17
- return env.Null();
18
- }
19
- double dgeo [3];
20
- if(!sweph_double_array_converter(dgeo, 3, info[1])) {
21
- Napi::TypeError::New(env, args[2].second).ThrowAsJavaScriptException();
22
- return env.Null();
23
- }
24
- double datm [4];
25
- if(!sweph_double_array_converter(datm, 4, info[2])) {
26
- Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
27
- return env.Null();
28
- }
29
- double dobs [6];
30
- if(!sweph_double_array_converter(dobs, 6, info[3])) {
31
- Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
32
- return env.Null();
33
- }
34
- char serr [AS_MAXCH] = "";
35
- double ret [50];
36
- int32 flag = swe_heliacal_pheno_ut(
37
- info[0].As<Napi::Number>().DoubleValue(),
38
- dgeo,
39
- datm,
40
- dobs,
41
- (char*)info[4].As<Napi::String>().Utf8Value().c_str(),
42
- info[5].As<Napi::Number>().Int32Value(),
43
- info[6].As<Napi::Number>().Int32Value(),
44
- ret,
45
- serr
46
- );
47
- Napi::Object obj = Napi::Object::New(env);
48
- obj["flag"] = flag;
49
- obj["error"] = serr;
50
- obj["data"] = sweph_js_array_converter(ret, 30, env);
51
- return obj;
52
- }
@@ -1,52 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 7, "Expecting 7 arguments: tjd_ut, dgeo, datm, dobs, object_name, event_type, hel_flag" },
5
- { NUMBER, "Argument 1 should be a number - julian day in universal time" },
6
- { ARRAY, "Argument 2 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
7
- { ARRAY, "Argument 3 should be an array of 4 numbers - atmospheric conditions [pressure, temperature, humidity, meteorological range]" },
8
- { ARRAY, "Argument 4 should be an array of 6 numbers - observer description [age, sellen ratio, optical type, optical magnification, optical aperture, optical transmission]" },
9
- { STRING, "Argument 5 should be a string - name of fixed star or planet" },
10
- { NUMBER, "Argument 6 should be a number - event type" },
11
- { NUMBER, "Argument 7 should be a number - calculation flag" }
12
- };
13
-
14
- Napi::Value sweph_heliacal_ut(const Napi::CallbackInfo& info) {
15
- Napi::Env env = info.Env();
16
- if(!sweph_type_check(args, info)) {
17
- return env.Null();
18
- }
19
- double dgeo [3];
20
- if(!sweph_double_array_converter(dgeo, 3, info[1])) {
21
- Napi::TypeError::New(env, args[2].second).ThrowAsJavaScriptException();
22
- return env.Null();
23
- }
24
- double datm [4];
25
- if(!sweph_double_array_converter(datm, 4, info[2])) {
26
- Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
27
- return env.Null();
28
- }
29
- double dobs [6];
30
- if(!sweph_double_array_converter(dobs, 6, info[3])) {
31
- Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
32
- return env.Null();
33
- }
34
- char serr [AS_MAXCH] = "";
35
- double ret [50];
36
- int32 flag = swe_heliacal_ut(
37
- info[0].As<Napi::Number>().DoubleValue(),
38
- dgeo,
39
- datm,
40
- dobs,
41
- (char*)info[4].As<Napi::String>().Utf8Value().c_str(),
42
- info[5].As<Napi::Number>().Int32Value(),
43
- info[6].As<Napi::Number>().Int32Value(),
44
- ret,
45
- serr
46
- );
47
- Napi::Object obj = Napi::Object::New(env);
48
- obj["flag"] = flag;
49
- obj["error"] = serr;
50
- obj["data"] = sweph_js_array_converter(ret, 3, env);
51
- return obj;
52
- }
@@ -1,33 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 5, "Expecting 5 arguments: ipl, x2cross, jd_et, flag, dir" },
5
- { NUMBER, "Argument 1 should be a number - object ID" },
6
- { NUMBER, "Argument 2 should be a number - longitude position to search for" },
7
- { NUMBER, "Argument 3 should be a number - start time in julian day in ephemeris/terrestrial time" },
8
- { NUMBER, "Argument 4 should be a number - calculation flag" },
9
- { NUMBER, "Argument 5 should be a number - direction to search, 0 = forwards, -1 = backwards" }
10
- };
11
-
12
- Napi::Value sweph_helio_cross(const Napi::CallbackInfo& info) {
13
- Napi::Env env = info.Env();
14
- if(!sweph_type_check(args, info)) {
15
- return env.Null();
16
- }
17
- char serr [AS_MAXCH] = "";
18
- double jd_cross;
19
- int32 flag = swe_helio_cross(
20
- info[0].As<Napi::Number>().Int32Value(),
21
- info[1].As<Napi::Number>().DoubleValue(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- info[3].As<Napi::Number>().Int32Value(),
24
- info[4].As<Napi::Number>().Int32Value(),
25
- &jd_cross,
26
- serr
27
- );
28
- Napi::Object obj = Napi::Object::New(env);
29
- obj["date"] = jd_cross;
30
- obj["flag"] = flag;
31
- obj["error"] = serr;
32
- return obj;
33
- }
@@ -1,33 +0,0 @@
1
- #include <sweph.h>
2
-
3
- constexpr std::pair<int, const char*> args[] = {
4
- { 5, "Expecting 5 arguments: ipl, x2cross, jd_ut, flag, dir" },
5
- { NUMBER, "Argument 1 should be a number - object ID" },
6
- { NUMBER, "Argument 2 should be a number - longitude position to search for" },
7
- { NUMBER, "Argument 3 should be a number - start time in julian day in universal time" },
8
- { NUMBER, "Argument 4 should be a number - calculation flag" },
9
- { NUMBER, "Argument 5 should be a number - direction to search, 0 = forwards, -1 = backwards" }
10
- };
11
-
12
- Napi::Value sweph_helio_cross_ut(const Napi::CallbackInfo& info) {
13
- Napi::Env env = info.Env();
14
- if(!sweph_type_check(args, info)) {
15
- return env.Null();
16
- }
17
- char serr [AS_MAXCH] = "";
18
- double jd_cross;
19
- int32 flag = swe_helio_cross_ut(
20
- info[0].As<Napi::Number>().Int32Value(),
21
- info[1].As<Napi::Number>().DoubleValue(),
22
- info[2].As<Napi::Number>().Int32Value(),
23
- info[3].As<Napi::Number>().Int32Value(),
24
- info[4].As<Napi::Number>().Int32Value(),
25
- &jd_cross,
26
- serr
27
- );
28
- Napi::Object obj = Napi::Object::New(env);
29
- obj["date"] = jd_cross;
30
- obj["flag"] = flag;
31
- obj["error"] = serr;
32
- return obj;
33
- }