( options: TextOptions, type: TextOptionsReq["type"] )
| 4001 | } |
| 4002 | |
| 4003 | const basePrompt = ( |
| 4004 | options: TextOptions, |
| 4005 | type: TextOptionsReq["type"] |
| 4006 | ): Prompt<string> => { |
| 4007 | const opts: TextOptionsReq = { |
| 4008 | default: "", |
| 4009 | type, |
| 4010 | validate: Effect.succeed, |
| 4011 | ...options |
| 4012 | } |
| 4013 | |
| 4014 | const initialState: TextState = { |
| 4015 | cursor: opts.default.length, |
| 4016 | value: opts.default, |
| 4017 | error: Option.none() |
| 4018 | } |
| 4019 | return Custom(initialState, { |
| 4020 | render: handleTextRender(opts), |
| 4021 | process: handleTextProcess(opts), |
| 4022 | clear: handleTextClear(opts) |
| 4023 | }) |
| 4024 | } |
| 4025 | |
| 4026 | interface ToggleOptionsReq extends OptionsReq<ToggleOptions> {} |
| 4027 |
no test coverage detected