microsoft / microsoft/node-api-dotnet

JSImportAttribute for easier invocation of JS APIs from C#

Abierto
#90 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@jasongin ya está trabajando en esto.

Desde el 12/4/2023.

enhancement marshalling
Lenguaje dominante
C#
Estrellas
783
Forks
80
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This issue tracks the idea of introducing a new JSImportAttribute type to the library, with associated source-generator support.

When [JSImport] is applied to a C# static partial method, the generated code will load a reference to the JS function (named in an attribute parameter) and marshal the parameters and return value.

Importing entire JS classes could also be supported, with more effort: When [JSImport] is applied to a C# partial class, the generated code will include a constructor that constructs an instance of the JS type (named in an attribute parameter), and implementations of all methods to marshal parameters and return values.

This could even be extended to reading TypeScript type-definitions, eliminating some of the need to declare all of the API surface in C#.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.