microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
dotnet/autoShell/Handlers/ICommandHandler.cs
26lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Collections.Generic; |
| 5 | using Newtonsoft.Json.Linq; |
| 6 | |
| 7 | namespace autoShell.Handlers; |
| 8 | |
| 9 | /// <summary> |
| 10 | /// Interface for command handlers that process autoShell actions. |
| 11 | /// </summary> |
| 12 | internal interface ICommandHandler |
| 13 | { |
| 14 | /// <summary> |
| 15 | /// Returns the set of command keys this handler supports. |
| 16 | /// </summary> |
| 17 | IEnumerable<string> SupportedCommands { get; } |
| 18 | |
| 19 | /// <summary> |
| 20 | /// Handles the command identified by <paramref name="key"/>. |
| 21 | /// </summary> |
| 22 | /// <param name="key">The command key from the incoming JSON object.</param> |
| 23 | /// <param name="value">The string representation of the command's value.</param> |
| 24 | /// <param name="rawValue">The original JToken value for commands that need structured data.</param> |
| 25 | void Handle(string key, string value, JToken rawValue); |
| 26 | } |