diff --git a/types/hotwired__turbo/hotwired__turbo-tests.ts b/types/hotwired__turbo/hotwired__turbo-tests.ts index 245cd39ce34c2c..98c550bb627ab4 100644 --- a/types/hotwired__turbo/hotwired__turbo-tests.ts +++ b/types/hotwired__turbo/hotwired__turbo-tests.ts @@ -47,6 +47,11 @@ turboFrame.src; turboFrame.src = "/messages"; turboFrame.src = null; +// $ExpectType "morph" | null +turboFrame.refresh; +turboFrame.refresh = "morph"; +turboFrame.refresh = null; + const turboStream = document.querySelector("turbo-stream")!; // $ExpectType StreamElement diff --git a/types/hotwired__turbo/index.d.ts b/types/hotwired__turbo/index.d.ts index 56a0d23125945b..df503b48ebe9a3 100644 --- a/types/hotwired__turbo/index.d.ts +++ b/types/hotwired__turbo/index.d.ts @@ -1,5 +1,6 @@ export class FrameElement extends HTMLElement { src: string | null; + refresh: "morph" | null; disabled: boolean; loading: "eager" | "lazy"; loaded: Promise; diff --git a/types/svgcanvas/index.d.ts b/types/svgcanvas/index.d.ts index 724679ec278eb0..4b1e149b9486d8 100644 --- a/types/svgcanvas/index.d.ts +++ b/types/svgcanvas/index.d.ts @@ -34,18 +34,6 @@ export interface C2SOptions { debug?: boolean; } -/** - * CanvasGradient for creating color gradients - */ -export interface CanvasGradient { - /** - * Adds a color stop to the gradient - * @param offset - A number between 0 and 1 - * @param color - A CSS color string - */ - addColorStop(offset: number, color: string): void; -} - /** * CanvasPattern for creating pattern fills */ @@ -53,11 +41,14 @@ export interface CanvasGradient { export interface CanvasPattern {} /** - * TextMetrics - measurement results from measureText() + * @deprecated Use the global DOM CanvasGradient type instead. */ -export interface TextMetrics { - width: number; -} +export type CanvasGradient = globalThis.CanvasGradient; + +/** + * @deprecated Use the global DOM TextMetrics type instead. + */ +export type TextMetrics = globalThis.TextMetrics; /** * Context - implements most of CanvasRenderingContext2D API but generates SVG diff --git a/types/svgcanvas/svgcanvas-tests.ts b/types/svgcanvas/svgcanvas-tests.ts index ee8adecb69f4ab..3af640d1a57920 100644 --- a/types/svgcanvas/svgcanvas-tests.ts +++ b/types/svgcanvas/svgcanvas-tests.ts @@ -1,4 +1,4 @@ -import { C2SOptions, CanvasGradient, CanvasPattern, Context, Element } from "svgcanvas"; +import { Context, Element } from "svgcanvas"; // Test Context construction // $ExpectType Context