Skip to content

Crawls the Adobe UXP documentation and generates Typescript declaration files

Notifications You must be signed in to change notification settings

integral-llc/adobe-uxp-types-crawler

 
 

Repository files navigation

Adobe UXP Types Crawler

Currently includes types for Adobe Photoshop.

This project crawls the Adobe UXP documentation and generates Typescript declaration files.

Usage

npm i -D adobe-uxp-types-photoshop
// tsconfig.json
{
  "compilerOptions": {
    "typeRoots": ["node_modules/@types", "node_modules/adobe-uxp-types-photoshop"],
    "types": ["adobe-uxp-types-photoshop", /* other types */] // this field is optional
  }
}

Best used together with: AdobeXD/typings

Warning: These typings are not thoroughly tested and will contain a lot of bugs! Please open an issue if you find any inconsistencies.

Intro

Currently only includes types for Photoshop

This project is a quickly hacked together Typescript .d.ts generator for Adobe UXP (for Photoshop). It uses Puppeteer to crawl https://www.adobe.io/photoshop/uxp/ps_reference/ and subpages, and dts-dom to stitch together the typings files.

See res/entrypoints.jsonc for configuration and overrides of the crawler.

Crawling

(minimum Node version: 14)

npm i
npx ts-node src/index.ts --entrypoints res/entrypoints.jsonc --templates-path res/templates --out-path tmp/out --cache-path tmp/cache

Publishing

This project is managed with a very basic Lerna setup.

npx ts-node src/index.ts --entrypoints res/entrypoints.jsonc --templates-path res/templates --out-path packages/photoshop --cache-path tmp/cache

Bumping package versions: Edit version in lerna.json and packages/photoshop/package.json.

Publishing to npm is currently done in Github Actions., based on the Lerna version. See .github/workflows/build-and-publish.yml.

Manually publishing:

npx lerna publish from-package

Credits

This project started from AdobeXD/typings, which did not include types for Photoshop. Descriptor enums and interfaces were taken from simonhenke/photoshop-types. A missing interfaces was taken from bbb999/Types-For-Adobe.

About

Crawls the Adobe UXP documentation and generates Typescript declaration files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%