import { MidiKey, State } from './state' import { Events } from './events' export type Prop < Key extends MidiKey, E = Events > = ( state: Omit, 'event'> & { event: E } ) => any | void export type Props = Partial export type FullProps = Partial<{ fade: Prop<'fade'> turn: Prop<'turn'> note: Prop<'note'> }> export type NativeProps = { [key in NativeKey]?: ( state: State<'shared'> & { event: undefined extends T[key] ? GetEvent : T[key] args: any }, ...args: any ) => void } type ReactDOMAttributes = React.DOMAttributes type NativeKey = keyof Omit< ReactDOMAttributes, keyof FullProps | 'children' | 'dangerouslySetInnerHTML' > type GetEvent = ReactDOMAttributes[Key] extends | React.EventHandler | undefined ? Event : UIEvent