@nocobase/plugin-multi-app-manager 2.0.0-beta.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/client/{db3a142b120d6553.js → 00b71fff3c8c7167.js} +1 -1
  2. package/dist/client/Migrate.d.ts +10 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/externalVersion.js +7 -7
  5. package/dist/locale/en-US.json +3 -2
  6. package/dist/locale/zh-CN.json +3 -2
  7. package/dist/node_modules/p-queue/dist/index.d.ts +101 -0
  8. package/dist/node_modules/p-queue/dist/index.js +1 -0
  9. package/dist/node_modules/p-queue/dist/lower-bound.d.ts +1 -0
  10. package/dist/node_modules/p-queue/dist/lower-bound.js +21 -0
  11. package/dist/node_modules/p-queue/dist/options.d.ts +64 -0
  12. package/dist/node_modules/p-queue/dist/options.js +2 -0
  13. package/dist/node_modules/p-queue/dist/priority-queue.d.ts +12 -0
  14. package/dist/node_modules/p-queue/dist/priority-queue.js +32 -0
  15. package/dist/node_modules/p-queue/dist/queue.d.ts +7 -0
  16. package/dist/node_modules/p-queue/dist/queue.js +2 -0
  17. package/dist/node_modules/p-queue/license +9 -0
  18. package/dist/node_modules/p-queue/node_modules/eventemitter3/index.d.ts +134 -0
  19. package/dist/node_modules/p-queue/node_modules/eventemitter3/index.js +336 -0
  20. package/dist/node_modules/p-queue/node_modules/eventemitter3/package.json +56 -0
  21. package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
  22. package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
  23. package/dist/node_modules/p-queue/package.json +1 -0
  24. package/dist/server/adapters/legacy-adapter.d.ts +43 -0
  25. package/dist/server/adapters/legacy-adapter.js +207 -0
  26. package/dist/server/server.d.ts +4 -6
  27. package/dist/server/server.js +38 -191
  28. package/package.json +2 -2
  29. package/dist/node_modules/mariadb/LICENSE +0 -502
  30. package/dist/node_modules/mariadb/callback.js +0 -41
  31. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +0 -278
  32. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  33. package/dist/node_modules/mariadb/lib/cmd/change-user.js +0 -149
  34. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +0 -17
  35. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +0 -102
  36. package/dist/node_modules/mariadb/lib/cmd/command.js +0 -168
  37. package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +0 -327
  38. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  39. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +0 -168
  40. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +0 -23
  41. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +0 -761
  42. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +0 -55
  43. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +0 -58
  44. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +0 -19
  45. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +0 -142
  46. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +0 -74
  47. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  48. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  49. package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +0 -74
  50. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +0 -29
  51. package/dist/node_modules/mariadb/lib/cmd/ping.js +0 -52
  52. package/dist/node_modules/mariadb/lib/cmd/query.js +0 -255
  53. package/dist/node_modules/mariadb/lib/cmd/quit.js +0 -28
  54. package/dist/node_modules/mariadb/lib/cmd/reset.js +0 -54
  55. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  56. package/dist/node_modules/mariadb/lib/cmd/stream.js +0 -45
  57. package/dist/node_modules/mariadb/lib/config/connection-options.js +0 -258
  58. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  59. package/dist/node_modules/mariadb/lib/config/pool-options.js +0 -47
  60. package/dist/node_modules/mariadb/lib/connection-callback.js +0 -160
  61. package/dist/node_modules/mariadb/lib/connection.js +0 -1460
  62. package/dist/node_modules/mariadb/lib/const/capabilities.js +0 -64
  63. package/dist/node_modules/mariadb/lib/const/collations.js +0 -473
  64. package/dist/node_modules/mariadb/lib/const/connection_status.js +0 -13
  65. package/dist/node_modules/mariadb/lib/const/error-code.js +0 -1282
  66. package/dist/node_modules/mariadb/lib/const/field-detail.js +0 -35
  67. package/dist/node_modules/mariadb/lib/const/field-type.js +0 -71
  68. package/dist/node_modules/mariadb/lib/const/server-status.js +0 -30
  69. package/dist/node_modules/mariadb/lib/const/state-change.js +0 -12
  70. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  71. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  72. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +0 -141
  73. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +0 -171
  74. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +0 -193
  75. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +0 -36
  76. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +0 -37
  77. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +0 -502
  78. package/dist/node_modules/mariadb/lib/io/packet.js +0 -515
  79. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  80. package/dist/node_modules/mariadb/lib/misc/connection-information.js +0 -96
  81. package/dist/node_modules/mariadb/lib/misc/errors.js +0 -123
  82. package/dist/node_modules/mariadb/lib/misc/parse.js +0 -1033
  83. package/dist/node_modules/mariadb/lib/misc/utils.js +0 -298
  84. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  85. package/dist/node_modules/mariadb/lib/pool-callback.js +0 -202
  86. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  87. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
  88. package/dist/node_modules/mariadb/lib/pool-promise.js +0 -108
  89. package/dist/node_modules/mariadb/node_modules/@types/node/assert/strict.d.ts +0 -8
  90. package/dist/node_modules/mariadb/node_modules/@types/node/assert.d.ts +0 -912
  91. package/dist/node_modules/mariadb/node_modules/@types/node/async_hooks.d.ts +0 -501
  92. package/dist/node_modules/mariadb/node_modules/@types/node/buffer.d.ts +0 -2232
  93. package/dist/node_modules/mariadb/node_modules/@types/node/child_process.d.ts +0 -1366
  94. package/dist/node_modules/mariadb/node_modules/@types/node/cluster.d.ts +0 -414
  95. package/dist/node_modules/mariadb/node_modules/@types/node/console.d.ts +0 -412
  96. package/dist/node_modules/mariadb/node_modules/@types/node/constants.d.ts +0 -18
  97. package/dist/node_modules/mariadb/node_modules/@types/node/crypto.d.ts +0 -3338
  98. package/dist/node_modules/mariadb/node_modules/@types/node/dgram.d.ts +0 -545
  99. package/dist/node_modules/mariadb/node_modules/@types/node/diagnostics_channel.d.ts +0 -152
  100. package/dist/node_modules/mariadb/node_modules/@types/node/dns/promises.d.ts +0 -370
  101. package/dist/node_modules/mariadb/node_modules/@types/node/dns.d.ts +0 -659
  102. package/dist/node_modules/mariadb/node_modules/@types/node/domain.d.ts +0 -169
  103. package/dist/node_modules/mariadb/node_modules/@types/node/events.d.ts +0 -651
  104. package/dist/node_modules/mariadb/node_modules/@types/node/fs/promises.d.ts +0 -1091
  105. package/dist/node_modules/mariadb/node_modules/@types/node/fs.d.ts +0 -3869
  106. package/dist/node_modules/mariadb/node_modules/@types/node/globals.d.ts +0 -294
  107. package/dist/node_modules/mariadb/node_modules/@types/node/globals.global.d.ts +0 -1
  108. package/dist/node_modules/mariadb/node_modules/@types/node/http.d.ts +0 -1396
  109. package/dist/node_modules/mariadb/node_modules/@types/node/http2.d.ts +0 -2101
  110. package/dist/node_modules/mariadb/node_modules/@types/node/https.d.ts +0 -391
  111. package/dist/node_modules/mariadb/node_modules/@types/node/index.d.ts +0 -129
  112. package/dist/node_modules/mariadb/node_modules/@types/node/inspector.d.ts +0 -2744
  113. package/dist/node_modules/mariadb/node_modules/@types/node/module.d.ts +0 -114
  114. package/dist/node_modules/mariadb/node_modules/@types/node/net.d.ts +0 -791
  115. package/dist/node_modules/mariadb/node_modules/@types/node/os.d.ts +0 -455
  116. package/dist/node_modules/mariadb/node_modules/@types/node/package.json +0 -220
  117. package/dist/node_modules/mariadb/node_modules/@types/node/path.d.ts +0 -180
  118. package/dist/node_modules/mariadb/node_modules/@types/node/perf_hooks.d.ts +0 -557
  119. package/dist/node_modules/mariadb/node_modules/@types/node/process.d.ts +0 -1481
  120. package/dist/node_modules/mariadb/node_modules/@types/node/punycode.d.ts +0 -117
  121. package/dist/node_modules/mariadb/node_modules/@types/node/querystring.d.ts +0 -131
  122. package/dist/node_modules/mariadb/node_modules/@types/node/readline.d.ts +0 -650
  123. package/dist/node_modules/mariadb/node_modules/@types/node/repl.d.ts +0 -424
  124. package/dist/node_modules/mariadb/node_modules/@types/node/stream/consumers.d.ts +0 -24
  125. package/dist/node_modules/mariadb/node_modules/@types/node/stream/promises.d.ts +0 -42
  126. package/dist/node_modules/mariadb/node_modules/@types/node/stream/web.d.ts +0 -330
  127. package/dist/node_modules/mariadb/node_modules/@types/node/stream.d.ts +0 -1249
  128. package/dist/node_modules/mariadb/node_modules/@types/node/string_decoder.d.ts +0 -67
  129. package/dist/node_modules/mariadb/node_modules/@types/node/timers/promises.d.ts +0 -68
  130. package/dist/node_modules/mariadb/node_modules/@types/node/timers.d.ts +0 -94
  131. package/dist/node_modules/mariadb/node_modules/@types/node/tls.d.ts +0 -1020
  132. package/dist/node_modules/mariadb/node_modules/@types/node/trace_events.d.ts +0 -161
  133. package/dist/node_modules/mariadb/node_modules/@types/node/tty.d.ts +0 -204
  134. package/dist/node_modules/mariadb/node_modules/@types/node/url.d.ts +0 -891
  135. package/dist/node_modules/mariadb/node_modules/@types/node/util.d.ts +0 -1594
  136. package/dist/node_modules/mariadb/node_modules/@types/node/v8.d.ts +0 -378
  137. package/dist/node_modules/mariadb/node_modules/@types/node/vm.d.ts +0 -507
  138. package/dist/node_modules/mariadb/node_modules/@types/node/wasi.d.ts +0 -158
  139. package/dist/node_modules/mariadb/node_modules/@types/node/worker_threads.d.ts +0 -649
  140. package/dist/node_modules/mariadb/node_modules/@types/node/zlib.d.ts +0 -517
  141. package/dist/node_modules/mariadb/package.json +0 -1
  142. package/dist/node_modules/mariadb/promise.js +0 -34
  143. package/dist/node_modules/mariadb/types/index.d.ts +0 -870
@@ -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
- }