JSdoc - Custom Type For Object Key For Autocompletion

Viewed 44

I wanted to get autocompletion on AnimStore for AnimKey (the key that gets the AnimLeaf).

AnimKey is user defined, so I can't create a list of possible strings.

/**
 * @typedef {string} AnimKey
   having a non generic in the first element makes AnimStore any
 * @typedef {Object.<string, AnimLeaf>} AnimStore
 */

Is there a way to make Object.<AnimKey, AnimLeaf> work, or another way to get autocompletion for AnimStore["this key"]

0 Answers
Related