I know it is possible to build a UXP plugin using Typescript, which I would like to do. Is there an existing @types project for InDesign and InDesign UXP? Is there another project other than @types that might have the definitions?
I got ok-ish to good results with this file:
Itâs a mix takes the UXP types by @thejustinwalsh (there are also other projects out there that have, some more updated than others, type definitions for the core UXP APIs) and the classic âTypes for Adobeâ projectâs InDesign types for the host-app-specific APIs, removes all the declare
keywords in it, and wraps it in a declare module âindesignâ {âŚ}
.
Thereâs also currently an active effort by Adobe to have official TypeScript definitions for at least the core UXP APIs, but Iâve had a few issues trying it a few days ago, so it might still take a few days/weeks for those to be usable âwithout interventionâ.
PS: Note that those solutions arenât super pretty or working perfectly, yet (so using them for strict type checking might cause issues). But itâs better than nothing at least
I appreciate the help, thank you
Do you know if thereâs any update on official Adobe typings for InDesign (or maybe somewhere to see progress)? Iâm using this file you linked here, and it works, but itâd be nice to be backed by Adobe.
Not to my knowledge (although I donât work for Adobe anymore â maybe @pkrishna has some more up-to-date information, since Iâm not sure whoâs responsible for the InDesign end of things at the moment?).
Unfortunately, the way this works on Adobeâs end is that the InDesign APIs (everything in require('indesign')
) is managed by the host app team (i.e., here, the InDesign team), while the core UXP APIs are managed by the UXP team. So the fact that UXP, by now, provides official types (which still leave lots of room for improvement with quite a lot of wrong and/or any
types, but hey â at least we now have official types), and Photoshopâs UXP APIs have had well-working type definitions for a long time, we can only hope (but I donât think itâs very likely to happen) that the InDesign team decides to commit resources to supporting TypeScript definitions for their APIs .
The InDesign scripting documentation is abysmal nowadays. Way back with ExtendScript Toolkit browsing the API wasnât too bad (though ESTK was super buggy), but since then the only usable documentation has been third-party. Now that doesnât seem to have been updated since InDesign 2022 either sadlyâŚ
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html
How difficult could it be for Adobe to generate similar up-to-date web documentation based on whatever internal format they have for this? And generate TypeScript definitions as well? The only official documentation right now has no categories and no cross-references making it very hard to browse.
You wonât get any argument from me. However, while I agree that the things provided officially at the moment are (in terms of reference) unusable, I will say that:
(tl;dr: if we want to have things like TypeScript definitions and a proper API reference, they will have to come from the developer community)
Truthfully: very. Not due to technical challenges, but more so a mix of the amount of cross-team efforts this would take (there are >= 3 teams that would have to commit to work on this). Combined with what, in my opinion, is a complete and utter under-staffing and under-resourcing of desktop extensibility ever since Adobe Express / Web Extensibility is a thing. And to get three teams to have the resources to do something that isnât deemed strategically important (like the web extensibility at the moment is) is next to impossible.
To be clear: Iâm not saying this to claim that the platform is bad. It isnât. Iâm still a plugin developer after having worked on the platform (and, in fact, the InDesign UXP launch) myself during my time at Adobe. But: I wouldnât hold my breath waiting for Adobe to provide a good API reference themselves. Which is sad, but it is what it is.
Even more so, unfortunately. For more reasons than I have the time to write here.
I realize that my response sounds very much like an old grumpy person . And perhaps I am â a little. But my reason for (while agreeing that this would be greatly beneficial to all of us) so bluntly rejecting these claims of âhow difficult can it beâ is that: Based on my experience (both as a plugin developer and former Adobe employee), as much as I regret to say this, these will probably never happen.
This isnât to blame on any of my former co-workers â what they can achieve to help all of us with the limited resources they have assigned to them is incredible! But: this situation means that things that, from the outside, let us think âhow difficult can it beâ can be impossible to achieve (which is frustrating for both sides).
So where does this leave us? With the conclusion that if we want these things (which a lot of us do, I think), they will have to (continue to) come from us, the community. Back when UXP was entirely new (and only in Adobe XD), the developer community was extremely tight-knit, which helped with these sorts of things. This is somewhat more complicated with UXP in InDesign, as the dynamics in the developer community are far more complicated (devs coming from InDesign to UXP, UXP to InDesign, entirely new, etc.). The ExtendScript based extensibility, of course, had a lot of dev community resources (including, but not limited to, indesignjs.de.
What we have to do now is to find a way for this sort of community effort to be established in the âUXP meets InDesignâ land. I very much hope (and like to think) that we will find this way.
Because, for better or for worse: I donât see a way where these things will be provided by Adobe.