Skip to content

IHex1bTerminalPresentationFilter

Namespace: Hex1b

Assembly: Hex1b.dll

A filter that observes data flowing between the terminal and presentation layer.

csharp
public interface IHex1bTerminalPresentationFilter

Methods

OnInputAsync(IReadOnlyList<AnsiToken>, TimeSpan, CancellationToken)

Called when input is received from the presentation layer.

Parameters:

Returns: ValueTask

csharp
ValueTask OnInputAsync(IReadOnlyList<AnsiToken> tokens, TimeSpan elapsed, CancellationToken ct = default)

OnOutputAsync(IReadOnlyList<AppliedToken>, TimeSpan, CancellationToken)

Called when output is being sent to the presentation layer.

Parameters:

Returns: ValueTask<AnsiToken>>

The tokens to send to the presentation layer. Return the original tokens to pass through, or a modified list.

csharp
ValueTask<IReadOnlyList<AnsiToken>> OnOutputAsync(IReadOnlyList<AppliedToken> appliedTokens, TimeSpan elapsed, CancellationToken ct = default)

OnResizeAsync(int, int, TimeSpan, CancellationToken)

Called when the terminal is resized by the presentation layer.

Parameters:

Returns: ValueTask

csharp
ValueTask OnResizeAsync(int width, int height, TimeSpan elapsed, CancellationToken ct = default)

OnSessionEndAsync(TimeSpan, CancellationToken)

Called when the terminal session ends.

Parameters:

Returns: ValueTask

csharp
ValueTask OnSessionEndAsync(TimeSpan elapsed, CancellationToken ct = default)

OnSessionStartAsync(int, int, DateTimeOffset, CancellationToken)

Called when the terminal session starts.

Parameters:

Returns: ValueTask

csharp
ValueTask OnSessionStartAsync(int width, int height, DateTimeOffset timestamp, CancellationToken ct = default)

Remarks

Presentation filters see: Output TO the presentation layer (after terminal processing)Input FROM the presentation layer (raw user input)

Use cases include: Render optimization (jitter elimination, batching)Output transformation (e.g., delta encoding)Input preprocessingNetwork protocol adaptation

Released under the MIT License.