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/os.js
6174 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 os module.
19
* @see http://nodejs.org/api/os.html
20
* @externs
21
* @author Daniel Wirtz <[email protected]>
22
*/
23
24
/**
25
BEGIN_NODE_INCLUDE
26
var os = require('os');
27
END_NODE_INCLUDE
28
*/
29
30
31
/**
32
* @return {string}
33
* @nosideeffects
34
*/
35
os.tmpdir = function() {};
36
37
/**
38
* @return {string}
39
* @nosideeffects
40
*/
41
os.hostname = function() {};
42
43
/**
44
* @return {string}
45
* @nosideeffects
46
*/
47
os.type = function() {};
48
49
/**
50
* @return {string}
51
* @nosideeffects
52
*/
53
os.platform = function() {};
54
55
/**
56
* @return {string}
57
* @nosideeffects
58
*/
59
os.arch = function() {};
60
61
/**
62
* @return {string}
63
* @nosideeffects
64
*/
65
os.release = function() {};
66
67
/**
68
* @return {number}
69
* @nosideeffects
70
*/
71
os.uptime = function() {};
72
73
/**
74
* @return {Array.<number>}
75
* @nosideeffects
76
*/
77
os.loadavg = function() {};
78
79
/**
80
* @return {number}
81
* @nosideeffects
82
*/
83
os.totalmem = function() {};
84
85
/**
86
* @return {number}
87
* @nosideeffects
88
*/
89
os.freemem = function() {};
90
91
/**
92
* @typedef {{model: string, speed: number, times: {user: number, nice: number, sys: number, idle: number, irg: number}}}
93
*/
94
var osCpusInfo;
95
96
/**
97
* @return {Array.<osCpusInfo>}
98
* @nosideeffects
99
*/
100
os.cpus = function() {};
101
102
/**
103
* @typedef {{address: string, family: string, internal: boolean}}
104
*/
105
var osNetworkInterfacesInfo;
106
107
/**
108
* @return {Object.<string,osNetworkInterfacesInfo>}
109
* @nosideeffects
110
*/
111
os.networkInterfaces = function() {};
112
113
/**
114
* @type {string}
115
*/
116
os.EOL;
117
118