Skip to content

Commit 5e1d4d3

Browse files
committed
Make sure [releaseProxy] is available on class instances
1 parent 66c0bf2 commit 5e1d4d3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/comlink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export type Remote<T> =
136136
...args: {
137137
[I in keyof TArguments]: UnproxyOrClone<TArguments[I]>;
138138
}
139-
): Promisify<RemoteObject<TInstance>>;
139+
): Promisify<Remote<TInstance>>;
140140
}
141141
: unknown) &
142142
// Include additional special comlink methods available on the proxy.

tests/type-checks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ async function closureSoICanUseAwait() {
190190
Comlink.windowEndpoint(self)
191191
);
192192
const inst1 = await new ProxiedFooClass("test");
193-
assert<IsExact<typeof inst1, Comlink.RemoteObject<Foo>>>(true);
193+
assert<IsExact<typeof inst1, Comlink.Remote<Foo>>>(true);
194+
inst1[Comlink.releaseProxy]();
195+
inst1[Comlink.createEndpoint]();
194196

195197
// @ts-expect-error
196198
// await new ProxiedFooClass(123);

0 commit comments

Comments
 (0)