//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// TypeScript helpers (universal micro-lib.) | Author: Sergei Y.Kitaev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// WASM helpers for .NET-Blazor invocation from TypeScript/JS (static class):
class WASM
{
   private static _AssemblyName_: string|null = null

   static AssemblyName(): string {
      if (!WASM._AssemblyName_)
         throw new Error('WASM assembly name has not been specified (WASM helper class).')
      return WASM._AssemblyName_
   }
   static GetAssemblyName(): string|null {
      return WASM._AssemblyName_
   }
   static SpecifyAssemblyName(value: string) {
      HArgChecking.PROVIDED(value, 'WASM.SpecifyAssemblyName', 'value')
      WASM._AssemblyName_ = value
   }

   static Invoke(methodName: string) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName)
   }
   static Invoke_1(methodName: string, arg_1: any) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1)
   }
   static Invoke_2(methodName: string, arg_1: any, arg_2: any) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2)
   }
   static Invoke_3(methodName: string, arg_1: any, arg_2: any, arg_3: any) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3)
   }
   static Invoke_4(methodName: string, arg_1: any, arg_2: any, arg_3: any, arg_4: any) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3, arg_4)
   }
   static Invoke_5(methodName: string, arg_1: any, arg_2: any, arg_3: any, arg_4: any, arg_5: any) {
      DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3, arg_4, arg_5)
   }

   static InvokeReturn(methodName: string): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName)
   }
   static InvokeReturn_1(methodName: string, arg_1: any): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1)
   }
   static InvokeReturn_2(methodName: string, arg_1: any, arg_2: any): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2)
   }
   static InvokeReturn_3(methodName: string, arg_1: any, arg_2: any, arg_3: any): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3)
   }
   static InvokeReturn_4(methodName: string, arg_1: any, arg_2: any, arg_3: any, arg_4: any): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3, arg_4)
   }
   static InvokeReturn_5(methodName: string,
      arg_1: any, arg_2: any, arg_3: any, arg_4: any, arg_5: any): any {
      return DotNet.invokeMethod(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3, arg_4, arg_5)
   }

   static AsyncInvoke(methodName: string): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(), methodName)
   }
   static AsyncInvoke_1(methodName: string, arg_1: any): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(), methodName, arg_1)
   }
   static AsyncInvoke_2(methodName: string, arg_1: any, arg_2: any): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(), methodName, arg_1, arg_2)
   }
   static AsyncInvoke_3(methodName: string, arg_1: any, arg_2: any, arg_3: any): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3)
   }
   static AsyncInvoke_4(methodName: string, arg_1: any, arg_2: any, arg_3: any, arg_4: any): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(), methodName, arg_1, arg_2, arg_3, arg_4)
   }
   static AsyncInvoke_5(methodName: string,
      arg_1: any, arg_2: any, arg_3: any, arg_4: any, arg_5: any): any {
      return DotNet.invokeMethodAsync(WASM.AssemblyName(),
         methodName, arg_1, arg_2, arg_3, arg_4, arg_5)
   }
} // WASM
