-
Notifications
You must be signed in to change notification settings - Fork 17
/
lune.d.ts
77 lines (77 loc) · 2.22 KB
/
lune.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
declare module "julian" {
/**
*
* @param {Date} date
* @returns {number}
*/
export function fromDate(date: Date): number;
/**
*
* @param {number} julian
* @returns {Date}
*/
export function toDate(julian: number): Date;
}
declare module "lune" {
export type Phase = {
phase: number;
illuminated: number;
age: number;
distance: number;
angular_diameter: number;
sun_distance: number;
sun_angular_diameter: number;
};
export type PhaseHunt = {
new_date: Date;
q1_date: Date;
full_date: Date;
q3_date: Date;
nextnew_date: Date;
};
const NEW: 0;
const FIRST: 1;
const FULL: 2;
const LAST: 3;
/**
* @typedef {Object} Phase
* @property {number} phase
* @property {number} illuminated
* @property {number} age
* @property {number} distance
* @property {number} angular_diameter
* @property {number} sun_distance
* @property {number} sun_angular_diameter
*/
/**
* Finds the phase information for specific date.
* @param {Date} date Date to get phase information of.
* @return {Phase} Phase data
*/
export function phase(date: Date): Phase;
/**
* @typedef {Object} PhaseHunt
* @property {Date} new_date
* @property {Date} q1_date
* @property {Date} full_date
* @property {Date} q3_date
* @property {Date} nextnew_date
*/
/**
* Find time of phases of the moon which surround the current date.
* Five phases are found, starting and ending with the new moons
* which bound the current lunation.
* @param {Date} sdate Date to start hunting from (defaults to current date)
* @return {PhaseHunt} Object containing recent past and future phases
*/
function phaseHunt(sdate: Date): PhaseHunt;
/**
*
* @param {Date} start
* @param {Date} end
* @param {number} phase
* @returns {Date[]}
*/
function phaseRange(start: Date, end: Date, phase: number): Date[];
export { NEW as PHASE_NEW, FIRST as PHASE_FIRST, FULL as PHASE_FULL, LAST as PHASE_LAST, phaseHunt as phase_hunt, phaseRange as phase_range };
}