Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/nsqjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/nsqjs - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

184

nsqjs/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for nsqjs 0.8.4
// Type definitions for nsqjs 0.9
// Project: https://github.com/dudleycarr/nsqjs

@@ -10,136 +10,108 @@ // Definitions by: Robert Kania <https://github.com/cezaryrk>

export = nsqjs
export class Message extends events.EventEmitter {
static BACKOFF: string;
static RESPOND: string;
static FINISH: number;
static REQUEUE: number;
static TOUCH: number;
readonly id: string;
body: any;
hasResponded: boolean;
timestamp: number;
declare namespace nsqjs {
constructor(id: string, timestamp: number, attempts: number, body: any,
requeueDelay: number, msgTimeout: number, maxMsgTimeout: number);
json(): any;
export enum RESPONSE_TYPE {
FINISH = 0,
REQUEUE = 1,
TOUCH = 2
}
timeUntilTimeout(hard?: boolean): number;
export class Message extends events.EventEmitter {
finish(): any;
static BACKOFF: string;
static RESPOND: string;
static FINISH: number;
static REQUEUE: number;
static TOUCH: number;
requeue(delay?: number, backoff?: boolean): any;
readonly id: string;
body: any;
hasResponded: boolean;
timestamp: number;
touch(): any;
respond(responseType: number, wireData: Buffer): any;
constructor(id: string, timestamp: number, attempts: number, body: any,
requeueDelay: number, msgTimeout: number, maxMsgTimeout: number);
on(event: "backoff", listener: () => void): this;
on(event: "respond", listener: (responseType: number, wireData: Buffer) => void): this;
}
json(): any;
export class Writer extends events.EventEmitter {
readonly nsqdHost: string;
readonly nsqdPort: number;
timeUntilTimeout(hard?: boolean): number;
static READY: string;
static CLOSED: string;
static ERROR: string;
finish(): any;
constructor(nsqdHost: string, nsqdPort: number, options?: ConnectionConfigOptions);
requeue(delay: number, backoff: string): any;
connect(): any;
touch(): any;
publish(topic: string, msgs: any, listener?: (err: Error) => void): any;
respond(responseType: RESPONSE_TYPE, wireData: any): any;
close(): any;
}
on(event: "ready" | "closed", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
}
export class Writer extends events.EventEmitter {
export class Reader extends events.EventEmitter {
static ERROR: string;
static MESSAGE: string;
static DISCARD: string;
static NSQD_CONNECTED: string;
static NSQD_CLOSED: string;
readonly nsqdHost: string
readonly nsqdPort: number
constructor(topic: string, channel: any, options?: ReaderConnectionConfigOptions);
static READY: string;
static CLOSED: string;
static ERROR: string;
connect(): any;
constructor(nsqdHost: string, nsqdPort: number, options?: IConnectionConfigOptions);
close(): any;
connect(): any;
pause(): any;
publish(topic: string, msgs: any, listener?: (err: Error) => void): any;
unpause(): any;
close(): any;
isPaused(): boolean;
on(event: string, listener: Function): this;
on(event: "ready", listener: () => void): void;
on(event: "closed", listener: () => void): void;
on(event: "error", listener: (err: Error) => void): void;
on(event: "connection_error", listener: (err: Error) => void): void;
queryLookupd(): any;
}
connectToNSQD(host: string, port: number): any;
export class Reader extends events.EventEmitter {
handleMessage(message: any): any;
static ERROR: string;
static MESSAGE: string;
static DISCARD: string;
static NSQD_CONNECTED: string;
static NSQD_CLOSED: string;
on(event: "nsqd_connected" | "nsqd_closed", listener: (host: string, port: number) => void): this;
on(event: "message" | "discard", listener: (message: Message) => void): this;
on(event: "error", listener: (err: Error) => void): this;
}
constructor(topic: string, channel: any, options?: IReaderConnectionConfigOptions);
export interface ConnectionConfigOptions {
authSecret?: string;
clientId?: string;
deflate?: boolean;
deflateLevel?: number;
heartbeatInterval?: number;
maxInFlight?: number;
messageTimeout?: number;
outputBufferSize?: number;
outputBufferTimeout?: number;
requeueDelay?: number;
sampleRate?: number;
snappy?: boolean;
tls?: boolean;
tlsVerification?: boolean;
}
connect(): any;
close(): any;
pause(): any;
unpause(): any;
isPaused(): boolean;
queryLookupd(): any;
connectToNSQD(host: string, port: number): any;
handleMessage(message: any): any;
on(event: string, listener: Function): this;
on(event: "nsqd_connected", listener: (host: string, port: number) => void): void;
on(event: "nsqd_closed", listener: (host: string, port: number) => void): void;
on(event: "message", listener: (message: Message) => void): void;
on(event: "discard", listener: (message: Message) => void): void;
on(event: "error", listener: (err: Error) => void): void;
on(event: "connection_error", listener: (err: Error) => void): void;
}
interface IConnectionConfigOptions {
authSecret?: string,
clientId?: string,
deflate?: boolean,
deflateLevel?: number,
heartbeatInterval?: number,
maxInFlight?: number,
messageTimeout?: number,
outputBufferSize?: number,
outputBufferTimeout?: number,
requeueDelay?: number,
sampleRate?: number,
snappy?: boolean,
tls?: boolean,
tlsVerification?: boolean
}
interface IReaderConnectionConfigOptions extends IConnectionConfigOptions {
lookupdHTTPAddresses?: string | string[],
lookupdPollInterval?: number,
lookupdPollJitter?: number,
name?: string,
nsqdTCPAddresses?: string | string[],
maxAttempts?: number,
maxBackoffDuration?: number
}
export interface ReaderConnectionConfigOptions extends ConnectionConfigOptions {
lookupdHTTPAddresses?: string | string[];
lookupdPollInterval?: number;
lookupdPollJitter?: number;
name?: string;
nsqdTCPAddresses?: string | string[];
maxAttempts?: number;
maxBackoffDuration?: number;
}
{
"name": "@types/nsqjs",
"version": "0.8.0",
"version": "0.9.0",
"description": "TypeScript definitions for nsqjs",

@@ -9,3 +9,4 @@ "license": "MIT",

"name": "Robert Kania",
"url": "https://github.com/cezaryrk"
"url": "https://github.com/cezaryrk",
"githubUsername": "cezaryrk"
}

@@ -22,4 +23,4 @@ ],

},
"typesPublisherContentHash": "983b08cef95303ee50951a8bcb01e20a9f1d6b4e0f930f8cb753a26b33f80730",
"typesPublisherContentHash": "9e242e2e6a91e90f2fa57786993825afc109a327b0a38c60bed32409caeb90f5",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Wed, 16 Aug 2017 22:06:59 GMT
* Last updated: Mon, 09 Oct 2017 21:51:28 GMT
* Dependencies: events, node

@@ -14,0 +14,0 @@ * Global values: none

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc