(value: boolean, options: ToggleOptions)
| 85 | } |
| 86 | |
| 87 | function renderSubmission(value: boolean, options: ToggleOptions) { |
| 88 | return Effect.gen(function*() { |
| 89 | const terminal = yield* Terminal.Terminal |
| 90 | const figures = yield* InternalAnsiUtils.figures |
| 91 | const columns = yield* terminal.columns |
| 92 | const leadingSymbol = Doc.annotate(figures.tick, Ansi.green) |
| 93 | const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright) |
| 94 | const toggle = renderToggle(value, options, true) |
| 95 | const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options) |
| 96 | return promptMsg.pipe( |
| 97 | Doc.cat(Doc.hardLine), |
| 98 | Optimize.optimize(Optimize.Deep), |
| 99 | Doc.render({ style: "pretty", options: { lineWidth: columns } }) |
| 100 | ) |
| 101 | }) |
| 102 | } |
| 103 | |
| 104 | const activate = Effect.succeed(Action.NextFrame({ state: true })) |
| 105 | const deactivate = Effect.succeed(Action.NextFrame({ state: false })) |
no test coverage detected