Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
The way to completeness...
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Wirtz committed Mar 8, 2013
1 parent f8b8a3c commit 206192f
Show file tree
Hide file tree
Showing 17 changed files with 1,266 additions and 37 deletions.
1 change: 1 addition & 0 deletions child_process.js
Expand Up @@ -17,6 +17,7 @@
/**
* @fileoverview Definitions for node's child_process module. Depends on the events module.
* @see http://nodejs.org/api/child_process.html
* @see https://github.com/joyent/node/blob/master/lib/child_process.js
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/
Expand Down
3 changes: 2 additions & 1 deletion cluster.js
Expand Up @@ -17,6 +17,7 @@
/**
* @fileoverview Definitions for node's cluster module. Depends on the events module.
* @see http://nodejs.org/api/cluster.html
* @see https://github.com/joyent/node/blob/master/lib/cluster.js
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/
Expand Down Expand Up @@ -74,7 +75,7 @@ cluster.disconnect = function(callback) {};
cluster.worker;

/**
* @type {Object.<string,cluster.Worker>}
* @type {?Object.<string,cluster.Worker>}
*/
cluster.workers;

Expand Down
97 changes: 97 additions & 0 deletions crypto.js
@@ -0,0 +1,97 @@
/*
* Copyright 2012 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @fileoverfiew Definitions for node's crypto module.
* @see http://nodejs.org/api/crypto.html
* @see https://github.com/joyent/node/blob/master/lib/crypto.js
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/

/**
BEGIN_NODE_INCLUDE
var crypto = require('crypto');
END_NODE_INCLUDE
*/

/**
* @type {Object.<string,*>}
*/
var crypto = {};

/**
* @typedef {{pfx: string|buffer.Buffer, key: string|buffer.Buffer, passphrase: string, cert: string|buffer.Buffer, ca: Array.<string|buffer.Buffer>, crl: string|Array.<string>, ciphers: string}}
*/
crypto.Credentials;

/**
* @param {Object.<string,string>=} details
* @return {crypto.Credentials}
*/
crypto.createCredentials = function(details) {};

/**
* @param {string} algorithm
* @return {crypto.Hash}
*/
crypto.createHash = function(algorithm) {};

/**
* @param {string} algorithm
* @param {Object} options
* @constructor
*/
crypto.Hash = function(algorithm, options) {};

/**
* @param {string|buffer.Buffer} data
* @param {string=} input_encoding
*/
crypto.Hash.prototype.update = function(data, input_encoding) {};

/**
* @param {string=} encoding
* @return {string}
*/
crypto.Hash.prototype.digest = function(encoding) {};

/**
* @param {string} algorithm
* @param {string|buffer.Buffer} key
* @return {crypto.Hmac}
*/
crypto.createHmac = function(algorithm, key) {};

/**
* @param {string} hmac
* @param {string|buffer.Buffer} key
* @param {Object} options
* @constructor
*/
crypto.Hmac = function(hmac, key, options) {};

/**
* @param {string|buffer.Buffer} data
*/
crypto.Hmac.prototype.update = function(data) {};

/**
* @param {string} encoding
*/
crypto.Hmac.prototype.digest = function(encoding) {};

// TODO: Finish...
106 changes: 106 additions & 0 deletions dgram.js
@@ -0,0 +1,106 @@
/*
* Copyright 2012 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @fileoverview Definitions for node's dgram module. Depends on the events module.
* @see http://nodejs.org/api/dgram.html
* @see https://github.com/joyent/node/blob/master/lib/dgram.js
* @externs
* @author Daniel Wirtz <dcode@dcode.io>
*/

/**
BEGIN_NODE_INCLUDE
var dgram = require('dgram');
END_NODE_INCLUDE
*/

/**
* @type {Object.<string,*>}
*/
var dgram = {};

/**
* @param {string} type
* @param {function(...)=} callback
* @return {dgram.Socket}
*/
dgram.createSocket = function(type, callback) {};

/**
* @constructor
* @extends events.EventEmitter
*/
dgram.Socket = function() {};

/**
* @param {buffer.Buffer} buf
* @param {number} offset
* @param {number} length
* @param {number} port
* @param {string} address
* @param {function(...)=} callback
*/
dgram.Socket.prototype.send = function(buf, offset, length, port, address, callback) {};

/**
* @param {number} port
* @param {string=} address
*/
dgram.Socket.prototype.bind = function(port, address) {};

/**
*/
dgram.Socket.prototype.close = function() {};

/**
* @return {string}
*/
dgram.Socket.prototype.address = function() {};

/**
* @param {boolean} flag
*/
dgram.Socket.prototype.setBroadcast = function(flag) {};

/**
* @param {number} ttl
* @return {number}
*/
dgram.Socket.prototype.setTTL = function(ttl) {};

/**
* @param {number} ttl
* @return {number}
*/
dgram.Socket.prototype.setMulticastTTL = function(ttl) {};

/**
* @param {boolean} flag
*/
dgram.Socket.prototype.setMulticastLoopback = function(flag) {};

/**
* @param {string} multicastAddress
* @param {string=} multicastInterface
*/
dgram.Socket.prototype.addMembership = function(multicastAddress, multicastInterface) {};

/**
* @param {string} multicastAddress
* @param {string=} multicastInterface
*/
dgram.Socket.prototype.dropMembership = function(multicastAddress, multicastInterface) {};

0 comments on commit 206192f

Please sign in to comment.