using System.Diagnostics.CodeAnalysis;
using OliverBooth.Data.Web;
using OliverBooth.Markdown.Template;
namespace OliverBooth.Services;
///
/// Represents a service that renders MediaWiki-style templates.
///
public interface ITemplateService
{
///
/// Renders the specified global template with the specified arguments.
///
/// The global template to render.
/// The rendered global template.
///
/// is .
///
string RenderGlobalTemplate(TemplateInline templateInline);
///
/// Renders the specified global template with the specified arguments.
///
/// The global template to render.
/// The database template object.
/// The rendered global template.
///
/// is .
///
string RenderTemplate(TemplateInline templateInline, ITemplate? template);
///
/// Attempts to get the template with the specified name.
///
/// The name of the template.
///
/// When this method returns, contains the template with the specified name, if the template is found;
/// otherwise, .
///
/// if the template exists; otherwise, .
bool TryGetTemplate(string name, [NotNullWhen(true)] out ITemplate? template);
///
/// Attempts to get the template with the specified name and variant.
///
/// The name of the template.
/// The variant of the template.
///
/// When this method returns, contains the template with the specified name and variant, if the template is
/// found; otherwise, .
///
/// if the template exists; otherwise, .
bool TryGetTemplate(string name, string variant, [NotNullWhen(true)] out ITemplate? template);
}