adobe-uxp-types-crawler
adobe-uxp-types-crawler copied to clipboard
Crawls the Adobe UXP documentation and generates Typescript declaration files
Adobe UXP Types Crawler
Currently includes types for Adobe Photoshop and UXP.
This project crawls the Adobe UXP documentation and generates Typescript declaration files, merging them with manually created types.
Usage
npm i -D @adobe-uxp-types/photoshop
npm i -D @adobe-uxp-types/uxp
// tsconfig.json
{
"compilerOptions": {
"typeRoots": ["node_modules/@types", "node_modules/@adobe-uxp-types"],
"types": ["photoshop", "uxp", /* other types */] // this field is optional
}
}
Looking for GroupLayer
or layerTree
? These were removed in newer versions of the UXP API. For Photoshop, make sure your manifest.json
has host.data.apiVersion
set to 2
!
Warning: These typings are not thoroughly tested and will contain a lot of bugs! Please open an issue if you find any inconsistencies.
The @adobe-uxp-types organization is not an official Adobe project
Intro
Currently only includes types for Photoshop and UXP
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:
npx lerna version <version> --no-git-tag-version
Then commit. Git tags are added by Github Actions.
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.Other types were taken from @types/photoshop. A missing interface was taken from bbb999/Types-For-Adobe. The common UXP typings were taken from thejustinwalsh/uxp-types.