diff --git a/Flow.Launcher.Plugin/IPublicAPI.cs b/Flow.Launcher.Plugin/IPublicAPI.cs index 2a69a2495..a3f711a17 100644 --- a/Flow.Launcher.Plugin/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/IPublicAPI.cs @@ -89,28 +89,85 @@ namespace Flow.Launcher.Plugin /// event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; + /// + /// Fuzzy Search the string with query + /// + /// Query String + /// The string to Search for Query + /// Match results MatchResult FuzzySearch(string query, string stringToCompare); + /// + /// Http Get to the spefic URL + /// + /// URL to call Http Get + /// Cancellation Token + /// Task to get string result Task HttpGetStringAsync(string url, CancellationToken token = default); + /// + /// Http Get to the spefic URL + /// + /// URL to call Http Get + /// Cancellation Token + /// Task to get stream result Task HttpGetStreamAsync(string url, CancellationToken token = default); + /// + /// Download the specific url to a cretain file path + /// + /// URL to download file + /// place to store file + /// Task showing the progress Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath); + /// + /// Add ActionKeyword for specific plugin + /// + /// ID for plugin that needs to add action keyword + /// The actionkeyword that is supposed to be added void AddActionKeyword(string pluginId, string newActionKeyword); + /// + /// Remove ActionKeyword for specific plugin + /// + /// ID for plugin that needs to remove action keyword + /// The actionkeyword that is supposed to be removed void RemoveActionKeyword(string pluginId, string oldActionKeyword); + /// + /// Log Debug message + /// Message will only be logged in Debug mode + /// void LogDebug(string className, string message, [CallerMemberName] string methodName = ""); + /// + /// Log Message + /// void LogInfo(string className, string message, [CallerMemberName] string methodName = ""); + /// + /// Log Warning + /// void LogWarn(string className, string message, [CallerMemberName] string methodName = ""); + /// + /// Log an Exception + /// void LogException(string className, string message, Exception e, [CallerMemberName] string methodName = ""); - T LoadJsonStorage(PluginMetadata metadata) where T : new(); + /// + /// Load JsonStorage for current plugin + /// + /// Type for deserialization + /// + T LoadJsonStorage() where T : new(); - void SaveJsonStorage(PluginMetadata metadata, T setting) where T : new(); + /// + /// Save JsonStorage for current plugin + /// + /// Type for Serialization + /// + void SaveJsonStorage(T setting) where T : new(); } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 327ee6658..200eb166a 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -131,9 +131,9 @@ namespace Flow.Launcher public void LogException(string className, string message, Exception e, [CallerMemberName] string methodName = "") => Log.Exception(className, message, e, methodName); - public T LoadJsonStorage(PluginMetadata metadata) where T : new() => new PluginJsonStorage().Load(); + public T LoadJsonStorage() where T : new() => new PluginJsonStorage().Load(); - public void SaveJsonStorage(PluginMetadata metadata, T setting) where T : new() => new PluginJsonStorage(setting).Save(); + public void SaveJsonStorage(T setting) where T : new() => new PluginJsonStorage(setting).Save(); public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;