// Automatically generated from TypeScript type definitions provided by // DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped), // which is licensed under the MIT license; see file DefinitelyTyped-LICENSE // in parent directory. // Type definitions for Node.js 10.5.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped // Parambir Singh // Christian Vaagland Tellnes // Wilco Bakker // Nicolas Voigt // Chigozirim C. // Flarna // Mariusz Wiktorczyk // wwwy3y3 // Deividas Bakanas // Kelvin Jin // Alvis HT Tang // Sebastian Silbermann // Hannes Magnusson // Alberto Schiabel // Klaus Meinhardt // Huw // Nicolas Even // Bruno Scheufler // Mohsen Azimi // Hoàng Văn Khải // Alexander T. // Lishude // Andrew Makarov // Zane Hannan AU // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** * @externs * @fileoverview Definitions for module "dgram" */ var dgram = {}; var events = require("events"); /** * @interface */ function RemoteInfo() {} /** * @type {string} */ RemoteInfo.prototype.address; /** * @type {number} */ RemoteInfo.prototype.port; /** * @type {number} */ RemoteInfo.prototype.size; /** * @interface */ function AddressInfo() {} /** * @type {string} */ AddressInfo.prototype.address; /** * @type {string} */ AddressInfo.prototype.family; /** * @type {number} */ AddressInfo.prototype.port; /** * @interface */ function BindOptions() {} /** * @type {number} */ BindOptions.prototype.port; /** * @type {string} */ BindOptions.prototype.address; /** * @type {boolean} */ BindOptions.prototype.exclusive; /** * @interface */ function SocketOptions() {} /** * @type {(string)} */ SocketOptions.prototype.type; /** * @type {boolean} */ SocketOptions.prototype.reuseAddr; /** * @param {string} type * @param {(function(Buffer, dgram.RemoteInfo): void)=} callback * @return {dgram.Socket} */ dgram.createSocket = function(type, callback) {}; /** * @param {dgram.SocketOptions} options * @param {(function(Buffer, dgram.RemoteInfo): void)=} callback * @return {dgram.Socket} */ dgram.createSocket = function(options, callback) {}; /** * @interface * @extends {events.EventEmitter} */ dgram.Socket = function() {}; /** * @param {(Buffer|String|Array<*>)} msg * @param {number} port * @param {string} address * @param {(function(Error, number): void)=} callback * @return {void} */ dgram.Socket.prototype.send = function(msg, port, address, callback) {}; /** * @param {(Buffer|String|Array<*>)} msg * @param {number} offset * @param {number} length * @param {number} port * @param {string} address * @param {(function(Error, number): void)=} callback * @return {void} */ dgram.Socket.prototype.send = function(msg, offset, length, port, address, callback) {}; /** * @param {number=} port * @param {string=} address * @param {(function(): void)=} callback * @return {void} */ dgram.Socket.prototype.bind = function(port, address, callback) {}; /** * @param {dgram.BindOptions} options * @param {Function=} callback * @return {void} */ dgram.Socket.prototype.bind = function(options, callback) {}; /** * @param {*=} callback * @return {void} */ dgram.Socket.prototype.close = function(callback) {}; /** * @return {dgram.AddressInfo} */ dgram.Socket.prototype.address = function() {}; /** * @param {boolean} flag * @return {void} */ dgram.Socket.prototype.setBroadcast = function(flag) {}; /** * @param {number} ttl * @return {void} */ dgram.Socket.prototype.setTTL = function(ttl) {}; /** * @param {number} ttl * @return {void} */ dgram.Socket.prototype.setMulticastTTL = function(ttl) {}; /** * @param {boolean} flag * @return {void} */ dgram.Socket.prototype.setMulticastLoopback = function(flag) {}; /** * @param {string} multicastAddress * @param {string=} multicastInterface * @return {void} */ dgram.Socket.prototype.addMembership = function(multicastAddress, multicastInterface) {}; /** * @param {string} multicastAddress * @param {string=} multicastInterface * @return {void} */ dgram.Socket.prototype.dropMembership = function(multicastAddress, multicastInterface) {}; /** * @return {void} */ dgram.Socket.prototype.ref = function() {}; /** * @return {void} */ dgram.Socket.prototype.unref = function() {}; module.exports.createSocket = dgram.createSocket; module.exports.createSocket = dgram.createSocket; module.exports.Socket = dgram.Socket;