onTransitionstart: TransitionEvent
}
-type StringKeyOf<T> = Extract<keyof T, string>
-
type EventHandlers<E> = {
- [K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
+ [K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
}
// use namespace import to avoid collision with generated types which use
type ElementAttrs<T> = T & ReservedProps
type NativeElements = {
- [K in StringKeyOf<IntrinsicElementAttributes>]: ElementAttrs<
+ [K in keyof IntrinsicElementAttributes]: ElementAttrs<
IntrinsicElementAttributes[K]
>
}