Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/closure-externs/node-externs.js
4133 views
1
/**
2
* @type {Object.<string,*>}
3
*/
4
var ws = {};
5
6
/**
7
* @param {string} event
8
* @param {function()} callback
9
*/
10
ws.on = function(event, callback) {};
11
12
/**
13
* @param {Object} data
14
* @param {Object} flags
15
* @param {function()=} callback
16
*/
17
ws.send = function(data, flags, callback) {};
18
19
/**
20
* @type {boolean}
21
*/
22
ws.binaryType;
23
24
/**
25
* @type {Object.<string,*>}
26
*/
27
var wss = ws.Server;
28
29
/**
30
* @param {string} event
31
* @param {function()} callback
32
*/
33
wss.on = function(event, callback) {};
34
35
/**
36
* @param {function()} callback
37
*/
38
wss.broadcast = function(callback) {};
39
40
/**
41
* @type {Object.<string,*>}
42
*/
43
wss._socket;
44
45
/**
46
* @type {string}
47
*/
48
wss.url;
49
50
/**
51
* @type {string}
52
*/
53
wss._socket.remoteAddress;
54
55
/**
56
* @type {number}
57
*/
58
wss._socket.remotePort;
59
60
/**
61
* @suppress {duplicate}
62
*/
63
var fs;
64
65
/**
66
* @param {...*} var_args
67
* @constructor
68
* @nosideeffects
69
*/
70
var Buffer = function(var_args) {};
71
72
/**
73
* @param {ArrayBuffer|SharedArrayBuffer|string} arrayBufferOrString
74
* @param {number|string=} byteOffsetOrEncoding
75
* @param {number=} length
76
* @return {nodeBuffer.Buffer}
77
* @nosideeffects
78
*/
79
Buffer.from = function(arrayBufferOrString, byteOffsetOrEncoding, length) {};
80
81
/**
82
* @param {number} size
83
* @param {(string|!Buffer|number)=} fill
84
* @param {string=} encoding
85
* @return {!Buffer}
86
*/
87
Buffer.alloc = function(size, fill, encoding) {};
88
89
/**
90
* @return {boolean}
91
* @nosideeffects
92
*/
93
Buffer.isBuffer = function(obj) {};
94
95
/**
96
* @param {number=} start
97
* @param {number=} end
98
* @return {Buffer}
99
* @nosideeffects
100
*/
101
Buffer.prototype.slice = function(start, end) {};
102
103
/**
104
* @param {string=} encoding
105
* @param {number=} start
106
* @param {number=} end
107
* @nosideeffects
108
*/
109
Buffer.prototype.toString = function(encoding, start, end) {};
110
111
Worker.prototype.ref = function() {};
112
Worker.prototype.unref = function() {};
113
114
/**
115
* @type {number}
116
*/
117
fs.Stats.prototype.atimeMs;
118
119
/**
120
* @type {number}
121
*/
122
fs.Stats.prototype.mtimeMs;
123
124
/**
125
* @type {number}
126
*/
127
fs.Stats.prototype.ctimeMs;
128
129
/**
130
* @type {number}
131
*/
132
fs.Stats.prototype.blksize;
133
134
/**
135
* @param {string} p
136
* @return {boolean}
137
* @nosideeffects
138
*/
139
path.isAbsolute;
140
141
/**
142
* @type {Object.<string,*>}
143
*/
144
path.posix;
145
146
crypto.randomFillSync;
147
148