@magmacomputing/tempo-plugin-astro 1.1.3 → 1.1.5
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 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ When resolving the term, the plugin intelligently returns the correct astronomic
|
|
|
39
39
|
key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
|
|
40
40
|
season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
|
|
41
41
|
sphere: 'north', // Flips to 'south' if sphere is set to 'south'
|
|
42
|
-
|
|
42
|
+
event: 'Equinox',
|
|
43
43
|
group: 'astronomy',
|
|
44
44
|
year: 2026,
|
|
45
45
|
month: 3,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { Tempo } from '@magmacomputing/tempo/core';
|
|
2
|
+
declare module '@magmacomputing/tempo/core' {
|
|
3
|
+
interface TempoTermRegistry {
|
|
4
|
+
astro: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
|
|
5
|
+
astronomy: {
|
|
6
|
+
key: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
|
|
7
|
+
season: 'Spring' | 'Summer' | 'Autumn' | 'Winter';
|
|
8
|
+
sphere: Tempo.COMPASS;
|
|
9
|
+
event: 'Equinox' | 'Solstice';
|
|
10
|
+
group: 'astronomy';
|
|
11
|
+
year: number;
|
|
12
|
+
month: number;
|
|
13
|
+
day: number;
|
|
14
|
+
hour: number;
|
|
15
|
+
minute: number;
|
|
16
|
+
second: number;
|
|
17
|
+
millisecond: number;
|
|
18
|
+
microsecond: number;
|
|
19
|
+
nanosecond: number;
|
|
20
|
+
start: Tempo;
|
|
21
|
+
end: Tempo;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
2
25
|
/**
|
|
3
26
|
* ## AstroTerm
|
|
4
27
|
* Exposes precise astronomical calculations as a standard Tempo scope.
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x2e7852=a0_0x24bb;(function(_0x4085b8,_0x36fb6c){const _0x4ce143=a0_0x24bb,_0x52677b=_0x4085b8();while(!![]){try{const _0x1cc85e=-parseInt(_0x4ce143(0x182))/0x1+parseInt(_0x4ce143(0x18e))/0x2*(parseInt(_0x4ce143(0x173))/0x3)+-parseInt(_0x4ce143(0x174))/0x4*(parseInt(_0x4ce143(0x188))/0x5)+parseInt(_0x4ce143(0x198))/0x6+-parseInt(_0x4ce143(0x17b))/0x7*(-parseInt(_0x4ce143(0x185))/0x8)+parseInt(_0x4ce143(0x19e))/0x9*(-parseInt(_0x4ce143(0x199))/0xa)+parseInt(_0x4ce143(0x196))/0xb*(parseInt(_0x4ce143(0x17e))/0xc);if(_0x1cc85e===_0x36fb6c)break;else _0x52677b['push'](_0x52677b['shift']());}catch(_0x5d0002){_0x52677b['push'](_0x52677b['shift']());}}}(a0_0x223a,0x34f4b));function a0_0x223a(){const _0x5ae4d2=['key','vernal','22296rpjbyC','Vernal','autumnal','winter','196605skHHGO','Spring','minute','8QFwyib','nanosecond','add','15WvMEHb','year','Winter','millisecond','South','UTC','2wXfRyz','trunc','microsecond','Solstice','map','Autumn','push','second','3058SbNJgW','hour','1588278hXWizm','33310fzsezk','Equinox','sphere','day','Summer','1143PhINjA','astronomy','month','599739obsOYi','206712isuJhG','toDateTime','config','extend','timeZoneId','find','Autumnal','73031TyqBgG'];a0_0x223a=function(){return _0x5ae4d2;};return a0_0x223a();}import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x2e7852(0x17d),'Summer':'summer','Autumnal':a0_0x2e7852(0x180),'Winter':'winter'}),{COMPASS,DURATIONS}=enums,key='astro',scope='astronomy';function calculateAstroMoment(_0x58ca84,_0x14dcc0,_0x51102e){const _0x4ddc85=a0_0x2e7852,_0x165c3b=(_0x58ca84-0x7d0)/0x3e8;let _0x366f7f;switch(_0x14dcc0){case ASTRO['Vernal']:_0x366f7f=2451623.80984+365242.37404*_0x165c3b+0.05169*_0x165c3b*_0x165c3b;break;case ASTRO[_0x4ddc85(0x19d)]:_0x366f7f=2451716.56767+365241.62603*_0x165c3b+0.00325*_0x165c3b*_0x165c3b;break;case ASTRO['Autumnal']:_0x366f7f=2451810.21715+365242.01767*_0x165c3b-0.11575*_0x165c3b*_0x165c3b;break;case ASTRO[_0x4ddc85(0x18a)]:_0x366f7f=2451900.05952+365242.74049*_0x165c3b-0.06223*_0x165c3b*_0x165c3b;break;}const _0x11c7e0=Math[_0x4ddc85(0x18f)]((_0x366f7f-2440587.5)*DURATIONS['days']);return new Tempo(_0x11c7e0,{'timeZone':_0x51102e,'timeStamp':'ms'});}function resolve(_0xf50638,_0x2179b){const _0x22af23=a0_0x2e7852,_0x43dba7=_0xf50638[_0x22af23(0x176)][_0x22af23(0x19b)];if(!_0x43dba7)return[];const _0x5132ce=_0x2179b?.['yy']??_0x2179b?.[_0x22af23(0x189)]??_0xf50638['yy'],_0x45f2ad=_0x2179b?.[_0x22af23(0x178)]??_0xf50638['tz']??_0x22af23(0x18d),_0x5b5b8f=[],_0x5aafe5=_0x43dba7===COMPASS[_0x22af23(0x18c)]?{'vernal':'Autumnal','summer':_0x22af23(0x18a),'autumnal':'Vernal','winter':_0x22af23(0x19d)}:{'vernal':_0x22af23(0x17f),'summer':_0x22af23(0x19d),'autumnal':_0x22af23(0x17a),'winter':_0x22af23(0x18a)},_0x4b0d62=_0x43dba7===COMPASS[_0x22af23(0x18c)]?{'vernal':'Autumn','summer':'Winter','autumnal':_0x22af23(0x183),'winter':'Summer'}:{'vernal':_0x22af23(0x183),'summer':_0x22af23(0x19d),'autumnal':_0x22af23(0x193),'winter':_0x22af23(0x18a)};for(const _0x4d0bac of[_0x5132ce-0x1,_0x5132ce,_0x5132ce+0x1]){const _0xf7ebeb=(_0x3cbfd8,_0x5b9ac8)=>{const _0x3c83af=_0x22af23,_0x4f12aa=calculateAstroMoment(_0x3cbfd8,_0x5b9ac8,_0x45f2ad),_0x161d9e=_0x4f12aa[_0x3c83af(0x175)]();return{'year':_0x161d9e['year'],'month':_0x161d9e[_0x3c83af(0x1a0)],'day':_0x161d9e[_0x3c83af(0x19c)],'hour':_0x161d9e[_0x3c83af(0x197)],'minute':_0x161d9e[_0x3c83af(0x184)],'second':_0x161d9e['second'],'millisecond':_0x161d9e[_0x3c83af(0x18b)],'microsecond':_0x161d9e[_0x3c83af(0x190)],'nanosecond':_0x161d9e[_0x3c83af(0x186)]};};_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5['vernal'],'season':_0x4b0d62[_0x22af23(0x17d)],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x17f)]),'event':_0x22af23(0x19a),'group':_0x22af23(0x19f)}),_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5['summer'],'season':_0x4b0d62['summer'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x19d)]),'event':'Solstice','group':'astronomy'}),_0x5b5b8f['push']({'key':_0x5aafe5[_0x22af23(0x180)],'season':_0x4b0d62['autumnal'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x17a)]),'event':_0x22af23(0x19a),'group':_0x22af23(0x19f)}),_0x5b5b8f[_0x22af23(0x194)]({'key':_0x5aafe5[_0x22af23(0x181)],'season':_0x4b0d62['winter'],'sphere':_0x43dba7,..._0xf7ebeb(_0x4d0bac,ASTRO[_0x22af23(0x18a)]),'event':_0x22af23(0x191),'group':_0x22af23(0x19f)});}return _0x5b5b8f;}function a0_0x24bb(_0x3c861a,_0x394f64){_0x3c861a=_0x3c861a-0x173;const _0x223ac5=a0_0x223a();let _0x24bbf3=_0x223ac5[_0x3c861a];return _0x24bbf3;}function resolveDateBoundary(_0x1d2029,_0x54d615){const _0x5abbe1=a0_0x2e7852,_0x1fddaa=resolve(_0x1d2029,_0x54d615);return _0x1fddaa[_0x5abbe1(0x192)](_0x7b82b9=>({..._0x7b82b9,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x5a2d2e){return resolve(this,_0x5a2d2e);},'define'(_0x246a08,_0x219658){const _0x549940=a0_0x2e7852,_0x19aae4=resolve(this,_0x219658),_0x45c5c5=resolveDateBoundary(this,_0x219658),_0xb40bb1=_0x219658??this['toDateTime']();if(_0x246a08===!![]||_0x246a08===void 0x0){const _0x3e7696=getTermRange(this,_0x45c5c5,!![],_0x219658);return _0x3e7696;}const _0x58e84d=getTermRange(this,_0x19aae4,![],_0x219658);if(!_0x58e84d)return _0x58e84d;const _0x37665b=getTermRange(this,_0x45c5c5,![],_0x219658);if(!_0x37665b)return _0x58e84d;const _0x349896=_0x19aae4[_0x549940(0x179)](_0xcb0ddd=>_0xcb0ddd[_0x549940(0x17c)]===_0x37665b[_0x549940(0x17c)]&&_0xcb0ddd['year']===_0x37665b[_0x549940(0x189)]&&_0xcb0ddd[_0x549940(0x1a0)]===_0x37665b[_0x549940(0x1a0)]&&_0xcb0ddd[_0x549940(0x19c)]===_0x37665b[_0x549940(0x19c)]);if(!_0x349896)return{..._0x37665b,'strict':_0x58e84d[_0x549940(0x17c)]};const _0x533594=_0xb40bb1['with']({'year':_0x349896['year'],'month':_0x349896[_0x549940(0x1a0)],'day':_0x349896[_0x549940(0x19c)],'hour':_0x349896[_0x549940(0x197)]??0x0,'minute':_0x349896[_0x549940(0x184)]??0x0,'second':_0x349896[_0x549940(0x195)]??0x0,'millisecond':_0x349896[_0x549940(0x18b)]??0x0,'microsecond':_0x349896[_0x549940(0x190)]??0x0,'nanosecond':_0x349896[_0x549940(0x186)]??0x0})[_0x549940(0x187)]({'minutes':0x1}),_0x26ab13=getTermRange(this,_0x19aae4,![],_0x533594);if(!_0x26ab13)return{..._0x37665b,'strict':_0x58e84d[_0x549940(0x17c)]};return{..._0x26ab13,'strict':_0x58e84d[_0x549940(0x17c)]};}});Tempo[a0_0x2e7852(0x177)](AstroTerm);export{AstroTerm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmacomputing/tempo-plugin-astro",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Tempo plugin that calculates precise astronomical seasons (solstices & equinoxes) using the Jean Meeus algorithm — hemisphere-aware, sub-minute accuracy",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
"import": "./dist/index.js"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|