kopia lustrzana https://github.com/shoelace-style/shoelace
Fixed Typescript error when CustomEvents with non-object details are registered
rodzic
15a4049a01
commit
e65b09fdec
|
@ -3,7 +3,7 @@ import { property } from 'lit/decorators.js';
|
|||
|
||||
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
||||
type SlEventInit<T> = T extends keyof GlobalEventHandlersEventMap
|
||||
? GlobalEventHandlersEventMap[T] extends CustomEvent
|
||||
? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<string, unknown>>
|
||||
? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<string, never>>
|
||||
? CustomEventInit<GlobalEventHandlersEventMap[T]['detail']>
|
||||
: WithRequired<CustomEventInit<GlobalEventHandlersEventMap[T]['detail']>, 'detail'>
|
||||
|
|
Ładowanie…
Reference in New Issue