You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing SignalR Hubs (server-side) in C# can be strongly typed by using interfaces, but the [TypeScript SignalR client](https://github.com/dotnet/aspnetcore/tree/main/src/SignalR/clients/ts/signalr) is not strongly typed. To call Hub methods, we must specify the method defined in Hub using a string. We also have to determine the return type manually. Moreover, registering client methods called from a server also requires specifying the method name as a string, and we must set parameter types manually.
@@ -82,7 +81,7 @@ export type ReceiverRegisterProvider = {
TypedSignalR.Client.TypeScript uses a library named [nenoNaninu/Tapper](https://github.com/nenoNaninu/Tapper) to convert C# types to TypeScript types.
@@ -266,12 +274,12 @@ public record CustomType2(float Value, DateTime ReleaseDate);
266
274
```
267
275
268
276
## Analyzer
277
+
269
278
User-defined types used in parameters and return values of methods defined within interfaces annotated with `Hub` or `Receiver` must be annotated with `TranspilationSource`.
270
279
The Analyzer checks in real-time whether this rule is followed. If not, the IDE will tell you.
SignalR supports both [server-to-client streaming and client-to-server streaming](https://docs.microsoft.com/en-us/aspnet/core/signalr/streaming?view=aspnetcore-6.0).
@@ -349,7 +357,7 @@ If you use `Task<T>` for the method return type in the receiver interface, you c
0 commit comments