Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(exchanges): improve typings
- Loading branch information
Showing
4 changed files
with
45 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) | ||
* Weyoss <weyoss@protonmail.com> | ||
* https://github.com/weyoss | ||
* | ||
* This source code is licensed under the MIT license found in the LICENSE file | ||
* in the root directory of this source tree. | ||
*/ | ||
|
||
import { ExchangeDirect } from '../../src/lib/exchange/exchange-direct'; | ||
import { ExchangeTopic } from '../../src/lib/exchange/exchange-topic'; | ||
import { ExchangeFanOut } from '../../src/lib/exchange/exchange-fan-out'; | ||
import { IQueueParams } from '../queue'; | ||
|
||
export enum EExchangeType { | ||
DIRECT, | ||
FANOUT, | ||
TOPIC, | ||
} | ||
|
||
export type TTopicParams = { | ||
topic: string; | ||
ns: string; | ||
}; | ||
|
||
export type TExchangeDirectBindingParams = IQueueParams | string; | ||
export type TExchangeTopicBindingParams = TTopicParams | string; | ||
export type TExchangeFanOutBindingParams = string; | ||
|
||
export type TExchange = ExchangeDirect | ExchangeTopic | ExchangeFanOut; | ||
|
||
export type TExchangeSerialized = | ||
| ReturnType<ExchangeDirect['toJSON']> | ||
| ReturnType<ExchangeTopic['toJSON']> | ||
| ReturnType<ExchangeFanOut['toJSON']>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
*/ | ||
|
||
export * from './exchange'; | ||
export * from './common'; |