This package has been deprecated

Author message:

Use @neonaut/sketch instead

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

3.0.0-alpha.0 • Public • Published

TypeScript definitions for Sketch JavaScript API

Installation

Install and save to devDependencies:

npm install --save-dev @types/sketch@npm:@chpio/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 @chpio/sketch

Weekly Downloads

1

Version

3.0.0-alpha.0

License

MIT

Unpacked Size

93.9 kB

Total Files

7

Last publish

Collaborators

  • chpio