-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathIMarkdownAsynchronousOutput.cs
More file actions
87 lines (76 loc) · 2.26 KB
/
IMarkdownAsynchronousOutput.cs
File metadata and controls
87 lines (76 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System.Text;
using System.Threading.Tasks;
using Waher.Runtime.Inventory;
using Waher.Script;
namespace Waher.Content.Markdown
{
/// <summary>
/// Markdown output type.
/// </summary>
public enum MarkdownOutputType
{
/// <summary>
/// Plaint text
/// </summary>
PlainText,
/// <summary>
/// Markdown
/// </summary>
Markdown,
/// <summary>
/// HTML
/// </summary>
Html,
/// <summary>
/// XAML (WPF version)
/// </summary>
Xaml,
/// <summary>
/// XAML (Xamarin.Forms version)
/// </summary>
XamarinForms,
/// <summary>
/// Smart Contract XML
/// </summary>
SmartContract,
/// <summary>
/// LaTeX
/// </summary>
Latex,
/// <summary>
/// XML
/// </summary>
Xml
}
/// <summary>
/// Interface for classes that help output asynchronous markdown output.
/// </summary>
public interface IMarkdownAsynchronousOutput : IProcessingSupport<MarkdownOutputType>
{
/// <summary>
/// Generates a stub in the output, that will be filled with the asynchronously generated
/// content, once it is reported.
/// </summary>
/// <param name="Type">Output type.</param>
/// <param name="Output">Output being generated.</param>
/// <param name="Title">Title of content.</param>
/// <param name="Document">Markdown Document being rendered.</param>
/// <returns>ID to report back, when content is completed.</returns>
Task<string> GenerateStub(MarkdownOutputType Type, StringBuilder Output, string Title, MarkdownDocument Document);
/// <summary>
/// Method called when asynchronous result has been generated in a Markdown document.
/// </summary>
/// <param name="Type">Output type.</param>
/// <param name="Id">ID of generated content.</param>
/// <param name="Result">Generated content.</param>
Task ReportResult(MarkdownOutputType Type, string Id, string Result);
/// <summary>
/// Method called when asynchronous result has been generated in a Markdown document.
/// </summary>
/// <param name="Type">Output type.</param>
/// <param name="Id">ID of generated content.</param>
/// <param name="Result">Generated content.</param>
/// <param name="More">If more information will be sent in another call.</param>
Task ReportResult(MarkdownOutputType Type, string Id, string Result, bool More);
}
}