clark-stevenson / paper.d.ts Goto Github PK
View Code? Open in Web Editor NEWARCHIVED Unofficial Typescript Definition for PaperJS
ARCHIVED Unofficial Typescript Definition for PaperJS
Would it be OK to merge these definitions into the DefinitelyTyped project, from where they might also be published to npm at @types/paper?
Hey @StickerFiend
๐
So I am not sure of the best way really.
Ideally I would be happy to transfer the whole thing to you so you can ditch me as the third wheel but I don't really know how to achieve that as not the best with Github.
You could also just copy the files from here, start your own Repo StickerFiend/paper.d.ts
Then I could put a big readme and a big dirty comment at the top of my version pointing them to your repo. This is what @natelong did a few years back https://github.com/natelong/pixi-ts-def when there was multiple competing declarations and this was before pixi typescript existed.
If you have experience of using these declarations successfully, maybe even paperjs would let you add a types
to their package.json to ship it along with the library.
options options!
I included npm package paper by giving "npm install paper". The package got added.
I wants to draw a line using paperJS. How it will be done in typescript?
Hi, in Color class function toCss has to be toCSS.
best regards!
Hi,
first of all, thank you for this definition that helps me starting a new project using typescript and paperjs.
Experimenting with it, I found that paper.Path.* static properties throw an error when trying to instantiate it as you would do with paperjs API.
new paper.Path(); // works as expected
new paper.Path.Rectangle(); // throws an error
I've searched ways to resolve it but I'm just starting with typescript and I didn't find any ways to use class static property as a constructor for another class.
Have you got an idea ?
Thank you.
Thank you very much for providing those types.
Excellent work!
This came to my attention:
let simpleLine: paper.Path.Line = new paper.Path.Line(paper.view.center, paper.view.center.add([10,10]));
simpleLine.style = { strokeColor: 'hsla(207, 100%, 33%, 1)', strokeWidth: 4 }; // reported as error, but valid and working
simpleLine.style: paper.Style | any
I use this often because it saves a lot of typing and I find it more readable.
Reference: paperjs
Pretty simple typo in the definition of cubicCurveTo.
I've noticed that property insertItems: boolean is missing from settings object in PaperScope class. And another thing - shouldn't the Path.Rectangle's first constructor be defined like this:
constructor(rectangle: paper.Rectangle, radius?: number);
instead of this:
constructor(rectangle: Rectangle, radius?: number);
given
/// <reference path="./paper.d.ts"/>
any of
import {Path} from "paper"
import {Path} from paper
import {Path} from "./paper"
Will not work.
If I change paper.d.ts to
declare module "paper" {
(declaring with a string literal), then the first import syntax will work. However, there will be no paper
object, so I'm not sure that's any good.
I guess another way of putting it would be.. How do I use it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.