Skip to content

Make output-related APIs of IInteractionService public for consumption #9867

@captainsafia

Description

@captainsafia

The IInteractionService that is currently used by CLI commands for prompting and output display is currently internal. While #9807 covers making the prompt-related APIs public, this issue overs making the APIs related to output streaming public. Something like the following:

public interface IOutputInteractionService
{
    void DisplayMessage(string emoji, string message);
    void DisplaySuccess(string message);
    void DisplayError(string errorMessage);
    void DisplaySubtleMessage(string message);
    void DisplayLines(IEnumerable<(string Stream, string Line)> lines);
}

The implementors can resolve the service from the DI container and use it to stream outputs:

public Task DeployAsync(DeployingContext context)
{
  var outputService = context.ServiceProvider.GetService<IOutputInteractionService>();
  outputService.DisplaySuccess("Successfully deployed to FooBar");
}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions