(input: string, state: TextState)
| 3918 | } |
| 3919 | |
| 3920 | const defaultTextProcessor = (input: string, state: TextState) => { |
| 3921 | const beforeCursor = state.value.slice(0, state.cursor) |
| 3922 | const afterCursor = state.value.slice(state.cursor) |
| 3923 | const value = `${beforeCursor}${input}${afterCursor}` |
| 3924 | const cursor = state.cursor + input.length |
| 3925 | return Effect.succeed( |
| 3926 | Action.NextFrame({ |
| 3927 | state: { ...state, cursor, value, error: Option.none() } |
| 3928 | }) |
| 3929 | ) |
| 3930 | } |
| 3931 | |
| 3932 | const handleTextRender = (options: TextOptionsReq) => { |
| 3933 | return (state: TextState, action: Action<TextState, string>) => { |
no test coverage detected