From 1495e24c436d97f17de42127ef9ad1c10e576f2c Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Tue, 3 Oct 2023 21:40:28 +0300 Subject: [PATCH] $mol_wire_sync, $mol_wire_async new types restore --- wire/async/async.ts | 15 +-------------- wire/sync/sync.ts | 14 +------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/wire/async/async.ts b/wire/async/async.ts index c347520fb47..98deb2dcbe3 100644 --- a/wire/async/async.ts +++ b/wire/async/async.ts @@ -30,20 +30,7 @@ namespace $ { return fiber.async() }, - } ) as any as ( - Host extends ( ... args: infer Args )=> infer Res - ? Res extends Promise - ? Host - : ( ... args: Args )=> Promise< Res > - : {} - ) & { - [ key in keyof Host ]: Host[ key ] extends ( ... args: infer Args )=> infer Res - ? Res extends Promise - ? Host[ key ] - : ( ... args: Args )=> Promise< Res > - : Host[ key ] - } - // as ObjectOrFunctionResultPromisify + } ) as unknown as ObjectOrFunctionResultPromisify } diff --git a/wire/sync/sync.ts b/wire/sync/sync.ts index 96ba204d0a6..90a5a328eb2 100644 --- a/wire/sync/sync.ts +++ b/wire/sync/sync.ts @@ -26,19 +26,7 @@ namespace $ { return fiber.sync() }, - } ) as any as ( - Host extends ( ... args: infer Args )=> infer Res - ? Res extends Promise< infer Res2 > - ? ( ... args: Args )=> Res2 - : Host - : {} - ) & { - [ key in keyof Host ]: Host[ key ] extends ( ... args: infer Args )=> Promise< infer Res > - ? ( ... args: Args )=> Res - : Host[ key ] - } - - //as ObjectOrFunctionResultAwaited + } ) as unknown as ObjectOrFunctionResultAwaited } type FunctionResultAwaited = Some extends (...args: infer Args) => infer Res