hebcal / hebcal-js

⛔️ DEPRECATED - a perpetual Jewish Calendar (JavaScript)
GNU General Public License v3.0
123 stars 40 forks source link

PR proposal: Add JSDoc types #70

Closed barakplasma closed 1 year ago

barakplasma commented 4 years ago

Would you accept a PR which added JSDoc types?

For example:

/**
 * @typedef {number | [number, number]} locationCoordinate
 */
/**
 * @param {locationCoordinate} lat
 * @param {locationCoordinate} lon
 */
HebcalProto.setLocation = function(lat, lon) {
    this.months.forEach(function(m){
        m.setLocation(lat, lon);
    });
    return this;
};

This could assist users of VS Code with Intellisense via JSDoc. Additionally, lets us run a bit of Typescript checking on the library. See also https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc

Scimonster commented 4 years ago

That would be awesome!

Arrow7000 commented 4 years ago

@barakplasma I'd be really grateful if you did this!