Skip to content

Commit 0effa38

Browse files
carlossanlopgewarrenradical
authored
Port System.Runtime.InteropServices.Javascript docs to RC1 (#8390)
* System.Runtime.InteropServices.Javascript RC1 * First batch of suggestions by gewarren Co-authored-by: Genevieve Warren <[email protected]> * Next batch of suggestions by gewarren. * Apply suggestions from code review * It's -> This API is * Apply suggestions from code review Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Genevieve Warren <[email protected]> * Update xml/System.Runtime.InteropServices.JavaScript/JSExportAttribute.xml Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: carlossanlop <[email protected]> Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: Ankit Jain <[email protected]>
1 parent 03b90b8 commit 0effa38

30 files changed

+341
-212
lines changed

xml/System.Runtime.InteropServices.JavaScript/JSException.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
23+
<summary>Represents an exception initiated from the JavaScript interop code.</summary>
2424
<remarks>To be added.</remarks>
2525
</Docs>
2626
<Members>
@@ -40,8 +40,8 @@
4040
<Parameter Name="msg" Type="System.String" />
4141
</Parameters>
4242
<Docs>
43-
<param name="msg">To be added.</param>
44-
<summary>To be added.</summary>
43+
<param name="msg">The message that describes the error.</param>
44+
<summary>Initializes a new instance of the JSException class with a specified error message.</summary>
4545
<remarks>To be added.</remarks>
4646
</Docs>
4747
</Member>

xml/System.Runtime.InteropServices.JavaScript/JSExportAttribute.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
28-
<remarks>To be added.</remarks>
27+
<summary>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>
28+
<remarks>
29+
<para>For marshaling arguments of complex types <see cref="T:System.Runtime.InteropServices.JavaScript.JSMarshalAsAttribute`1" />.</para>
30+
<para>This attribute is meaningless if the source generator associated with it is not enabled.</para>
31+
<para>The current built-in source generator only supports C# and only supplies an implementation when applied to static, non-partial, or non-generic methods.</para>
32+
<para>Exported methods cannot be trimmed by the linker.</para>
33+
</remarks>
2934
</Docs>
3035
<Members>
3136
<Member MemberName=".ctor">
@@ -41,7 +46,7 @@
4146
</AssemblyInfo>
4247
<Parameters />
4348
<Docs>
44-
<summary>To be added.</summary>
49+
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.JavaScript.JSExportAttribute" /> class.</summary>
4550
<remarks>To be added.</remarks>
4651
</Docs>
4752
</Member>

xml/System.Runtime.InteropServices.JavaScript/JSFunctionBinding.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
</Attribute>
2929
</Attributes>
3030
<Docs>
31-
<summary>To be added.</summary>
31+
<summary>Represents a bound imported or exported JavaScript function and contains information necessary to invoke it.
32+
This API supports JSImport infrastructure and is not intended to be used directly from your code.</summary>
3233
<remarks>To be added.</remarks>
3334
</Docs>
3435
<Members>
@@ -73,7 +74,8 @@
7374
<param name="functionName">To be added.</param>
7475
<param name="moduleName">To be added.</param>
7576
<param name="signatures">To be added.</param>
76-
<summary>To be added.</summary>
77+
<summary>Locates and binds a JavaScript function given name and module so that it can later be invoked by managed callers.
78+
This API supports JSImport infrastructure and is not intended to be used directly from your code.</summary>
7779
<returns>To be added.</returns>
7880
<remarks>To be added.</remarks>
7981
</Docs>
@@ -102,7 +104,8 @@
102104
<param name="fullyQualifiedName">To be added.</param>
103105
<param name="signatureHash">To be added.</param>
104106
<param name="signatures">To be added.</param>
105-
<summary>To be added.</summary>
107+
<summary>Binds a specific managed function wrapper so that it can later be invoked by JavaScript callers.
108+
This API supports JSImport infrastructure and is not intended to be used directly from your code.</summary>
106109
<returns>To be added.</returns>
107110
<remarks>To be added.</remarks>
108111
</Docs>
@@ -129,7 +132,8 @@
129132
<Docs>
130133
<param name="signature">To be added.</param>
131134
<param name="arguments">To be added.</param>
132-
<summary>To be added.</summary>
135+
<summary>Invokes a previously bound JavaScript function using the provided span to transport argument and return values.
136+
This API supports JSImport infrastructure and is not intended to be used directly from your code.</summary>
133137
<remarks>To be added.</remarks>
134138
</Docs>
135139
</Member>

xml/System.Runtime.InteropServices.JavaScript/JSHost.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
23+
<summary>Represents the JavaScript host environment where the .NET runtime is currently operating.</summary>
2424
<remarks>To be added.</remarks>
2525
</Docs>
2626
<Members>
@@ -40,7 +40,7 @@
4040
<ReturnType>System.Runtime.InteropServices.JavaScript.JSObject</ReturnType>
4141
</ReturnValue>
4242
<Docs>
43-
<summary>To be added.</summary>
43+
<summary>Returns a proxy for the JavaScript module that contains the .NET runtime.</summary>
4444
<value>To be added.</value>
4545
<remarks>To be added.</remarks>
4646
</Docs>
@@ -61,7 +61,7 @@
6161
<ReturnType>System.Runtime.InteropServices.JavaScript.JSObject</ReturnType>
6262
</ReturnValue>
6363
<Docs>
64-
<summary>To be added.</summary>
64+
<summary>Returns a proxy for the <see href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/globalThis">globalThis</see> JavaScript host object.</summary>
6565
<value>To be added.</value>
6666
<remarks>To be added.</remarks>
6767
</Docs>
@@ -86,11 +86,12 @@
8686
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
8787
</Parameters>
8888
<Docs>
89-
<param name="moduleName">To be added.</param>
90-
<param name="moduleUrl">To be added.</param>
91-
<param name="cancellationToken">To be added.</param>
92-
<summary>To be added.</summary>
93-
<returns>To be added.</returns>
89+
<param name="moduleName">Globally unique identifier of the ES6 module, which is used by <see cref="M:System.Runtime.InteropServices.JavaScript.JSImportAttribute.#ctor(System.String,System.String)" />.</param>
90+
<param name="moduleUrl">The location of the module file.</param>
91+
<param name="cancellationToken">The token to monitor for cancellation requests.</param>
92+
<summary>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>.
93+
If a module with the provided <paramref name="moduleName" /> has previously been instantiated, it will be returned instead.</summary>
94+
<returns>A proxy for the JavaScript object that contains the module's exports.</returns>
9495
<remarks>To be added.</remarks>
9596
</Docs>
9697
</Member>

xml/System.Runtime.InteropServices.JavaScript/JSImportAttribute.xml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
28-
<remarks>To be added.</remarks>
27+
<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.</summary>
28+
<remarks>
29+
<para>To configure the marshalling behavior for specific values, <see cref="T:System.Runtime.InteropServices.JavaScript.JSMarshalAsAttribute`1" />.</para>
30+
<para>This attribute is meaningless if the source generator associated with it is not enabled.</para>
31+
<para>The current built-in source generator only supports C# and only supplies an implementation when applied to static, partial, non-generic methods.</para>
32+
</remarks>
2933
</Docs>
3034
<Members>
3135
<Member MemberName=".ctor">
@@ -44,8 +48,8 @@
4448
<Parameter Name="functionName" Type="System.String" />
4549
</Parameters>
4650
<Docs>
47-
<param name="functionName">To be added.</param>
48-
<summary>To be added.</summary>
51+
<param name="functionName">The name of the function to be bound in the module. Use dots for nested objects.</param>
52+
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.JavaScript.JSImportAttribute" /> class.</summary>
4953
<remarks>To be added.</remarks>
5054
</Docs>
5155
</Member>
@@ -66,9 +70,10 @@
6670
<Parameter Name="moduleName" Type="System.String" />
6771
</Parameters>
6872
<Docs>
69-
<param name="functionName">To be added.</param>
70-
<param name="moduleName">To be added.</param>
71-
<summary>To be added.</summary>
73+
<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.
74+
Functions nested inside of objects can be referred to by using the dot operator to connect one or more names.</param>
75+
<param name="moduleName">Globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="M:System.Runtime.InteropServices.JavaScript.JSHost.ImportAsync(System.String,System.String,System.Threading.CancellationToken)" /> before any attempt to invoke the function.</param>
76+
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.JavaScript.JSImportAttribute" /> class.</summary>
7277
<remarks>To be added.</remarks>
7378
</Docs>
7479
</Member>
@@ -88,9 +93,9 @@
8893
<ReturnType>System.String</ReturnType>
8994
</ReturnValue>
9095
<Docs>
91-
<summary>To be added.</summary>
96+
<summary>Gets the name of the target JavaScript function. This name will be used as a key to locate the function in the module.</summary>
9297
<value>To be added.</value>
93-
<remarks>To be added.</remarks>
98+
<remarks>Functions nested inside of objects can be referred to by using the dot operator to connect one or more names.</remarks>
9499
</Docs>
95100
</Member>
96101
<Member MemberName="ModuleName">
@@ -109,7 +114,7 @@
109114
<ReturnType>System.String</ReturnType>
110115
</ReturnValue>
111116
<Docs>
112-
<summary>To be added.</summary>
117+
<summary>Gets the globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via <see cref="M:System.Runtime.InteropServices.JavaScript.JSHost.ImportAsync(System.String,System.String,System.Threading.CancellationToken)" /> before any attempt to invoke the function.</summary>
113118
<value>To be added.</value>
114119
<remarks>To be added.</remarks>
115120
</Docs>

xml/System.Runtime.InteropServices.JavaScript/JSMarshalAsAttribute`1.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
</Attribute>
3232
</Attributes>
3333
<Docs>
34-
<typeparam name="T">To be added.</typeparam>
35-
<summary>To be added.</summary>
34+
<typeparam name="T">One of the types defined in <see cref="T:System.Runtime.InteropServices.JavaScript.JSType" />, for example <see cref="T:System.Runtime.InteropServices.JavaScript.JSType.MemoryView" />.</typeparam>
35+
<summary>Specifies the JavaScript type associated with a managed argument or return value.
36+
The JSImport generator will use this information to marshal data between the JavaScript and managed environments.</summary>
3637
<remarks>To be added.</remarks>
3738
</Docs>
3839
<Members>
@@ -49,7 +50,7 @@
4950
</AssemblyInfo>
5051
<Parameters />
5152
<Docs>
52-
<summary>To be added.</summary>
53+
<summary>Initializes a new instance of <see cref="T:System.Runtime.InteropServices.JavaScript.JSMarshalAsAttribute`1" /> configured by generic parameters of <see cref="T:System.Runtime.InteropServices.JavaScript.JSType" />.</summary>
5354
<remarks>To be added.</remarks>
5455
</Docs>
5556
</Member>

xml/System.Runtime.InteropServices.JavaScript/JSMarshalerArgument+ArgumentToJSCallback`1.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<typeparam name="T">To be added.</typeparam>
2727
<param name="arg">To be added.</param>
2828
<param name="value">To be added.</param>
29-
<summary>To be added.</summary>
29+
<summary>Assists in marshalling of Task results and Function arguments.
30+
This API is used by JSImport code generator and should not be used by developers in source code.</summary>
3031
<remarks>To be added.</remarks>
3132
</Docs>
3233
</Type>

xml/System.Runtime.InteropServices.JavaScript/JSMarshalerArgument+ArgumentToManagedCallback`1.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<typeparam name="T">To be added.</typeparam>
2727
<param name="arg">To be added.</param>
2828
<param name="value">To be added.</param>
29-
<summary>To be added.</summary>
29+
<summary>Assists in marshalling of Task results and Function arguments.
30+
This API is used by JSImport code generator and should not be used by developers in source code.</summary>
3031
<remarks>To be added.</remarks>
3132
</Docs>
3233
</Type>

0 commit comments

Comments
 (0)