MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / get

Function get

src/proxy/renderer.ts:28–50  ·  view source on GitHub ↗
(target, key)

Source from the content-addressed store, hash-verified

26 {},
27 {
28 get(target, key) {
29 return (...args: any[]) => {
30 return new Promise((resolve) => {
31 promiseCounter += 1;
32 pendingPromiseCallbacks[promiseCounter] = resolve;
33 ipcRenderer.send("proxy-service", {
34 type: name,
35 method: key,
36 args,
37 promiseCounter,
38 });
39
40 ipcRenderer.once(
41 `proxy-service-res-${promiseCounter}`,
42 (event, arg) => {
43 pendingPromiseCallbacks[arg.promiseCounter](arg.result);
44
45 delete pendingPromiseCallbacks[arg.promiseCounter];
46 }
47 );
48 });
49 };
50 },
51 }
52 );
53 return proxy as Promisified<T>;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected