BSB Node.js Type Definitions
    Preparing search index...

    Function SmartFunctionCallAsync

    • Initializes a function call and calls it with context but shows as the function type (async)

      Type Parameters

      • T extends SmartFunctionCallFunc

      Parameters

      • context: any

        the context to call the function with

      • input: T | undefined

        the function to call

      • ...params: Parameters<T>

        the parameters to pass to the function

      Returns Promise<void | ReturnType<T>>

      Async called function return type or immediately if the input is not a function

      BSBError context is not an object

      const myFunc = async (a: string, b: number) => {
      console.log("called with " + a + " and " + b);
      };
      console.log("done with " + await SmartFunctionCallAsync(this, myFunc, "a", 5));