using System.Threading.Tasks;
namespace Microsoft.AspNetCore.SpaServices.Prerendering
{
///
/// Represents a service that can perform server-side prerendering for
/// JavaScript-based Single Page Applications. This is an alternative
/// to using the 'asp-prerender-module' tag helper.
///
public interface ISpaPrerenderer
{
///
/// Invokes JavaScript code to perform server-side prerendering for a
/// Single-Page Application. This is an alternative to using the
/// 'asp-prerender-module' tag helper.
///
/// The JavaScript module that exports a prerendering function.
/// The name of the export from the JavaScript module, if it is not the default export.
/// An optional JSON-serializable object to pass to the JavaScript prerendering function.
/// If specified, the prerendering task will time out after this duration if not already completed.
///
Task RenderToString(
string moduleName,
string exportName = null,
object customDataParameter = null,
int timeoutMilliseconds = default(int));
}
}