@neonaut-pub/sketch
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-alpha.2 • Public • Published

TypeScript definitions for Sketch JavaScript API

Installation

Install and save to devDependencies:

npm install --save-dev @types/sketch@npm:@neonaut-pub/sketch

It's necessary to config TypeScript (use tsconfig.json) to use es6 lib, since:

  • "Sketch runs JavaScript code in JavaScriptCore, with full ES6 support" (Here).
{
    "compilerOptions": {
        "lib": [
            "es6"
        ]
    }
}

Summary

This package contains type definitions for Sketch JavaScript API.

Examples

import sketch from "sketch";

// `document` has the type `undefined | Document`
const document = sketch.getSelectedDocument();

// `page` has the type `Page`
const page = document.selectedPage;

Package Sidebar

Install

npm i @neonaut-pub/sketch

Weekly Downloads

1

Version

3.0.0-alpha.2

License

MIT

Unpacked Size

93.7 kB

Total Files

7

Last publish

Collaborators

  • heinergrote
  • p.golmann
  • chpio