Function
call
(method: Method, input: Parameters<T[Method]>[0])
Source from the content-addressed store, hash-verified
| 31 | } |
| 32 | return { |
| 33 | call<Method extends keyof T>(method: Method, input: Parameters<T[Method]>[0]): Promise<ReturnType<T[Method]>> { |
| 34 | const requestId = id++ |
| 35 | return new Promise((resolve) => { |
| 36 | pending.set(requestId, resolve) |
| 37 | target.postMessage(JSON.stringify({ type: "rpc.request", method, input, id: requestId })) |
| 38 | }) |
| 39 | }, |
| 40 | } |
| 41 | } |
| 42 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected