@orrery/core 0.1.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.
@@ -0,0 +1,249 @@
1
+ /** 오행 (Five Elements) */
2
+ type Element = 'tree' | 'fire' | 'earth' | 'metal' | 'water';
3
+ /** 음양 (Yin-Yang) */
4
+ type YinYang = '+' | '-';
5
+ /** 성별 */
6
+ type Gender = 'M' | 'F';
7
+ /** 생년월일시 입력 */
8
+ interface BirthInput {
9
+ year: number;
10
+ month: number;
11
+ day: number;
12
+ hour: number;
13
+ minute: number;
14
+ gender: Gender;
15
+ /** 시간 모름 여부 */
16
+ unknownTime?: boolean;
17
+ /** 위도 (기본값: 37.5194 서울) */
18
+ latitude?: number;
19
+ /** 경도 (기본값: 127.0992 서울) */
20
+ longitude?: number;
21
+ }
22
+ /** 천간 정보 */
23
+ interface StemInfo {
24
+ name: string;
25
+ yinyang: YinYang;
26
+ element: Element;
27
+ }
28
+ /** 십신 관계 */
29
+ interface Relation {
30
+ hanja: string;
31
+ hangul: string;
32
+ }
33
+ /** 12운성 */
34
+ interface Meteor {
35
+ hanja: string;
36
+ hangul: string;
37
+ }
38
+ /** 12신살 */
39
+ interface Spirit {
40
+ hanja: string;
41
+ hangul: string;
42
+ }
43
+ /** 사주 하나의 주 (柱) */
44
+ interface Pillar {
45
+ /** 60갑자 문자열 (예: '甲子') */
46
+ ganzi: string;
47
+ /** 천간 */
48
+ stem: string;
49
+ /** 지지 */
50
+ branch: string;
51
+ }
52
+ /** 사주 결과에서의 하나의 주 상세 */
53
+ interface PillarDetail {
54
+ pillar: Pillar;
55
+ /** 천간 십신 (일간 기준) */
56
+ stemSipsin: string;
57
+ /** 지지 십신 (지장간 정기 기준) */
58
+ branchSipsin: string;
59
+ /** 12운성 */
60
+ unseong: string;
61
+ /** 12신살 (연지 기준) */
62
+ sinsal: string;
63
+ /** 지장간 */
64
+ jigang: string;
65
+ }
66
+ /** 대운 항목 */
67
+ interface DaewoonItem {
68
+ index: number;
69
+ ganzi: string;
70
+ startDate: Date;
71
+ age: number;
72
+ stemSipsin: string;
73
+ branchSipsin: string;
74
+ /** 12운성 (일간 기준) */
75
+ unseong: string;
76
+ /** 12신살 (연지 기준) */
77
+ sinsal: string;
78
+ }
79
+ /** 관계 분석 결과 */
80
+ interface RelationResult {
81
+ type: string;
82
+ detail: string | null;
83
+ }
84
+ /** 주 쌍 관계 */
85
+ interface PairRelation {
86
+ stem: RelationResult[];
87
+ branch: RelationResult[];
88
+ }
89
+ /** 전체 팔자 관계 분석 */
90
+ interface AllRelations {
91
+ pairs: Map<string, PairRelation>;
92
+ triple: RelationResult[];
93
+ directional: RelationResult[];
94
+ }
95
+ /** 신살 정보 */
96
+ interface SpecialSals {
97
+ yangin: number[];
98
+ baekho: boolean;
99
+ goegang: boolean;
100
+ }
101
+ /** 트랜짓 항목 */
102
+ interface TransitItem {
103
+ date: Date;
104
+ type: '日運' | '月運';
105
+ transit: string;
106
+ natalName: string;
107
+ relations: Array<{
108
+ prefix: string;
109
+ relation: RelationResult;
110
+ }>;
111
+ }
112
+ /** 사주 계산 전체 결과 */
113
+ interface SajuResult {
114
+ input: BirthInput;
115
+ /** 4주 (시, 일, 월, 년 순서) */
116
+ pillars: PillarDetail[];
117
+ /** 대운 */
118
+ daewoon: DaewoonItem[];
119
+ /** 팔자 관계 */
120
+ relations: AllRelations;
121
+ /** 신살 */
122
+ specialSals: SpecialSals;
123
+ }
124
+ /** 오행국 */
125
+ interface WuXingJu {
126
+ name: string;
127
+ number: number;
128
+ }
129
+ /** 성요 정보 */
130
+ interface ZiweiStar {
131
+ name: string;
132
+ brightness: string;
133
+ siHua: string;
134
+ }
135
+ /** 궁위 정보 */
136
+ interface ZiweiPalace {
137
+ name: string;
138
+ zhi: string;
139
+ gan: string;
140
+ ganZhi: string;
141
+ stars: ZiweiStar[];
142
+ isShenGong: boolean;
143
+ }
144
+ /** 자미두수 명반 */
145
+ interface ZiweiChart {
146
+ solarYear: number;
147
+ solarMonth: number;
148
+ solarDay: number;
149
+ hour: number;
150
+ minute: number;
151
+ isMale: boolean;
152
+ lunarYear: number;
153
+ lunarMonth: number;
154
+ lunarDay: number;
155
+ isLeapMonth: boolean;
156
+ yearGan: string;
157
+ yearZhi: string;
158
+ mingGongZhi: string;
159
+ shenGongZhi: string;
160
+ wuXingJu: WuXingJu;
161
+ palaces: Record<string, ZiweiPalace>;
162
+ daXianStartAge: number;
163
+ }
164
+ /** 유월 정보 */
165
+ interface LiuYueInfo {
166
+ month: number;
167
+ mingGongZhi: string;
168
+ natalPalaceName: string;
169
+ }
170
+ /** 유년 정보 */
171
+ interface LiuNianInfo {
172
+ year: number;
173
+ gan: string;
174
+ zhi: string;
175
+ mingGongZhi: string;
176
+ natalPalaceAtMing: string;
177
+ siHua: Record<string, string>;
178
+ siHuaPalaces: Record<string, string>;
179
+ palaces: Record<string, string>;
180
+ liuyue: LiuYueInfo[];
181
+ daxianPalaceName: string;
182
+ daxianAgeStart: number;
183
+ daxianAgeEnd: number;
184
+ }
185
+ /** 12궁 별자리 */
186
+ type ZodiacSign = 'Aries' | 'Taurus' | 'Gemini' | 'Cancer' | 'Leo' | 'Virgo' | 'Libra' | 'Scorpio' | 'Sagittarius' | 'Capricorn' | 'Aquarius' | 'Pisces';
187
+ /** 행성 ID */
188
+ type PlanetId = 'Sun' | 'Moon' | 'Mercury' | 'Venus' | 'Mars' | 'Jupiter' | 'Saturn' | 'Uranus' | 'Neptune' | 'Pluto' | 'Chiron' | 'NorthNode' | 'SouthNode';
189
+ /** 행성 위치 */
190
+ interface PlanetPosition {
191
+ id: PlanetId;
192
+ longitude: number;
193
+ latitude: number;
194
+ speed: number;
195
+ sign: ZodiacSign;
196
+ degreeInSign: number;
197
+ isRetrograde: boolean;
198
+ house: number;
199
+ }
200
+ /** 하우스 cusp */
201
+ interface NatalHouse {
202
+ number: number;
203
+ cuspLongitude: number;
204
+ sign: ZodiacSign;
205
+ degreeInSign: number;
206
+ }
207
+ /** 앵글 (ASC, MC, DESC, IC) */
208
+ interface NatalAngles {
209
+ asc: {
210
+ longitude: number;
211
+ sign: ZodiacSign;
212
+ degreeInSign: number;
213
+ };
214
+ mc: {
215
+ longitude: number;
216
+ sign: ZodiacSign;
217
+ degreeInSign: number;
218
+ };
219
+ desc: {
220
+ longitude: number;
221
+ sign: ZodiacSign;
222
+ degreeInSign: number;
223
+ };
224
+ ic: {
225
+ longitude: number;
226
+ sign: ZodiacSign;
227
+ degreeInSign: number;
228
+ };
229
+ }
230
+ /** 애스펙트 종류 */
231
+ type AspectType = 'conjunction' | 'sextile' | 'square' | 'trine' | 'opposition';
232
+ /** 애스펙트 */
233
+ interface NatalAspect {
234
+ planet1: PlanetId;
235
+ planet2: PlanetId;
236
+ type: AspectType;
237
+ angle: number;
238
+ orb: number;
239
+ }
240
+ /** 네이탈 차트 전체 결과 */
241
+ interface NatalChart {
242
+ input: BirthInput;
243
+ planets: PlanetPosition[];
244
+ houses: NatalHouse[];
245
+ angles: NatalAngles;
246
+ aspects: NatalAspect[];
247
+ }
248
+
249
+ export type { AllRelations, AspectType, BirthInput, DaewoonItem, Element, Gender, LiuNianInfo, LiuYueInfo, Meteor, NatalAngles, NatalAspect, NatalChart, NatalHouse, PairRelation, Pillar, PillarDetail, PlanetId, PlanetPosition, Relation, RelationResult, SajuResult, SpecialSals, Spirit, StemInfo, TransitItem, WuXingJu, YinYang, ZiweiChart, ZiweiPalace, ZiweiStar, ZodiacSign };
package/dist/types.js ADDED
File without changes
@@ -0,0 +1,13 @@
1
+ import { ZiweiChart, LiuNianInfo } from './types.js';
2
+
3
+ declare function createChart(year: number, month: number, day: number, hour: number, minute: number, isMale: boolean): ZiweiChart;
4
+ declare function calculateLiunian(chart: ZiweiChart, year: number): LiuNianInfo;
5
+ declare function getDaxianList(chart: ZiweiChart): Array<{
6
+ ageStart: number;
7
+ ageEnd: number;
8
+ palaceName: string;
9
+ ganZhi: string;
10
+ mainStars: string[];
11
+ }>;
12
+
13
+ export { calculateLiunian, createChart, getDaxianList };
package/dist/ziwei.js ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ calculateLiunian,
3
+ createChart,
4
+ getDaxianList
5
+ } from "./chunk-KD6TCTRW.js";
6
+ import "./chunk-VJDUZB5T.js";
7
+ import "./chunk-JSBRDJBE.js";
8
+ export {
9
+ calculateLiunian,
10
+ createChart,
11
+ getDaxianList
12
+ };
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@orrery/core",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.js",
8
+ "types": "./dist/index.d.ts"
9
+ },
10
+ "./saju": {
11
+ "import": "./dist/saju.js",
12
+ "types": "./dist/saju.d.ts"
13
+ },
14
+ "./ziwei": {
15
+ "import": "./dist/ziwei.js",
16
+ "types": "./dist/ziwei.d.ts"
17
+ },
18
+ "./natal": {
19
+ "import": "./dist/natal.js",
20
+ "types": "./dist/natal.d.ts"
21
+ },
22
+ "./pillars": {
23
+ "import": "./dist/pillars.js",
24
+ "types": "./dist/pillars.d.ts"
25
+ },
26
+ "./types": {
27
+ "import": "./dist/types.js",
28
+ "types": "./dist/types.d.ts"
29
+ },
30
+ "./constants": {
31
+ "import": "./dist/constants.js",
32
+ "types": "./dist/constants.d.ts"
33
+ },
34
+ "./cities": {
35
+ "import": "./dist/cities.js",
36
+ "types": "./dist/cities.d.ts"
37
+ }
38
+ },
39
+ "files": [
40
+ "dist/"
41
+ ],
42
+ "scripts": {
43
+ "build": "tsup",
44
+ "test": "vitest run"
45
+ },
46
+ "dependencies": {
47
+ "lunar-javascript": "^1.7.7"
48
+ },
49
+ "peerDependencies": {
50
+ "swisseph-wasm": "^0.0.4"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "swisseph-wasm": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "devDependencies": {
58
+ "tsup": "^8.5.0",
59
+ "typescript": "~5.9.3",
60
+ "vitest": "^4.0.18"
61
+ }
62
+ }