@nocobase/plugin-multi-app-manager 1.2.12-alpha → 1.3.0-alpha.20240710084543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/package.json +2 -2
  2. package/dist/client/AppManager.d.ts +0 -10
  3. package/dist/client/AppNameInput.d.ts +0 -10
  4. package/dist/client/MultiAppManagerProvider.d.ts +0 -10
  5. package/dist/client/MultiAppManagerProvider.style.d.ts +0 -13
  6. package/dist/client/Settings.d.ts +0 -10
  7. package/dist/client/index.d.ts +0 -14
  8. package/dist/client/index.js +0 -10
  9. package/dist/client/settings/schemas/applications.d.ts +0 -18
  10. package/dist/client/utils.d.ts +0 -12
  11. package/dist/externalVersion.js +0 -25
  12. package/dist/index.d.ts +0 -10
  13. package/dist/index.js +0 -48
  14. package/dist/locale/en-US.json +0 -11
  15. package/dist/locale/es-ES.json +0 -9
  16. package/dist/locale/index.d.ts +0 -9
  17. package/dist/locale/index.js +0 -36
  18. package/dist/locale/ko_KR.json +0 -11
  19. package/dist/locale/pt-BR.json +0 -9
  20. package/dist/locale/zh-CN.json +0 -14
  21. package/dist/node_modules/mariadb/LICENSE +0 -502
  22. package/dist/node_modules/mariadb/callback.js +0 -41
  23. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +0 -278
  24. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  25. package/dist/node_modules/mariadb/lib/cmd/change-user.js +0 -149
  26. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +0 -17
  27. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +0 -102
  28. package/dist/node_modules/mariadb/lib/cmd/command.js +0 -168
  29. package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +0 -327
  30. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  31. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +0 -168
  32. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +0 -23
  33. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +0 -761
  34. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +0 -55
  35. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +0 -58
  36. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +0 -19
  37. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +0 -142
  38. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +0 -74
  39. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  40. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  41. package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +0 -74
  42. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +0 -29
  43. package/dist/node_modules/mariadb/lib/cmd/ping.js +0 -52
  44. package/dist/node_modules/mariadb/lib/cmd/query.js +0 -255
  45. package/dist/node_modules/mariadb/lib/cmd/quit.js +0 -28
  46. package/dist/node_modules/mariadb/lib/cmd/reset.js +0 -54
  47. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  48. package/dist/node_modules/mariadb/lib/cmd/stream.js +0 -45
  49. package/dist/node_modules/mariadb/lib/config/connection-options.js +0 -258
  50. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  51. package/dist/node_modules/mariadb/lib/config/pool-options.js +0 -47
  52. package/dist/node_modules/mariadb/lib/connection-callback.js +0 -160
  53. package/dist/node_modules/mariadb/lib/connection.js +0 -1460
  54. package/dist/node_modules/mariadb/lib/const/capabilities.js +0 -64
  55. package/dist/node_modules/mariadb/lib/const/collations.js +0 -473
  56. package/dist/node_modules/mariadb/lib/const/connection_status.js +0 -13
  57. package/dist/node_modules/mariadb/lib/const/error-code.js +0 -1282
  58. package/dist/node_modules/mariadb/lib/const/field-detail.js +0 -35
  59. package/dist/node_modules/mariadb/lib/const/field-type.js +0 -71
  60. package/dist/node_modules/mariadb/lib/const/server-status.js +0 -30
  61. package/dist/node_modules/mariadb/lib/const/state-change.js +0 -12
  62. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  63. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  64. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +0 -141
  65. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +0 -171
  66. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +0 -193
  67. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +0 -36
  68. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +0 -37
  69. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +0 -502
  70. package/dist/node_modules/mariadb/lib/io/packet.js +0 -515
  71. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  72. package/dist/node_modules/mariadb/lib/misc/connection-information.js +0 -96
  73. package/dist/node_modules/mariadb/lib/misc/errors.js +0 -123
  74. package/dist/node_modules/mariadb/lib/misc/parse.js +0 -1033
  75. package/dist/node_modules/mariadb/lib/misc/utils.js +0 -298
  76. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  77. package/dist/node_modules/mariadb/lib/pool-callback.js +0 -202
  78. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  79. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
  80. package/dist/node_modules/mariadb/lib/pool-promise.js +0 -108
  81. package/dist/node_modules/mariadb/node_modules/@types/node/assert/strict.d.ts +0 -8
  82. package/dist/node_modules/mariadb/node_modules/@types/node/assert.d.ts +0 -912
  83. package/dist/node_modules/mariadb/node_modules/@types/node/async_hooks.d.ts +0 -501
  84. package/dist/node_modules/mariadb/node_modules/@types/node/buffer.d.ts +0 -2232
  85. package/dist/node_modules/mariadb/node_modules/@types/node/child_process.d.ts +0 -1366
  86. package/dist/node_modules/mariadb/node_modules/@types/node/cluster.d.ts +0 -414
  87. package/dist/node_modules/mariadb/node_modules/@types/node/console.d.ts +0 -412
  88. package/dist/node_modules/mariadb/node_modules/@types/node/constants.d.ts +0 -18
  89. package/dist/node_modules/mariadb/node_modules/@types/node/crypto.d.ts +0 -3338
  90. package/dist/node_modules/mariadb/node_modules/@types/node/dgram.d.ts +0 -545
  91. package/dist/node_modules/mariadb/node_modules/@types/node/diagnostics_channel.d.ts +0 -152
  92. package/dist/node_modules/mariadb/node_modules/@types/node/dns/promises.d.ts +0 -370
  93. package/dist/node_modules/mariadb/node_modules/@types/node/dns.d.ts +0 -659
  94. package/dist/node_modules/mariadb/node_modules/@types/node/domain.d.ts +0 -169
  95. package/dist/node_modules/mariadb/node_modules/@types/node/events.d.ts +0 -651
  96. package/dist/node_modules/mariadb/node_modules/@types/node/fs/promises.d.ts +0 -1091
  97. package/dist/node_modules/mariadb/node_modules/@types/node/fs.d.ts +0 -3869
  98. package/dist/node_modules/mariadb/node_modules/@types/node/globals.d.ts +0 -294
  99. package/dist/node_modules/mariadb/node_modules/@types/node/globals.global.d.ts +0 -1
  100. package/dist/node_modules/mariadb/node_modules/@types/node/http.d.ts +0 -1396
  101. package/dist/node_modules/mariadb/node_modules/@types/node/http2.d.ts +0 -2101
  102. package/dist/node_modules/mariadb/node_modules/@types/node/https.d.ts +0 -391
  103. package/dist/node_modules/mariadb/node_modules/@types/node/index.d.ts +0 -129
  104. package/dist/node_modules/mariadb/node_modules/@types/node/inspector.d.ts +0 -2744
  105. package/dist/node_modules/mariadb/node_modules/@types/node/module.d.ts +0 -114
  106. package/dist/node_modules/mariadb/node_modules/@types/node/net.d.ts +0 -791
  107. package/dist/node_modules/mariadb/node_modules/@types/node/os.d.ts +0 -455
  108. package/dist/node_modules/mariadb/node_modules/@types/node/package.json +0 -220
  109. package/dist/node_modules/mariadb/node_modules/@types/node/path.d.ts +0 -180
  110. package/dist/node_modules/mariadb/node_modules/@types/node/perf_hooks.d.ts +0 -557
  111. package/dist/node_modules/mariadb/node_modules/@types/node/process.d.ts +0 -1481
  112. package/dist/node_modules/mariadb/node_modules/@types/node/punycode.d.ts +0 -117
  113. package/dist/node_modules/mariadb/node_modules/@types/node/querystring.d.ts +0 -131
  114. package/dist/node_modules/mariadb/node_modules/@types/node/readline.d.ts +0 -650
  115. package/dist/node_modules/mariadb/node_modules/@types/node/repl.d.ts +0 -424
  116. package/dist/node_modules/mariadb/node_modules/@types/node/stream/consumers.d.ts +0 -24
  117. package/dist/node_modules/mariadb/node_modules/@types/node/stream/promises.d.ts +0 -42
  118. package/dist/node_modules/mariadb/node_modules/@types/node/stream/web.d.ts +0 -330
  119. package/dist/node_modules/mariadb/node_modules/@types/node/stream.d.ts +0 -1249
  120. package/dist/node_modules/mariadb/node_modules/@types/node/string_decoder.d.ts +0 -67
  121. package/dist/node_modules/mariadb/node_modules/@types/node/timers/promises.d.ts +0 -68
  122. package/dist/node_modules/mariadb/node_modules/@types/node/timers.d.ts +0 -94
  123. package/dist/node_modules/mariadb/node_modules/@types/node/tls.d.ts +0 -1020
  124. package/dist/node_modules/mariadb/node_modules/@types/node/trace_events.d.ts +0 -161
  125. package/dist/node_modules/mariadb/node_modules/@types/node/tty.d.ts +0 -204
  126. package/dist/node_modules/mariadb/node_modules/@types/node/url.d.ts +0 -891
  127. package/dist/node_modules/mariadb/node_modules/@types/node/util.d.ts +0 -1594
  128. package/dist/node_modules/mariadb/node_modules/@types/node/v8.d.ts +0 -378
  129. package/dist/node_modules/mariadb/node_modules/@types/node/vm.d.ts +0 -507
  130. package/dist/node_modules/mariadb/node_modules/@types/node/wasi.d.ts +0 -158
  131. package/dist/node_modules/mariadb/node_modules/@types/node/worker_threads.d.ts +0 -649
  132. package/dist/node_modules/mariadb/node_modules/@types/node/zlib.d.ts +0 -517
  133. package/dist/node_modules/mariadb/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  134. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  135. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  136. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  137. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  138. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/modules.xml +0 -8
  139. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  140. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
  141. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
  142. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/index.js +0 -23
  143. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/internal.js +0 -198
  144. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  145. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  146. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
  147. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  148. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  149. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  150. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  151. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  152. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  153. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  154. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  155. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf16.js +0 -197
  156. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf32.js +0 -319
  157. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf7.js +0 -290
  158. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  159. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/index.d.ts +0 -41
  160. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/index.js +0 -180
  161. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/streams.js +0 -109
  162. package/dist/node_modules/mariadb/node_modules/iconv-lite/package.json +0 -44
  163. package/dist/node_modules/mariadb/package.json +0 -1
  164. package/dist/node_modules/mariadb/promise.js +0 -34
  165. package/dist/node_modules/mariadb/types/index.d.ts +0 -870
  166. package/dist/server/collections/applications.d.ts +0 -10
  167. package/dist/server/collections/applications.js +0 -75
  168. package/dist/server/index.d.ts +0 -11
  169. package/dist/server/index.js +0 -40
  170. package/dist/server/models/application.d.ts +0 -18
  171. package/dist/server/models/application.js +0 -50
  172. package/dist/server/server.d.ts +0 -26
  173. package/dist/server/server.js +0 -310
  174. package/dist/swagger/index.d.ts +0 -195
  175. package/dist/swagger/index.js +0 -226
@@ -1,557 +0,0 @@
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
- *
11
- * ```js
12
- * const { PerformanceObserver, performance } = require('perf_hooks');
13
- *
14
- * const obs = new PerformanceObserver((items) => {
15
- * console.log(items.getEntries()[0].duration);
16
- * performance.clearMarks();
17
- * });
18
- * obs.observe({ type: 'measure' });
19
- * performance.measure('Start to Now');
20
- *
21
- * performance.mark('A');
22
- * doSomeLongRunningProcess(() => {
23
- * performance.measure('A to Now', 'A');
24
- *
25
- * performance.mark('B');
26
- * performance.measure('A to B', 'A', 'B');
27
- * });
28
- * ```
29
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/perf_hooks.js)
30
- */
31
- declare module 'perf_hooks' {
32
- import { AsyncResource } from 'node:async_hooks';
33
- type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
34
- interface NodeGCPerformanceDetail {
35
- /**
36
- * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
37
- * the type of garbage collection operation that occurred.
38
- * See perf_hooks.constants for valid values.
39
- */
40
- readonly kind?: number | undefined;
41
- /**
42
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
43
- * property contains additional information about garbage collection operation.
44
- * See perf_hooks.constants for valid values.
45
- */
46
- readonly flags?: number | undefined;
47
- }
48
- /**
49
- * @since v8.5.0
50
- */
51
- class PerformanceEntry {
52
- protected constructor();
53
- /**
54
- * The total number of milliseconds elapsed for this entry. This value will not
55
- * be meaningful for all Performance Entry types.
56
- * @since v8.5.0
57
- */
58
- readonly duration: number;
59
- /**
60
- * The name of the performance entry.
61
- * @since v8.5.0
62
- */
63
- readonly name: string;
64
- /**
65
- * The high resolution millisecond timestamp marking the starting time of the
66
- * Performance Entry.
67
- * @since v8.5.0
68
- */
69
- readonly startTime: number;
70
- /**
71
- * The type of the performance entry. It may be one of:
72
- *
73
- * * `'node'` (Node.js only)
74
- * * `'mark'` (available on the Web)
75
- * * `'measure'` (available on the Web)
76
- * * `'gc'` (Node.js only)
77
- * * `'function'` (Node.js only)
78
- * * `'http2'` (Node.js only)
79
- * * `'http'` (Node.js only)
80
- * @since v8.5.0
81
- */
82
- readonly entryType: EntryType;
83
- /**
84
- * Additional detail specific to the `entryType`.
85
- * @since v16.0.0
86
- */
87
- readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
88
- }
89
- /**
90
- * _This property is an extension by Node.js. It is not available in Web browsers._
91
- *
92
- * Provides timing details for Node.js itself. The constructor of this class
93
- * is not exposed to users.
94
- * @since v8.5.0
95
- */
96
- class PerformanceNodeTiming extends PerformanceEntry {
97
- /**
98
- * The high resolution millisecond timestamp at which the Node.js process
99
- * completed bootstrapping. If bootstrapping has not yet finished, the property
100
- * has the value of -1.
101
- * @since v8.5.0
102
- */
103
- readonly bootstrapComplete: number;
104
- /**
105
- * The high resolution millisecond timestamp at which the Node.js environment was
106
- * initialized.
107
- * @since v8.5.0
108
- */
109
- readonly environment: number;
110
- /**
111
- * The high resolution millisecond timestamp of the amount of time the event loop
112
- * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
113
- * does not take CPU usage into consideration. If the event loop has not yet
114
- * started (e.g., in the first tick of the main script), the property has the
115
- * value of 0.
116
- * @since v14.10.0, v12.19.0
117
- */
118
- readonly idleTime: number;
119
- /**
120
- * The high resolution millisecond timestamp at which the Node.js event loop
121
- * exited. If the event loop has not yet exited, the property has the value of -1\.
122
- * It can only have a value of not -1 in a handler of the `'exit'` event.
123
- * @since v8.5.0
124
- */
125
- readonly loopExit: number;
126
- /**
127
- * The high resolution millisecond timestamp at which the Node.js event loop
128
- * started. If the event loop has not yet started (e.g., in the first tick of the
129
- * main script), the property has the value of -1.
130
- * @since v8.5.0
131
- */
132
- readonly loopStart: number;
133
- /**
134
- * The high resolution millisecond timestamp at which the V8 platform was
135
- * initialized.
136
- * @since v8.5.0
137
- */
138
- readonly v8Start: number;
139
- }
140
- interface EventLoopUtilization {
141
- idle: number;
142
- active: number;
143
- utilization: number;
144
- }
145
- /**
146
- * @param util1 The result of a previous call to eventLoopUtilization()
147
- * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
148
- */
149
- type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
150
- interface MarkOptions {
151
- /**
152
- * Additional optional detail to include with the mark.
153
- */
154
- detail?: unknown | undefined;
155
- /**
156
- * An optional timestamp to be used as the mark time.
157
- * @default `performance.now()`.
158
- */
159
- startTime?: number | undefined;
160
- }
161
- interface MeasureOptions {
162
- /**
163
- * Additional optional detail to include with the mark.
164
- */
165
- detail?: unknown | undefined;
166
- /**
167
- * Duration between start and end times.
168
- */
169
- duration?: number | undefined;
170
- /**
171
- * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
172
- */
173
- end?: number | string | undefined;
174
- /**
175
- * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
176
- */
177
- start?: number | string | undefined;
178
- }
179
- interface TimerifyOptions {
180
- /**
181
- * A histogram object created using
182
- * `perf_hooks.createHistogram()` that will record runtime durations in
183
- * nanoseconds.
184
- */
185
- histogram?: RecordableHistogram | undefined;
186
- }
187
- interface Performance {
188
- /**
189
- * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
190
- * If name is provided, removes only the named mark.
191
- * @param name
192
- */
193
- clearMarks(name?: string): void;
194
- /**
195
- * Creates a new PerformanceMark entry in the Performance Timeline.
196
- * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
197
- * and whose performanceEntry.duration is always 0.
198
- * Performance marks are used to mark specific significant moments in the Performance Timeline.
199
- * @param name
200
- */
201
- mark(name?: string, options?: MarkOptions): void;
202
- /**
203
- * Creates a new PerformanceMeasure entry in the Performance Timeline.
204
- * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
205
- * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
206
- *
207
- * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
208
- * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
209
- * then startMark is set to timeOrigin by default.
210
- *
211
- * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
212
- * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
213
- * @param name
214
- * @param startMark
215
- * @param endMark
216
- */
217
- measure(name: string, startMark?: string, endMark?: string): void;
218
- measure(name: string, options: MeasureOptions): void;
219
- /**
220
- * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
221
- */
222
- readonly nodeTiming: PerformanceNodeTiming;
223
- /**
224
- * @return the current high resolution millisecond timestamp
225
- */
226
- now(): number;
227
- /**
228
- * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
229
- */
230
- readonly timeOrigin: number;
231
- /**
232
- * Wraps a function within a new function that measures the running time of the wrapped function.
233
- * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
234
- * @param fn
235
- */
236
- timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
237
- /**
238
- * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
239
- * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
240
- * No other CPU idle time is taken into consideration.
241
- */
242
- eventLoopUtilization: EventLoopUtilityFunction;
243
- }
244
- interface PerformanceObserverEntryList {
245
- /**
246
- * Returns a list of `PerformanceEntry` objects in chronological order
247
- * with respect to `performanceEntry.startTime`.
248
- *
249
- * ```js
250
- * const {
251
- * performance,
252
- * PerformanceObserver
253
- * } = require('perf_hooks');
254
- *
255
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
256
- * console.log(perfObserverList.getEntries());
257
- *
258
- * * [
259
- * * PerformanceEntry {
260
- * * name: 'test',
261
- * * entryType: 'mark',
262
- * * startTime: 81.465639,
263
- * * duration: 0
264
- * * },
265
- * * PerformanceEntry {
266
- * * name: 'meow',
267
- * * entryType: 'mark',
268
- * * startTime: 81.860064,
269
- * * duration: 0
270
- * * }
271
- * * ]
272
- *
273
- * observer.disconnect();
274
- * });
275
- * obs.observe({ type: 'mark' });
276
- *
277
- * performance.mark('test');
278
- * performance.mark('meow');
279
- * ```
280
- * @since v8.5.0
281
- */
282
- getEntries(): PerformanceEntry[];
283
- /**
284
- * Returns a list of `PerformanceEntry` objects in chronological order
285
- * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
286
- * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
287
- *
288
- * ```js
289
- * const {
290
- * performance,
291
- * PerformanceObserver
292
- * } = require('perf_hooks');
293
- *
294
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
295
- * console.log(perfObserverList.getEntriesByName('meow'));
296
- *
297
- * * [
298
- * * PerformanceEntry {
299
- * * name: 'meow',
300
- * * entryType: 'mark',
301
- * * startTime: 98.545991,
302
- * * duration: 0
303
- * * }
304
- * * ]
305
- *
306
- * console.log(perfObserverList.getEntriesByName('nope')); // []
307
- *
308
- * console.log(perfObserverList.getEntriesByName('test', 'mark'));
309
- *
310
- * * [
311
- * * PerformanceEntry {
312
- * * name: 'test',
313
- * * entryType: 'mark',
314
- * * startTime: 63.518931,
315
- * * duration: 0
316
- * * }
317
- * * ]
318
- *
319
- * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
320
- * observer.disconnect();
321
- * });
322
- * obs.observe({ entryTypes: ['mark', 'measure'] });
323
- *
324
- * performance.mark('test');
325
- * performance.mark('meow');
326
- * ```
327
- * @since v8.5.0
328
- */
329
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
330
- /**
331
- * Returns a list of `PerformanceEntry` objects in chronological order
332
- * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
333
- *
334
- * ```js
335
- * const {
336
- * performance,
337
- * PerformanceObserver
338
- * } = require('perf_hooks');
339
- *
340
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
341
- * console.log(perfObserverList.getEntriesByType('mark'));
342
- *
343
- * * [
344
- * * PerformanceEntry {
345
- * * name: 'test',
346
- * * entryType: 'mark',
347
- * * startTime: 55.897834,
348
- * * duration: 0
349
- * * },
350
- * * PerformanceEntry {
351
- * * name: 'meow',
352
- * * entryType: 'mark',
353
- * * startTime: 56.350146,
354
- * * duration: 0
355
- * * }
356
- * * ]
357
- *
358
- * observer.disconnect();
359
- * });
360
- * obs.observe({ type: 'mark' });
361
- *
362
- * performance.mark('test');
363
- * performance.mark('meow');
364
- * ```
365
- * @since v8.5.0
366
- */
367
- getEntriesByType(type: EntryType): PerformanceEntry[];
368
- }
369
- type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
370
- class PerformanceObserver extends AsyncResource {
371
- constructor(callback: PerformanceObserverCallback);
372
- /**
373
- * Disconnects the `PerformanceObserver` instance from all notifications.
374
- * @since v8.5.0
375
- */
376
- disconnect(): void;
377
- /**
378
- * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`:
379
- *
380
- * ```js
381
- * const {
382
- * performance,
383
- * PerformanceObserver
384
- * } = require('perf_hooks');
385
- *
386
- * const obs = new PerformanceObserver((list, observer) => {
387
- * // Called three times synchronously. `list` contains one item.
388
- * });
389
- * obs.observe({ type: 'mark' });
390
- *
391
- * for (let n = 0; n < 3; n++)
392
- * performance.mark(`test${n}`);
393
- * ```
394
- * @since v8.5.0
395
- */
396
- observe(
397
- options:
398
- | {
399
- entryTypes: ReadonlyArray<EntryType>;
400
- buffered?: boolean | undefined;
401
- }
402
- | {
403
- type: EntryType;
404
- buffered?: boolean | undefined;
405
- }
406
- ): void;
407
- }
408
- namespace constants {
409
- const NODE_PERFORMANCE_GC_MAJOR: number;
410
- const NODE_PERFORMANCE_GC_MINOR: number;
411
- const NODE_PERFORMANCE_GC_INCREMENTAL: number;
412
- const NODE_PERFORMANCE_GC_WEAKCB: number;
413
- const NODE_PERFORMANCE_GC_FLAGS_NO: number;
414
- const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
415
- const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
416
- const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
417
- const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
418
- const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
419
- const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
420
- }
421
- const performance: Performance;
422
- interface EventLoopMonitorOptions {
423
- /**
424
- * The sampling rate in milliseconds.
425
- * Must be greater than zero.
426
- * @default 10
427
- */
428
- resolution?: number | undefined;
429
- }
430
- interface Histogram {
431
- /**
432
- * Returns a `Map` object detailing the accumulated percentile distribution.
433
- * @since v11.10.0
434
- */
435
- readonly percentiles: Map<number, number>;
436
- /**
437
- * The number of times the event loop delay exceeded the maximum 1 hour event
438
- * loop delay threshold.
439
- * @since v11.10.0
440
- */
441
- readonly exceeds: number;
442
- /**
443
- * The minimum recorded event loop delay.
444
- * @since v11.10.0
445
- */
446
- readonly min: number;
447
- /**
448
- * The maximum recorded event loop delay.
449
- * @since v11.10.0
450
- */
451
- readonly max: number;
452
- /**
453
- * The mean of the recorded event loop delays.
454
- * @since v11.10.0
455
- */
456
- readonly mean: number;
457
- /**
458
- * The standard deviation of the recorded event loop delays.
459
- * @since v11.10.0
460
- */
461
- readonly stddev: number;
462
- /**
463
- * Resets the collected histogram data.
464
- * @since v11.10.0
465
- */
466
- reset(): void;
467
- /**
468
- * Returns the value at the given percentile.
469
- * @since v11.10.0
470
- * @param percentile A percentile value in the range (0, 100].
471
- */
472
- percentile(percentile: number): number;
473
- }
474
- interface IntervalHistogram extends Histogram {
475
- /**
476
- * Enables the update interval timer. Returns `true` if the timer was
477
- * started, `false` if it was already started.
478
- * @since v11.10.0
479
- */
480
- enable(): boolean;
481
- /**
482
- * Disables the update interval timer. Returns `true` if the timer was
483
- * stopped, `false` if it was already stopped.
484
- * @since v11.10.0
485
- */
486
- disable(): boolean;
487
- }
488
- interface RecordableHistogram extends Histogram {
489
- /**
490
- * @since v15.9.0, v14.18.0
491
- * @param val The amount to record in the histogram.
492
- */
493
- record(val: number | bigint): void;
494
- /**
495
- * Calculates the amount of time (in nanoseconds) that has passed since the
496
- * previous call to `recordDelta()` and records that amount in the histogram.
497
- *
498
- * ## Examples
499
- * @since v15.9.0, v14.18.0
500
- */
501
- recordDelta(): void;
502
- }
503
- /**
504
- * _This property is an extension by Node.js. It is not available in Web browsers._
505
- *
506
- * Creates an `IntervalHistogram` object that samples and reports the event loop
507
- * delay over time. The delays will be reported in nanoseconds.
508
- *
509
- * Using a timer to detect approximate event loop delay works because the
510
- * execution of timers is tied specifically to the lifecycle of the libuv
511
- * event loop. That is, a delay in the loop will cause a delay in the execution
512
- * of the timer, and those delays are specifically what this API is intended to
513
- * detect.
514
- *
515
- * ```js
516
- * const { monitorEventLoopDelay } = require('perf_hooks');
517
- * const h = monitorEventLoopDelay({ resolution: 20 });
518
- * h.enable();
519
- * // Do something.
520
- * h.disable();
521
- * console.log(h.min);
522
- * console.log(h.max);
523
- * console.log(h.mean);
524
- * console.log(h.stddev);
525
- * console.log(h.percentiles);
526
- * console.log(h.percentile(50));
527
- * console.log(h.percentile(99));
528
- * ```
529
- * @since v11.10.0
530
- */
531
- function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
532
- interface CreateHistogramOptions {
533
- /**
534
- * The minimum recordable value. Must be an integer value greater than 0.
535
- * @default 1
536
- */
537
- min?: number | bigint | undefined;
538
- /**
539
- * The maximum recordable value. Must be an integer value greater than min.
540
- * @default Number.MAX_SAFE_INTEGER
541
- */
542
- max?: number | bigint | undefined;
543
- /**
544
- * The number of accuracy digits. Must be a number between 1 and 5.
545
- * @default 3
546
- */
547
- figures?: number | undefined;
548
- }
549
- /**
550
- * Returns a `RecordableHistogram`.
551
- * @since v15.9.0, v14.18.0
552
- */
553
- function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
554
- }
555
- declare module 'node:perf_hooks' {
556
- export * from 'perf_hooks';
557
- }