261 references to KnownManagedType
Microsoft.Interop.JavaScript.JSImportGenerator (261)
JSGeneratorFactory.cs (228)
45
case { TypeInfo: JSSimpleTypeInfo(
KnownManagedType
.Void), JSType: JSTypeFlags.DiscardNoWait }:
47
case { TypeInfo: JSSimpleTypeInfo(
KnownManagedType
.Void), JSType: JSTypeFlags.Discard }:
48
case { TypeInfo: JSSimpleTypeInfo(
KnownManagedType
.Void), JSType: JSTypeFlags.Void }:
49
case { TypeInfo: JSSimpleTypeInfo(
KnownManagedType
.Void), JSType: JSTypeFlags.None }:
50
case { TypeInfo: JSSimpleTypeInfo(
KnownManagedType
.Void), JSType: JSTypeFlags.Missing }:
82
case { TypeInfo: JSTaskTypeInfo(JSSimpleTypeInfo(
KnownManagedType
.Void)) task }:
96
internal static ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context, bool isToJs,
KnownManagedType
marshaledType,
KnownManagedType
[] argumentTypes, JSTypeFlags jsType, JSTypeFlags[] jsTypeArguments, Func<string, ResolvedGenerator> failWithReason)
101
case
KnownManagedType
.Boolean when jsType == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean));
102
case
KnownManagedType
.Byte when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte));
103
case
KnownManagedType
.Char when jsType == JSTypeFlags.String: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char));
104
case
KnownManagedType
.Int16 when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16));
105
case
KnownManagedType
.Int32 when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32));
106
case
KnownManagedType
.Int64 when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int52));
107
case
KnownManagedType
.Int64 when jsType == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.BigInt64));
108
case
KnownManagedType
.Single when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single));
109
case
KnownManagedType
.Double when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double));
110
case
KnownManagedType
.IntPtr when jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr));
111
case
KnownManagedType
.DateTime when jsType == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTime));
112
case
KnownManagedType
.DateTimeOffset when jsType == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTimeOffset));
113
case
KnownManagedType
.Exception when jsType == JSTypeFlags.Error: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Exception));
114
case
KnownManagedType
.JSObject when jsType == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.JSObject));
115
case
KnownManagedType
.String when jsType == JSTypeFlags.String: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.String));
116
case
KnownManagedType
.Object when jsType == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Object));
119
case
KnownManagedType
.Boolean when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean));
120
case
KnownManagedType
.Byte when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte));
121
case
KnownManagedType
.Char when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char));
122
case
KnownManagedType
.Int16 when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16));
123
case
KnownManagedType
.Int32 when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32));
124
case
KnownManagedType
.Single when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single));
125
case
KnownManagedType
.Double when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double));
126
case
KnownManagedType
.IntPtr when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr));
127
case
KnownManagedType
.Exception when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Exception));
128
case
KnownManagedType
.JSObject when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.JSObject));
129
case
KnownManagedType
.String when jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new PrimitiveJSGenerator(info, context, MarshalerType.String));
132
case
KnownManagedType
.Int64 when jsType == JSTypeFlags.Missing:
133
case
KnownManagedType
.DateTime when jsType == JSTypeFlags.Missing:
134
case
KnownManagedType
.DateTimeOffset when jsType == JSTypeFlags.Missing:
135
case
KnownManagedType
.Object when jsType == JSTypeFlags.Missing:
139
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Boolean && jsType == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Boolean));
140
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Byte));
141
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Char && jsType == JSTypeFlags.String: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Byte));
142
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int16 && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Int16));
143
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Int32));
144
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int64 && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Int52));
145
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int64 && jsType == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.BigInt64));
146
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Double));
147
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Single && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Single));
148
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.IntPtr && jsType == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.IntPtr));
149
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.DateTime && jsType == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.DateTime));
150
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.DateTimeOffset && jsType == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.DateTimeOffset));
153
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Boolean && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Boolean));
154
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Byte));
155
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Char && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Byte));
156
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int16 && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Int16));
157
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Int32));
158
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Single && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Single));
159
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.Double));
160
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.IntPtr && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new NullableJSGenerator(info, context, MarshalerType.IntPtr));
163
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.Int64 && jsType == JSTypeFlags.Missing:
164
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.DateTime && jsType == JSTypeFlags.Missing:
165
case
KnownManagedType
.Nullable when argumentTypes[0] ==
KnownManagedType
.DateTimeOffset && jsType == JSTypeFlags.Missing:
168
case
KnownManagedType
.Nullable:
172
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes.Length == 0 && jsTypeArguments[0] == JSTypeFlags.Void: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void));
173
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Byte));
174
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Boolean && jsTypeArguments[0] == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean));
175
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Char && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Char));
176
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Int16 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int16));
177
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int32));
178
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Int64 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int52));
179
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Int64 && jsTypeArguments[0] == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.BigInt64));
180
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.IntPtr && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr));
181
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Double));
182
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Single && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Single));
183
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject));
184
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.String));
185
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Exception && jsTypeArguments[0] == JSTypeFlags.Error: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Exception));
186
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.DateTime && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTime));
187
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.DateTimeOffset && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTimeOffset));
188
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Object));
191
case
KnownManagedType
.Task when jsType == JSTypeFlags.Missing && argumentTypes.Length == 0: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void));
192
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Boolean && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean));
193
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Byte));
194
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Char && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Char));
195
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Int16 && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int16));
196
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int32));
197
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Single && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Single));
198
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Double));
199
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.IntPtr && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr));
200
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.JSObject && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject));
201
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.String && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.String));
202
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Exception && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Exception));
205
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Int64 && jsType == JSTypeFlags.Missing:
206
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.DateTime && jsType == JSTypeFlags.Missing:
207
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.DateTimeOffset && jsType == JSTypeFlags.Missing:
208
case
KnownManagedType
.Task when argumentTypes[0] ==
KnownManagedType
.Object && jsType == JSTypeFlags.Missing:
211
case
KnownManagedType
.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1:
215
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Byte));
216
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.String));
217
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Double));
218
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Int32));
219
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.JSObject));
220
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] ==
KnownManagedType
.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Object));
223
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Byte));
224
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.String && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.String));
225
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Double));
226
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Int32));
227
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.JSObject && jsType == JSTypeFlags.Missing: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.JSObject));
228
case
KnownManagedType
.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1:
232
case
KnownManagedType
.Array when argumentTypes[0] ==
KnownManagedType
.Object && jsType == JSTypeFlags.Missing:
236
case
KnownManagedType
.Span when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0:
238
case
KnownManagedType
.Span when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Byte: return ResolvedGenerator.Resolved(new SpanJSGenerator(info, context, MarshalerType.Byte));
239
case
KnownManagedType
.Span when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Int32: return ResolvedGenerator.Resolved(new SpanJSGenerator(info, context, MarshalerType.Int32));
240
case
KnownManagedType
.Span when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Double: return ResolvedGenerator.Resolved(new SpanJSGenerator(info, context, MarshalerType.Double));
242
case
KnownManagedType
.Span when jsType == JSTypeFlags.MemoryView:
246
case
KnownManagedType
.Span when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Missing:
247
case
KnownManagedType
.Span when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Missing:
248
case
KnownManagedType
.Span when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Missing:
252
case
KnownManagedType
.ArraySegment when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0:
254
case
KnownManagedType
.ArraySegment when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Byte: return ResolvedGenerator.Resolved(new ArraySegmentJSGenerator(info, context, MarshalerType.Byte));
255
case
KnownManagedType
.ArraySegment when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Int32: return ResolvedGenerator.Resolved(new ArraySegmentJSGenerator(info, context, MarshalerType.Int32));
256
case
KnownManagedType
.ArraySegment when jsType == JSTypeFlags.MemoryView && argumentTypes[0] ==
KnownManagedType
.Double: return ResolvedGenerator.Resolved(new ArraySegmentJSGenerator(info, context, MarshalerType.Double));
257
case
KnownManagedType
.ArraySegment when jsType == JSTypeFlags.MemoryView:
261
case
KnownManagedType
.ArraySegment when argumentTypes[0] ==
KnownManagedType
.Byte && jsType == JSTypeFlags.Missing:
262
case
KnownManagedType
.ArraySegment when argumentTypes[0] ==
KnownManagedType
.Int32 && jsType == JSTypeFlags.Missing:
263
case
KnownManagedType
.ArraySegment when argumentTypes[0] ==
KnownManagedType
.Double && jsType == JSTypeFlags.Missing:
267
case
KnownManagedType
.Function when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length:
268
case
KnownManagedType
.Action when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length:
272
var isReturn = marshaledType ==
KnownManagedType
.Function && i == jsTypeArguments.Length - 1;
273
if (argumentTypes[i] ==
KnownManagedType
.Array
274
|| argumentTypes[i] ==
KnownManagedType
.Span
275
|| argumentTypes[i] ==
KnownManagedType
.ArraySegment
276
|| argumentTypes[i] ==
KnownManagedType
.Task
277
|| argumentTypes[i] ==
KnownManagedType
.Function
278
|| argumentTypes[i] ==
KnownManagedType
.Action
279
|| argumentTypes[i] ==
KnownManagedType
.Unknown
284
var gen = Create(info, context, isToJs ^ (!isReturn), argumentTypes[i], Array.Empty<
KnownManagedType
>(), jsTypeArguments[i], Array.Empty<JSTypeFlags>(), failWithReason);
287
var maxArgs = marshaledType ==
KnownManagedType
.Action ? 3 : 4;
293
return ResolvedGenerator.Resolved(new FuncJSGenerator(info, context, marshaledType ==
KnownManagedType
.Action, argsMarshallerTypes));
294
case
KnownManagedType
.Action when jsType == JSTypeFlags.Function:
295
case
KnownManagedType
.Function when jsType == JSTypeFlags.Function:
299
case
KnownManagedType
.Function when jsType == JSTypeFlags.Missing:
300
case
KnownManagedType
.Action when jsType == JSTypeFlags.Missing:
303
if (argumentTypes[i] ==
KnownManagedType
.Array
304
|| argumentTypes[i] ==
KnownManagedType
.Span
305
|| argumentTypes[i] ==
KnownManagedType
.ArraySegment
306
|| argumentTypes[i] ==
KnownManagedType
.Task
307
|| argumentTypes[i] ==
KnownManagedType
.Function
308
|| argumentTypes[i] ==
KnownManagedType
.Action
309
|| argumentTypes[i] ==
KnownManagedType
.Unknown
JSManagedTypeInfo.cs (28)
12
internal abstract record JSTypeInfo(
KnownManagedType
KnownType)
20
return new JSSimpleTypeInfo(
KnownManagedType
.Void)
25
return new JSSimpleTypeInfo(
KnownManagedType
.Boolean)
30
return new JSSimpleTypeInfo(
KnownManagedType
.Byte)
35
return new JSSimpleTypeInfo(
KnownManagedType
.Char)
40
return new JSSimpleTypeInfo(
KnownManagedType
.Int16)
45
return new JSSimpleTypeInfo(
KnownManagedType
.Int32)
50
return new JSSimpleTypeInfo(
KnownManagedType
.Int64)
55
return new JSSimpleTypeInfo(
KnownManagedType
.Single)
60
return new JSSimpleTypeInfo(
KnownManagedType
.Double)
66
return new JSSimpleTypeInfo(
KnownManagedType
.IntPtr)
71
return new JSSimpleTypeInfo(
KnownManagedType
.DateTime)
76
return new JSSimpleTypeInfo(
KnownManagedType
.DateTimeOffset)
81
return new JSSimpleTypeInfo(
KnownManagedType
.Exception)
86
return new JSSimpleTypeInfo(
KnownManagedType
.Object)
91
return new JSSimpleTypeInfo(
KnownManagedType
.String)
96
return new JSSimpleTypeInfo(
KnownManagedType
.JSObject)
119
return new JSTaskTypeInfo(new JSSimpleTypeInfo(
KnownManagedType
.Void, SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword))));
175
internal sealed record JSInvalidTypeInfo() : JSSimpleTypeInfo(
KnownManagedType
.None);
177
internal record JSSimpleTypeInfo(
KnownManagedType
KnownType) : JSTypeInfo(KnownType)
179
public JSSimpleTypeInfo(
KnownManagedType
knownType, TypeSyntax syntax)
187
internal sealed record JSArrayTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.Array);
189
internal sealed record JSSpanTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.Span);
191
internal sealed record JSArraySegmentTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.ArraySegment);
193
internal sealed record JSTaskTypeInfo(JSSimpleTypeInfo ResultTypeInfo) : JSTypeInfo(
KnownManagedType
.Task);
195
internal sealed record JSNullableTypeInfo(JSSimpleTypeInfo ResultTypeInfo) : JSTypeInfo(
KnownManagedType
.Nullable);
197
internal sealed record JSFunctionTypeInfo(bool IsAction, JSSimpleTypeInfo[] ArgsTypeInfo) : JSTypeInfo(IsAction ?
KnownManagedType
.Action :
KnownManagedType
.Function);
Marshaling\TaskJSGenerator.cs (5)
25
if (jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void))
51
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
58
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
70
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
77
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)