JsExportAttribute Class
Generates the JavaScript binding of a class: a source generator adds a static JsClass property to the class, which JsRealm.GetClass turns into a JavaScript class. The class and its containing types must be partial.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class JsExportAttribute : AttributeRemarks
- The public constructor is the constructor of the JavaScript class (see
JsConstructorAttributewhen there are several); an abstract class, or a class without public constructor, cannot be created by the scripts. - The public instance methods, properties and fields are the methods and accessors of the prototype; the static ones are properties of the constructor.
- A static class is a plain object whose properties are its static members, as
Math. - The names are converted to camelCase: use
JsNameAttributeto choose another name, andJsIgnoreAttributeto hide a member.
- Inheritance
AttributeJsExportAttribute
Constructors
| Name | Description |
|---|---|
| JsExportAttribute() |
JsExportAttribute()
public JsExportAttribute()No documentation is available.
Properties
| Name | Description |
|---|---|
| Name | Gets or sets the name of the JavaScript class. The default is the name of the .NET class. |