Skip to content

Typings for Adobe XD API Surfaces

License

Notifications You must be signed in to change notification settings

arniebradfo/typings

 
 

Repository files navigation

Adobe XD Plugin API typings

Typings for Adobe XD and (UXP)[https://www.adobe.io/xd/uxp/uxp/] Plugin Development

typings-supported autocompletion features in JetBrains WebStorm

Getting started

These Type Declaration files provide your IDE (e.g. Visual Studio Code or WebStorm) with information about the XD API surface, enabling type checking, autocomplete suggestions, and more.

To get started

  • install the package via npm:
    npm i adobexd-types`
    
  • add the typings file to "typeRoots" your jsconfig.json or tsconfig.json:
    {
      "compilerOptions": {
        "typeRoots": ["node_modules/adobexd-types"]
      },
    }
  • (optional) add the UXP WebComponents to the JSX.IntrinsicElements namespace by adding a reference to a types.d.ts file
    /// <reference path="./node_modules/adobexd-types/uxp/jsxWebComponents.d.ts" /> 

About these type files

These type declarations track the contents of the official documentation. If an issue with the type declarations stems from an issue with the official documentation, then the type declaration files will be fixed once the issue is addressed in the documentation. This is intentional so as to keep the type declarations both maintainable and in sync with the documentation.

A few notable exceptions include:

  • The application.import() function cannot be declared because import is a reserved TypeScript keyword (not sure if this can be fixed). It is declared as application.importFiles() instead.
  • To avoid ambiguity with the DOM Selection type, the interface Selection is also provided as an alias XDSelection and exported from the 'scenegraph' module

Original Documentation Links

About

Typings for Adobe XD API Surfaces

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%