-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interface for user interaction
- Loading branch information
Showing
9 changed files
with
80 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Lip; | ||
|
||
/// <summary> | ||
/// Represents a user interaction interface. | ||
/// </summary> | ||
public interface IUserInteraction | ||
{ | ||
/// <summary> | ||
/// Displays a confirmation dialog and returns user's choice. | ||
/// </summary> | ||
/// <param name="format">The message to display</param> | ||
/// <returns>True if confirmed, false otherwise</returns> | ||
Task<bool> ConfirmAsync(string format, params object[] args); | ||
|
||
/// <summary> | ||
/// Prompts user for text input. | ||
/// </summary> | ||
/// <param name="format">The prompt message</param> | ||
/// <param name="defaultValue">Optional default value</param> | ||
/// <returns>User input as string</returns> | ||
Task<string?> PromptForInputAsync(string format, params object[] args); | ||
|
||
/// <summary> | ||
/// Prompts user to select from multiple options. | ||
/// </summary> | ||
/// <param name="format">The prompt message</param> | ||
/// <param name="options">Available options</param> | ||
/// <returns>Selected option</returns> | ||
Task<string> PromptForSelectionAsync(IEnumerable<string> options, string format, params object[] args); | ||
|
||
/// <summary> | ||
/// Shows progress for long-running operations. | ||
/// </summary> | ||
/// <param name="format">Progress message</param> | ||
/// <param name="progress">Progress value (0.0-1.0)</param> | ||
Task UpdateProgressAsync(float progress, string format, params object[] args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
using System.IO.Abstractions; | ||
using Microsoft.Extensions.Logging; | ||
using System.IO.Abstractions; | ||
|
||
namespace Lip; | ||
|
||
public partial class Lip(RuntimeConfiguration runtimeConfig, IFileSystem filesystem, Serilog.ILogger logger) | ||
/// <summary> | ||
/// The main class of the Lip library. | ||
/// </summary> | ||
/// <param name="runtimeConfig">The runtime configuration.</param> | ||
/// <param name="filesystem">The file system wrapper.</param> | ||
/// <param name="logger">The logger.</param> | ||
/// <param name="userInteraction">The user interaction wrapper.</param> | ||
public partial class Lip(RuntimeConfiguration runtimeConfig, IFileSystem filesystem, ILogger logger, IUserInteraction userInteraction) | ||
{ | ||
private const string PackageManifestFileName = "tooth.json"; | ||
|
||
private readonly IFileSystem _filesystem = filesystem; | ||
private readonly Serilog.ILogger _logger = logger; | ||
private readonly ILogger _logger = logger; | ||
private readonly RuntimeConfiguration _runtimeConfig = runtimeConfig; | ||
private readonly IUserInteraction _userInteraction = userInteraction; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters