thejustinwalsh / uxp-types

Typescript definitions for the Adobe UXP API

Home Page:https://www.npmjs.com/package/uxp-types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UXP Types

Typescript definitions for the Adobe UXP API

Install

npm install -D uxp-types
# or
yarn add --dev uxp-types

Config

// 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",
    ]
  }
}

Usage

import { storage } from "uxp";
import { action } from "photoshop";

storage.localFileSystem.getFileForOpening(...)

action.batchPlay(...)

Why

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 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 repository.

About

Typescript definitions for the Adobe UXP API

https://www.npmjs.com/package/uxp-types

License:MIT License