Skip to content

Commit 25ae1ca

Browse files
committed
Provide createProxy
1 parent 8d6cad6 commit 25ae1ca

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

packages/host/src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) TileDB, Inc.
22
// Distributed under the terms of the Modified BSD License.
3-
import { windowEndpoint, wrap } from 'comlink';
3+
import { windowEndpoint, wrap, proxy, ProxyOrClone } from 'comlink';
4+
45
import { ICommandBridgeRemote } from 'jupyter-iframe-commands';
56
/**
67
* A bridge to expose actions on JupyterLab commands.
@@ -22,3 +23,13 @@ export function createBridge({ iframeId }: { iframeId: string }) {
2223

2324
return wrap<ICommandBridgeRemote>(windowEndpoint(iframe.contentWindow));
2425
}
26+
27+
/**
28+
* Creates a proxy for the given object.
29+
*
30+
* @param args - The object to create a proxy for.
31+
* @returns A proxy for the given object.
32+
*/
33+
export function createProxy(args: any): ProxyOrClone<any> {
34+
return proxy(args);
35+
}

packages/host/tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
"outDir": "lib",
55
"rootDir": "src"
66
},
7-
"include": ["src/**/*"]
7+
"include": ["src/**/*"],
8+
"references": [
9+
{
10+
"path": "../extension"
11+
}
12+
]
813
}

0 commit comments

Comments
 (0)