opensource-nepal / node-nepali-datetime

A Node project designed to support native JavaScript-like features for Nepali date and times. It includes features such as 'NepaliDate' for Nepali date support and 'dateConverter' for date conversions.
GNU General Public License v3.0
63 stars 18 forks source link

feat: constructor overloaded docstring added with type validation #53

Closed n1rjal closed 1 year ago

n1rjal commented 1 year ago

Constructor overloading with typescript and examples of each cases are added like in Native Javascript Date constructor in Typescript.

Description

I have introduced Typescript types and examples of each case using constructor overloading and tsdoc examples implementation. It increases readabiloty and usability of the code for end users. It also provides various type safety features.

Related Issue

This PR is related to issue #11

Type of Change

Please mark the appropriate option below to describe the type of change your pull request introduces:

Checklist

Additional Notes

I have also added some as unknown as boolean in some failing tests too make it typescript error free. Here are some of the changes that a user of the package can see.

image image image image image image image

By submitting this pull request, I confirm that I have read and complied with the contribution guidelines of this project.