uxp-types
Version:
Typescript definitions for the Adobe UXP API
46 lines (36 loc) • 1.1 kB
Markdown
> Typescript definitions for the Adobe UXP API
```sh
npm install -D uxp-types
yarn add --dev uxp-types
```
```js
// tsconfig.json
{
"compilerOptions": {
...,
// Prefered
"moduleResolution": "node",
"esModuleInterop": true,
// typeRoots override defaults, so be sure to include the implicit @types as well
"typeRoots": [
"node_modules/@types",
"node_modules/uxp-types",
]
}
}
```
```ts
import { storage } from "uxp";
import { action } from "photoshop";
storage.localFileSystem.getFileForOpening(...)
action.batchPlay(...)
```
This is a simple drop in set of types with minimal configuration that also supports importing `uxp` and `photoshop` directly in Typescript projects.
The uxp types have been generated by running [dts-gen](https://github.com/microsoft/dts-gen) in the Adobe UXP Developer Tools within Photoshop then hand modified to better type the API.
The photoshop types are pulled directly from @simonhenke [photoshop-types](https://github.com/simonhenke/photoshop-types) repository.