KristofferStrube.Blazor.WebIDL 0.1.0-alpha.17

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of KristofferStrube.Blazor.WebIDL.
There is a newer version of this package available.
See the version list below for details.
dotnet add package KristofferStrube.Blazor.WebIDL --version 0.1.0-alpha.17
NuGet\Install-Package KristofferStrube.Blazor.WebIDL -Version 0.1.0-alpha.17
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KristofferStrube.Blazor.WebIDL" Version="0.1.0-alpha.17" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KristofferStrube.Blazor.WebIDL --version 0.1.0-alpha.17
#r "nuget: KristofferStrube.Blazor.WebIDL, 0.1.0-alpha.17"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KristofferStrube.Blazor.WebIDL as a Cake Addin
#addin nuget:?package=KristofferStrube.Blazor.WebIDL&version=0.1.0-alpha.17&prerelease

// Install KristofferStrube.Blazor.WebIDL as a Cake Tool
#tool nuget:?package=KristofferStrube.Blazor.WebIDL&version=0.1.0-alpha.17&prerelease

License: MIT GitHub issues GitHub forks GitHub stars NuGet Downloads (official NuGet)

Blazor.WebIDL

A Blazor wrapper for types and interfaces used in and defined in the standard WebIDL specification. Among these are declarations that define specific behavior for interfaces and the standard exception definition types used across all WebIDL based APIs.

This wrapper is still being developed so ideas are still being tested and experimented with.

Demo

The sample project can be demoed at https://kristofferstrube.github.io/Blazor.WebIDL/

On each page you can find the corresponding code for the example in the top right corner.

Exceptions

The specification defines the types and names for all the standard exceptions and the standard names for DomExceptions.

Standard behavior and method definitions

The standard WebIDL specification make definitions that are used across all API specifications that use WebIDL for defining their interfaces. Declarations like Iterable, Asynchronously iterable, Maplike, Setlike define expected behavior and methods that should apply to the interfaces that use these definitions. This wrapper defines C# interfaces for these declarations that have implementations for the expected methods. This makes it easy and safe to implement wrappers for interfaces that define i.e. Setlike behavior.

We have currently implemented 2 interfaces for the Setlike declaration called IReadonlySetlike and IReadWriteSetlike where IReadWriteSetlike inherits from IReadonlySetlike

They can be used like this to make a very simple wrapper for the JS Set type:

public class Set : IReadWriteSetlike<Set>
{
    public IJSObjectReference JSReference { get; }
    public IJSRuntime JSRuntime { get; }

    public static async Task<Set> CreateAsync<T>(IJSRuntime jSRuntime, IEnumerable<T>? iterable = null)
    {
        var jSInstance = await jSRuntime.InvokeAsync<IJSObjectReference>("constructSet", iterable);
        return new Set(jSRuntime, jSInstance);
    }

    public Set(IJSRuntime jSRuntime, IJSObjectReference jSReference)
    {
        JSRuntime = jSRuntime;
        JSReference = jSReference;
    }
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on KristofferStrube.Blazor.WebIDL:

Package Downloads
KristofferStrube.Blazor.DOM The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

DOM API wrapper implementation for Blazor.

KristofferStrube.Blazor.WebAudio The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Web Audio API wrapper implementation for Blazor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.0 193 3/9/2024
0.4.0 92 2/22/2024
0.3.0 161 1/4/2024
0.2.0 1,531 8/15/2023
0.1.0 584 6/21/2023
0.1.0-alpha.22 76 6/19/2023
0.1.0-alpha.21 62 6/8/2023
0.1.0-alpha.20 83 6/8/2023
0.1.0-alpha.19 66 6/7/2023
0.1.0-alpha.18 67 6/7/2023
0.1.0-alpha.17 99 5/31/2023
0.1.0-alpha.16 75 5/29/2023
0.1.0-alpha.15 68 5/29/2023
0.1.0-alpha.14 63 5/29/2023
0.1.0-alpha.13 64 5/29/2023
0.1.0-alpha.12 65 5/29/2023
0.1.0-alpha.11 70 5/28/2023
0.1.0-alpha.10 64 5/25/2023
0.1.0-alpha.9 80 5/20/2023
0.1.0-alpha.8 62 5/20/2023
0.1.0-alpha.7 66 5/20/2023
0.1.0-alpha.6 72 5/9/2023
0.1.0-alpha.5 85 4/12/2023
0.1.0-alpha.4 117 4/10/2023
0.1.0-alpha.3 88 4/10/2023
0.1.0-alpha.2 105 3/13/2023
0.1.0-alpha.1 16,997 2/28/2023