kungfooman / RuntimeTypeInspector.js

Checking JSDoc types at runtime for high-quality types - Trust is good, control is better.
MIT License
8 stars 0 forks source link

Implement named tuples #88

Closed kungfooman closed 7 months ago

kungfooman commented 7 months ago

Fixes: #87

Input:

/**
 * Named tuple to indicate the order we are using is (height x width), even though
 * the Graphics’ industry standard is (width x height).
 * @typedef {[height: number, width: number]} HeightWidth
 */

Generated output:

registerTypedef('HeightWidth', {
  "type": "tuple",
  "elements": [
    "number",
    "number"
  ]
});