State of Typings

Hi, referencing the samples, the typings are unusable in their current state. The panel sample doesn’t even compile without changes.

I am wondering whether or not it is worth my time to manually go through and fix the typings, or if I should wait a few weeks if you guys are planning to update the API/types.

Some typings are just invalid (e.x. using [] which is an always empty unit array). Then there is an entire EventManager API used in the panels sample that is documented nowhere, I have searched extensively.
Additionally the UXP external typings NPM package are out of date (and haven’t been updated in 2 years).

Using the documentation on the Adobe website isn’t great either, since it doesn’t denote which functions return promises, as well as the types are also flawed. A lot of params/values are just denoted as object or any. There are a lot of number parameters that clearly refer to enum values, but those aren’t documented anywhere.

2 Likes

Apologies for the inconvenience.

We are aware of our type definition and documentation issues, and it’s definitely in our plan to improve them as well as the sample panel code in the future releases. There has been other priorities such that we have not been able to work on it in details, but this is 100% a thing that has been included at our to-do-list.

Thanks for trying out UXP and feedbacks!

2 Likes

If helpful to anyone, I have gone through and attempted to update all the typings, add the undocumented APIs, and fix many of the errors in the original typings.
I setup a script to go through the global objects and scrape all their properties, which ran in the UXP debug console. It’s not great but it’s better than before.

Link

3 Likes

If the photoshop types and samples could be updated, too, I would deeply appreciate it.

Thank you for this! I need the photoshop API types, but wanted to give kudos for your work here!

2 Likes