From cc0b88be420b1fe057a8640bbffb1af3bf327cef Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Sat, 28 Jan 2023 19:08:44 +0330 Subject: [PATCH] fix(signal): import types --- core/signal/src/command-handler.ts | 2 +- core/signal/src/context-consumer.ts | 7 ++++--- core/signal/src/context-provider.ts | 7 ++++--- core/signal/src/event-listener.ts | 5 +++-- core/signal/src/event-trigger.ts | 5 +++-- core/signal/src/requestable-context-consumer.ts | 4 ++-- core/signal/src/requestable-context-provider.ts | 4 ++-- core/signal/src/signal-manager.ts | 5 +++-- 8 files changed, 22 insertions(+), 17 deletions(-) diff --git a/core/signal/src/command-handler.ts b/core/signal/src/command-handler.ts index cd32caad4..ed0a843e4 100644 --- a/core/signal/src/command-handler.ts +++ b/core/signal/src/command-handler.ts @@ -1,7 +1,7 @@ import {signalManager} from './signal-manager.js'; /** - * Command handler/provider interface. + * Command handler/define interface. */ export const commandHandler = { /** diff --git a/core/signal/src/context-consumer.ts b/core/signal/src/context-consumer.ts index 06aedb689..aa21692e0 100644 --- a/core/signal/src/context-consumer.ts +++ b/core/signal/src/context-consumer.ts @@ -1,7 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {signalManager} from './signal-manager.js'; +import type {Stringifyable, OmitFirstParam} from '@alwatr/type'; + + /** * Context consumer interface. */ @@ -74,7 +75,7 @@ export const contextConsumer = { */ bind: (contextId: string) =>({ /** - * Event signal Id. + * Context signal Id. */ id: contextId, diff --git a/core/signal/src/context-provider.ts b/core/signal/src/context-provider.ts index 792f0d8df..83308960e 100644 --- a/core/signal/src/context-provider.ts +++ b/core/signal/src/context-provider.ts @@ -1,7 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {signalManager} from './signal-manager.js'; +import type {Stringifyable, OmitFirstParam} from '@alwatr/type'; + + /** * Context provider interface. */ @@ -59,7 +60,7 @@ export const contextProvider = { */ bind: (contextId: string) =>({ /** - * Event signal Id. + * Context signal Id. */ id: contextId, diff --git a/core/signal/src/event-listener.ts b/core/signal/src/event-listener.ts index 5faf068d9..660b05753 100644 --- a/core/signal/src/event-listener.ts +++ b/core/signal/src/event-listener.ts @@ -1,7 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {signalManager} from './signal-manager.js'; +import type {Stringifyable, OmitFirstParam} from '@alwatr/type'; + + /** * Event signal listener/subscriber interface. */ diff --git a/core/signal/src/event-trigger.ts b/core/signal/src/event-trigger.ts index c545dfc87..4376525da 100644 --- a/core/signal/src/event-trigger.ts +++ b/core/signal/src/event-trigger.ts @@ -1,7 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {signalManager} from './signal-manager.js'; +import type {Stringifyable, OmitFirstParam} from '@alwatr/type'; + + /** * Event signal trigger/dispatcher interface. */ diff --git a/core/signal/src/requestable-context-consumer.ts b/core/signal/src/requestable-context-consumer.ts index 60f20cac7..9de00c7f8 100644 --- a/core/signal/src/requestable-context-consumer.ts +++ b/core/signal/src/requestable-context-consumer.ts @@ -1,8 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {contextConsumer} from './context-consumer.js'; import {signalManager} from './signal-manager.js'; +import type{Stringifyable, OmitFirstParam} from '@alwatr/type'; + /** * Requestable context consumer interface. */ diff --git a/core/signal/src/requestable-context-provider.ts b/core/signal/src/requestable-context-provider.ts index ecd90ce68..eeb7dd50d 100644 --- a/core/signal/src/requestable-context-provider.ts +++ b/core/signal/src/requestable-context-provider.ts @@ -1,8 +1,8 @@ -import {Stringifyable, OmitFirstParam} from '@alwatr/type'; - import {contextProvider} from './context-provider.js'; import {signalManager} from './signal-manager.js'; +import type {Stringifyable, OmitFirstParam} from '@alwatr/type'; + /** * Requestable context provider interface. */ diff --git a/core/signal/src/signal-manager.ts b/core/signal/src/signal-manager.ts index 30512dcd5..d97d80394 100644 --- a/core/signal/src/signal-manager.ts +++ b/core/signal/src/signal-manager.ts @@ -1,5 +1,4 @@ import {createLogger, globalAlwatr} from '@alwatr/logger'; -import {Stringifyable} from '@alwatr/type'; import type { DispatchOptions, @@ -11,6 +10,8 @@ import type { ProviderOptions, SignalStorage, } from './type.js'; +import type {Stringifyable} from '@alwatr/type'; + globalAlwatr.registeredList.push({ name: '@alwatr/signal', @@ -385,7 +386,7 @@ export const signalManager = { * Example: * * ```ts - * const returnObject = signalManager.requestCommand('show-dialog', {foo: 'bar'}); + * const returnObject = await signalManager.requestCommand('show-dialog', {foo: 'bar'}); * ``` */ requestCommand: , TReturn extends Stringifyable>(