The title might be a bit unclear, but here's a code:

**fruits.js**

```
class Fruit {
  constructor(color, taste) {
    this.color = color;
    this.taste = taste;
  }

  get fruitColor() {
    return this.color;
  }

  get fruitTaste() {
    return this.taste;
  }
}

const Fruits = {
  APPLE: new Fruit("green", "sweet"),
  LEMON: new Fruit("yellow", "sour"),
};

module.exports = { Fruits };

```

**my.class.js**

```
const { Fruits } = require("./fruits");

class MyClass {

  // I want a jsdoc here in order to get intellisense
  // and be able to have access to all fruit methods like 'fruitColor'
  getFruitColor(fruit) {
    return fruit.fruitColor;
  }

  getAppleColor() {
    return this.getFruitColor(Fruits.APPLE);
  }
}

module.exports = new MyClass();

```

**index.js** (does not actually matters in terms of the question)

```
const MyClass = require("./my.class");

const appleColor = MyClass.getAppleColor();
console.log(appleColor);

```

So I have this object `Fruits`. Each key value of it is an instance of the class Fruit (but with a different properties). When I'm passing this object's property as an argument I want to document it so I can get intellisense inside a function which accessing the 'Fruit' class methods.

Of course I don't want to hardcode it's properties because object `Fruits` can have lot's of different keys (orange, pineapple, pear etc. ).

Is ther some way to say something like:

```
/**
* @param {propertyvlaue of type Fruits}
*/

```

or

```
/**
* @param {fruit: <typeof Fruits.>}
*/

```

Or should I maybe use @typedef somewhere in `MyClass`?

**UPD:**
After trying to understand Graham P Heath answer I tried:

```
const { Fruits } = require("./fruits");

class MyClass {
  /**@param {Object.<string, Fruit>} */
  getFruitColor(fruit) {
    return fruit.fruitColor;
  }

```

But the problem is that `MyClass` does not know anything about class `Fruit` (which is the value of each key inside `Fruits` object)