From 8b01bfed8b61610ea3c3c7a51d0fe88b34a5619f Mon Sep 17 00:00:00 2001
From: Stephen Niedzielski <stephen.niedzielski@reddit.com>
Date: Tue, 19 Dec 2023 09:31:20 -0700
Subject: [PATCH] Fix event types

---
 src/ui/components/play-console.ts              | 2 +-
 src/ui/components/play-editor/play-editor.ts   | 4 ++--
 src/ui/components/play-new-pen-button.ts       | 2 +-
 src/ui/components/play-pen-header.ts           | 4 ++--
 src/ui/components/play-preview-controls.ts     | 4 ++--
 src/ui/components/play-preview.ts              | 6 +++---
 src/ui/components/play-resizable-text-input.ts | 2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/ui/components/play-console.ts b/src/ui/components/play-console.ts
index 70f7eae..e181fde 100644
--- a/src/ui/components/play-console.ts
+++ b/src/ui/components/play-console.ts
@@ -15,7 +15,7 @@ import {Bubble} from '../bubble.js'
 
 declare global {
   interface HTMLElementEventMap {
-    'open-line': OpenLine
+    'open-line': CustomEvent<OpenLine>
   }
   interface HTMLElementTagNameMap {
     'play-console': PlayConsole
diff --git a/src/ui/components/play-editor/play-editor.ts b/src/ui/components/play-editor/play-editor.ts
index e4b79b6..9b179b2 100644
--- a/src/ui/components/play-editor/play-editor.ts
+++ b/src/ui/components/play-editor/play-editor.ts
@@ -21,8 +21,8 @@ import {newEditorState} from './editor-state.js'
 
 declare global {
   interface HTMLElementEventMap {
-    edit: string
-    'edit-template': string
+    edit: CustomEvent<string>
+    'edit-template': CustomEvent<string>
   }
   interface HTMLElementTagNameMap {
     'play-editor': PlayEditor
diff --git a/src/ui/components/play-new-pen-button.ts b/src/ui/components/play-new-pen-button.ts
index 710b83f..808ec2f 100644
--- a/src/ui/components/play-new-pen-button.ts
+++ b/src/ui/components/play-new-pen-button.ts
@@ -22,7 +22,7 @@ const iconSizes: {[key in SizeOptions]: string} = {
 
 declare global {
   interface HTMLElementEventMap {
-    'edit-src': string
+    'edit-src': CustomEvent<string>
   }
   interface HTMLElementTagNameMap {
     'play-new-pen-button': PlayNewPenButton
diff --git a/src/ui/components/play-pen-header.ts b/src/ui/components/play-pen-header.ts
index 4c52bea..20c56de 100644
--- a/src/ui/components/play-pen-header.ts
+++ b/src/ui/components/play-pen-header.ts
@@ -19,8 +19,8 @@ import './play-resizable-text-input.js'
 
 declare global {
   interface HTMLElementEventMap {
-    'edit-name': string
-    share: undefined
+    'edit-name': CustomEvent<string>
+    share: CustomEvent<undefined>
   }
   interface HTMLElementTagNameMap {
     'play-pen-header': PlayPenHeader
diff --git a/src/ui/components/play-preview-controls.ts b/src/ui/components/play-preview-controls.ts
index debbbdd..9888e33 100644
--- a/src/ui/components/play-preview-controls.ts
+++ b/src/ui/components/play-preview-controls.ts
@@ -24,8 +24,8 @@ const sizes: readonly [width: number, label: string][] = [
 
 declare global {
   interface HTMLElementEventMap {
-    'preview-scheme': ColorScheme
-    'preview-width': number
+    'preview-scheme': CustomEvent<ColorScheme>
+    'preview-width': CustomEvent<number>
   }
   interface HTMLElementTagNameMap {
     'play-preview-controls': PlayPreviewControls
diff --git a/src/ui/components/play-preview.ts b/src/ui/components/play-preview.ts
index 8edf5e7..13a541b 100644
--- a/src/ui/components/play-preview.ts
+++ b/src/ui/components/play-preview.ts
@@ -18,9 +18,9 @@ import type {PreviewError} from '../../types/preview-error.js'
 
 declare global {
   interface HTMLElementEventMap {
-    error: PreviewError
-    'clear-errors': undefined
-    'devvit-ui-error': unknown
+    error: CustomEvent<PreviewError>
+    'clear-errors': CustomEvent<undefined>
+    'devvit-ui-error': CustomEvent<unknown>
   }
   interface HTMLElementTagNameMap {
     'play-preview': PlayPreview
diff --git a/src/ui/components/play-resizable-text-input.ts b/src/ui/components/play-resizable-text-input.ts
index 606ea62..bd3d338 100644
--- a/src/ui/components/play-resizable-text-input.ts
+++ b/src/ui/components/play-resizable-text-input.ts
@@ -11,7 +11,7 @@ import {Bubble} from '../bubble.js'
 
 declare global {
   interface HTMLElementEventMap {
-    'edit-text': string
+    'edit-text': CustomEvent<string>
   }
   interface HTMLElementTagNameMap {
     'play-resizable-text-input': PlayResizableTextInput