From 50972f2b38d8ef82c5349b4a185a2a00d7659645 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 23 Feb 2023 11:33:31 -0500 Subject: [PATCH] update changelog and comment --- docs/resources/changelog.md | 1 + src/internal/shoelace-element.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 5d6387e7..f87ddac8 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -8,6 +8,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti ## Next +- Added TypeScript types to all custom events [#1183](https://github.com/shoelace-style/shoelace/pull/1183) - Fixed a bug in `` that caused the display label to render incorrectly in Chrome after form validation [#1197](https://github.com/shoelace-style/shoelace/discussions/1197) - Fixed a bug in `` that prevented users from applying their own value for `autocapitalize`, `autocomplete`, and `autocorrect` when using `type="password` [#1205](https://github.com/shoelace-style/shoelace/issues/1205) - Fixed a bug in `` that prevented scroll controls from showing when dynamically adding tabs [#1208](https://github.com/shoelace-style/shoelace/issues/1208) diff --git a/src/internal/shoelace-element.ts b/src/internal/shoelace-element.ts index b5ef3a93..6e4e6e38 100644 --- a/src/internal/shoelace-element.ts +++ b/src/internal/shoelace-element.ts @@ -39,9 +39,9 @@ type EventTypesWithoutRequiredDetail = { // Helper to make a specific property of an object non-optional type WithRequired = T & { [P in K]-?: T[P] }; -// Given an event name string, get a valid type for the options to initialize the event that is more restrictive -// than just CustomEventInit when appropriate (validate the type of the event detail, and require it to be -// provided if the event requires it) +// Given an event name string, get a valid type for the options to initialize the event that is more restrictive than +// just CustomEventInit when appropriate (validate the type of the event detail, and require it to be provided if the +// event requires it) type SlEventInit = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent> ? GlobalEventHandlersEventMap[T] extends CustomEvent>