using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Http; using ZelWiki.Library.Interfaces; namespace ZelWiki.Engine.Library.Interfaces { public interface IZelEngineState { #region Parameters. ISessionState? Session { get; } IQueryCollection QueryString { get; } IZelEngine Engine { get; } IPage Page { get; } int? Revision { get; } public HashSet OmitMatches { get; } public int NestDepth { get; } //Used for recursion. #endregion #region State. /// /// Custom page title set by a call to @@Title("...") /// public string? PageTitle { get; set; } Dictionary Variables { get; } Dictionary Snippets { get; } List Tags { get; set; } List ProcessingInstructions { get; } List OutgoingLinks { get; } List TableOfContents { get; } List Headers { get; } #endregion #region Results. string HtmlResult { get; } TimeSpan ProcessingTime { get; } int ErrorCount { get; } int MatchCount { get; } #endregion /// /// Used to store values for handlers that needs to survive only a single wiki processing session. /// public void SetStateValue(string key, T value); /// /// Used to get values for handlers that needs to survive only a single wiki processing session. /// public bool TryGetStateValue(string key, [MaybeNullWhen(false)] out T? outValue); /// /// Used to get values for handlers that needs to survive only a single wiki processing session. /// public T GetStateValue(string key, T defaultValue); string GetNextQueryToken(); /// /// Transforms "included" wiki pages, for example if a wiki function /// injected additional wiki markup, this 'could' be processed separately. /// /// The child page to process /// The optional revision of the child page to process /// IZelEngineState TransformChild(IPage page, int? revision = null); } }