docsforadobe / Types-for-Adobe

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

Separate PlugPlugExternalObject types #43

Closed vespakoen closed 6 years ago

vespakoen commented 6 years ago

This is an improvement over https://github.com/pravdomil/Types-for-Adobe/pull/30. This time I added the CSXSEvent types in a separate type definition. ExternalObject should be available in all Adobe environments, it allows one to load native frameworks. The "PlugPlugExternalObject" is a framework that comes with Adobe tools by default and provides communication from ExtendScript to the CEP host, once this framework is loaded the CSXS type is available in the ExtendScript environment, so when using the framework you should now simply add this definition file to your tsconfig.json.

Is this the right approach? Or should we put it somewhere else?

vespakoen commented 6 years ago

I was unable to load the file in my project so I created a folder + tsconfig.json for easy loading, my compilerOptions looks something like this now:

{
    // ...
    "types": [
      "AfterEffects/2018",
      "shared/PlugPlugExternalObject"
    ],
    "typeRoots": [
      "../../node_modules/types-for-adobe"
    ]
    // ...
}

And that works fine. Hope this works for you too ;)

vespakoen commented 6 years ago

By the way, I was wondering if you would be up for a chat, I am going to be using these types a lot and will hopefully be able to bring in a lot of improvements soon.

I am trying to find a way to use multiple types together in a single project and am struggling to find the right approach here, I am considering using namespaces but that probably is going to add to much bloat for "single environment use", would love to discuss it further, please email me @ hello[at]koenschmeets.nl

pravdomil commented 6 years ago

Hi, I'm lazy to review to PR this week, I will take a look at it next week, stay tuned

pravdomil commented 6 years ago

can you use prettier on changed files?

pravdomil commented 6 years ago

I am trying to find a way to use multiple types together in a single project

types-for-adobe will always pollute the global namespace I think, so by now there is no way how to use multiple types without conflicts

melMass commented 4 years ago

How to use this PR? I still got 'Cannot find name 'ExternalObject''