How to specify a Javascript Promise as an operation's return type

Hi… I have created a class File which has an operation named load().

In VP, I want to specify that the load operation is asynchronous. I also want to define the return type as a Javascript Promise which resolves with the type text.

Basically, I want to document this Javascript class in Visual Paradigm:

class File {
  async load () {
    return 'something'
  }
}

Does anyone have any opinions on how to achieve this?

Hi 75lb,

Thank you for your inquiry. I have forwarded your question to our team for further review. When there is any news, I will share it with you.

Best regards,
Jick Yeung

Hi 75lb,

We do not support generating JavaScript, so I suppose you are asking for the way to model async method in UML. As we know, UML does not specify how to represent async method. If you want to draw a diagram for documentation purposes, I suggest you specify the return type of your method as : “Promise”
image

Best regards,
Jick Yeung