diff --git a/types/hotwired__turbo/hotwired__turbo-tests.ts b/types/hotwired__turbo/hotwired__turbo-tests.ts index 4bc74319abaabc..5e3f6a582d3f63 100644 --- a/types/hotwired__turbo/hotwired__turbo-tests.ts +++ b/types/hotwired__turbo/hotwired__turbo-tests.ts @@ -151,6 +151,13 @@ document.addEventListener("turbo:submit-end", function(event) { } }); +document.addEventListener("turbo:before-morph-attribute", function(event) { + // $ExpectType string + event.detail.attributeName; + // $ExpectType "update" | "remove" + event.detail.mutationType; +}); + // Test start() function start(); diff --git a/types/hotwired__turbo/index.d.ts b/types/hotwired__turbo/index.d.ts index bfd2d8a12449be..fa0c1ce206aec8 100644 --- a/types/hotwired__turbo/index.d.ts +++ b/types/hotwired__turbo/index.d.ts @@ -520,7 +520,7 @@ export type TurboMorphElementEvent = CustomEvent<{ export type TurboBeforeMorphAttributeEvent = CustomEvent<{ attributeName: string; - mutationType: "updated" | "removed"; + mutationType: "update" | "remove"; }>; export type TurboBeforeFrameMorphEvent = CustomEvent<{