namespace MoonlightServers.Daemon.ServerSystem.Interfaces; public interface IConsole : IServerComponent { /// /// Writes to the standard input of the console. If attached to the runtime when using docker for example this /// would write into the containers standard input. /// This method does not add a newline separator at the end of the content. The caller needs to add this themselves if required /// /// Content to write /// public Task WriteStdInAsync(string content); /// /// Writes to the standard output of the console. If attached to the runtime when using docker for example this /// would write into the containers standard output. /// This method does not add a newline separator at the end of the content. The caller needs to add this themselves if required /// /// Content to write /// public Task WriteStdOutAsync(string content); /// /// Attaches the console to the runtime environment /// /// public Task AttachRuntimeAsync(); /// /// Attaches the console to the installation environment /// /// public Task AttachInstallationAsync(); /// /// Fetches all output from the runtime environment and write them into the cache without triggering any events /// /// public Task FetchRuntimeAsync(); /// /// Fetches all output from the installation environment and write them into the cache without triggering any events /// /// public Task FetchInstallationAsync(); /// /// Clears the cache of the standard output received by the environments /// /// public Task ClearCacheAsync(); /// /// Gets the content from the standard output cache /// /// Content from the cache public Task> GetCacheAsync(); /// /// Subscribes to standard output receive events /// /// Callback which will be invoked whenever a new line is received /// Subscription disposable to unsubscribe from the event public Task SubscribeStdOutAsync(Func callback); }