Path: blob/main/third_party/closure-compiler/node-externs/tls.js
6172 views
/*1* Copyright 2012 The Closure Compiler Authors.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516/**17* @fileoverview Definitions for node's tls module. Depends on the stream module.18* @see http://nodejs.org/api/tls.html19* @see https://github.com/joyent/node/blob/master/lib/tls.js20* @externs21* @author Daniel Wirtz <[email protected]>22*/2324/**25BEGIN_NODE_INCLUDE26var tls = require('tls');27END_NODE_INCLUDE28*/2930/**31* @type {Object.<string,*>}32*/33var tls = {};3435/**36* @typedef {{pfx: (string|nodeBuffer.Buffer), key: (string|nodeBuffer.Buffer), passphrase: string, cert: (string|nodeBuffer.Buffer), ca: Array.<string|nodeBuffer.Buffer>, crl: (string|Array.<string>), ciphers: string, honorCipherOrder: boolean, requestCert: boolean, rejectUnauthorized: boolean, NPNProtocols: (Array|nodeBuffer.Buffer), SNICallback: function(string), sessionIdContext: string}}37*/38tls.CreateOptions;3940/**41*42* @param {tls.CreateOptions} options43* @param {function(...)=} secureConnectionListener44* @return {tls.Server}45*/46tls.createServer = function(options, secureConnectionListener) {};4748/**49* @typedef {{host: string, port: number, socket: *, pfx: (string|nodeBuffer.Buffer), key: (string|nodeBuffer.Buffer), passphrase: string, cert: (string|nodeBuffer.Buffer), ca: Array.<string>, rejectUnauthorized: boolean, NPNProtocols: Array.<string|nodeBuffer.Buffer>, servername: string}}50*/51tls.ConnectOptions;5253/**54*55* @param {number|tls.ConnectOptions} port56* @param {(string|tls.ConnectOptions|function(...))=} host57* @param {(tls.ConnectOptions|function(...))=} options58* @param {function(...)=} callback59*/60tls.connect = function(port, host, options, callback) {};6162/**63* XXX EMSCRIPTEN removed annotation on param {crypto.Credentials=} credentials, as it gives a warning [JSC_UNRECOGNIZED_TYPE_ERROR] Bad type annotation. Unknown type crypto.Credentials64* @param {boolean=} isServer65* @param {boolean=} requestCert66* @param {boolean=} rejectUnauthorized67* @return {tls.SecurePair}68*/69tls.createSecurePair = function(credentials, isServer, requestCert, rejectUnauthorized) {};7071/**72* @constructor73* @extends events.EventEmitter74*/75tls.SecurePair = function() {};7677/**78* @constructor79* @extends net.Server80*/81tls.Server = function() {};8283/**84* @param {string} hostname85* @param {string|nodeBuffer.Buffer} credentials86*/87tls.Server.prototype.addContext = function(hostname, credentials) {};8889/**90* @constructor91* @extends stream.Duplex92*/93tls.CleartextStream = function() {};9495/**96* @type {boolean}97*/98tls.CleartextStream.prototype.authorized;99100/**101* @type {?string}102*/103tls.CleartextStream.prototype.authorizationError;104105/**106* @return {Object.<string,(string|Object.<string,string>)>}107*/108tls.CleartextStream.prototype.getPeerCertificate = function() {};109110/**111* @return {{name: string, version: string}}112*/113tls.CleartextStream.prototype.getCipher = function() {};114115/**116* @return {{port: number, family: string, address: string}}117*/118tls.CleartextStream.prototype.address = function() {};119120/**121* @type {string}122*/123tls.CleartextStream.prototype.remoteAddress;124125/**126* @type {number}127*/128tls.CleartextStream.prototype.remotePort;129130131