import type { Event } from './event'; export type EventHandler = ((event: E) => void) & { eventType: E['type'] }; export type StateFactory = (context: { apply: (e: S) => void; on: ( type: T, fn: (event: Extract) => void ) => EventHandler; }) => EventHandler[]; export function useState( factory: StateFactory ): StateFactory { return factory; }