otris / jsdoc-tsd

JSDoc template for generating TypeScript definition files based on JSDoc comments.
MIT License
29 stars 7 forks source link

Multi-dimensional array with different types #41

Closed allejo closed 6 years ago

allejo commented 6 years ago

Given I have the following jsdoc for a function,

/**
 * @param {Array<Array<string|CustomObject>>} [field] ...
 */
function myFunction(field) {}

This is the resulting invalid TS that I get:

static myFunction(field?: Array.<(string|CustomObject)[]): void;

Is there a correct way of handling multi-dimensional arrays of different types or is this a bug in the generation?

wehrstedt commented 6 years ago

This is a bug in the current version, but the issue belongs to #39 and #38. I will try to fix it now.

allejo commented 6 years ago

Great! Thanks for the fix 👍