@astronomy-bundle/solar-eclipse 9.0.0
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.
- package/README.md +1 -0
- package/index.d.mts +154 -0
- package/index.d.ts +154 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/index.mjs +2 -0
- package/index.mjs.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// TODO
|
package/index.d.mts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
declare class Location {
|
|
2
|
+
readonly lat: number;
|
|
3
|
+
readonly lon: number;
|
|
4
|
+
readonly elevation: number;
|
|
5
|
+
private readonly location;
|
|
6
|
+
private prefixesNorthSouth;
|
|
7
|
+
private prefixesEastWest;
|
|
8
|
+
constructor(lat: number, lon: number, elevation?: number);
|
|
9
|
+
static create(lat: number, lon: number, elevation?: number): Location;
|
|
10
|
+
getLatitude(): number;
|
|
11
|
+
getLongitude(): number;
|
|
12
|
+
getLatitudeInDegreeMinutes(): string;
|
|
13
|
+
getLongitudeInDegreeMinutes(): string;
|
|
14
|
+
getLatitudeInDegreeMinutesSeconds(): string;
|
|
15
|
+
getLongitudeInDegreeMinutesSeconds(): string;
|
|
16
|
+
getElevation(): number;
|
|
17
|
+
getDistanceToInKm(location: Location): number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface LatLon {
|
|
21
|
+
lat: number;
|
|
22
|
+
lon: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type Time = {
|
|
26
|
+
year: number;
|
|
27
|
+
month: number;
|
|
28
|
+
day: number;
|
|
29
|
+
hour: number;
|
|
30
|
+
min: number;
|
|
31
|
+
sec: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare class TimeOfInterest {
|
|
35
|
+
readonly time: Time;
|
|
36
|
+
readonly jd: number;
|
|
37
|
+
readonly T: number;
|
|
38
|
+
constructor(time: Time);
|
|
39
|
+
static fromCurrentTime(): TimeOfInterest;
|
|
40
|
+
static fromTime(year: number, month: number, day: number, hour?: number, min?: number, sec?: number): TimeOfInterest;
|
|
41
|
+
static fromDate(date: Date): TimeOfInterest;
|
|
42
|
+
static fromYearOfDay(year: number, dayOfYear: number): TimeOfInterest;
|
|
43
|
+
static fromJulianDay(jd: number): TimeOfInterest;
|
|
44
|
+
static fromJulianCenturiesJ2000(T: number): TimeOfInterest;
|
|
45
|
+
getTime(): Time;
|
|
46
|
+
getString(): string;
|
|
47
|
+
getDate(): Date;
|
|
48
|
+
getDecimalYear(): number;
|
|
49
|
+
getDayOfYear(): number;
|
|
50
|
+
getDayOfWeek(): number;
|
|
51
|
+
isLeapYear(): boolean;
|
|
52
|
+
getJulianDay(): number;
|
|
53
|
+
getJulianDay0(): number;
|
|
54
|
+
getJulianCenturiesJ2000(): number;
|
|
55
|
+
getJulianMillenniaJ2000(): number;
|
|
56
|
+
getGreenwichMeanSiderealTime(): number;
|
|
57
|
+
getGreenwichApparentSiderealTime(): number;
|
|
58
|
+
getLocalMeanSiderealTime(location: LatLon): number;
|
|
59
|
+
getLocalApparentSiderealTime(location: LatLon): number;
|
|
60
|
+
getDeltaT(): number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare enum SolarEclipseType {
|
|
64
|
+
Partial = "partial",
|
|
65
|
+
Total = "total",
|
|
66
|
+
Annular = "annular",
|
|
67
|
+
Hybrid = "hybrid"
|
|
68
|
+
}
|
|
69
|
+
declare enum LocalSolarEclipseType {
|
|
70
|
+
Partial = "partial",
|
|
71
|
+
Total = "total",
|
|
72
|
+
Annular = "annular"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface BesselianElements {
|
|
76
|
+
t0Jde: number;
|
|
77
|
+
t0Hours: number;
|
|
78
|
+
tMin: number;
|
|
79
|
+
tMax: number;
|
|
80
|
+
deltaT: number;
|
|
81
|
+
x: Array<number>;
|
|
82
|
+
y: Array<number>;
|
|
83
|
+
d: Array<number>;
|
|
84
|
+
mu: Array<number>;
|
|
85
|
+
l1: Array<number>;
|
|
86
|
+
l2: Array<number>;
|
|
87
|
+
tanF1: number;
|
|
88
|
+
tanF2: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare class LocalEclipseCircumstances {
|
|
92
|
+
private readonly elements;
|
|
93
|
+
private readonly location;
|
|
94
|
+
private readonly toi;
|
|
95
|
+
private readonly tau;
|
|
96
|
+
private readonly snap;
|
|
97
|
+
private constructor();
|
|
98
|
+
static create(elements: BesselianElements, location: Location, toi: TimeOfInterest): LocalEclipseCircumstances;
|
|
99
|
+
getLocation(): Location;
|
|
100
|
+
getTimeOfInterest(): TimeOfInterest;
|
|
101
|
+
getType(): LocalSolarEclipseType;
|
|
102
|
+
isInEclipse(): boolean;
|
|
103
|
+
isInCentralEclipse(): boolean;
|
|
104
|
+
getMagnitude(): number;
|
|
105
|
+
getObscuration(): number;
|
|
106
|
+
getSunAltitude(): number;
|
|
107
|
+
getMoonAltitude(): number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface EclipseContacts {
|
|
111
|
+
c1: Date;
|
|
112
|
+
c2: Date | null;
|
|
113
|
+
max: Date;
|
|
114
|
+
c3: Date | null;
|
|
115
|
+
c4: Date;
|
|
116
|
+
}
|
|
117
|
+
interface EclipseContactsTau {
|
|
118
|
+
c1: number;
|
|
119
|
+
c2: number | null;
|
|
120
|
+
max: number;
|
|
121
|
+
c3: number | null;
|
|
122
|
+
c4: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class LocalSolarEclipse {
|
|
126
|
+
private readonly elements;
|
|
127
|
+
private readonly location;
|
|
128
|
+
private readonly contactTaus;
|
|
129
|
+
private constructor();
|
|
130
|
+
static create(elements: BesselianElements, location: Location): LocalSolarEclipse;
|
|
131
|
+
getCircumstances(toi: TimeOfInterest): LocalEclipseCircumstances;
|
|
132
|
+
getType(): LocalSolarEclipseType;
|
|
133
|
+
getContactTaus(): EclipseContactsTau | null;
|
|
134
|
+
getContactTimes(): EclipseContacts;
|
|
135
|
+
getDuration(): number;
|
|
136
|
+
getCentralDuration(): number | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class SolarEclipse {
|
|
140
|
+
private readonly elements;
|
|
141
|
+
private constructor();
|
|
142
|
+
static createFromDate(date: string): SolarEclipse;
|
|
143
|
+
static createFromToi(toi: TimeOfInterest): SolarEclipse;
|
|
144
|
+
static createFromBesselianElements(elements: BesselianElements): SolarEclipse;
|
|
145
|
+
getLocalEclipse(location: Location): LocalSolarEclipse;
|
|
146
|
+
getType(): SolarEclipseType;
|
|
147
|
+
getMaxObscuration(): number;
|
|
148
|
+
getMaxDuration(): number;
|
|
149
|
+
getMaxCentralDuration(): number;
|
|
150
|
+
getSarosNumber(): number;
|
|
151
|
+
getLocationOfGreatestEclipse(): Location;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export { LocalEclipseCircumstances, LocalSolarEclipse, SolarEclipse };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
declare class Location {
|
|
2
|
+
readonly lat: number;
|
|
3
|
+
readonly lon: number;
|
|
4
|
+
readonly elevation: number;
|
|
5
|
+
private readonly location;
|
|
6
|
+
private prefixesNorthSouth;
|
|
7
|
+
private prefixesEastWest;
|
|
8
|
+
constructor(lat: number, lon: number, elevation?: number);
|
|
9
|
+
static create(lat: number, lon: number, elevation?: number): Location;
|
|
10
|
+
getLatitude(): number;
|
|
11
|
+
getLongitude(): number;
|
|
12
|
+
getLatitudeInDegreeMinutes(): string;
|
|
13
|
+
getLongitudeInDegreeMinutes(): string;
|
|
14
|
+
getLatitudeInDegreeMinutesSeconds(): string;
|
|
15
|
+
getLongitudeInDegreeMinutesSeconds(): string;
|
|
16
|
+
getElevation(): number;
|
|
17
|
+
getDistanceToInKm(location: Location): number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface LatLon {
|
|
21
|
+
lat: number;
|
|
22
|
+
lon: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type Time = {
|
|
26
|
+
year: number;
|
|
27
|
+
month: number;
|
|
28
|
+
day: number;
|
|
29
|
+
hour: number;
|
|
30
|
+
min: number;
|
|
31
|
+
sec: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare class TimeOfInterest {
|
|
35
|
+
readonly time: Time;
|
|
36
|
+
readonly jd: number;
|
|
37
|
+
readonly T: number;
|
|
38
|
+
constructor(time: Time);
|
|
39
|
+
static fromCurrentTime(): TimeOfInterest;
|
|
40
|
+
static fromTime(year: number, month: number, day: number, hour?: number, min?: number, sec?: number): TimeOfInterest;
|
|
41
|
+
static fromDate(date: Date): TimeOfInterest;
|
|
42
|
+
static fromYearOfDay(year: number, dayOfYear: number): TimeOfInterest;
|
|
43
|
+
static fromJulianDay(jd: number): TimeOfInterest;
|
|
44
|
+
static fromJulianCenturiesJ2000(T: number): TimeOfInterest;
|
|
45
|
+
getTime(): Time;
|
|
46
|
+
getString(): string;
|
|
47
|
+
getDate(): Date;
|
|
48
|
+
getDecimalYear(): number;
|
|
49
|
+
getDayOfYear(): number;
|
|
50
|
+
getDayOfWeek(): number;
|
|
51
|
+
isLeapYear(): boolean;
|
|
52
|
+
getJulianDay(): number;
|
|
53
|
+
getJulianDay0(): number;
|
|
54
|
+
getJulianCenturiesJ2000(): number;
|
|
55
|
+
getJulianMillenniaJ2000(): number;
|
|
56
|
+
getGreenwichMeanSiderealTime(): number;
|
|
57
|
+
getGreenwichApparentSiderealTime(): number;
|
|
58
|
+
getLocalMeanSiderealTime(location: LatLon): number;
|
|
59
|
+
getLocalApparentSiderealTime(location: LatLon): number;
|
|
60
|
+
getDeltaT(): number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare enum SolarEclipseType {
|
|
64
|
+
Partial = "partial",
|
|
65
|
+
Total = "total",
|
|
66
|
+
Annular = "annular",
|
|
67
|
+
Hybrid = "hybrid"
|
|
68
|
+
}
|
|
69
|
+
declare enum LocalSolarEclipseType {
|
|
70
|
+
Partial = "partial",
|
|
71
|
+
Total = "total",
|
|
72
|
+
Annular = "annular"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface BesselianElements {
|
|
76
|
+
t0Jde: number;
|
|
77
|
+
t0Hours: number;
|
|
78
|
+
tMin: number;
|
|
79
|
+
tMax: number;
|
|
80
|
+
deltaT: number;
|
|
81
|
+
x: Array<number>;
|
|
82
|
+
y: Array<number>;
|
|
83
|
+
d: Array<number>;
|
|
84
|
+
mu: Array<number>;
|
|
85
|
+
l1: Array<number>;
|
|
86
|
+
l2: Array<number>;
|
|
87
|
+
tanF1: number;
|
|
88
|
+
tanF2: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare class LocalEclipseCircumstances {
|
|
92
|
+
private readonly elements;
|
|
93
|
+
private readonly location;
|
|
94
|
+
private readonly toi;
|
|
95
|
+
private readonly tau;
|
|
96
|
+
private readonly snap;
|
|
97
|
+
private constructor();
|
|
98
|
+
static create(elements: BesselianElements, location: Location, toi: TimeOfInterest): LocalEclipseCircumstances;
|
|
99
|
+
getLocation(): Location;
|
|
100
|
+
getTimeOfInterest(): TimeOfInterest;
|
|
101
|
+
getType(): LocalSolarEclipseType;
|
|
102
|
+
isInEclipse(): boolean;
|
|
103
|
+
isInCentralEclipse(): boolean;
|
|
104
|
+
getMagnitude(): number;
|
|
105
|
+
getObscuration(): number;
|
|
106
|
+
getSunAltitude(): number;
|
|
107
|
+
getMoonAltitude(): number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface EclipseContacts {
|
|
111
|
+
c1: Date;
|
|
112
|
+
c2: Date | null;
|
|
113
|
+
max: Date;
|
|
114
|
+
c3: Date | null;
|
|
115
|
+
c4: Date;
|
|
116
|
+
}
|
|
117
|
+
interface EclipseContactsTau {
|
|
118
|
+
c1: number;
|
|
119
|
+
c2: number | null;
|
|
120
|
+
max: number;
|
|
121
|
+
c3: number | null;
|
|
122
|
+
c4: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class LocalSolarEclipse {
|
|
126
|
+
private readonly elements;
|
|
127
|
+
private readonly location;
|
|
128
|
+
private readonly contactTaus;
|
|
129
|
+
private constructor();
|
|
130
|
+
static create(elements: BesselianElements, location: Location): LocalSolarEclipse;
|
|
131
|
+
getCircumstances(toi: TimeOfInterest): LocalEclipseCircumstances;
|
|
132
|
+
getType(): LocalSolarEclipseType;
|
|
133
|
+
getContactTaus(): EclipseContactsTau | null;
|
|
134
|
+
getContactTimes(): EclipseContacts;
|
|
135
|
+
getDuration(): number;
|
|
136
|
+
getCentralDuration(): number | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class SolarEclipse {
|
|
140
|
+
private readonly elements;
|
|
141
|
+
private constructor();
|
|
142
|
+
static createFromDate(date: string): SolarEclipse;
|
|
143
|
+
static createFromToi(toi: TimeOfInterest): SolarEclipse;
|
|
144
|
+
static createFromBesselianElements(elements: BesselianElements): SolarEclipse;
|
|
145
|
+
getLocalEclipse(location: Location): LocalSolarEclipse;
|
|
146
|
+
getType(): SolarEclipseType;
|
|
147
|
+
getMaxObscuration(): number;
|
|
148
|
+
getMaxDuration(): number;
|
|
149
|
+
getMaxCentralDuration(): number;
|
|
150
|
+
getSarosNumber(): number;
|
|
151
|
+
getLocationOfGreatestEclipse(): Location;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export { LocalEclipseCircumstances, LocalSolarEclipse, SolarEclipse };
|