Take this Blazor project as an example. It defines interop methods
interop
The backend is using standard C#