Skip to content

Commit

Permalink
fix(signal): import types
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Jan 28, 2023
1 parent dda9466 commit cc0b88b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion core/signal/src/command-handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {signalManager} from './signal-manager.js';

/**
* Command handler/provider interface.
* Command handler/define interface.
*/
export const commandHandler = {
/**
Expand Down
7 changes: 4 additions & 3 deletions core/signal/src/context-consumer.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -74,7 +75,7 @@ export const contextConsumer = {
*/
bind: <T extends Stringifyable>(contextId: string) =>({
/**
* Event signal Id.
* Context signal Id.
*/
id: contextId,

Expand Down
7 changes: 4 additions & 3 deletions core/signal/src/context-provider.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -59,7 +60,7 @@ export const contextProvider = {
*/
bind: <T extends Stringifyable>(contextId: string) =>({
/**
* Event signal Id.
* Context signal Id.
*/
id: contextId,

Expand Down
5 changes: 3 additions & 2 deletions core/signal/src/event-listener.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
5 changes: 3 additions & 2 deletions core/signal/src/event-trigger.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions core/signal/src/requestable-context-consumer.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions core/signal/src/requestable-context-provider.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
5 changes: 3 additions & 2 deletions core/signal/src/signal-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {createLogger, globalAlwatr} from '@alwatr/logger';
import {Stringifyable} from '@alwatr/type';

import type {
DispatchOptions,
Expand All @@ -11,6 +10,8 @@ import type {
ProviderOptions,
SignalStorage,
} from './type.js';
import type {Stringifyable} from '@alwatr/type';


globalAlwatr.registeredList.push({
name: '@alwatr/signal',
Expand Down Expand Up @@ -385,7 +386,7 @@ export const signalManager = {
* Example:
*
* ```ts
* const returnObject = signalManager.requestCommand<ArgumentType, ReturnType>('show-dialog', {foo: 'bar'});
* const returnObject = await signalManager.requestCommand<ArgumentType, ReturnType>('show-dialog', {foo: 'bar'});
* ```
*/
requestCommand: <TArgument extends Record<string, Stringifyable>, TReturn extends Stringifyable>(
Expand Down

0 comments on commit cc0b88b

Please sign in to comment.