Migre le projet vers Blazor WebAssembly en .NET 10

This commit is contained in:
2026-04-13 21:29:12 +02:00
parent b11056097d
commit 90f17c9c89
26 changed files with 4314 additions and 94 deletions

View File

@@ -0,0 +1,30 @@
using Microsoft.JSInterop;
namespace ChessCubing.App.Services;
public sealed class BrowserBridge(IJSRuntime jsRuntime)
{
public ValueTask StartViewportAsync()
=> jsRuntime.InvokeVoidAsync("chesscubingViewport.start");
public ValueTask SetBodyStateAsync(string? page, string? bodyClass)
=> jsRuntime.InvokeVoidAsync("chesscubingPage.setBodyState", page, bodyClass ?? string.Empty);
public ValueTask<string?> ReadMatchJsonAsync()
=> jsRuntime.InvokeAsync<string?>("chesscubingStorage.getMatchState", MatchStore.StorageKey, MatchStore.WindowNameKey);
public ValueTask WriteMatchJsonAsync(string json)
=> jsRuntime.InvokeVoidAsync("chesscubingStorage.setMatchState", MatchStore.StorageKey, MatchStore.WindowNameKey, json);
public ValueTask ClearMatchAsync()
=> jsRuntime.InvokeVoidAsync("chesscubingStorage.clearMatchState", MatchStore.StorageKey);
public ValueTask<bool> PlayCubePhaseAlertAsync()
=> jsRuntime.InvokeAsync<bool>("chesscubingAudio.playCubePhaseAlert");
public ValueTask PrimeAudioAsync()
=> jsRuntime.InvokeVoidAsync("chesscubingAudio.prime");
public ValueTask ForceRefreshAsync(string path)
=> jsRuntime.InvokeVoidAsync("chesscubingBrowser.forceRefresh", path);
}