1

Let's say I import an ES6 module like this:

import * as moduleVar1 from "./variant/One.js";
import * as moduleVar2 from "./variant/Two.js";
import * as moduleVar3 from "./variant/Three.js";

Now, I e.g. select one of the loaded modules programmatically with a usual switch-case statement or similar. The selected module is saved via module = moduleVar1 (or similar) in a variable.

Finally, I want to pass the module to another function:

continueFunction(module)

Now, how do I document the parameter type in function (here continueFunction), so that it specifies that it accepts an ES6 module?

I mean, @param {Object} would likely fit, but it is not really specific.

rugk
  • 4,755
  • 2
  • 28
  • 55

1 Answers1

0

You would use the tag of the exported type. For example if all modules were a Number then you would use @param {Number}.

Alexis Tyler
  • 1,394
  • 6
  • 30
  • 48