Code Completion for AUI / AJS in JavaScript


I am starting to write a Confluence User Macro and I was wondering how I can get JavaScript code completion e.g. in Visual Studio Code (or any other editor) for AUI / AJS.

I would like to know what is behind AJS.*. Like AJS.toInit() or AJS.Confluence.* and so on.

Thanks, Daniel


Lol yes please I’ve just been trial and error for far too long :slight_smile:

I haven’t seen it anywhere, for me it is usually rampaging through the AJS docs… Also with atlassian guys focused towards the Forge I really doubt that there will be AJS autocompletion anytime soon…

Forge is nice but Cloud is still something my industry can never use so it’s always nice to see but pointless for me.


I’m not personally aware of any typings/code-complete for AUI and AJS values. Though I recognise their value, unfortunately, creating them it’s not on the Server platform team’s roadmap.

If there’s anyone in the community who has started or maintaining their own typings for these libraries, we could take a look at those as a starting point and point the community toward a common solution. At this stage, though, I can’t promise any time toward maintaining a set of typings.

1 Like

I have the same require. I don’t want my IntelliJ warn me every time I call AJS.toInit or whatever code like that.

I believe that you only need to put the Javascript file to the global library in IntelliJ and it will recognize this lib.

This is my workaround solution to get rid of those warnings. Just add this JS file to your Editor’s libraries, the file can be found here: ajs.js · GitHub
This js file defines the methods that I want IntelliJ to recognize.

1 Like

@NhacTatNguyen .
Thanks. That’s useful advice.

I also found ajs-type - npm which is provided by //SEIBERT/MEDIA which has more methods.

Hope it helps :smiley:

1 Like