Automattic / node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.22k stars 1.17k forks source link

Document or list/reference `ImageData` and other missing public APIs and further clarify which are non-standard #1476

Open brettz9 opened 5 years ago

brettz9 commented 5 years ago

Feature

Could the API for createImageData be replaced by or supplemented by ImageData for slightly easier parity with the browser constructor?

Steps to Produce

const {ImageData} = require('canvas');
const data = new ImageData(200, 200);

Your Environment

zbjornson commented 5 years ago

That exact code snippet works, actually. The full list of exported classes, functions and constants is here:

https://github.com/Automattic/node-canvas/blob/7baaecfe13638fb8406f5277e97bb99e26afef51/index.js#L51-L84

brettz9 commented 5 years ago

Ah, ok, cool. :) And thanks. But I'd suggest documenting or at least listing or linking to these on the README.

I also think the descriptions could better clarify or be subcategorized at the heading or intro level--i.e., without needing to drill down to the individual definition. Namely, which of the so-called "Non-standard" APIs are actually enhanced or modified standards and which are wholly non-standard--including the utility functions.