Types-for-Adobe icon indicating copy to clipboard operation
Types-for-Adobe copied to clipboard

Added definition of ElementPlacement.

Open YukiWorks432 opened this issue 6 months ago • 2 comments

#143 Added definition of ElementPlacement. Accordingly, the type of the argument insertionLocation has been changed to ElementPlacement.

YukiWorks432 avatar May 12 '25 14:05 YukiWorks432

Hi! See the top of the Illustrator typedef files for reference on how to declare enums. It'd be worth checking what the enumerated value equals, too, for accuracy!

Also note that the Illustrator docs have both a 2015.3 and a 2022 version, and this change should be added to both (assuming the enum exists in both)

zlovatt avatar May 17 '25 13:05 zlovatt

Hi! I tried outputting it with alert, and for example:

alert(ElementPlacement.INSIDE) // shows "ElementPlacement.INSIDE"
alert(typeof ElementPlacement.INSIDE) // shows "object"

so I’m not sure whether it’s actually a string or an object. That’s why I wrote it the way I did but how should I declare it correctly? Sorry, I’m not very familiar with TypeScript… I don't know if this is correct, but I converted it to enum by specifying a string.

Also, I don’t have an environment to test against Illustrator 2015.3, so I didn’t update that version, but it does look like the enum existed back then. I’ll go ahead and add it.

YukiWorks432 avatar May 17 '25 14:05 YukiWorks432