SpectreInteractionPresenter
Spectre-aware interaction presenter that supports explicit output capture when an application temporarily owns the terminal surface.
- Kind:
Class - Namespace: Repl.Spectre
- Assembly:
Repl.Spectre - Source: src/Repl.Spectre/SpectreInteractionPresenter.cs
Signature
Section titled “Signature”public sealed class SpectreInteractionPresenter : IReplInteractionPresenterInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Constructors
Section titled “Constructors”SpectreInteractionPresenter(InteractionOptions, OutputOptions)
Section titled “SpectreInteractionPresenter(InteractionOptions, OutputOptions)”Creates a presenter backed by the default console interaction presenter.
public SpectreInteractionPresenter(InteractionOptions options, OutputOptions outputOptions)Parameters
Section titled “Parameters”options(InteractionOptions)outputOptions(OutputOptions)
Methods
Section titled “Methods”BeginCapture(IReplInteractionPresenter)
Section titled “BeginCapture(IReplInteractionPresenter)”Redirects interaction events to the provided sink for the current async flow. Dispose the returned scope to restore the previous sink.
public IDisposable BeginCapture(IReplInteractionPresenter sink)Parameters
Section titled “Parameters”sink(IReplInteractionPresenter)
Returns
Section titled “Returns”BeginCapture(TextWriter)
Section titled “BeginCapture(TextWriter)”Redirects interaction events to a plain text writer for the current async flow. The writer sink never emits ANSI control sequences or OSC progress messages.
public IDisposable BeginCapture(TextWriter writer)Parameters
Section titled “Parameters”writer(TextWriter)
Returns
Section titled “Returns”PresentAsync(ReplInteractionEvent, CancellationToken)
Section titled “PresentAsync(ReplInteractionEvent, CancellationToken)”Presents one semantic event.
public ValueTask PresentAsync(ReplInteractionEvent evt, CancellationToken cancellationToken)Parameters
Section titled “Parameters”evt(ReplInteractionEvent): Semantic interaction event.cancellationToken(CancellationToken): Cancellation token.
Returns
Section titled “Returns”ValueTask - An asynchronous operation.