From e0825a891ae6805d2c589046285c7fdfec5c82b8 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Mon, 4 Nov 2024 21:19:58 +0300 Subject: [PATCH] $mol_wire_sync fix wire sync type --- wire/sync/sync.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/sync/sync.ts b/wire/sync/sync.ts index 4baf4a717e..ae1ad9177c 100644 --- a/wire/sync/sync.ts +++ b/wire/sync/sync.ts @@ -18,7 +18,7 @@ namespace $ { * Convert asynchronous (promise-based) API to synchronous by wrapping function and method calls in a fiber. * @see https://mol.hyoo.ru/#!section=docs/=1fcpsq_1wh0h2 */ - export function $mol_wire_sync< Host extends object >( obj: Host ) { + export function $mol_wire_sync< Host extends object & (new ( ... args: unknown[] )=> unknown) >( obj: Host ) { return new Proxy( obj, { get( obj, field ) { @@ -40,7 +40,7 @@ namespace $ { }, construct(obj, args) { - const temp = $mol_wire_task.getter(factory(obj as new ( ... args: unknown[] )=> unknown)) + const temp = $mol_wire_task.getter(factory(obj)) return temp( obj, args ).sync() as object },