aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/canvas.classes.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/api/canvas.classes.ts')
-rw-r--r--src/bun.js/api/canvas.classes.ts73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/bun.js/api/canvas.classes.ts b/src/bun.js/api/canvas.classes.ts
new file mode 100644
index 000000000..ce3cac6c3
--- /dev/null
+++ b/src/bun.js/api/canvas.classes.ts
@@ -0,0 +1,73 @@
+import { define } from "../scripts/class-definitions";
+
+export default [
+ define({
+ name: "Canvas",
+ construct: true,
+ finalize: true,
+ hasPendingActivity: true,
+ configurable: false,
+ klass: {},
+ JSType: "0b11101110",
+ proto: {
+ width: {
+ getter: "getWidth",
+ setter: "setWidth",
+ },
+ height: {
+ getter: "getHeight",
+ setter: "setHeight",
+ },
+ x: {
+ getter: "getX",
+ setter: "setX",
+ },
+ y: {
+ getter: "getY",
+ setter: "setY",
+ },
+ animate: {
+ fn: "animate",
+ length: 1,
+ },
+ close: {
+ fn: "close",
+ length: 0,
+ },
+ getContext: {
+ fn: "getContext",
+ length: 1,
+ },
+ },
+ }),
+ define({
+ name: "CanvasRenderingContext2D",
+ construct: true,
+ finalize: false,
+ configurable: false,
+ klass: {},
+ JSType: "0b11101110",
+ proto: {
+ strokeStyle: {
+ getter: "getStrokeStyle",
+ setter: "setStrokeStyle",
+ },
+ fillStyle: {
+ getter: "getFillStyle",
+ setter: "setFillStyle",
+ },
+ clearRect: {
+ fn: "clearRect",
+ length: 4,
+ },
+ fillRect: {
+ fn: "fillRect",
+ length: 4,
+ },
+ strokeRect: {
+ fn: "strokeRect",
+ length: 4,
+ },
+ },
+ }),
+];