mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Merge branch 'zeromq-event' of https://github.com/panuhorsmalahti/DefinitelyTyped into panuhorsmalahti-zeromq-event
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/// <reference path='zmq.d.ts' />
|
||||
/// <reference path='../node/node-0.11.d.ts' />
|
||||
|
||||
import zmq = require('zmq');
|
||||
|
||||
@@ -18,6 +19,9 @@ function test3() {
|
||||
var sock = zmq.socket('push');
|
||||
sock.bindSync('tcp://127.0.0.1:3000');
|
||||
sock.send(['hello', 'world']);
|
||||
sock.on('message', function (buffer: Buffer) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
function test4() {
|
||||
|
||||
9
node_zeromq/zmq.d.ts
vendored
9
node_zeromq/zmq.d.ts
vendored
@@ -3,6 +3,8 @@
|
||||
// Definitions by: Dave McKeown <http://github.com/davemckeown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path='../node/node-0.11.d.ts' />
|
||||
|
||||
interface EventEmitter {}
|
||||
|
||||
declare module 'zmq' {
|
||||
@@ -158,6 +160,13 @@ declare module 'zmq' {
|
||||
*/
|
||||
close(): Socket;
|
||||
|
||||
/**
|
||||
* Socket event
|
||||
* @param eventName {string}
|
||||
* @param callback {Function}
|
||||
*/
|
||||
on(eventName: string, callback: (buffer: Buffer) => void): void;
|
||||
|
||||
// Socket Options
|
||||
_fd: any;
|
||||
_ioevents: any;
|
||||
|
||||
Reference in New Issue
Block a user