Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
eadmundo committed Oct 8, 2023
1 parent 9bc3101 commit a3ff706
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
declare module '@autotelic/fastify-queue' {
type InitializerFunc = (key: any, value: any, r: any) => any;
type ResolverFunc = (key: any, value: any, r: any) => any;
type OnErrorFunc = (e: Error, r: any) => void;
type OnResolvedFunc = (resolved: any, r: any) => Promise<void> | void;

interface FastifyQueueOptions {
initializer?: InitializerFunc;
resolver?: ResolverFunc;
onError?: OnErrorFunc;
onResolved?: OnResolvedFunc;
queueName?: string;
concurrency?: number;
stopOnError?: boolean;
}

interface FastifyQueueInstance {
add: (key: any, value: any) => void;
resolve: (cb?: OnResolvedFunc) => Promise<void>;
contents: any;
[key: string]: any;
}

function fastifyQueue(fastify: any, options: FastifyQueueOptions): void;

export = fastifyQueue;
}

0 comments on commit a3ff706

Please sign in to comment.