@types/rsmq-worker
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.30 • Public • Published

    Installation

    npm install --save @types/rsmq-worker

    Summary

    This package contains type definitions for rsmq-worker (http://smrchy.github.io/rsmq/rsmq-worker/).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rsmq-worker.

    index.d.ts

    // Type definitions for rsmq-worker 0.3.5
    // Project: http://smrchy.github.io/rsmq/rsmq-worker/
    // Definitions by: TANAKA Koichi <https://github.com/MugeSo>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference types="rsmq"/>
    
    
    import redis = require('redis');
    import events = require('events');
    import * as RedisSMQ from 'rsmq';
    
    declare namespace RSMQWorker {
        export interface Client extends events.EventEmitter {
            start(): Client;
            stop(): Client;
            send(message: string, delay?: number, cb?: CallbackT<string>): Client;
            send(message: string, cb: CallbackT<string>): Client;
            del(id: string, cb?: CallbackT<void>): Client;
            changeInterval(interval: number | number[]): Client;
        }
    
        export interface Options {
            interval?: number | undefined;
            maxReceiveCount?: number | undefined;
            invisibletime?: number | undefined;
            defaultDelay?: number | undefined;
            autostart?: boolean | undefined;
            timeout?: number | undefined;
            customExceedCheck?: CustomExceedCheckCallback | undefined;
            rsmq?: RedisSMQ.Client | undefined;
            redis?: redis.RedisClient | undefined;
            redisPrefix?: string | undefined;
            host?: string | undefined;
            port?: number | undefined;
            options?: redis.ClientOpts | undefined;
        }
    
        export interface CustomExceedCheckCallback {
            (message: RedisSMQ.Message): boolean;
        }
    
        export interface CallbackT<R> {
            (e?: Error, res?: R): void;
        }
    }
    
    interface RSMQWorkerStatic {
        new (queuename: string, options?: RSMQWorker.Options): RSMQWorker.Client;
    }
    
    declare var RSMQWorker: RSMQWorkerStatic;
    export = RSMQWorker;

    Additional Details

    Credits

    These definitions were written by TANAKA Koichi.

    Keywords

    none

    Install

    npm i @types/rsmq-worker

    DownloadsWeekly Downloads

    525

    Version

    0.3.30

    License

    MIT

    Unpacked Size

    6.2 kB

    Total Files

    4

    Last publish

    Collaborators

    • types