UNPKG

@marchingy/lunar

Version:

Chinese calendar with the 24 solar terms.

26 lines (25 loc) 1.4 kB
import { ChineseDate } from './lunar-calendar'; /** * @description GB/T 33661-2017 农历的编算和颁行 * @link http://c.gb688.cn/bzgk/gb/showGb?type=online&hcno=E107EA4DE9725EDF819F33C60A44B296 */ export declare class SolarTerm { label: string; date?: ChineseDate; readonly order: number; readonly longitude: number; constructor(order: number, label: string); toString: () => string; isMidTerm(): boolean; static create(index: number, lang?: Array<string> | ReadonlyArray<string>): SolarTerm; } export declare function create24SolarTerms(lang?: Array<string> | ReadonlyArray<string>): Map<number, SolarTerm>; export declare function calcMoonEclipticLongitude(targetDate: Date, coordinate?: GeoJSON.Position): number; export declare function calcSunEclipticLongitude(targetDate: Date, coordinate?: GeoJSON.Position): number; export declare function calcDiffOfSunAndMoon(time: Date, coordinate?: GeoJSON.Position): number; export declare function getTermOnDay(date: Date, coordinate?: GeoJSON.Position): SolarTerm | null; export declare function countSolarTerms(fromDate: Date, toDate: Date, coordinate?: GeoJSON.Position): Array<SolarTerm>; /** * This method will countSolarTerms with params that are the first date and the latest date of the year. */ export declare function getTermsOnYear(year: number, coordinate?: GeoJSON.Position): Array<SolarTerm>;