import { type Remote } from "https://dotland.deno.dev/x/scaffold@0.3.0/src/deps/comlink.ts";
Takes the raw type of a remote object, function or class in the other thread and returns the type as it is visible to
the local thread from the proxy return value of Comlink.wrap()
or Comlink.proxy()
.
definition:
& (T extends (...args: infer TArguments) => infer TReturn ? (...args: [I in keyof TArguments]: UnproxyOrClone<TArguments[I]>) => Promisify<ProxyOrClone<Unpromisify<TReturn>>> : unknown)
& (T extends { new (...args: infer TArguments): infer TInstance; } ? { new (...args: [I in keyof TArguments]: UnproxyOrClone<TArguments[I]>): Promisify<Remote<TInstance>>; } : unknown)