docsforadobe / Types-for-Adobe

TypeScript types for Adobe: AfterEffects, Animate, Audition, Illustrator, InDesign, Photoshop, Premiere, ScriptUI.
532 stars 126 forks source link

`typename` fields are missing (at least for Illustrator) #51

Closed martijnthe closed 11 months ago

martijnthe commented 6 years ago

The JS API doc of Illustrator (2017) contains typename fields for almost (if not all) classes. Theses are missing from the .d.ts. I guess they're missing from the .xml definitions too? Should I open a PR for this?

I'm trying to figure out the best way to switch based on the subclass. I noticed instance.prototype returns undefined so I figured typename would be the second best. I guess I could do a big if ... else if .... using a bunch of instanceofs, but this doesn't seem very clean nor efficient.

pravdomil commented 4 years ago

open pr

zlovatt commented 11 months ago

Closed as these are present in the .d.ts files in this repo.

ganicus commented 9 months ago

Consider to reopen... not present in Color parent class. It causes problems when doing switch statements using swatch colors and doing conditional logic off Color instances typename.

Shouldn't declare class Color{} have: declare class Color{ typename: string }