mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-06 04:34:24 +08:00
37 lines
1.1 KiB
TypeScript
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;
|