From 57200a541d41e65dbe087b85602c8d4486add03f Mon Sep 17 00:00:00 2001 From: David Pine Date: Fri, 29 Nov 2024 10:49:16 -0600 Subject: [PATCH] Simplify intefaces and add a few more bits about the abort flag in the speech recognition API. --- .../IGeolocationService.cs | 4 +--- src/Blazor.Geolocation/IGeolocationService.cs | 4 +--- .../ILocalStorageService.cs | 4 +--- src/Blazor.LocalStorage/ILocalStorageService.cs | 4 +--- .../IPermissionsService.cs | 4 +--- .../ISessionStorageService.cs | 4 +--- src/Blazor.SessionStorage/ISessionStorageService.cs | 4 +--- .../ISpeechRecognitionService.cs | 11 ++++++++++- .../ISpeechRecognitionService.cs | 11 ++++++++++- .../ISpeechSynthesisService.cs | 4 +--- src/Blazor.SpeechSynthesis/ISpeechSynthesisService.cs | 4 +--- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Blazor.Geolocation.WebAssembly/IGeolocationService.cs b/src/Blazor.Geolocation.WebAssembly/IGeolocationService.cs index 64f9acb5..f2d37f70 100644 --- a/src/Blazor.Geolocation.WebAssembly/IGeolocationService.cs +++ b/src/Blazor.Geolocation.WebAssembly/IGeolocationService.cs @@ -7,6 +7,4 @@ namespace Microsoft.JSInterop; TypeName = "Geolocation", Implementation = "window.navigator.geolocation", Url = "https://developer.mozilla.org/docs/Web/API/Geolocation")] -public partial interface IGeolocationService -{ -} \ No newline at end of file +public partial interface IGeolocationService; \ No newline at end of file diff --git a/src/Blazor.Geolocation/IGeolocationService.cs b/src/Blazor.Geolocation/IGeolocationService.cs index f2a20f5c..ed303283 100644 --- a/src/Blazor.Geolocation/IGeolocationService.cs +++ b/src/Blazor.Geolocation/IGeolocationService.cs @@ -8,6 +8,4 @@ namespace Microsoft.JSInterop; Implementation = "window.navigator.geolocation", HostingModel = BlazorHostingModel.Server, Url = "https://developer.mozilla.org/docs/Web/API/Geolocation")] -public partial interface IGeolocationService -{ -} \ No newline at end of file +public partial interface IGeolocationService; \ No newline at end of file diff --git a/src/Blazor.LocalStorage.WebAssembly/ILocalStorageService.cs b/src/Blazor.LocalStorage.WebAssembly/ILocalStorageService.cs index 22e4c731..f5141bbc 100644 --- a/src/Blazor.LocalStorage.WebAssembly/ILocalStorageService.cs +++ b/src/Blazor.LocalStorage.WebAssembly/ILocalStorageService.cs @@ -12,6 +12,4 @@ namespace Microsoft.JSInterop; "getItem", "setItem:value" ])] -public partial interface ILocalStorageService -{ -} \ No newline at end of file +public partial interface ILocalStorageService; \ No newline at end of file diff --git a/src/Blazor.LocalStorage/ILocalStorageService.cs b/src/Blazor.LocalStorage/ILocalStorageService.cs index 08bdd239..9a17ccfe 100644 --- a/src/Blazor.LocalStorage/ILocalStorageService.cs +++ b/src/Blazor.LocalStorage/ILocalStorageService.cs @@ -13,6 +13,4 @@ namespace Microsoft.JSInterop; [ "https://raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom.d.ts" ])] -public partial interface ILocalStorageService -{ -} \ No newline at end of file +public partial interface ILocalStorageService; \ No newline at end of file diff --git a/src/Blazor.Permissions.WebAssembly/IPermissionsService.cs b/src/Blazor.Permissions.WebAssembly/IPermissionsService.cs index 586af654..7e17e467 100644 --- a/src/Blazor.Permissions.WebAssembly/IPermissionsService.cs +++ b/src/Blazor.Permissions.WebAssembly/IPermissionsService.cs @@ -8,6 +8,4 @@ namespace Microsoft.JSInterop; // TypeName = "Permissions", // Implementation = "window.navigator.permissions", // Url = "https://developer.mozilla.org/docs/Web/API/Navigator/permissions")] -public partial interface IPermissionsService -{ -} \ No newline at end of file +public partial interface IPermissionsService; \ No newline at end of file diff --git a/src/Blazor.SessionStorage.WebAssembly/ISessionStorageService.cs b/src/Blazor.SessionStorage.WebAssembly/ISessionStorageService.cs index 7da2f96d..bca90d16 100644 --- a/src/Blazor.SessionStorage.WebAssembly/ISessionStorageService.cs +++ b/src/Blazor.SessionStorage.WebAssembly/ISessionStorageService.cs @@ -13,6 +13,4 @@ namespace Microsoft.JSInterop; "getItem", "setItem:value" ])] -public partial interface ISessionStorageService -{ -} \ No newline at end of file +public partial interface ISessionStorageService; \ No newline at end of file diff --git a/src/Blazor.SessionStorage/ISessionStorageService.cs b/src/Blazor.SessionStorage/ISessionStorageService.cs index 18586b63..ffeaf52a 100644 --- a/src/Blazor.SessionStorage/ISessionStorageService.cs +++ b/src/Blazor.SessionStorage/ISessionStorageService.cs @@ -10,6 +10,4 @@ namespace Microsoft.JSInterop; HostingModel = BlazorHostingModel.Server, OnlyGeneratePureJS = true, Url = "https://developer.mozilla.org/docs/Web/API/Window/sessionStorage")] -public partial interface ISessionStorageService -{ -} \ No newline at end of file +public partial interface ISessionStorageService; \ No newline at end of file diff --git a/src/Blazor.SpeechRecognition.WebAssembly/ISpeechRecognitionService.cs b/src/Blazor.SpeechRecognition.WebAssembly/ISpeechRecognitionService.cs index 64d4591f..acf6d90d 100644 --- a/src/Blazor.SpeechRecognition.WebAssembly/ISpeechRecognitionService.cs +++ b/src/Blazor.SpeechRecognition.WebAssembly/ISpeechRecognitionService.cs @@ -19,7 +19,16 @@ public interface ISpeechRecognitionService : IAsyncDisposable Task InitializeModuleAsync(bool logModuleDetails = true); /// - /// Cancels the active speech recognition session. + /// Cancels the active speech recognition session. Based on the + /// flag, calls the corresponding native JavaScript API when: + /// + /// + /// : Calls speechRecognition.abort which will send an "aborted" error message. + /// + /// + /// : Calls speechRecognition.stop which gracefully stops recognition. + /// + /// /// /// /// Is aborted controls which API to call, diff --git a/src/Blazor.SpeechRecognition/ISpeechRecognitionService.cs b/src/Blazor.SpeechRecognition/ISpeechRecognitionService.cs index ea3955ae..ea8f0cdd 100644 --- a/src/Blazor.SpeechRecognition/ISpeechRecognitionService.cs +++ b/src/Blazor.SpeechRecognition/ISpeechRecognitionService.cs @@ -10,7 +10,16 @@ namespace Microsoft.JSInterop; public interface ISpeechRecognitionService : IAsyncDisposable { /// - /// Cancels the active speech recognition session. + /// Cancels the active speech recognition session. Based on the + /// flag, calls the corresponding native JavaScript API when: + /// + /// + /// : Calls speechRecognition.abort which will send an "aborted" error message. + /// + /// + /// : Calls speechRecognition.stop which gracefully stops recognition. + /// + /// /// /// /// Is aborted controls which API to call, diff --git a/src/Blazor.SpeechSynthesis.WebAssembly/ISpeechSynthesisService.cs b/src/Blazor.SpeechSynthesis.WebAssembly/ISpeechSynthesisService.cs index 72692586..ebb80dc3 100644 --- a/src/Blazor.SpeechSynthesis.WebAssembly/ISpeechSynthesisService.cs +++ b/src/Blazor.SpeechSynthesis.WebAssembly/ISpeechSynthesisService.cs @@ -12,6 +12,4 @@ namespace Microsoft.JSInterop; [ "getVoices" ])] -public partial interface ISpeechSynthesisService -{ -} \ No newline at end of file +public partial interface ISpeechSynthesisService; \ No newline at end of file diff --git a/src/Blazor.SpeechSynthesis/ISpeechSynthesisService.cs b/src/Blazor.SpeechSynthesis/ISpeechSynthesisService.cs index 5e84d448..1fb99679 100644 --- a/src/Blazor.SpeechSynthesis/ISpeechSynthesisService.cs +++ b/src/Blazor.SpeechSynthesis/ISpeechSynthesisService.cs @@ -13,6 +13,4 @@ namespace Microsoft.JSInterop; [ "getVoices" ])] -public partial interface ISpeechSynthesisService -{ -} \ No newline at end of file +public partial interface ISpeechSynthesisService; \ No newline at end of file