added types declarations

This commit is contained in:
Ali Camarata 2023-12-01 22:41:48 +07:00
parent 612aa63a78
commit f3203d2d2b
2 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "luxon-hijri",
"version": "1.0.0",
"version": "1.0.1",
"description": "A Hijri date converter based on the Umm al-Qura calendar system, using Luxon for date manipulations.",
"main": "dist/index.js",
"types": "dist/index.d.ts",

11
src/index.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
// Define interfaces and types if necessary
interface HijriDate {
hy: number; // Hijri Year
hm: number; // Hijri Month
hd: number; // Hijri Day
}
// Export functions with their signatures
export function toGregorian(hy: number, hm: number, hd: number): Date | null;
export function toHijri(gregorianDate: Date): HijriDate | null;
export function formatHijriDate(hijriDate: HijriDate, format: string): string;