This commit is contained in:
Zel
2025-02-23 18:47:21 +08:00
parent eaaffeeccb
commit e46a7ca31c
104 changed files with 2630 additions and 2516 deletions

View File

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