(input_map: Array<[string, InputHandler]>)
| 30 | type InputMapper = (input: string) => MaybeCursor |
| 31 | const NOOP_HANDLER: InputHandler = () => {} |
| 32 | function mapInput(input_map: Array<[string, InputHandler]>): InputMapper { |
| 33 | const map = new Map(input_map) |
| 34 | return function (input: string): MaybeCursor { |
| 35 | return (map.get(input) ?? NOOP_HANDLER)(input) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | export type UseTextInputProps = { |
| 40 | value: string |