-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize configuration & Update docs (#1)
# Motivations Standardized configuration # Modifications - Introduce `INuiBuilder` for use with `AddNuiServices` to configure an internal static of "options" - Simplify manual publishing CI - Update readme
- Loading branch information
Showing
12 changed files
with
91 additions
and
46 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
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
16 changes: 16 additions & 0 deletions
16
src/CitizenFX.Extensions.Blazor.WebAssembly/INuiBuilder.cs
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,16 @@ | ||
using System.Text.Json; | ||
|
||
namespace CitizenFX.Extensions.Blazor.WebAssembly; | ||
|
||
public interface INuiBuilder | ||
{ | ||
/// <summary> | ||
/// The <see cref="System.Text.Json.JsonSerializerOptions"/> used by <see cref="NuiMessageHandler"/> and <see cref="Services.NuiCallbackService"/> for JSON serialization/deserialization | ||
/// </summary> | ||
public JsonSerializerOptions JsonSerializerOptions { get; } | ||
|
||
/// <summary> | ||
/// The identifier field for <see cref="NuiMessageHandler"/> to determine which <see cref="NuiMessageHandler"/> to trigger by <see cref="NuiMessageListener"/> | ||
/// </summary> | ||
public string MessageHandlerIdentifierField { get; set; } | ||
} |
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,6 @@ | ||
namespace CitizenFX.Extensions.Blazor.WebAssembly.Internal; | ||
|
||
internal sealed class Nui | ||
{ | ||
internal static NuiBuilder Options = new(); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/CitizenFX.Extensions.Blazor.WebAssembly/Internal/NuiBuilder.cs
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,12 @@ | ||
using System.Text.Json; | ||
|
||
namespace CitizenFX.Extensions.Blazor.WebAssembly.Internal; | ||
|
||
internal sealed class NuiBuilder : INuiBuilder | ||
{ | ||
/// <inheritdoc /> | ||
public JsonSerializerOptions JsonSerializerOptions { get; } = new(); | ||
|
||
/// <inheritdoc /> | ||
public string MessageHandlerIdentifierField { get; set; } = "type"; | ||
} |
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
14 changes: 0 additions & 14 deletions
14
src/CitizenFX.Extensions.Blazor.WebAssembly/NuiJsonSerializerOptions.cs
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
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