Type Alias InsteadCallback<A, R>

InsteadCallback<A, R>: ((args: A, orig: ((...args: A) => R), self: ObjectExports) => R | void)

Code to run instead of the original function

Type Parameters

  • A extends unknown[] = unknown[]
  • R = unknown

Type declaration

    • (args, orig, self): R | void
    • Parameters

      • args: A

        Arguments passed to the original function

      • orig: ((...args: A) => R)

        The original function

          • (...args): R
          • Parameters

            • Rest...args: A

            Returns R

      • self: ObjectExports

        The module the injected function is on

      Returns R | void

      New result to return