From 1f2ae690b8466ff9c04549977ac0ffdc6d4457d4 Mon Sep 17 00:00:00 2001 From: Steven Lin Date: Thu, 1 May 2025 22:09:38 +0800 Subject: [PATCH] Move FillStyle --- src/CanvasAPI.res | 6 ++++-- src/{DOMAPI => CanvasAPI}/FillStyle.js | 4 ++-- src/{DOMAPI => CanvasAPI}/FillStyle.res | 0 src/DOMAPI.res | 4 +--- tests/DOMAPI/HTMLCanvasElement__test.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/{DOMAPI => CanvasAPI}/FillStyle.js (73%) rename src/{DOMAPI => CanvasAPI}/FillStyle.res (100%) diff --git a/src/CanvasAPI.res b/src/CanvasAPI.res index e7e431b..e1b820e 100644 --- a/src/CanvasAPI.res +++ b/src/CanvasAPI.res @@ -117,6 +117,8 @@ type webGLPowerPreference = | @as("high-performance") HighPerformance | @as("low-power") LowPower +@editor.completeFrom(FillStyle) type fillStyle + /** [See OffscreenCanvas on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas) */ @@ -183,11 +185,11 @@ type offscreenCanvasRenderingContext2D = { /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeStyle) */ - mutable strokeStyle: unknown, + mutable strokeStyle: fillStyle, /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillStyle) */ - mutable fillStyle: unknown, + mutable fillStyle: fillStyle, /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX) */ diff --git a/src/DOMAPI/FillStyle.js b/src/CanvasAPI/FillStyle.js similarity index 73% rename from src/DOMAPI/FillStyle.js rename to src/CanvasAPI/FillStyle.js index d12dfc1..7a8e910 100644 --- a/src/DOMAPI/FillStyle.js +++ b/src/CanvasAPI/FillStyle.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebAPI from "../CanvasAPI/CanvasPattern.js"; -import * as CanvasGradient$WebAPI from "../CanvasAPI/CanvasGradient.js"; +import * as CanvasPattern$WebAPI from "./CanvasPattern.js"; +import * as CanvasGradient$WebAPI from "./CanvasGradient.js"; function decode(t) { if (CanvasGradient$WebAPI.isInstanceOf(t)) { diff --git a/src/DOMAPI/FillStyle.res b/src/CanvasAPI/FillStyle.res similarity index 100% rename from src/DOMAPI/FillStyle.res rename to src/CanvasAPI/FillStyle.res diff --git a/src/DOMAPI.res b/src/DOMAPI.res index 78549c9..36d016c 100644 --- a/src/DOMAPI.res +++ b/src/DOMAPI.res @@ -198,8 +198,6 @@ type shareData = { mutable url?: string, } -@editor.completeFrom(FillStyle) type fillStyle - /** @editor.completeFrom(Window) The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. [See Location on MDN](https://developer.mozilla.org/docs/Web/API/Location) @@ -9517,7 +9515,7 @@ type canvasRenderingContext2D = { /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeStyle) */ - mutable strokeStyle: unknown, + mutable strokeStyle: fillStyle, /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillStyle) */ diff --git a/tests/DOMAPI/HTMLCanvasElement__test.js b/tests/DOMAPI/HTMLCanvasElement__test.js index 1b4ec3b..4a8b94e 100644 --- a/tests/DOMAPI/HTMLCanvasElement__test.js +++ b/tests/DOMAPI/HTMLCanvasElement__test.js @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as FillStyle$WebAPI from "../../src/DOMAPI/FillStyle.js"; +import * as FillStyle$WebAPI from "../../src/CanvasAPI/FillStyle.js"; let myCanvas = document.getElementById("myCanvas");