# Code Completion for AUI / AJS in JavaScript

**URL:** <https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035>\
**Category:** Confluence Server\
**Tags:** javascript, user-macro, aui\
**Created:** [January 21, 2020, 12:52am UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035 "2020-01-21T00:52:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielKuehner](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/danielkuehner/32/39103_2.png) [@DanielKuehner](https://community.developer.atlassian.com/u/DanielKuehner)\
**Post date:** [January 21, 2020, 12:52am UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/1 "2020-01-21T00:52:26Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![sfbehnke](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sfbehnke/32/34486_2.png) [@sfbehnke](https://community.developer.atlassian.com/u/sfbehnke)\
**Post date:** [January 21, 2020, 11:17pm UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/2 "2020-01-21T23:17:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mcobanov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/mcobanov/32/38951_2.png) [@Mcobanov](https://community.developer.atlassian.com/u/Mcobanov)\
**Post date:** [January 23, 2020, 3:10pm UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/3 "2020-01-23T15:10:43Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![sfbehnke](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sfbehnke/32/34486_2.png) [@sfbehnke](https://community.developer.atlassian.com/u/sfbehnke)\
**Post date:** [January 23, 2020, 5:41pm UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/4 "2020-01-23T17:41:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/daz/32/35911_2.png) [@daz](https://community.developer.atlassian.com/u/daz)\
**Post date:** [January 29, 2020, 4:57am UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/5 "2020-01-29T04:57:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nhac.tat.nguyen](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/nhac.tat.nguyen/32/39032_2.png) [@nhac.tat.nguyen](https://community.developer.atlassian.com/u/nhac.tat.nguyen)\
**Post date:** [August 30, 2020, 8:09am UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/6 "2020-08-30T08:09:25Z")

</div>

I have the same require. I don’t want my IntelliJ warn me every time I call `AJS.toInit` or whatever code like that.  
 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/b/f/bf1ec18c8bdf2e1af68158f90b7131bf08549906.png)

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

 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/9/0/9092ff66d91fd4953972739381edc11be983ebe8.png)

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](https://gist.github.com/NguyenTatNhac/b68a260899917d059d50687806562e45)  
This js file defines the methods that I want IntelliJ to recognize.  
 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/6/7/6775571ad1b05d97cc3894745eabb209233a5ff1.png)

---

<div class="post-metadata">

**Author:** ![huasoon](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/huasoon/32/38299_2.png) [@huasoon](https://community.developer.atlassian.com/u/huasoon)\
**Post date:** [April 17, 2021, 9:43am UTC](https://community.developer.atlassian.com/t/code-completion-for-aui-ajs-in-javascript/35035/7 "2021-04-17T09:43:30Z")

</div>

@anon8500491 .  
Thanks. That’s useful advice.

I also found [ajs-type - npm](https://www.npmjs.com/package/ajs-type) which is provided by //SEIBERT/MEDIA which has more methods.

Hope it helps 😃
