Skip to content

Commit

Permalink
Export more types.
Browse files Browse the repository at this point in the history
  • Loading branch information
llambeau committed May 10, 2024
1 parent 8e095c8 commit dbf26f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "Framework on top of RabbitMQ for easing up the development of producer/consumer/job queues.",
"version": "1.0.0-rc.1",
"author": "Louis Lambeau <[email protected]>",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"arnavon": "./bin/run"
},
Expand Down
10 changes: 8 additions & 2 deletions src/consumer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { inspect } from '../robust';
import Arnavon from '..';
import { Server } from 'http';
import { JobRunner, JobDispatcher } from '../jobs';
import { JobRunnerConfig } from '../jobs/runner';
import { JobRunnerConfig, JobRunnerContext } from '../jobs/runner';
import { Registry } from 'prom-client';

export type JobConsumerContext = JobRunnerContext & {
dispatcher: JobDispatcher
prometheusRegistry: Registry
}

export default class Consumer {

Expand Down Expand Up @@ -74,7 +80,7 @@ export default class Consumer {
// @ts-expect-error we need to refactor this
_job.payload = validator.validate(_job.payload);
// Extend context to include dispatcher and prometheus registry
const extendedContext = Object.assign({}, context, {
const extendedContext: JobConsumerContext = Object.assign({}, context, {
dispatcher: this.#dispatcher,
prometheusRegistry: Arnavon.registry,
});
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ export {
Server,
Consumer,
};

export * from './consumer';
export * from './server';
export * from './queue';
export * from './jobs';
export * from './config';

0 comments on commit dbf26f6

Please sign in to comment.