(options: ToggleOptions)
| 1268 | * @since 4.0.0 |
| 1269 | */ |
| 1270 | export const toggle = (options: ToggleOptions): Prompt<boolean> => { |
| 1271 | const opts: ToggleOptionsReq = { |
| 1272 | initial: false, |
| 1273 | active: "on", |
| 1274 | inactive: "off", |
| 1275 | ...options |
| 1276 | } |
| 1277 | return custom(opts.initial, { |
| 1278 | render: handleToggleRender(opts), |
| 1279 | process: handleToggleProcess, |
| 1280 | clear: () => handleToggleClear(opts) |
| 1281 | }) |
| 1282 | } |
| 1283 | |
| 1284 | const proto = { |
| 1285 | ...Effectable.Prototype<Prompt<any>>({ |
nothing calls this directly
no test coverage detected