microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
dotnet/autoShell/Handlers/IActionHandler.cs
26lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Collections.Generic; |
| 5 | using System.Text.Json; |
| 6 | |
| 7 | namespace autoShell.Handlers; |
| 8 | |
| 9 | /// <summary> |
| 10 | /// Interface for handlers that process autoShell actions. |
| 11 | /// </summary> |
| 12 | internal interface IActionHandler |
| 13 | { |
| 14 | /// <summary> |
| 15 | /// Returns the set of action names this handler supports. |
| 16 | /// </summary> |
| 17 | IEnumerable<string> SupportedActions { get; } |
| 18 | |
| 19 | /// <summary> |
| 20 | /// Handles the action identified by <paramref name="key"/>. |
| 21 | /// </summary> |
| 22 | /// <param name="key">The action name.</param> |
| 23 | /// <param name="parameters">The action parameters as a read-only JsonElement.</param> |
| 24 | /// <returns>A <see cref="ActionResult"/> describing the outcome.</returns> |
| 25 | ActionResult Handle(string key, JsonElement parameters); |
| 26 | } |
| 27 | |