@shopify/ui-extensions-server-kit 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -1
  3. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +1 -0
  4. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +1 -1
  5. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +8 -0
  6. package/dist/ExtensionServerClient/server-types.d.ts +42 -0
  7. package/dist/context/constants.cjs.js +1 -1
  8. package/dist/context/constants.d.ts +0 -1
  9. package/dist/context/constants.es.js +0 -1
  10. package/dist/context/types.d.ts +1 -0
  11. package/dist/hooks/index.d.ts +0 -2
  12. package/dist/i18n.cjs.js +1 -1
  13. package/dist/i18n.d.ts +1 -20
  14. package/dist/i18n.es.js +0 -1
  15. package/dist/index.cjs.js +1 -1
  16. package/dist/index.es.js +40 -48
  17. package/dist/testing/extensions.cjs.js +1 -1
  18. package/dist/testing/extensions.es.js +2 -2
  19. package/dist/types.cjs.js +1 -1
  20. package/dist/types.d.ts +10 -4
  21. package/dist/types.es.js +2 -2
  22. package/dist/utilities/index.d.ts +0 -1
  23. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.d.ts +3 -0
  24. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.d.ts +2 -0
  25. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.d.ts +17 -0
  26. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.d.ts +9 -0
  27. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +1 -0
  28. package/node_modules/@shopify/ui-extensions-test-utils/package.json +2 -3
  29. package/package.json +7 -6
  30. package/project.json +0 -2
  31. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +837 -330
  32. package/src/ExtensionServerClient/ExtensionServerClient.ts +10 -8
  33. package/src/ExtensionServerClient/server-types.ts +55 -0
  34. package/src/ExtensionServerClient/types.ts +2 -0
  35. package/src/context/ExtensionServerProvider.test.tsx +202 -39
  36. package/src/context/ExtensionServerProvider.tsx +1 -0
  37. package/src/context/constants.ts +3 -2
  38. package/src/context/types.ts +1 -0
  39. package/src/hooks/index.ts +0 -2
  40. package/src/i18n.ts +3 -3
  41. package/src/state/reducers/extensionServerReducer.test.ts +2 -2
  42. package/src/testing/extensions.ts +2 -2
  43. package/src/types.ts +10 -4
  44. package/src/utilities/index.ts +0 -1
  45. package/src/utilities/replaceUpdated.ts +1 -0
  46. package/src/utilities/set.ts +1 -0
  47. package/dist/hooks/useExtensionClient.cjs.js +0 -1
  48. package/dist/hooks/useExtensionClient.d.ts +0 -1
  49. package/dist/hooks/useExtensionClient.es.js +0 -8
  50. package/dist/hooks/useExtensionServerEvent.cjs.js +0 -1
  51. package/dist/hooks/useExtensionServerEvent.d.ts +0 -1
  52. package/dist/hooks/useExtensionServerEvent.es.js +0 -9
  53. package/dist/utilities/groupByKey.cjs.js +0 -1
  54. package/dist/utilities/groupByKey.d.ts +0 -3
  55. package/dist/utilities/groupByKey.es.js +0 -6
  56. package/node_modules/@types/node/LICENSE +0 -21
  57. package/node_modules/@types/node/README.md +0 -15
  58. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  59. package/node_modules/@types/node/assert.d.ts +0 -985
  60. package/node_modules/@types/node/async_hooks.d.ts +0 -522
  61. package/node_modules/@types/node/buffer.d.ts +0 -2321
  62. package/node_modules/@types/node/child_process.d.ts +0 -1544
  63. package/node_modules/@types/node/cluster.d.ts +0 -432
  64. package/node_modules/@types/node/console.d.ts +0 -412
  65. package/node_modules/@types/node/constants.d.ts +0 -19
  66. package/node_modules/@types/node/crypto.d.ts +0 -4451
  67. package/node_modules/@types/node/dgram.d.ts +0 -586
  68. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -192
  69. package/node_modules/@types/node/dns/promises.d.ts +0 -381
  70. package/node_modules/@types/node/dns.d.ts +0 -809
  71. package/node_modules/@types/node/dom-events.d.ts +0 -122
  72. package/node_modules/@types/node/domain.d.ts +0 -170
  73. package/node_modules/@types/node/events.d.ts +0 -803
  74. package/node_modules/@types/node/fs/promises.d.ts +0 -1205
  75. package/node_modules/@types/node/fs.d.ts +0 -4211
  76. package/node_modules/@types/node/globals.d.ts +0 -377
  77. package/node_modules/@types/node/globals.global.d.ts +0 -1
  78. package/node_modules/@types/node/http.d.ts +0 -1801
  79. package/node_modules/@types/node/http2.d.ts +0 -2386
  80. package/node_modules/@types/node/https.d.ts +0 -544
  81. package/node_modules/@types/node/index.d.ts +0 -88
  82. package/node_modules/@types/node/inspector.d.ts +0 -2739
  83. package/node_modules/@types/node/module.d.ts +0 -298
  84. package/node_modules/@types/node/net.d.ts +0 -913
  85. package/node_modules/@types/node/os.d.ts +0 -473
  86. package/node_modules/@types/node/package.json +0 -235
  87. package/node_modules/@types/node/path.d.ts +0 -191
  88. package/node_modules/@types/node/perf_hooks.d.ts +0 -626
  89. package/node_modules/@types/node/process.d.ts +0 -1531
  90. package/node_modules/@types/node/punycode.d.ts +0 -117
  91. package/node_modules/@types/node/querystring.d.ts +0 -141
  92. package/node_modules/@types/node/readline/promises.d.ts +0 -143
  93. package/node_modules/@types/node/readline.d.ts +0 -666
  94. package/node_modules/@types/node/repl.d.ts +0 -430
  95. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  96. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  97. package/node_modules/@types/node/stream/web.d.ts +0 -336
  98. package/node_modules/@types/node/stream.d.ts +0 -1731
  99. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  100. package/node_modules/@types/node/test.d.ts +0 -1113
  101. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  102. package/node_modules/@types/node/timers.d.ts +0 -126
  103. package/node_modules/@types/node/tls.d.ts +0 -1203
  104. package/node_modules/@types/node/trace_events.d.ts +0 -171
  105. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  106. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -985
  107. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -522
  108. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2321
  109. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1544
  110. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  111. package/node_modules/@types/node/ts4.8/console.d.ts +0 -412
  112. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  113. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4450
  114. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  115. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -192
  116. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -381
  117. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  118. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  119. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  120. package/node_modules/@types/node/ts4.8/events.d.ts +0 -754
  121. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1205
  122. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4211
  123. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -377
  124. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  125. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1801
  126. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2386
  127. package/node_modules/@types/node/ts4.8/https.d.ts +0 -544
  128. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  129. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2739
  130. package/node_modules/@types/node/ts4.8/module.d.ts +0 -298
  131. package/node_modules/@types/node/ts4.8/net.d.ts +0 -913
  132. package/node_modules/@types/node/ts4.8/os.d.ts +0 -473
  133. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -626
  135. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1531
  136. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  137. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  138. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -143
  139. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -666
  140. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  141. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  142. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  143. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -336
  144. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1731
  145. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  146. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1113
  147. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  148. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -126
  149. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1203
  150. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -171
  151. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -206
  152. package/node_modules/@types/node/ts4.8/url.d.ts +0 -937
  153. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2075
  154. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -541
  155. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -667
  156. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  157. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -692
  158. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  159. package/node_modules/@types/node/tty.d.ts +0 -206
  160. package/node_modules/@types/node/url.d.ts +0 -937
  161. package/node_modules/@types/node/util.d.ts +0 -2075
  162. package/node_modules/@types/node/v8.d.ts +0 -541
  163. package/node_modules/@types/node/vm.d.ts +0 -667
  164. package/node_modules/@types/node/wasi.d.ts +0 -158
  165. package/node_modules/@types/node/worker_threads.d.ts +0 -692
  166. package/node_modules/@types/node/zlib.d.ts +0 -517
  167. package/src/hooks/useExtensionClient.ts +0 -6
  168. package/src/hooks/useExtensionServerEvent.ts +0 -11
  169. package/src/utilities/groupByKey.ts +0 -3
@@ -1,473 +0,0 @@
1
- /**
2
- * The `os` module provides operating system-related utility methods and
3
- * properties. It can be accessed using:
4
- *
5
- * ```js
6
- * const os = require('os');
7
- * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
9
- */
10
- declare module "os" {
11
- interface CpuInfo {
12
- model: string;
13
- speed: number;
14
- times: {
15
- user: number;
16
- nice: number;
17
- sys: number;
18
- idle: number;
19
- irq: number;
20
- };
21
- }
22
- interface NetworkInterfaceBase {
23
- address: string;
24
- netmask: string;
25
- mac: string;
26
- internal: boolean;
27
- cidr: string | null;
28
- }
29
- interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
30
- family: "IPv4";
31
- scopeid?: undefined;
32
- }
33
- interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
34
- family: "IPv6";
35
- scopeid: number;
36
- }
37
- interface UserInfo<T> {
38
- username: T;
39
- uid: number;
40
- gid: number;
41
- shell: T | null;
42
- homedir: T;
43
- }
44
- type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
45
- /**
46
- * Returns the host name of the operating system as a string.
47
- * @since v0.3.3
48
- */
49
- function hostname(): string;
50
- /**
51
- * Returns an array containing the 1, 5, and 15 minute load averages.
52
- *
53
- * The load average is a measure of system activity calculated by the operating
54
- * system and expressed as a fractional number.
55
- *
56
- * The load average is a Unix-specific concept. On Windows, the return value is
57
- * always `[0, 0, 0]`.
58
- * @since v0.3.3
59
- */
60
- function loadavg(): number[];
61
- /**
62
- * Returns the system uptime in number of seconds.
63
- * @since v0.3.3
64
- */
65
- function uptime(): number;
66
- /**
67
- * Returns the amount of free system memory in bytes as an integer.
68
- * @since v0.3.3
69
- */
70
- function freemem(): number;
71
- /**
72
- * Returns the total amount of system memory in bytes as an integer.
73
- * @since v0.3.3
74
- */
75
- function totalmem(): number;
76
- /**
77
- * Returns an array of objects containing information about each logical CPU core.
78
- *
79
- * The properties included on each object include:
80
- *
81
- * ```js
82
- * [
83
- * {
84
- * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
85
- * speed: 2926,
86
- * times: {
87
- * user: 252020,
88
- * nice: 0,
89
- * sys: 30340,
90
- * idle: 1070356870,
91
- * irq: 0
92
- * }
93
- * },
94
- * {
95
- * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
96
- * speed: 2926,
97
- * times: {
98
- * user: 306960,
99
- * nice: 0,
100
- * sys: 26980,
101
- * idle: 1071569080,
102
- * irq: 0
103
- * }
104
- * },
105
- * {
106
- * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
107
- * speed: 2926,
108
- * times: {
109
- * user: 248450,
110
- * nice: 0,
111
- * sys: 21750,
112
- * idle: 1070919370,
113
- * irq: 0
114
- * }
115
- * },
116
- * {
117
- * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
118
- * speed: 2926,
119
- * times: {
120
- * user: 256880,
121
- * nice: 0,
122
- * sys: 19430,
123
- * idle: 1070905480,
124
- * irq: 20
125
- * }
126
- * },
127
- * ]
128
- * ```
129
- *
130
- * `nice` values are POSIX-only. On Windows, the `nice` values of all processors
131
- * are always 0.
132
- * @since v0.3.3
133
- */
134
- function cpus(): CpuInfo[];
135
- /**
136
- * Returns an estimate of the default amount of parallelism a program should use. Always returns a value greater than zero.
137
- *
138
- * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
139
- * @since 18.4.0
140
- */
141
- function availableParallelism(): number;
142
- /**
143
- * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
144
- * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
145
- *
146
- * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
147
- * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
148
- * @since v0.3.3
149
- */
150
- function type(): string;
151
- /**
152
- * Returns the operating system as a string.
153
- *
154
- * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
155
- * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
156
- * @since v0.3.3
157
- */
158
- function release(): string;
159
- /**
160
- * Returns an object containing network interfaces that have been assigned a
161
- * network address.
162
- *
163
- * Each key on the returned object identifies a network interface. The associated
164
- * value is an array of objects that each describe an assigned network address.
165
- *
166
- * The properties available on the assigned network address object include:
167
- *
168
- * ```js
169
- * {
170
- * lo: [
171
- * {
172
- * address: '127.0.0.1',
173
- * netmask: '255.0.0.0',
174
- * family: 'IPv4',
175
- * mac: '00:00:00:00:00:00',
176
- * internal: true,
177
- * cidr: '127.0.0.1/8'
178
- * },
179
- * {
180
- * address: '::1',
181
- * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
182
- * family: 'IPv6',
183
- * mac: '00:00:00:00:00:00',
184
- * scopeid: 0,
185
- * internal: true,
186
- * cidr: '::1/128'
187
- * }
188
- * ],
189
- * eth0: [
190
- * {
191
- * address: '192.168.1.108',
192
- * netmask: '255.255.255.0',
193
- * family: 'IPv4',
194
- * mac: '01:02:03:0a:0b:0c',
195
- * internal: false,
196
- * cidr: '192.168.1.108/24'
197
- * },
198
- * {
199
- * address: 'fe80::a00:27ff:fe4e:66a1',
200
- * netmask: 'ffff:ffff:ffff:ffff::',
201
- * family: 'IPv6',
202
- * mac: '01:02:03:0a:0b:0c',
203
- * scopeid: 1,
204
- * internal: false,
205
- * cidr: 'fe80::a00:27ff:fe4e:66a1/64'
206
- * }
207
- * ]
208
- * }
209
- * ```
210
- * @since v0.6.0
211
- */
212
- function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
213
- /**
214
- * Returns the string path of the current user's home directory.
215
- *
216
- * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
217
- * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
218
- *
219
- * On Windows, it uses the `USERPROFILE` environment variable if defined.
220
- * Otherwise it uses the path to the profile directory of the current user.
221
- * @since v2.3.0
222
- */
223
- function homedir(): string;
224
- /**
225
- * Returns information about the currently effective user. On POSIX platforms,
226
- * this is typically a subset of the password file. The returned object includes
227
- * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
228
- *
229
- * The value of `homedir` returned by `os.userInfo()` is provided by the operating
230
- * system. This differs from the result of `os.homedir()`, which queries
231
- * environment variables for the home directory before falling back to the
232
- * operating system response.
233
- *
234
- * Throws a `SystemError` if a user has no `username` or `homedir`.
235
- * @since v6.0.0
236
- */
237
- function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
238
- function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
239
- type SignalConstants = {
240
- [key in NodeJS.Signals]: number;
241
- };
242
- namespace constants {
243
- const UV_UDP_REUSEADDR: number;
244
- namespace signals {}
245
- const signals: SignalConstants;
246
- namespace errno {
247
- const E2BIG: number;
248
- const EACCES: number;
249
- const EADDRINUSE: number;
250
- const EADDRNOTAVAIL: number;
251
- const EAFNOSUPPORT: number;
252
- const EAGAIN: number;
253
- const EALREADY: number;
254
- const EBADF: number;
255
- const EBADMSG: number;
256
- const EBUSY: number;
257
- const ECANCELED: number;
258
- const ECHILD: number;
259
- const ECONNABORTED: number;
260
- const ECONNREFUSED: number;
261
- const ECONNRESET: number;
262
- const EDEADLK: number;
263
- const EDESTADDRREQ: number;
264
- const EDOM: number;
265
- const EDQUOT: number;
266
- const EEXIST: number;
267
- const EFAULT: number;
268
- const EFBIG: number;
269
- const EHOSTUNREACH: number;
270
- const EIDRM: number;
271
- const EILSEQ: number;
272
- const EINPROGRESS: number;
273
- const EINTR: number;
274
- const EINVAL: number;
275
- const EIO: number;
276
- const EISCONN: number;
277
- const EISDIR: number;
278
- const ELOOP: number;
279
- const EMFILE: number;
280
- const EMLINK: number;
281
- const EMSGSIZE: number;
282
- const EMULTIHOP: number;
283
- const ENAMETOOLONG: number;
284
- const ENETDOWN: number;
285
- const ENETRESET: number;
286
- const ENETUNREACH: number;
287
- const ENFILE: number;
288
- const ENOBUFS: number;
289
- const ENODATA: number;
290
- const ENODEV: number;
291
- const ENOENT: number;
292
- const ENOEXEC: number;
293
- const ENOLCK: number;
294
- const ENOLINK: number;
295
- const ENOMEM: number;
296
- const ENOMSG: number;
297
- const ENOPROTOOPT: number;
298
- const ENOSPC: number;
299
- const ENOSR: number;
300
- const ENOSTR: number;
301
- const ENOSYS: number;
302
- const ENOTCONN: number;
303
- const ENOTDIR: number;
304
- const ENOTEMPTY: number;
305
- const ENOTSOCK: number;
306
- const ENOTSUP: number;
307
- const ENOTTY: number;
308
- const ENXIO: number;
309
- const EOPNOTSUPP: number;
310
- const EOVERFLOW: number;
311
- const EPERM: number;
312
- const EPIPE: number;
313
- const EPROTO: number;
314
- const EPROTONOSUPPORT: number;
315
- const EPROTOTYPE: number;
316
- const ERANGE: number;
317
- const EROFS: number;
318
- const ESPIPE: number;
319
- const ESRCH: number;
320
- const ESTALE: number;
321
- const ETIME: number;
322
- const ETIMEDOUT: number;
323
- const ETXTBSY: number;
324
- const EWOULDBLOCK: number;
325
- const EXDEV: number;
326
- const WSAEINTR: number;
327
- const WSAEBADF: number;
328
- const WSAEACCES: number;
329
- const WSAEFAULT: number;
330
- const WSAEINVAL: number;
331
- const WSAEMFILE: number;
332
- const WSAEWOULDBLOCK: number;
333
- const WSAEINPROGRESS: number;
334
- const WSAEALREADY: number;
335
- const WSAENOTSOCK: number;
336
- const WSAEDESTADDRREQ: number;
337
- const WSAEMSGSIZE: number;
338
- const WSAEPROTOTYPE: number;
339
- const WSAENOPROTOOPT: number;
340
- const WSAEPROTONOSUPPORT: number;
341
- const WSAESOCKTNOSUPPORT: number;
342
- const WSAEOPNOTSUPP: number;
343
- const WSAEPFNOSUPPORT: number;
344
- const WSAEAFNOSUPPORT: number;
345
- const WSAEADDRINUSE: number;
346
- const WSAEADDRNOTAVAIL: number;
347
- const WSAENETDOWN: number;
348
- const WSAENETUNREACH: number;
349
- const WSAENETRESET: number;
350
- const WSAECONNABORTED: number;
351
- const WSAECONNRESET: number;
352
- const WSAENOBUFS: number;
353
- const WSAEISCONN: number;
354
- const WSAENOTCONN: number;
355
- const WSAESHUTDOWN: number;
356
- const WSAETOOMANYREFS: number;
357
- const WSAETIMEDOUT: number;
358
- const WSAECONNREFUSED: number;
359
- const WSAELOOP: number;
360
- const WSAENAMETOOLONG: number;
361
- const WSAEHOSTDOWN: number;
362
- const WSAEHOSTUNREACH: number;
363
- const WSAENOTEMPTY: number;
364
- const WSAEPROCLIM: number;
365
- const WSAEUSERS: number;
366
- const WSAEDQUOT: number;
367
- const WSAESTALE: number;
368
- const WSAEREMOTE: number;
369
- const WSASYSNOTREADY: number;
370
- const WSAVERNOTSUPPORTED: number;
371
- const WSANOTINITIALISED: number;
372
- const WSAEDISCON: number;
373
- const WSAENOMORE: number;
374
- const WSAECANCELLED: number;
375
- const WSAEINVALIDPROCTABLE: number;
376
- const WSAEINVALIDPROVIDER: number;
377
- const WSAEPROVIDERFAILEDINIT: number;
378
- const WSASYSCALLFAILURE: number;
379
- const WSASERVICE_NOT_FOUND: number;
380
- const WSATYPE_NOT_FOUND: number;
381
- const WSA_E_NO_MORE: number;
382
- const WSA_E_CANCELLED: number;
383
- const WSAEREFUSED: number;
384
- }
385
- namespace priority {
386
- const PRIORITY_LOW: number;
387
- const PRIORITY_BELOW_NORMAL: number;
388
- const PRIORITY_NORMAL: number;
389
- const PRIORITY_ABOVE_NORMAL: number;
390
- const PRIORITY_HIGH: number;
391
- const PRIORITY_HIGHEST: number;
392
- }
393
- }
394
- const devNull: string;
395
- const EOL: string;
396
- /**
397
- * Returns the operating system CPU architecture for which the Node.js binary was
398
- * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
399
- *
400
- * The return value is equivalent to `process.arch`.
401
- * @since v0.5.0
402
- */
403
- function arch(): string;
404
- /**
405
- * Returns a string identifying the kernel version.
406
- *
407
- * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
408
- * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
409
- * @since v13.11.0, v12.17.0
410
- */
411
- function version(): string;
412
- /**
413
- * Returns a string identifying the operating system platform for which
414
- * the Node.js binary was compiled. The value is set at compile time.
415
- * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
416
- *
417
- * The return value is equivalent to `process.platform`.
418
- *
419
- * The value `'android'` may also be returned if Node.js is built on the Android
420
- * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
421
- * @since v0.5.0
422
- */
423
- function platform(): NodeJS.Platform;
424
- /**
425
- * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
426
- *
427
- * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
428
- * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
429
- * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
430
- * @since v18.9.0
431
- */
432
- function machine(): string;
433
- /**
434
- * Returns the operating system's default directory for temporary files as a
435
- * string.
436
- * @since v0.9.9
437
- */
438
- function tmpdir(): string;
439
- /**
440
- * Returns a string identifying the endianness of the CPU for which the Node.js
441
- * binary was compiled.
442
- *
443
- * Possible values are `'BE'` for big endian and `'LE'` for little endian.
444
- * @since v0.9.4
445
- */
446
- function endianness(): "BE" | "LE";
447
- /**
448
- * Returns the scheduling priority for the process specified by `pid`. If `pid` is
449
- * not provided or is `0`, the priority of the current process is returned.
450
- * @since v10.10.0
451
- * @param [pid=0] The process ID to retrieve scheduling priority for.
452
- */
453
- function getPriority(pid?: number): number;
454
- /**
455
- * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
456
- *
457
- * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
458
- * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
459
- * mapping may cause the return value to be slightly different on Windows. To avoid
460
- * confusion, set `priority` to one of the priority constants.
461
- *
462
- * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
463
- * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
464
- * @since v10.10.0
465
- * @param [pid=0] The process ID to set scheduling priority for.
466
- * @param priority The scheduling priority to assign to the process.
467
- */
468
- function setPriority(priority: number): void;
469
- function setPriority(pid: number, priority: number): void;
470
- }
471
- declare module "node:os" {
472
- export * from "os";
473
- }