Skip to content

Added definition of ElementPlacement. #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

YukiWorks432
Copy link

@YukiWorks432 YukiWorks432 commented May 12, 2025

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

Changed the argument type of insertionLocation to ElementPlacement.
@zlovatt
Copy link
Member

zlovatt commented May 17, 2025

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)

@YukiWorks432
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants