alicezetion 1.9.6 → 1.9.8

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