diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 5d6387e76..f87ddac87 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 b5ef3a932..6e4e6e388 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>