Skip to content

Commit f152573

Browse files
committed
fix: export types from index
1 parent 0dfc9e6 commit f152573

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/async-helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import {Message} from './subscriber';
1818
* Represents an async function that can process a message and return
1919
* a Promise for the function's completion.
2020
*/
21-
export interface UserHandler {
21+
export interface AsyncMessageHandler {
2222
(message: Message): Promise<void>;
2323
}
2424

2525
/**
2626
* A handler for sub.on('message', x) that can be passed to .on() to do
2727
* the async processing in this class.
2828
*/
29-
export interface StreamHandler {
29+
export interface StreamMessageHandler {
3030
(message: Message): void;
3131
}
3232

@@ -66,19 +66,19 @@ export class AsyncHelper {
6666
tailPromise: Promise<void> = Promise.resolve();
6767

6868
// The user's handler that will be called to take a message and get back a Promise.
69-
userHandler: UserHandler;
69+
userHandler: AsyncMessageHandler;
7070

7171
/**
7272
* @param userHandler The async function we'll call for each message.
7373
*/
74-
constructor(userHandler: UserHandler) {
74+
constructor(userHandler: AsyncMessageHandler) {
7575
this.userHandler = userHandler;
7676
}
7777

7878
/**
7979
* A handler function that you can pass to .on('message').
8080
*/
81-
get handler(): StreamHandler {
81+
get handler(): StreamMessageHandler {
8282
return this.streamHandler.bind(this);
8383
}
8484

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ export {
175175
} from './topic';
176176
export {Duration, TotalOfUnit, DurationLike} from './temporal';
177177
export {DebugMessage} from './debug';
178+
export {
179+
AsyncHelper,
180+
AsyncMessageHandler,
181+
StreamMessageHandler,
182+
} from './async-helper';
178183

179184
if (process.env.DEBUG_GRPC) {
180185
console.info('gRPC logging set to verbose');

0 commit comments

Comments
 (0)