Clean up public API

* Make things a bit more consistent
* Add extension methods to configure things like tables, panels and grids.
This commit is contained in:
Patrik Svensson
2020-08-26 15:03:49 +02:00
committed by Patrik Svensson
parent c111c7d463
commit 31f117aed0
24 changed files with 569 additions and 266 deletions

View File

@ -0,0 +1,26 @@
using System.Collections.Generic;
namespace Spectre.Console.Rendering
{
/// <summary>
/// Represents something that can be rendered to the console.
/// </summary>
public interface IRenderable
{
/// <summary>
/// Measures the renderable object.
/// </summary>
/// <param name="context">The render context.</param>
/// <param name="maxWidth">The maximum allowed width.</param>
/// <returns>The minimum and maximum width of the object.</returns>
Measurement Measure(RenderContext context, int maxWidth);
/// <summary>
/// Renders the object.
/// </summary>
/// <param name="context">The render context.</param>
/// <param name="maxWidth">The maximum allowed width.</param>
/// <returns>A collection of segments.</returns>
IEnumerable<Segment> Render(RenderContext context, int maxWidth);
}
}