Files
DefinitelyTyped/types/sqs-consumer/index.d.ts
2018-02-13 16:54:43 -06:00

37 lines
1.1 KiB
TypeScript

// Type definitions for sqs-consumer 3.8
// Project: https://github.com/BBC/sqs-consumer
// Definitions by: Daniel Chao <http://dchao.co/>
// Eric Byers <http://github.com/EricByers>
// Ezinwa Okpoechi <http://github.com/BrainMaestro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { SQS } from "aws-sdk";
declare namespace Consumer {
export type ConsumerDone = (error?: Error) => void;
export interface Options {
queueUrl: string;
handleMessage(message: SQS.Message, done: ConsumerDone): any;
region?: string;
attributeNames?: string[];
messageAttributeNames?: string[];
batchSize?: number;
visibilityTimeout?: number;
terminateVisibilityTimeout?: boolean;
waitTimeSeconds?: number;
authenticationErrorTimeout?: number;
sqs?: SQS;
}
}
declare class Consumer extends NodeJS.EventEmitter {
constructor(options: Consumer.Options);
start(): void;
stop(): void;
static create(options: Consumer.Options): Consumer;
}
export = Consumer;