( options: TextOptions, type: TextOptionsReq["type"] )
| 3737 | } |
| 3738 | |
| 3739 | const basePrompt = ( |
| 3740 | options: TextOptions, |
| 3741 | type: TextOptionsReq["type"] |
| 3742 | ): Prompt<string> => { |
| 3743 | const opts: TextOptionsReq = { |
| 3744 | default: "", |
| 3745 | type, |
| 3746 | validate: Effect.succeed, |
| 3747 | ...options |
| 3748 | } |
| 3749 | |
| 3750 | const initialState: TextState = { |
| 3751 | cursor: opts.default.length, |
| 3752 | value: opts.default, |
| 3753 | error: Option.none() |
| 3754 | } |
| 3755 | return custom(initialState, { |
| 3756 | render: handleTextRender(opts), |
| 3757 | process: handleTextProcess(opts), |
| 3758 | clear: handleTextClear(opts) |
| 3759 | }) |
| 3760 | } |
| 3761 | |
| 3762 | interface ToggleOptionsReq extends Required<ToggleOptions> {} |
| 3763 |
no test coverage detected