[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class JSFunctionBinding
{
+ internal JSFunctionBinding() { throw null; }
public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) { throw null; }
public static JSFunctionBinding BindJSFunction(string functionName, string moduleName, ReadOnlySpan<JSMarshalerType> signatures) { throw null; }
public static JSFunctionBinding BindManagedFunction(string fullyQualifiedName, int signatureHash, ReadOnlySpan<JSMarshalerType> signatures) { throw null; }
namespace System.Runtime.InteropServices.JavaScript
{
/// <summary>
- /// Represents an Exception initiated from the JavaScript interop code.
+ /// Represents an exception initiated from the JavaScript interop code.
/// </summary>
[SupportedOSPlatform("browser")] // @kg: Do we really need to platform-lock JSException?
public sealed class JSException : Exception
namespace System.Runtime.InteropServices.JavaScript
{
/// <summary>
- /// Attribute used to indicate a source generator should export a method to JavaScript and create thunks necessary to marshal its arguments along with any return value or thrown exception.
- /// For marshaling arguments of complex types <seealso cref="JSMarshalAsAttribute{T}"/>.
+ /// Indicates that a source generator should export the attributed method to JavaScript and create thunks necessary to marshal its arguments and any return value or thrown exception.
/// </summary>
/// <remarks>
+ /// For marshaling arguments of complex types <see cref="JSMarshalAsAttribute{T}" />.
/// This attribute is meaningless if the source generator associated with it is not enabled.
- /// The current built-in source generator only supports C# and only supplies an implementation when
+ /// The current built-in source generator only supports C# and only supplies an implementation when applied to static, non-partial, or non-generic methods.
/// applied to static, non-partial, non-generic methods.
/// Exported methods cannot be trimmed by the linker.
/// </remarks>
public sealed class JSExportAttribute : Attribute
{
/// <summary>
- /// Initializes a new instance of the <see cref="JSExportAttribute"/>.
+ /// Initializes a new instance of the <see cref="JSExportAttribute" /> class.
/// </summary>
public JSExportAttribute()
{
[CLSCompliant(false)]
[SupportedOSPlatform("browser")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public sealed partial class JSFunctionBinding
+ public sealed class JSFunctionBinding
{
+ /// <summary>
+ /// This API supports JSImport infrastructure and is not intended to be used directly from your code.
+ /// </summary>
+ internal JSFunctionBinding() { }
+
#region intentionally opaque internal structure
internal unsafe JSBindingHeader* Header;
internal unsafe JSBindingType* Sigs;// points to first arg, not exception, not result
/// Invokes a previously bound JavaScript function using the provided span to transport argument and return values.
/// This API supports JSImport infrastructure and is not intended to be used directly from your code.
/// </summary>
+ /// <param name="signature">Generated metadata about the method signature used for marshaling.</param>
+ /// <param name="arguments">The intermediate buffer with marshalled arguments.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments)
{
/// Locates and binds a JavaScript function given name and module so that it can later be invoked by managed callers.
/// This API supports JSImport infrastructure and is not intended to be used directly from your code.
/// </summary>
+ /// <param name="functionName">The name of the exported JavaScript function.</param>
+ /// <param name="moduleName">The name of the ES6 module.</param>
+ /// <param name="signatures">The metadata about the signature of the marshaled parameters.</param>
+ /// <returns>The method metadata.</returns>
+ /// <exception cref="PlatformNotSupportedException">The method is executed on an architecture other than WebAssembly.</exception>
// JavaScriptExports need to be protected from trimming because they are used from C/JS code which IL linker can't see
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, "System.Runtime.InteropServices.JavaScript.JavaScriptExports", "System.Runtime.InteropServices.JavaScript")]
// TODO make this DynamicDependency conditional
/// Binds a specific managed function wrapper so that it can later be invoked by JavaScript callers.
/// This API supports JSImport infrastructure and is not intended to be used directly from your code.
/// </summary>
+ /// <param name="fullyQualifiedName">The fully qualified name of the exported method.</param>
+ /// <param name="signatureHash">The hash of the signature metadata.</param>
+ /// <param name="signatures">The metadata about the signature of the marshaled parameters.</param>
+ /// <returns>The method metadata.</returns>
+ /// <exception cref="PlatformNotSupportedException">The method is executed on architecture other than WebAssembly.</exception>
public static JSFunctionBinding BindManagedFunction(string fullyQualifiedName, int signatureHash, ReadOnlySpan<JSMarshalerType> signatures)
{
if (RuntimeInformation.OSArchitecture != Architecture.Wasm)
public static partial class JSHost
{
/// <summary>
- /// Returns a proxy for the <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis">globalThis</see> JavaScript host object.
+ /// Returns a proxy for the <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/globalThis">globalThis</see> JavaScript host object.
/// </summary>
public static JSObject GlobalThis
{
}
/// <summary>
- /// Download and instantiate an ES6 module from the provided URL, via the JavaScript host's <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import">dynamic import API</see>.
- /// If a module with the provided <paramref name="moduleName"/> has previously been instantiated, it will be returned instead.
+ /// Downloads and instantiates an ES6 module from the provided URL, via the JavaScript host's <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import">dynamic import API</see>.
+ /// If a module with the provided <paramref name="moduleName" /> has previously been instantiated, it will be returned instead.
/// </summary>
/// <param name="moduleName">Globally unique identifier of the ES6 module, which is used by <see cref="JSImportAttribute(string, string)"/>.</param>
/// <param name="moduleUrl">The location of the module file.</param>
{
/// <summary>
/// Indicates that the JSImport source generator should create a managed wrapper to invoke a specific imported JavaScript function and marshal its arguments, return values, and exceptions.
- /// To configure the marshaling behavior for specific values, <seealso cref="JSMarshalAsAttribute{T}"/>.
+ /// To configure the marshalling behavior for specific values, <see cref="JSMarshalAsAttribute{T}" />.
/// </summary>
/// <remarks>
/// This attribute is meaningless if the source generator associated with it is not enabled.
- /// The current built-in source generator only supports C# and only supplies an implementation when
- /// applied to static, partial, non-generic methods.
+ /// The current built-in source generator only supports C# and only supplies an implementation when applied to static, partial, non-generic methods.
/// </remarks>
/// <example>
/// <code>
public sealed class JSImportAttribute : Attribute
{
/// <summary>
- /// The name of the target JavaScript function. This name will be used as a key to locate the function in the module.
- /// Functions nested inside of objects can be referred to by using the dot operator to connect one or more names.
+ /// Gets the name of the target JavaScript function. This name will be used as a key to locate the function in the module.
/// </summary>
+ /// <remarks>Functions nested inside of objects can be referred to by using the dot operator to connect one or more names.</remarks>
public string FunctionName { get; }
/// <summary>
- /// Globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="JSHost.ImportAsync(string, string, Threading.CancellationToken)"/> before any attempt to invoke the function.
+ /// Gets the globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="JSHost.ImportAsync(string, string, Threading.CancellationToken)" /> before any attempt to invoke the function.
/// </summary>
public string? ModuleName { get; }
/// <summary>
- /// Initializes a new instance of the <see cref="JSImportAttribute"/>.
+ /// Initializes a new instance of the <see cref="JSImportAttribute" /> class.
/// </summary>
- /// <param name="functionName">Name of the function to be bound in the module. It allows dots for nested objects.</param>
+ /// <param name="functionName">The name of the function to be bound in the module. Use dots for nested objects.</param>
public JSImportAttribute(string functionName)
{
FunctionName = functionName;
}
/// <summary>
- /// Initializes a new instance of the <see cref="JSImportAttribute"/>.
+ /// Initializes a new instance of the <see cref="JSImportAttribute" /> class.
/// </summary>
/// <param name="functionName">
/// The name of the target JavaScript function. This name will be used as a key to locate the function in the module.
/// Functions nested inside of objects can be referred to by using the dot operator to connect one or more names.
/// </param>
/// <param name="moduleName">
- /// Globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="JSHost.ImportAsync(string, string, Threading.CancellationToken)"/> before any attempt to invoke the function.
+ /// Globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="JSHost.ImportAsync(string, string, Threading.CancellationToken)" /> before any attempt to invoke the function.
/// </param>
public JSImportAttribute(string functionName, string moduleName)
{
/// Specifies the JavaScript type associated with a managed argument or return value.
/// The JSImport generator will use this information to marshal data between the JavaScript and managed environments.
/// </summary>
- /// <typeparam name="T">One of the types defined in <see cref="JSType"/>, for example <see cref="JSType.MemoryView"/></typeparam>
+ /// <typeparam name="T">One of the types defined in <see cref="JSType" />, for example <see cref="JSType.MemoryView" />.</typeparam>
/// <example>
/// <code>
/// [JSImport("createFunction", "my-math-helper")]
public sealed class JSMarshalAsAttribute<T> : Attribute where T : JSType
{
/// <summary>
- /// Create a <see cref="JSMarshalAsAttribute{T}" /> configured by generic parameters of <see cref="JSType" />.
+ /// Initializes a new instance of <see cref="JSMarshalAsAttribute{T}" /> configured by generic parameters of <see cref="JSType" />.
/// </summary>
public JSMarshalAsAttribute() { }
}
namespace System.Runtime.InteropServices.JavaScript
{
/// <summary>
- /// Represents type metadata about marshaler, which are necessary for marshaling function arguments.
- /// It's used by JSImport code generator and should not be used by developers in source code.
+ /// Represents type metadata about the marshaller that are necessary for marshalling function arguments.
+ /// This API is used by the JSImport code generator and should not be used by developers in source code.
/// </summary>
[SupportedOSPlatform("browser")]
[EditorBrowsable(EditorBrowsableState.Never)]
/// <summary>
/// Marshaling validates that the JavaScript function returned undefined value.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Void { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Void
/// <summary>
/// Marshaling ignores result of the JavaScript function.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Discard { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Discard
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</see> type.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Boolean { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Boolean
});
/// <summary>
- /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</see>.
+ /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Byte { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Byte
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</see> one character long.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</see> one character long.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Char { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Char
});
/// <summary>
- /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array">Int16Array</see>.
+ /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int16Array">Int16Array</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Int16 { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Int16
/// <summary>
- /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array">Int32Array</see>.
+ /// Marshal as JavaScript Number via <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int32Array">Int32Array</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Int32 { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Int32
/// <summary>
/// Marshal as JavaScript Number within -9007199254740991 and 9007199254740991 range.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Int52 { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Int52
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType BigInt64 { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.BigInt64
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Double { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Double
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Single { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Single
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType IntPtr { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.IntPtr
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</see> or it's JSObject proxy on managed side.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</see> or its JSObject proxy on managed side.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType JSObject { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.JSObject
/// <summary>
/// Dynamic marshal as best fit. For <see cref="object"/> maps to ManagedObject proxy on JavaScript side.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Object { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Object
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType String { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.String
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Exception { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.Exception
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType DateTime { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.DateTime
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType DateTimeOffset { get; } = new JSMarshalerType(new JSFunctionBinding.JSBindingType
{
Type = MarshalerType.DateTimeOffset
});
+ /// <summary>
+ /// Marshal as JavaScript underlying primitive type.
+ /// </summary>
+ /// <param name="primitive">Underlying primitive type.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Nullable(JSMarshalerType primitive)
{
CheckNullable(primitive);
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Task()
{
return _task;
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
+ /// <param name="result">Metadata about the type of the <see cref="System.Threading.Tasks.Task"/> result value.</param>
public static JSMarshalerType Task(JSMarshalerType result)
{
CheckTask(result);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</see>.
/// </summary>
+ /// <param name="element">Metadata about the type of the array element.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Array(JSMarshalerType element)
{
CheckArray(element);
/// <remarks>
/// ArraySegment will hold <see cref="GCHandleType.Pinned"/> to underlying array until disposed or garbage collected on JS side.
/// </remarks>
+ /// <param name="element">Metadata about the type of the array element.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType ArraySegment(JSMarshalerType element)
{
CheckArraySegment(element);
/// Marshal as instance of Span class on JavaScript side.
/// </summary>
/// <remarks>Marshaler is not pinning the data, caller is responsible for doing that.</remarks>
+ /// <param name="element">Metadata about the type of the span element.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Span(JSMarshalerType element)
{
CheckArraySegment(element);
});
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Action()
{
return _action;
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Action{T1}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Action(JSMarshalerType arg1)
{
CheckTask(arg1);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Action{T1,T2}"/>.</param>
+ /// <param name="arg2">Metadata about the type of the second argument of the <see cref="System.Action{T1,T2}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Action(JSMarshalerType arg1, JSMarshalerType arg2)
{
CheckTask(arg1);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Action{T1,T2,T3}"/>.</param>
+ /// <param name="arg2">Metadata about the type of the second argument of the <see cref="System.Action{T1,T2,T3}"/>.</param>
+ /// <param name="arg3">Metadata about the type of the third argument of the <see cref="System.Action{T1,T2,T3}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Action(JSMarshalerType arg1, JSMarshalerType arg2, JSMarshalerType arg3)
{
CheckTask(arg1);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="result">Metadata about the type of the result of the <see cref="System.Func{TRes}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Function(JSMarshalerType result)
{
CheckTask(result);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Func{TRes,T1}"/>.</param>
+ /// <param name="result">Metadata about the type of the result of the <see cref="System.Func{TRes,T1}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Function(JSMarshalerType arg1, JSMarshalerType result)
{
CheckTask(arg1);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Func{TRes,T1,T2}"/>.</param>
+ /// <param name="arg2">Metadata about the type of the second argument of the <see cref="System.Func{TRes,T1,T2}"/>.</param>
+ /// <param name="result">Metadata about the type of the result of the <see cref="System.Func{TRes,T1,T2}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Function(JSMarshalerType arg1, JSMarshalerType arg2, JSMarshalerType result)
{
CheckTask(arg1);
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see>.
/// </summary>
+ /// <param name="arg1">Metadata about the type of the first argument of the <see cref="System.Func{TRes,T1,T2,T3}"/>.</param>
+ /// <param name="arg2">Metadata about the type of the second argument of the <see cref="System.Func{TRes,T1,T2,T3}"/>.</param>
+ /// <param name="arg3">Metadata about the type of the third argument of the <see cref="System.Func{TRes,T1,T2,T3}"/>.</param>
+ /// <param name="result">Metadata about the type of the result of the <see cref="System.Func{TRes,T1,T2,T3}"/>.</param>
+ /// <returns>The marshaler metadata.</returns>
public static JSMarshalerType Function(JSMarshalerType arg1, JSMarshalerType arg2, JSMarshalerType arg3, JSMarshalerType result)
{
CheckTask(arg1);
/// <summary>
/// Checks whether the target object or one of its prototypes has a property with the specified name.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns><see langword="true" /> when the object has the property with the specified name.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool HasProperty(string propertyName)
{
/// <summary>
/// Returns <code>typeof()</code> of the property.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>One of "undefined", "object", "boolean", "number", "bigint", "string", "symbol" or "function".</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string GetTypeOfProperty(string propertyName)
{
}
/// <summary>
- /// Returns value of the property as <see cref="bool"/> if the property exists, otherwise false.
+ /// Returns the value of the specified property as <see cref="T:System.Boolean" /> if the property exists, otherwise <see langword="false" />.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not a bool.</remarks>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <summary>
/// Returns value of the property as <see cref="int"/> if the property exists, otherwise 0.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not an integer.</remarks>
/// <summary>
/// Returns value of the property as <see cref="double"/> if the property exists, otherwise 0.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not a number.</remarks>
/// <summary>
/// Returns value of the property as <see cref="string"/> if the property exists, otherwise null.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not a string.</remarks>
/// <summary>
/// Returns value of the property as <see cref="JSObject"/> proxy if the property exists, otherwise null.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not an object.</remarks>
/// <summary>
/// Returns value of the property as <see cref="byte"/> array if the property exists, otherwise null.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <returns>The value of the property with the specified name.</returns>
/// <seealso cref="GetTypeOfProperty(string)"/>
/// <seealso cref="HasProperty(string)"/>
/// <remarks>Will throw <see cref="JSException"/> when the property value is not an array.</remarks>
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, bool value)
{
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, int value)
{
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, double value)
{
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, string? value)
{
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, JSObject? value)
{
/// <summary>
/// Defines a new property on the target object, or modifies an existing property to have the specified value.
/// </summary>
+ /// <param name="propertyName">The name of the property.</param>
+ /// <param name="value">Value of property to set.</param>
/// <remarks>The method will copy the bytes.</remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetProperty(string propertyName, byte[]? value)
namespace System.Runtime.InteropServices.JavaScript
{
/// <summary>
- /// Used as generic argument for <see cref="JSMarshalAsAttribute{T}"/> to express expected JavaScript type, which should be source or result of argument marshaling.
+ /// Used as generic argument for <see cref="JSMarshalAsAttribute{T}"/> to express expected JavaScript type, which should be input or output of argument marshaling.
/// </summary>
[SupportedOSPlatform("browser")]
public abstract class JSType
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</see> type.
/// </summary>
public sealed class Boolean : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</see> type.
/// </summary>
public sealed class Number : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see> type.
/// </summary>
public sealed class BigInt : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see> type.
/// </summary>
public sealed class Date : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</see> type.
/// </summary>
public sealed class String : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</see> type.
/// </summary>
public sealed class Object : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</see> type.
/// </summary>
public sealed class Error : JSType
{
}
/// <summary>
- /// Marshal as copy of JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</see> or <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray">TypedArray</see> type.
+ /// Marshal as a copy of the JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</see> or <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray">TypedArray</see> type.
/// </summary>
+ /// <typeparam name="T">The type of array element.</typeparam>
public sealed class Array<T> : JSType where T : JSType
{
internal Array() { }
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</see> type.
/// </summary>
+ /// <typeparam name="T">The type of marshalled result value.</typeparam>
public sealed class Promise<T> : JSType where T : JSType
{
internal Promise() { }
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
/// </summary>
public sealed class Function : JSType
{
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
/// </summary>
+ /// <typeparam name="T">The type of marshaled parameter or result.</typeparam>
public sealed class Function<T> : JSType where T : JSType
{
internal Function() { }
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
/// </summary>
+ /// <typeparam name="T1">The type of marshaled parameter or result.</typeparam>
+ /// <typeparam name="T2">Type of marshaled parameter.</typeparam>
public sealed class Function<T1, T2> : JSType where T1 : JSType where T2 : JSType
{
internal Function() { }
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
/// </summary>
+ /// <typeparam name="T1">The type of marshaled parameter or result.</typeparam>
+ /// <typeparam name="T2">Type of marshaled parameter.</typeparam>
+ /// <typeparam name="T3">Type of marshaled parameter.</typeparam>
public sealed class Function<T1, T2, T3> : JSType where T1 : JSType where T2 : JSType where T3 : JSType
{
internal Function() { }
}
/// <summary>
- /// Marshal as JavaScript <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
+ /// Marshal as JavaScript <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</see> type.
/// </summary>
+ /// <typeparam name="T1">The type of marshaled parameter or result.</typeparam>
+ /// <typeparam name="T2">Type of marshaled parameter.</typeparam>
+ /// <typeparam name="T3">Type of marshaled parameter.</typeparam>
+ /// <typeparam name="T4">Type of marshaled parameter.</typeparam>
public sealed class Function<T1, T2, T3, T4> : JSType where T1 : JSType where T2 : JSType where T3 : JSType where T4 : JSType
{
internal Function() { }
/// <summary>
/// Push the specified elements.
/// </summary>
- /// <returns>The new length of the Array push was called on</returns>
+ /// <returns>The new length of the Array push was called on.</returns>
/// <param name="elements">Elements.</param>
public int Push(params object[] elements) => (int)this.Invoke("push", elements);
/// <summary>
/// Pop this instance.
/// </summary>
- /// <returns>The element removed from the array or null if the array was empty</returns>
+ /// <returns>The element removed from the array or null if the array was empty.</returns>
public object Pop() => (object)this.Invoke("pop");
/// <summary>
/// Remove the first element of the Array and return that element
/// </summary>
- /// <returns>The removed element</returns>
+ /// <returns>The removed element.</returns>
public object Shift() => this.Invoke("shift");
/// <summary>
/// <summary>
/// Index of the search element.
/// </summary>
- /// <returns>The index of first occurrence of searchElement in the Array or -1 if not Found</returns>
+ /// <returns>The index of first occurrence of searchElement in the Array or -1 if not Found.</returns>
/// <param name="searchElement">Search element.</param>
- /// <param name="fromIndex">The index to start the search from</param>
+ /// <param name="fromIndex">The index to start the search from.</param>
public int IndexOf(object searchElement, int fromIndex = 0) => (int)this.Invoke("indexOf", searchElement, fromIndex);
/// <summary>
/// Finds the index of the last occurrence of<paramref name="searchElement" />
/// </summary>
- /// <returns>The index of the last occurrence</returns>
+ /// <returns>The index of the last occurrence.</returns>
/// <param name="searchElement">Search element.</param>
public int LastIndexOf(object searchElement) => (int)this.Invoke("lastIndexOf", searchElement);
/// <summary>
/// Gets a value indicating whether this ArrayBuffer is view.
/// </summary>
- /// <value><c>true</c> if is view; otherwise, <c>false</c>.</value>
+ /// <value><see langword="true"/> if is view; otherwise, <see langword="false"/>.</value>
public bool IsView => (bool)this.GetObjectProperty("isView");
/// <summary>
/// Returns the named property from the object, or throws a JSException on error.
/// </summary>
/// <param name="self">thisArg</param>
- /// <param name="name">The name of the property to lookup</param>
+ /// <param name="name">The name of the property to lookup.</param>
/// <remarks>
/// This method can raise a JSException if fetching the property in Javascript raises an exception.
/// </remarks>
/// <remarks>
/// </remarks>
/// <param name="self">thisArg</param>
- /// <param name="name">The name of the property to lookup</param>
+ /// <param name="name">The name of the property to lookup.</param>
/// <param name="value">The value can be a primitive type (int, double, string, bool), an
/// array that will be surfaced as a typed ArrayBuffer (byte[], sbyte[], short[], ushort[],
/// float[], double[]) </param>
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManagedBig(out long value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJSBig(long value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManagedBig(out long? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJSBig(long? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out bool value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(bool value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out bool? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(bool? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out byte value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(byte value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out byte? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(byte? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out byte[]? value)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(byte[]? value)
{
if (value == null)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
// this only supports array round-trip, there is no way how to create ArraySegment in JS
public unsafe void ToManaged(out ArraySegment<byte> value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(ArraySegment<byte> value)
{
if (value.Array == null)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out Span<byte> value)
{
value = new Span<byte>((void*)slot.IntPtrValue, slot.Length);
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
- /// <remarks>caller is responsible for pinning</remarks>
+ /// <remarks>caller is responsible for pinning.</remarks>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(Span<byte> value)
{
slot.Length = value.Length;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out char value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(char value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out char? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(char? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out DateTimeOffset value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(DateTimeOffset value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out DateTimeOffset? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(DateTimeOffset? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out DateTime value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(DateTime value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out DateTime? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(DateTime? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out double value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(double value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out double? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(double? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out double[]? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(double[] value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
// this only supports array round-trip
public unsafe void ToManaged(out ArraySegment<double> value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(ArraySegment<double> value)
{
if (value.Array == null)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out Span<double> value)
{
value = new Span<double>((void*)slot.IntPtrValue, slot.Length);
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
- /// <remarks>caller is responsible for pinning</remarks>
+ /// <remarks>caller is responsible for pinning.</remarks>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(Span<double> value)
{
slot.Length = value.Length;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out Exception? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(Exception? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out Action? value)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToManaged<T>(out Action<T>? value, ArgumentToJSCallback<T> arg1Marshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToManaged<T1, T2>(out Action<T1, T2>? value, ArgumentToJSCallback<T1> arg1Marshaler, ArgumentToJSCallback<T2> arg2Marshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T3">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg3Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToManaged<T1, T2, T3>(out Action<T1, T2, T3>? value, ArgumentToJSCallback<T1> arg1Marshaler, ArgumentToJSCallback<T2> arg2Marshaler, ArgumentToJSCallback<T3> arg3Marshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
public unsafe void ToManaged<TResult>(out Func<TResult>? value, ArgumentToManagedCallback<TResult> resMarshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
public unsafe void ToManaged<T, TResult>(out Func<T, TResult>? value, ArgumentToJSCallback<T> arg1Marshaler, ArgumentToManagedCallback<TResult> resMarshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
public unsafe void ToManaged<T1, T2, TResult>(out Func<T1, T2, TResult>? value, ArgumentToJSCallback<T1> arg1Marshaler, ArgumentToJSCallback<T2> arg2Marshaler, ArgumentToManagedCallback<TResult> resMarshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T3">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg3Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
public unsafe void ToManaged<T1, T2, T3, TResult>(out Func<T1, T2, T3, TResult>? value, ArgumentToJSCallback<T1> arg1Marshaler, ArgumentToJSCallback<T2> arg2Marshaler, ArgumentToJSCallback<T3> arg3Marshaler, ArgumentToManagedCallback<TResult> resMarshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(Action value)
{
Action cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToJS<T>(Action<T> value, ArgumentToManagedCallback<T> arg1Marshaler)
{
Action<T> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToJS<T1, T2>(Action<T1, T2> value, ArgumentToManagedCallback<T1> arg1Marshaler, ArgumentToManagedCallback<T2> arg2Marshaler)
{
Action<T1, T2> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Action.</typeparam>
+ /// <typeparam name="T3">The type of the marshaled argument of the Action.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Action.</param>
+ /// <param name="arg3Marshaler">The generated callback which marshals the argument of the Action.</param>
public unsafe void ToJS<T1, T2, T3>(Action<T1, T2, T3> value, ArgumentToManagedCallback<T1> arg1Marshaler, ArgumentToManagedCallback<T2> arg2Marshaler, ArgumentToManagedCallback<T3> arg3Marshaler)
{
Action<T1, T2, T3> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
public unsafe void ToJS<TResult>(Func<TResult> value, ArgumentToJSCallback<TResult> resMarshaler)
{
Func<TResult> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
public unsafe void ToJS<T, TResult>(Func<T, TResult> value, ArgumentToManagedCallback<T> arg1Marshaler, ArgumentToJSCallback<TResult> resMarshaler)
{
Func<T, TResult> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Func.</param>
public unsafe void ToJS<T1, T2, TResult>(Func<T1, T2, TResult> value, ArgumentToManagedCallback<T1> arg1Marshaler, ArgumentToManagedCallback<T2> arg2Marshaler, ArgumentToJSCallback<TResult> resMarshaler)
{
Func<T1, T2, TResult> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T1">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T2">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="T3">The type of the marshaled argument of the Func.</typeparam>
+ /// <typeparam name="TResult">Type of marshaled result of the Func.</typeparam>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="resMarshaler">The generated callback which marshals the result of the Func.</param>
+ /// <param name="arg1Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg2Marshaler">The generated callback which marshals the argument of the Func.</param>
+ /// <param name="arg3Marshaler">The generated callback which marshals the argument of the Func.</param>
public unsafe void ToJS<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult> value, ArgumentToManagedCallback<T1> arg1Marshaler, ArgumentToManagedCallback<T2> arg2Marshaler, ArgumentToManagedCallback<T3> arg3Marshaler, ArgumentToJSCallback<TResult> resMarshaler)
{
Func<T1, T2, T3, TResult> cpy = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out short value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(short value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out short? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(short? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out int value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(int value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out int? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(int? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out int[]? value)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(int[]? value)
{
if (value == null)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
// this only supports array round-trip
public unsafe void ToManaged(out ArraySegment<int> value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(ArraySegment<int> value)
{
if (value.Array == null)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out Span<int> value)
{
value = new Span<int>((void*)slot.IntPtrValue, slot.Length);
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
- /// <remarks>caller is responsible for pinning</remarks>
+ /// <remarks>caller is responsible for pinning.</remarks>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToJS(Span<int> value)
{
slot.Length = value.Length;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out long value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(long value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out long? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(long? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out IntPtr value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(IntPtr value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out IntPtr? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(IntPtr? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out void* value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(void* value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out JSObject? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(JSObject? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out JSObject?[]? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(JSObject?[] value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out object? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(object? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out object?[]? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(object?[] value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out float value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(float value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out float? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ToJS(float? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out string? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(string? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToManaged(out string?[]? value)
{
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ToJS(string?[] value)
{
public partial struct JSMarshalerArgument
{
/// <summary>
- /// Helps with marshaling of the Task result or Function arguments.
- /// It's used by JSImport code generator and should not be used by developers in source code.
+ /// Assists in marshalling of Task results and Function arguments.
+ /// This API is used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">Type of the marshaled value.</typeparam>
+ /// <param name="arg">The low-level argument representation.</param>
+ /// <param name="value">The value to be marshaled.</param>
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public delegate void ArgumentToManagedCallback<T>(ref JSMarshalerArgument arg, out T value);
/// <summary>
- /// Helps with marshaling of the Task result or Function arguments.
- /// It's used by JSImport code generator and should not be used by developers in source code.
+ /// Assists in marshalling of Task results and Function arguments.
+ /// This API is used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <typeparam name="T">Type of the marshaled value.</typeparam>
+ /// <param name="arg">The low-level argument representation.</param>
+ /// <param name="value">The value to be marshaled.</param>
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public delegate void ArgumentToJSCallback<T>(ref JSMarshalerArgument arg, T value);
/// <summary>
/// Implementation of the argument marshaling.
- /// It's used by JSImport code generator and should not be used by developers in source code.
+ /// This API is used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public unsafe void ToManaged(out Task? value)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="marshaler">The generated callback which marshals the result value of the <see cref="System.Threading.Tasks.Task"/>.</param>
+ /// <typeparam name="T">Type of marshaled result of the <see cref="System.Threading.Tasks.Task"/>.</typeparam>
public unsafe void ToManaged<T>(out Task<T>? value, ArgumentToManagedCallback<T> marshaler)
{
if (slot.Type == MarshalerType.None)
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
public void ToJS(Task? value)
{
Task? task = value;
/// Implementation of the argument marshaling.
/// It's used by JSImport code generator and should not be used by developers in source code.
/// </summary>
+ /// <param name="value">The value to be marshaled.</param>
+ /// <param name="marshaler">The generated callback which marshals the result value of the <see cref="System.Threading.Tasks.Task"/>.</param>
+ /// <typeparam name="T">Type of marshaled result of the <see cref="System.Threading.Tasks.Task"/>.</typeparam>
public void ToJS<T>(Task<T>? value, ArgumentToJSCallback<T> marshaler)
{
Task<T>? task = value;