zai-fca 1.0.7

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.

Potentially problematic release.


This version of zai-fca might be problematic. Click here for more details.

Files changed (264) hide show
  1. package/.cache/replit/env/latest +56 -0
  2. package/.cache/replit/env/latest.json +1 -0
  3. package/.cache/replit/modules/nodejs-20.res +1 -0
  4. package/.cache/replit/modules/replit.res +1 -0
  5. package/.cache/replit/modules.stamp +0 -0
  6. package/.cache/typescript/5.6/node_modules/.package-lock.json +178 -0
  7. package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
  8. package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
  9. package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
  10. package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
  11. package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
  12. package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
  13. package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
  14. package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
  15. package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
  16. package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
  17. package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
  18. package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
  19. package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
  20. package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
  21. package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
  22. package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
  23. package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
  24. package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  25. package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
  26. package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
  27. package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
  28. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  29. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
  30. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  31. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  32. package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
  33. package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
  34. package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
  35. package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
  36. package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  37. package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
  38. package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
  39. package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
  40. package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
  41. package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
  42. package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
  43. package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
  44. package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
  45. package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  46. package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
  47. package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
  48. package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
  49. package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
  50. package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
  51. package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
  52. package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
  53. package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
  54. package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
  55. package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
  56. package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
  57. package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
  58. package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
  59. package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
  60. package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
  61. package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
  62. package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
  63. package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
  64. package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
  65. package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
  66. package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
  67. package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
  68. package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
  69. package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
  70. package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
  71. package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
  72. package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
  73. package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
  74. package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
  75. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  76. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  77. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
  78. package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
  79. package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
  80. package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
  81. package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
  82. package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
  83. package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
  84. package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
  85. package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
  86. package/.cache/typescript/5.6/node_modules/@types/node-cron/LICENSE +21 -0
  87. package/.cache/typescript/5.6/node_modules/@types/node-cron/README.md +76 -0
  88. package/.cache/typescript/5.6/node_modules/@types/node-cron/index.d.ts +57 -0
  89. package/.cache/typescript/5.6/node_modules/@types/node-cron/package.json +50 -0
  90. package/.cache/typescript/5.6/node_modules/@types/npmlog/LICENSE +21 -0
  91. package/.cache/typescript/5.6/node_modules/@types/npmlog/README.md +15 -0
  92. package/.cache/typescript/5.6/node_modules/@types/npmlog/index.d.ts +84 -0
  93. package/.cache/typescript/5.6/node_modules/@types/npmlog/package.json +32 -0
  94. package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
  95. package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
  96. package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
  97. package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
  98. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
  99. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
  100. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
  101. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
  102. package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
  103. package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
  104. package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
  105. package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
  106. package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
  107. package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
  108. package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
  109. package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
  110. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  111. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
  112. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
  113. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  114. package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
  115. package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
  116. package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
  117. package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
  118. package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
  119. package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
  120. package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
  121. package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
  122. package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
  123. package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
  124. package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
  125. package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
  126. package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
  127. package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
  128. package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
  129. package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
  130. package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  131. package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
  132. package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
  133. package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
  134. package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
  135. package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
  136. package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
  137. package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
  138. package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
  139. package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
  140. package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
  141. package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
  142. package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
  143. package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
  144. package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
  145. package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
  146. package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
  147. package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
  148. package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
  149. package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
  150. package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
  151. package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
  152. package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
  153. package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
  154. package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
  155. package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
  156. package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
  157. package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
  158. package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +21 -0
  159. package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
  160. package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
  161. package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
  162. package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
  163. package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
  164. package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
  165. package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
  166. package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
  167. package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
  168. package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  169. package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
  170. package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  171. package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
  172. package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
  173. package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
  174. package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
  175. package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
  176. package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
  177. package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  178. package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
  179. package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
  180. package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
  181. package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
  182. package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
  183. package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
  184. package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
  185. package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
  186. package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  187. package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
  188. package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
  189. package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
  190. package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
  191. package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
  192. package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
  193. package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
  194. package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
  195. package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
  196. package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
  197. package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
  198. package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
  199. package/.cache/typescript/5.6/package-lock.json +190 -0
  200. package/.cache/typescript/5.6/package.json +1 -0
  201. package/.replit +4 -0
  202. package/.upm/store.json +1 -0
  203. package/LICENSE +21 -0
  204. package/README.md +289 -0
  205. package/index.js +460 -0
  206. package/package.json +45 -0
  207. package/src/Screenshot.js +83 -0
  208. package/src/addExternalModule.js +15 -0
  209. package/src/addUserToGroup.js +77 -0
  210. package/src/changeAdminStatus.js +47 -0
  211. package/src/changeArchivedStatus.js +41 -0
  212. package/src/changeAvt.js +85 -0
  213. package/src/changeBio.js +65 -0
  214. package/src/changeBlockedStatus.js +36 -0
  215. package/src/changeGroupImage.js +106 -0
  216. package/src/changeNickname.js +45 -0
  217. package/src/changeThreadColor.js +61 -0
  218. package/src/changeThreadEmoji.js +41 -0
  219. package/src/createNewGroup.js +70 -0
  220. package/src/createPoll.js +59 -0
  221. package/src/createPost.js +277 -0
  222. package/src/deleteMessage.js +44 -0
  223. package/src/deleteThread.js +42 -0
  224. package/src/forwardAttachment.js +47 -0
  225. package/src/getCurrentUserID.js +7 -0
  226. package/src/getEmojiUrl.js +27 -0
  227. package/src/getFriendsList.js +73 -0
  228. package/src/getThreadHistory.js +537 -0
  229. package/src/getThreadHistoryDeprecated.js +71 -0
  230. package/src/getThreadInfo.js +232 -0
  231. package/src/getThreadInfoDeprecated.js +56 -0
  232. package/src/getThreadList.js +213 -0
  233. package/src/getThreadListDeprecated.js +46 -0
  234. package/src/getThreadPictures.js +59 -0
  235. package/src/getUID.js +119 -0
  236. package/src/getUserID.js +61 -0
  237. package/src/getUserInfo.js +66 -0
  238. package/src/handleFriendRequest.js +46 -0
  239. package/src/handleMessageRequest.js +47 -0
  240. package/src/httpGet.js +49 -0
  241. package/src/httpPost.js +48 -0
  242. package/src/listenMqtt.js +827 -0
  243. package/src/listenMqtt.txt +827 -0
  244. package/src/logout.js +68 -0
  245. package/src/markAsDelivered.js +47 -0
  246. package/src/markAsRead.js +70 -0
  247. package/src/markAsReadAll.js +40 -0
  248. package/src/markAsSeen.js +48 -0
  249. package/src/muteThread.js +45 -0
  250. package/src/postFormData.txt +46 -0
  251. package/src/removeUserFromGroup.js +45 -0
  252. package/src/resolvePhotoUrl.js +36 -0
  253. package/src/searchForThread.js +42 -0
  254. package/src/sendMessage.js +329 -0
  255. package/src/sendTypingIndicator.js +70 -0
  256. package/src/setMessageReaction.js +109 -0
  257. package/src/setPostReaction.js +102 -0
  258. package/src/setTitle.js +70 -0
  259. package/src/shareContact.js +46 -0
  260. package/src/shareLink.js +62 -0
  261. package/src/threadColors.js +41 -0
  262. package/src/unfriend.js +42 -0
  263. package/src/unsendMessage.js +39 -0
  264. package/utils.js +2876 -0
@@ -0,0 +1,965 @@
1
+ /**
2
+ * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
3
+ * Node.js-specific performance measurements.
4
+ *
5
+ * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
6
+ *
7
+ * * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
8
+ * * [Performance Timeline](https://w3c.github.io/performance-timeline/)
9
+ * * [User Timing](https://www.w3.org/TR/user-timing/)
10
+ * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
11
+ *
12
+ * ```js
13
+ * import { PerformanceObserver, performance } from 'node:perf_hooks';
14
+ *
15
+ * const obs = new PerformanceObserver((items) => {
16
+ * console.log(items.getEntries()[0].duration);
17
+ * performance.clearMarks();
18
+ * });
19
+ * obs.observe({ type: 'measure' });
20
+ * performance.measure('Start to Now');
21
+ *
22
+ * performance.mark('A');
23
+ * doSomeLongRunningProcess(() => {
24
+ * performance.measure('A to Now', 'A');
25
+ *
26
+ * performance.mark('B');
27
+ * performance.measure('A to B', 'A', 'B');
28
+ * });
29
+ * ```
30
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js)
31
+ */
32
+ declare module "perf_hooks" {
33
+ import { AsyncResource } from "node:async_hooks";
34
+ type EntryType =
35
+ | "dns" // Node.js only
36
+ | "function" // Node.js only
37
+ | "gc" // Node.js only
38
+ | "http2" // Node.js only
39
+ | "http" // Node.js only
40
+ | "mark" // available on the Web
41
+ | "measure" // available on the Web
42
+ | "net" // Node.js only
43
+ | "node" // Node.js only
44
+ | "resource"; // available on the Web
45
+ interface NodeGCPerformanceDetail {
46
+ /**
47
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
48
+ * the type of garbage collection operation that occurred.
49
+ * See perf_hooks.constants for valid values.
50
+ */
51
+ readonly kind?: number | undefined;
52
+ /**
53
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
54
+ * property contains additional information about garbage collection operation.
55
+ * See perf_hooks.constants for valid values.
56
+ */
57
+ readonly flags?: number | undefined;
58
+ }
59
+ /**
60
+ * The constructor of this class is not exposed to users directly.
61
+ * @since v8.5.0
62
+ */
63
+ class PerformanceEntry {
64
+ protected constructor();
65
+ /**
66
+ * The total number of milliseconds elapsed for this entry. This value will not
67
+ * be meaningful for all Performance Entry types.
68
+ * @since v8.5.0
69
+ */
70
+ readonly duration: number;
71
+ /**
72
+ * The name of the performance entry.
73
+ * @since v8.5.0
74
+ */
75
+ readonly name: string;
76
+ /**
77
+ * The high resolution millisecond timestamp marking the starting time of the
78
+ * Performance Entry.
79
+ * @since v8.5.0
80
+ */
81
+ readonly startTime: number;
82
+ /**
83
+ * The type of the performance entry. It may be one of:
84
+ *
85
+ * * `'node'` (Node.js only)
86
+ * * `'mark'` (available on the Web)
87
+ * * `'measure'` (available on the Web)
88
+ * * `'gc'` (Node.js only)
89
+ * * `'function'` (Node.js only)
90
+ * * `'http2'` (Node.js only)
91
+ * * `'http'` (Node.js only)
92
+ * @since v8.5.0
93
+ */
94
+ readonly entryType: EntryType;
95
+ /**
96
+ * Additional detail specific to the `entryType`.
97
+ * @since v16.0.0
98
+ */
99
+ readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
100
+ toJSON(): any;
101
+ }
102
+ /**
103
+ * Exposes marks created via the `Performance.mark()` method.
104
+ * @since v18.2.0, v16.17.0
105
+ */
106
+ class PerformanceMark extends PerformanceEntry {
107
+ readonly duration: 0;
108
+ readonly entryType: "mark";
109
+ }
110
+ /**
111
+ * Exposes measures created via the `Performance.measure()` method.
112
+ *
113
+ * The constructor of this class is not exposed to users directly.
114
+ * @since v18.2.0, v16.17.0
115
+ */
116
+ class PerformanceMeasure extends PerformanceEntry {
117
+ readonly entryType: "measure";
118
+ }
119
+ interface UVMetrics {
120
+ /**
121
+ * Number of event loop iterations.
122
+ */
123
+ readonly loopCount: number;
124
+ /**
125
+ * Number of events that have been processed by the event handler.
126
+ */
127
+ readonly events: number;
128
+ /**
129
+ * Number of events that were waiting to be processed when the event provider was called.
130
+ */
131
+ readonly eventsWaiting: number;
132
+ }
133
+ /**
134
+ * _This property is an extension by Node.js. It is not available in Web browsers._
135
+ *
136
+ * Provides timing details for Node.js itself. The constructor of this class
137
+ * is not exposed to users.
138
+ * @since v8.5.0
139
+ */
140
+ class PerformanceNodeTiming extends PerformanceEntry {
141
+ readonly entryType: "node";
142
+ /**
143
+ * The high resolution millisecond timestamp at which the Node.js process
144
+ * completed bootstrapping. If bootstrapping has not yet finished, the property
145
+ * has the value of -1.
146
+ * @since v8.5.0
147
+ */
148
+ readonly bootstrapComplete: number;
149
+ /**
150
+ * The high resolution millisecond timestamp at which the Node.js environment was
151
+ * initialized.
152
+ * @since v8.5.0
153
+ */
154
+ readonly environment: number;
155
+ /**
156
+ * The high resolution millisecond timestamp of the amount of time the event loop
157
+ * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
158
+ * does not take CPU usage into consideration. If the event loop has not yet
159
+ * started (e.g., in the first tick of the main script), the property has the
160
+ * value of 0.
161
+ * @since v14.10.0, v12.19.0
162
+ */
163
+ readonly idleTime: number;
164
+ /**
165
+ * The high resolution millisecond timestamp at which the Node.js event loop
166
+ * exited. If the event loop has not yet exited, the property has the value of -1\.
167
+ * It can only have a value of not -1 in a handler of the `'exit'` event.
168
+ * @since v8.5.0
169
+ */
170
+ readonly loopExit: number;
171
+ /**
172
+ * The high resolution millisecond timestamp at which the Node.js event loop
173
+ * started. If the event loop has not yet started (e.g., in the first tick of the
174
+ * main script), the property has the value of -1.
175
+ * @since v8.5.0
176
+ */
177
+ readonly loopStart: number;
178
+ /**
179
+ * The high resolution millisecond timestamp at which the Node.js process was initialized.
180
+ * @since v8.5.0
181
+ */
182
+ readonly nodeStart: number;
183
+ /**
184
+ * This is a wrapper to the `uv_metrics_info` function.
185
+ * It returns the current set of event loop metrics.
186
+ *
187
+ * It is recommended to use this property inside a function whose execution was
188
+ * scheduled using `setImmediate` to avoid collecting metrics before finishing all
189
+ * operations scheduled during the current loop iteration.
190
+ * @since v22.8.0, v20.18.0
191
+ */
192
+ readonly uvMetricsInfo: UVMetrics;
193
+ /**
194
+ * The high resolution millisecond timestamp at which the V8 platform was
195
+ * initialized.
196
+ * @since v8.5.0
197
+ */
198
+ readonly v8Start: number;
199
+ }
200
+ interface EventLoopUtilization {
201
+ idle: number;
202
+ active: number;
203
+ utilization: number;
204
+ }
205
+ /**
206
+ * @param utilization1 The result of a previous call to `eventLoopUtilization()`.
207
+ * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
208
+ */
209
+ type EventLoopUtilityFunction = (
210
+ utilization1?: EventLoopUtilization,
211
+ utilization2?: EventLoopUtilization,
212
+ ) => EventLoopUtilization;
213
+ interface MarkOptions {
214
+ /**
215
+ * Additional optional detail to include with the mark.
216
+ */
217
+ detail?: unknown | undefined;
218
+ /**
219
+ * An optional timestamp to be used as the mark time.
220
+ * @default `performance.now()`
221
+ */
222
+ startTime?: number | undefined;
223
+ }
224
+ interface MeasureOptions {
225
+ /**
226
+ * Additional optional detail to include with the mark.
227
+ */
228
+ detail?: unknown | undefined;
229
+ /**
230
+ * Duration between start and end times.
231
+ */
232
+ duration?: number | undefined;
233
+ /**
234
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
235
+ */
236
+ end?: number | string | undefined;
237
+ /**
238
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
239
+ */
240
+ start?: number | string | undefined;
241
+ }
242
+ interface TimerifyOptions {
243
+ /**
244
+ * A histogram object created using `perf_hooks.createHistogram()` that will record runtime
245
+ * durations in nanoseconds.
246
+ */
247
+ histogram?: RecordableHistogram | undefined;
248
+ }
249
+ interface Performance {
250
+ /**
251
+ * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline.
252
+ * If `name` is provided, removes only the named mark.
253
+ * @since v8.5.0
254
+ */
255
+ clearMarks(name?: string): void;
256
+ /**
257
+ * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline.
258
+ * If `name` is provided, removes only the named measure.
259
+ * @since v16.7.0
260
+ */
261
+ clearMeasures(name?: string): void;
262
+ /**
263
+ * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline.
264
+ * If `name` is provided, removes only the named resource.
265
+ * @since v18.2.0, v16.17.0
266
+ */
267
+ clearResourceTimings(name?: string): void;
268
+ /**
269
+ * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
270
+ * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
271
+ * No other CPU idle time is taken into consideration.
272
+ */
273
+ eventLoopUtilization: EventLoopUtilityFunction;
274
+ /**
275
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
276
+ * If you are only interested in performance entries of certain types or that have certain names, see
277
+ * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
278
+ * @since v16.7.0
279
+ */
280
+ getEntries(): PerformanceEntry[];
281
+ /**
282
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
283
+ * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
284
+ * @param name
285
+ * @param type
286
+ * @since v16.7.0
287
+ */
288
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
289
+ /**
290
+ * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
291
+ * whose `performanceEntry.entryType` is equal to `type`.
292
+ * @param type
293
+ * @since v16.7.0
294
+ */
295
+ getEntriesByType(type: EntryType): PerformanceEntry[];
296
+ /**
297
+ * Creates a new `PerformanceMark` entry in the Performance Timeline.
298
+ * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`,
299
+ * and whose `performanceEntry.duration` is always `0`.
300
+ * Performance marks are used to mark specific significant moments in the Performance Timeline.
301
+ *
302
+ * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with
303
+ * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is
304
+ * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`.
305
+ * @param name
306
+ */
307
+ mark(name: string, options?: MarkOptions): PerformanceMark;
308
+ /**
309
+ * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
310
+ * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
311
+ * Performance resources are used to mark moments in the Resource Timeline.
312
+ * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
313
+ * @param requestedUrl The resource url
314
+ * @param initiatorType The initiator name, e.g: 'fetch'
315
+ * @param global
316
+ * @param cacheMode The cache mode must be an empty string ('') or 'local'
317
+ * @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
318
+ * @param responseStatus The response's status code
319
+ * @param deliveryType The delivery type. Default: ''.
320
+ * @since v18.2.0, v16.17.0
321
+ */
322
+ markResourceTiming(
323
+ timingInfo: object,
324
+ requestedUrl: string,
325
+ initiatorType: string,
326
+ global: object,
327
+ cacheMode: "" | "local",
328
+ bodyInfo: object,
329
+ responseStatus: number,
330
+ deliveryType?: string,
331
+ ): PerformanceResourceTiming;
332
+ /**
333
+ * Creates a new PerformanceMeasure entry in the Performance Timeline.
334
+ * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
335
+ * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
336
+ *
337
+ * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
338
+ * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
339
+ * then startMark is set to timeOrigin by default.
340
+ *
341
+ * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
342
+ * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
343
+ * @param name
344
+ * @param startMark
345
+ * @param endMark
346
+ * @return The PerformanceMeasure entry that was created
347
+ */
348
+ measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
349
+ measure(name: string, options: MeasureOptions): PerformanceMeasure;
350
+ /**
351
+ * _This property is an extension by Node.js. It is not available in Web browsers._
352
+ *
353
+ * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones.
354
+ * @since v8.5.0
355
+ */
356
+ readonly nodeTiming: PerformanceNodeTiming;
357
+ /**
358
+ * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process.
359
+ * @since v8.5.0
360
+ */
361
+ now(): number;
362
+ /**
363
+ * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
364
+ *
365
+ * By default the max buffer size is set to 250.
366
+ * @since v18.8.0
367
+ */
368
+ setResourceTimingBufferSize(maxSize: number): void;
369
+ /**
370
+ * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp
371
+ * at which the current `node` process began, measured in Unix time.
372
+ * @since v8.5.0
373
+ */
374
+ readonly timeOrigin: number;
375
+ /**
376
+ * _This property is an extension by Node.js. It is not available in Web browsers._
377
+ *
378
+ * Wraps a function within a new function that measures the running time of the wrapped function.
379
+ * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
380
+ *
381
+ * ```js
382
+ * import {
383
+ * performance,
384
+ * PerformanceObserver,
385
+ * } from 'node:perf_hooks';
386
+ *
387
+ * function someFunction() {
388
+ * console.log('hello world');
389
+ * }
390
+ *
391
+ * const wrapped = performance.timerify(someFunction);
392
+ *
393
+ * const obs = new PerformanceObserver((list) => {
394
+ * console.log(list.getEntries()[0].duration);
395
+ *
396
+ * performance.clearMarks();
397
+ * performance.clearMeasures();
398
+ * obs.disconnect();
399
+ * });
400
+ * obs.observe({ entryTypes: ['function'] });
401
+ *
402
+ * // A performance timeline entry will be created
403
+ * wrapped();
404
+ * ```
405
+ *
406
+ * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported
407
+ * once the finally handler is invoked.
408
+ * @param fn
409
+ */
410
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
411
+ /**
412
+ * An object which is JSON representation of the performance object. It is similar to
413
+ * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
414
+ * @since v16.1.0
415
+ */
416
+ toJSON(): any;
417
+ }
418
+ class PerformanceObserverEntryList {
419
+ /**
420
+ * Returns a list of `PerformanceEntry` objects in chronological order
421
+ * with respect to `performanceEntry.startTime`.
422
+ *
423
+ * ```js
424
+ * import {
425
+ * performance,
426
+ * PerformanceObserver,
427
+ * } from 'node:perf_hooks';
428
+ *
429
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
430
+ * console.log(perfObserverList.getEntries());
431
+ *
432
+ * * [
433
+ * * PerformanceEntry {
434
+ * * name: 'test',
435
+ * * entryType: 'mark',
436
+ * * startTime: 81.465639,
437
+ * * duration: 0,
438
+ * * detail: null
439
+ * * },
440
+ * * PerformanceEntry {
441
+ * * name: 'meow',
442
+ * * entryType: 'mark',
443
+ * * startTime: 81.860064,
444
+ * * duration: 0,
445
+ * * detail: null
446
+ * * }
447
+ * * ]
448
+ *
449
+ * performance.clearMarks();
450
+ * performance.clearMeasures();
451
+ * observer.disconnect();
452
+ * });
453
+ * obs.observe({ type: 'mark' });
454
+ *
455
+ * performance.mark('test');
456
+ * performance.mark('meow');
457
+ * ```
458
+ * @since v8.5.0
459
+ */
460
+ getEntries(): PerformanceEntry[];
461
+ /**
462
+ * Returns a list of `PerformanceEntry` objects in chronological order
463
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
464
+ * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
465
+ *
466
+ * ```js
467
+ * import {
468
+ * performance,
469
+ * PerformanceObserver,
470
+ * } from 'node:perf_hooks';
471
+ *
472
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
473
+ * console.log(perfObserverList.getEntriesByName('meow'));
474
+ *
475
+ * * [
476
+ * * PerformanceEntry {
477
+ * * name: 'meow',
478
+ * * entryType: 'mark',
479
+ * * startTime: 98.545991,
480
+ * * duration: 0,
481
+ * * detail: null
482
+ * * }
483
+ * * ]
484
+ *
485
+ * console.log(perfObserverList.getEntriesByName('nope')); // []
486
+ *
487
+ * console.log(perfObserverList.getEntriesByName('test', 'mark'));
488
+ *
489
+ * * [
490
+ * * PerformanceEntry {
491
+ * * name: 'test',
492
+ * * entryType: 'mark',
493
+ * * startTime: 63.518931,
494
+ * * duration: 0,
495
+ * * detail: null
496
+ * * }
497
+ * * ]
498
+ *
499
+ * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
500
+ *
501
+ * performance.clearMarks();
502
+ * performance.clearMeasures();
503
+ * observer.disconnect();
504
+ * });
505
+ * obs.observe({ entryTypes: ['mark', 'measure'] });
506
+ *
507
+ * performance.mark('test');
508
+ * performance.mark('meow');
509
+ * ```
510
+ * @since v8.5.0
511
+ */
512
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
513
+ /**
514
+ * Returns a list of `PerformanceEntry` objects in chronological order
515
+ * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
516
+ *
517
+ * ```js
518
+ * import {
519
+ * performance,
520
+ * PerformanceObserver,
521
+ * } from 'node:perf_hooks';
522
+ *
523
+ * const obs = new PerformanceObserver((perfObserverList, observer) => {
524
+ * console.log(perfObserverList.getEntriesByType('mark'));
525
+ *
526
+ * * [
527
+ * * PerformanceEntry {
528
+ * * name: 'test',
529
+ * * entryType: 'mark',
530
+ * * startTime: 55.897834,
531
+ * * duration: 0,
532
+ * * detail: null
533
+ * * },
534
+ * * PerformanceEntry {
535
+ * * name: 'meow',
536
+ * * entryType: 'mark',
537
+ * * startTime: 56.350146,
538
+ * * duration: 0,
539
+ * * detail: null
540
+ * * }
541
+ * * ]
542
+ *
543
+ * performance.clearMarks();
544
+ * performance.clearMeasures();
545
+ * observer.disconnect();
546
+ * });
547
+ * obs.observe({ type: 'mark' });
548
+ *
549
+ * performance.mark('test');
550
+ * performance.mark('meow');
551
+ * ```
552
+ * @since v8.5.0
553
+ */
554
+ getEntriesByType(type: EntryType): PerformanceEntry[];
555
+ }
556
+ type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
557
+ /**
558
+ * @since v8.5.0
559
+ */
560
+ class PerformanceObserver extends AsyncResource {
561
+ constructor(callback: PerformanceObserverCallback);
562
+ /**
563
+ * Disconnects the `PerformanceObserver` instance from all notifications.
564
+ * @since v8.5.0
565
+ */
566
+ disconnect(): void;
567
+ /**
568
+ * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
569
+ *
570
+ * ```js
571
+ * import {
572
+ * performance,
573
+ * PerformanceObserver,
574
+ * } from 'node:perf_hooks';
575
+ *
576
+ * const obs = new PerformanceObserver((list, observer) => {
577
+ * // Called once asynchronously. `list` contains three items.
578
+ * });
579
+ * obs.observe({ type: 'mark' });
580
+ *
581
+ * for (let n = 0; n < 3; n++)
582
+ * performance.mark(`test${n}`);
583
+ * ```
584
+ * @since v8.5.0
585
+ */
586
+ observe(
587
+ options:
588
+ | {
589
+ entryTypes: readonly EntryType[];
590
+ buffered?: boolean | undefined;
591
+ }
592
+ | {
593
+ type: EntryType;
594
+ buffered?: boolean | undefined;
595
+ },
596
+ ): void;
597
+ }
598
+ /**
599
+ * Provides detailed network timing data regarding the loading of an application's resources.
600
+ *
601
+ * The constructor of this class is not exposed to users directly.
602
+ * @since v18.2.0, v16.17.0
603
+ */
604
+ class PerformanceResourceTiming extends PerformanceEntry {
605
+ readonly entryType: "resource";
606
+ protected constructor();
607
+ /**
608
+ * The high resolution millisecond timestamp at immediately before dispatching the `fetch`
609
+ * request. If the resource is not intercepted by a worker the property will always return 0.
610
+ * @since v18.2.0, v16.17.0
611
+ */
612
+ readonly workerStart: number;
613
+ /**
614
+ * The high resolution millisecond timestamp that represents the start time of the fetch which
615
+ * initiates the redirect.
616
+ * @since v18.2.0, v16.17.0
617
+ */
618
+ readonly redirectStart: number;
619
+ /**
620
+ * The high resolution millisecond timestamp that will be created immediately after receiving
621
+ * the last byte of the response of the last redirect.
622
+ * @since v18.2.0, v16.17.0
623
+ */
624
+ readonly redirectEnd: number;
625
+ /**
626
+ * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
627
+ * @since v18.2.0, v16.17.0
628
+ */
629
+ readonly fetchStart: number;
630
+ /**
631
+ * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
632
+ * for the resource.
633
+ * @since v18.2.0, v16.17.0
634
+ */
635
+ readonly domainLookupStart: number;
636
+ /**
637
+ * The high resolution millisecond timestamp representing the time immediately after the Node.js finished
638
+ * the domain name lookup for the resource.
639
+ * @since v18.2.0, v16.17.0
640
+ */
641
+ readonly domainLookupEnd: number;
642
+ /**
643
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts to
644
+ * establish the connection to the server to retrieve the resource.
645
+ * @since v18.2.0, v16.17.0
646
+ */
647
+ readonly connectStart: number;
648
+ /**
649
+ * The high resolution millisecond timestamp representing the time immediately after Node.js finishes
650
+ * establishing the connection to the server to retrieve the resource.
651
+ * @since v18.2.0, v16.17.0
652
+ */
653
+ readonly connectEnd: number;
654
+ /**
655
+ * The high resolution millisecond timestamp representing the time immediately before Node.js starts the
656
+ * handshake process to secure the current connection.
657
+ * @since v18.2.0, v16.17.0
658
+ */
659
+ readonly secureConnectionStart: number;
660
+ /**
661
+ * The high resolution millisecond timestamp representing the time immediately before Node.js receives the
662
+ * first byte of the response from the server.
663
+ * @since v18.2.0, v16.17.0
664
+ */
665
+ readonly requestStart: number;
666
+ /**
667
+ * The high resolution millisecond timestamp representing the time immediately after Node.js receives the
668
+ * last byte of the resource or immediately before the transport connection is closed, whichever comes first.
669
+ * @since v18.2.0, v16.17.0
670
+ */
671
+ readonly responseEnd: number;
672
+ /**
673
+ * A number representing the size (in octets) of the fetched resource. The size includes the response header
674
+ * fields plus the response payload body.
675
+ * @since v18.2.0, v16.17.0
676
+ */
677
+ readonly transferSize: number;
678
+ /**
679
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
680
+ * removing any applied content-codings.
681
+ * @since v18.2.0, v16.17.0
682
+ */
683
+ readonly encodedBodySize: number;
684
+ /**
685
+ * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
686
+ * removing any applied content-codings.
687
+ * @since v18.2.0, v16.17.0
688
+ */
689
+ readonly decodedBodySize: number;
690
+ /**
691
+ * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
692
+ * @since v18.2.0, v16.17.0
693
+ */
694
+ toJSON(): any;
695
+ }
696
+ namespace constants {
697
+ const NODE_PERFORMANCE_GC_MAJOR: number;
698
+ const NODE_PERFORMANCE_GC_MINOR: number;
699
+ const NODE_PERFORMANCE_GC_INCREMENTAL: number;
700
+ const NODE_PERFORMANCE_GC_WEAKCB: number;
701
+ const NODE_PERFORMANCE_GC_FLAGS_NO: number;
702
+ const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
703
+ const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
704
+ const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
705
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
706
+ const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
707
+ const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
708
+ }
709
+ const performance: Performance;
710
+ interface EventLoopMonitorOptions {
711
+ /**
712
+ * The sampling rate in milliseconds.
713
+ * Must be greater than zero.
714
+ * @default 10
715
+ */
716
+ resolution?: number | undefined;
717
+ }
718
+ interface Histogram {
719
+ /**
720
+ * The number of samples recorded by the histogram.
721
+ * @since v17.4.0, v16.14.0
722
+ */
723
+ readonly count: number;
724
+ /**
725
+ * The number of samples recorded by the histogram.
726
+ * v17.4.0, v16.14.0
727
+ */
728
+ readonly countBigInt: bigint;
729
+ /**
730
+ * The number of times the event loop delay exceeded the maximum 1 hour event
731
+ * loop delay threshold.
732
+ * @since v11.10.0
733
+ */
734
+ readonly exceeds: number;
735
+ /**
736
+ * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold.
737
+ * @since v17.4.0, v16.14.0
738
+ */
739
+ readonly exceedsBigInt: bigint;
740
+ /**
741
+ * The maximum recorded event loop delay.
742
+ * @since v11.10.0
743
+ */
744
+ readonly max: number;
745
+ /**
746
+ * The maximum recorded event loop delay.
747
+ * v17.4.0, v16.14.0
748
+ */
749
+ readonly maxBigInt: number;
750
+ /**
751
+ * The mean of the recorded event loop delays.
752
+ * @since v11.10.0
753
+ */
754
+ readonly mean: number;
755
+ /**
756
+ * The minimum recorded event loop delay.
757
+ * @since v11.10.0
758
+ */
759
+ readonly min: number;
760
+ /**
761
+ * The minimum recorded event loop delay.
762
+ * v17.4.0, v16.14.0
763
+ */
764
+ readonly minBigInt: bigint;
765
+ /**
766
+ * Returns the value at the given percentile.
767
+ * @since v11.10.0
768
+ * @param percentile A percentile value in the range (0, 100].
769
+ */
770
+ percentile(percentile: number): number;
771
+ /**
772
+ * Returns the value at the given percentile.
773
+ * @since v17.4.0, v16.14.0
774
+ * @param percentile A percentile value in the range (0, 100].
775
+ */
776
+ percentileBigInt(percentile: number): bigint;
777
+ /**
778
+ * Returns a `Map` object detailing the accumulated percentile distribution.
779
+ * @since v11.10.0
780
+ */
781
+ readonly percentiles: Map<number, number>;
782
+ /**
783
+ * Returns a `Map` object detailing the accumulated percentile distribution.
784
+ * @since v17.4.0, v16.14.0
785
+ */
786
+ readonly percentilesBigInt: Map<bigint, bigint>;
787
+ /**
788
+ * Resets the collected histogram data.
789
+ * @since v11.10.0
790
+ */
791
+ reset(): void;
792
+ /**
793
+ * The standard deviation of the recorded event loop delays.
794
+ * @since v11.10.0
795
+ */
796
+ readonly stddev: number;
797
+ }
798
+ interface IntervalHistogram extends Histogram {
799
+ /**
800
+ * Enables the update interval timer. Returns `true` if the timer was
801
+ * started, `false` if it was already started.
802
+ * @since v11.10.0
803
+ */
804
+ enable(): boolean;
805
+ /**
806
+ * Disables the update interval timer. Returns `true` if the timer was
807
+ * stopped, `false` if it was already stopped.
808
+ * @since v11.10.0
809
+ */
810
+ disable(): boolean;
811
+ }
812
+ interface RecordableHistogram extends Histogram {
813
+ /**
814
+ * @since v15.9.0, v14.18.0
815
+ * @param val The amount to record in the histogram.
816
+ */
817
+ record(val: number | bigint): void;
818
+ /**
819
+ * Calculates the amount of time (in nanoseconds) that has passed since the
820
+ * previous call to `recordDelta()` and records that amount in the histogram.
821
+ * @since v15.9.0, v14.18.0
822
+ */
823
+ recordDelta(): void;
824
+ /**
825
+ * Adds the values from `other` to this histogram.
826
+ * @since v17.4.0, v16.14.0
827
+ */
828
+ add(other: RecordableHistogram): void;
829
+ }
830
+ /**
831
+ * _This property is an extension by Node.js. It is not available in Web browsers._
832
+ *
833
+ * Creates an `IntervalHistogram` object that samples and reports the event loop
834
+ * delay over time. The delays will be reported in nanoseconds.
835
+ *
836
+ * Using a timer to detect approximate event loop delay works because the
837
+ * execution of timers is tied specifically to the lifecycle of the libuv
838
+ * event loop. That is, a delay in the loop will cause a delay in the execution
839
+ * of the timer, and those delays are specifically what this API is intended to
840
+ * detect.
841
+ *
842
+ * ```js
843
+ * import { monitorEventLoopDelay } from 'node:perf_hooks';
844
+ * const h = monitorEventLoopDelay({ resolution: 20 });
845
+ * h.enable();
846
+ * // Do something.
847
+ * h.disable();
848
+ * console.log(h.min);
849
+ * console.log(h.max);
850
+ * console.log(h.mean);
851
+ * console.log(h.stddev);
852
+ * console.log(h.percentiles);
853
+ * console.log(h.percentile(50));
854
+ * console.log(h.percentile(99));
855
+ * ```
856
+ * @since v11.10.0
857
+ */
858
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
859
+ interface CreateHistogramOptions {
860
+ /**
861
+ * The minimum recordable value. Must be an integer value greater than 0.
862
+ * @default 1
863
+ */
864
+ min?: number | bigint | undefined;
865
+ /**
866
+ * The maximum recordable value. Must be an integer value greater than min.
867
+ * @default Number.MAX_SAFE_INTEGER
868
+ */
869
+ max?: number | bigint | undefined;
870
+ /**
871
+ * The number of accuracy digits. Must be a number between 1 and 5.
872
+ * @default 3
873
+ */
874
+ figures?: number | undefined;
875
+ }
876
+ /**
877
+ * Returns a `RecordableHistogram`.
878
+ * @since v15.9.0, v14.18.0
879
+ */
880
+ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
881
+ import {
882
+ performance as _performance,
883
+ PerformanceEntry as _PerformanceEntry,
884
+ PerformanceMark as _PerformanceMark,
885
+ PerformanceMeasure as _PerformanceMeasure,
886
+ PerformanceObserver as _PerformanceObserver,
887
+ PerformanceObserverEntryList as _PerformanceObserverEntryList,
888
+ PerformanceResourceTiming as _PerformanceResourceTiming,
889
+ } from "perf_hooks";
890
+ global {
891
+ /**
892
+ * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
893
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry
894
+ * @since v19.0.0
895
+ */
896
+ var PerformanceEntry: typeof globalThis extends {
897
+ onmessage: any;
898
+ PerformanceEntry: infer T;
899
+ } ? T
900
+ : typeof _PerformanceEntry;
901
+ /**
902
+ * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
903
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark
904
+ * @since v19.0.0
905
+ */
906
+ var PerformanceMark: typeof globalThis extends {
907
+ onmessage: any;
908
+ PerformanceMark: infer T;
909
+ } ? T
910
+ : typeof _PerformanceMark;
911
+ /**
912
+ * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
913
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure
914
+ * @since v19.0.0
915
+ */
916
+ var PerformanceMeasure: typeof globalThis extends {
917
+ onmessage: any;
918
+ PerformanceMeasure: infer T;
919
+ } ? T
920
+ : typeof _PerformanceMeasure;
921
+ /**
922
+ * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
923
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver
924
+ * @since v19.0.0
925
+ */
926
+ var PerformanceObserver: typeof globalThis extends {
927
+ onmessage: any;
928
+ PerformanceObserver: infer T;
929
+ } ? T
930
+ : typeof _PerformanceObserver;
931
+ /**
932
+ * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
933
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist
934
+ * @since v19.0.0
935
+ */
936
+ var PerformanceObserverEntryList: typeof globalThis extends {
937
+ onmessage: any;
938
+ PerformanceObserverEntryList: infer T;
939
+ } ? T
940
+ : typeof _PerformanceObserverEntryList;
941
+ /**
942
+ * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
943
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming
944
+ * @since v19.0.0
945
+ */
946
+ var PerformanceResourceTiming: typeof globalThis extends {
947
+ onmessage: any;
948
+ PerformanceResourceTiming: infer T;
949
+ } ? T
950
+ : typeof _PerformanceResourceTiming;
951
+ /**
952
+ * `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
953
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance
954
+ * @since v16.0.0
955
+ */
956
+ var performance: typeof globalThis extends {
957
+ onmessage: any;
958
+ performance: infer T;
959
+ } ? T
960
+ : typeof _performance;
961
+ }
962
+ }
963
+ declare module "node:perf_hooks" {
964
+ export * from "perf_hooks";
965
+ }