Typescript definitions for UXP?

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?

1 Like

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 :wink:

1 Like

I appreciate the help, thank you

1 Like