Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/third_party/closure-compiler/node-externs/tls.js
6172 views
1
/*
2
* Copyright 2012 The Closure Compiler Authors.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/**
18
* @fileoverview Definitions for node's tls module. Depends on the stream module.
19
* @see http://nodejs.org/api/tls.html
20
* @see https://github.com/joyent/node/blob/master/lib/tls.js
21
* @externs
22
* @author Daniel Wirtz <[email protected]>
23
*/
24
25
/**
26
BEGIN_NODE_INCLUDE
27
var tls = require('tls');
28
END_NODE_INCLUDE
29
*/
30
31
/**
32
* @type {Object.<string,*>}
33
*/
34
var tls = {};
35
36
/**
37
* @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}}
38
*/
39
tls.CreateOptions;
40
41
/**
42
*
43
* @param {tls.CreateOptions} options
44
* @param {function(...)=} secureConnectionListener
45
* @return {tls.Server}
46
*/
47
tls.createServer = function(options, secureConnectionListener) {};
48
49
/**
50
* @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}}
51
*/
52
tls.ConnectOptions;
53
54
/**
55
*
56
* @param {number|tls.ConnectOptions} port
57
* @param {(string|tls.ConnectOptions|function(...))=} host
58
* @param {(tls.ConnectOptions|function(...))=} options
59
* @param {function(...)=} callback
60
*/
61
tls.connect = function(port, host, options, callback) {};
62
63
/**
64
* XXX EMSCRIPTEN removed annotation on param {crypto.Credentials=} credentials, as it gives a warning [JSC_UNRECOGNIZED_TYPE_ERROR] Bad type annotation. Unknown type crypto.Credentials
65
* @param {boolean=} isServer
66
* @param {boolean=} requestCert
67
* @param {boolean=} rejectUnauthorized
68
* @return {tls.SecurePair}
69
*/
70
tls.createSecurePair = function(credentials, isServer, requestCert, rejectUnauthorized) {};
71
72
/**
73
* @constructor
74
* @extends events.EventEmitter
75
*/
76
tls.SecurePair = function() {};
77
78
/**
79
* @constructor
80
* @extends net.Server
81
*/
82
tls.Server = function() {};
83
84
/**
85
* @param {string} hostname
86
* @param {string|nodeBuffer.Buffer} credentials
87
*/
88
tls.Server.prototype.addContext = function(hostname, credentials) {};
89
90
/**
91
* @constructor
92
* @extends stream.Duplex
93
*/
94
tls.CleartextStream = function() {};
95
96
/**
97
* @type {boolean}
98
*/
99
tls.CleartextStream.prototype.authorized;
100
101
/**
102
* @type {?string}
103
*/
104
tls.CleartextStream.prototype.authorizationError;
105
106
/**
107
* @return {Object.<string,(string|Object.<string,string>)>}
108
*/
109
tls.CleartextStream.prototype.getPeerCertificate = function() {};
110
111
/**
112
* @return {{name: string, version: string}}
113
*/
114
tls.CleartextStream.prototype.getCipher = function() {};
115
116
/**
117
* @return {{port: number, family: string, address: string}}
118
*/
119
tls.CleartextStream.prototype.address = function() {};
120
121
/**
122
* @type {string}
123
*/
124
tls.CleartextStream.prototype.remoteAddress;
125
126
/**
127
* @type {number}
128
*/
129
tls.CleartextStream.prototype.remotePort;
130
131