@interfere/react 12.0.5 → 12.1.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 (182) hide show
  1. package/README.md +103 -0
  2. package/dist/actionable-DOmVf_ib.mjs +1 -0
  3. package/dist/activity-D18VXGTn.mjs +1 -0
  4. package/dist/{activity-BfYxFVcK.d.mts → activity-Duhfgvxt.d.mts} +1 -1
  5. package/dist/{api-DEVCOKkJ.d.mts → api-CMPV9rgU.d.mts} +1 -1
  6. package/dist/api-DXmjUMZE.mjs +1 -0
  7. package/dist/api.mjs +1 -1
  8. package/dist/bot-YLSbnCeg.mjs +1 -0
  9. package/dist/buffer-BRn_kSm-.mjs +1 -0
  10. package/dist/capture-BV2RlsYg.mjs +1 -0
  11. package/dist/capture-boundary-Cz0jO-y5.mjs +1 -0
  12. package/dist/chunking-Dvs3f50A.d.mts +39 -0
  13. package/dist/chunking-qZffPbyY.mjs +2 -0
  14. package/dist/compressor-host-BAz6860r.d.mts +9 -0
  15. package/dist/compressor-host-CrKngamF.mjs +1 -0
  16. package/dist/config-Bm8myQlS.mjs +1 -0
  17. package/dist/config-CBqqY1AV.d.mts +29 -0
  18. package/dist/config-DapTbKhs.mjs +1 -0
  19. package/dist/{config-Rm-ct4K1.d.mts → config-Dyc09HCZ.d.mts} +2 -1
  20. package/dist/consent-COUmLJLD.mjs +1 -0
  21. package/dist/console-patch-WNKoLE7U.mjs +1 -0
  22. package/dist/delivery-DehIJWRh.mjs +1 -0
  23. package/dist/device-6T3DYkLD.mjs +1 -0
  24. package/dist/device-DRK7hhLi.mjs +1 -0
  25. package/dist/device-metadata-Ffi__vup.mjs +1 -0
  26. package/dist/{dist-ByNfzdQp.mjs → dist-Bcb677YG.mjs} +2 -2
  27. package/dist/environment-CoEXhF1a.mjs +1 -0
  28. package/dist/environment-_LKcAXKG.d.mts +9 -0
  29. package/dist/error-boundary.d.mts +1 -1
  30. package/dist/error-boundary.mjs +1 -1
  31. package/dist/errors-BDmCWb5z.mjs +1 -0
  32. package/dist/event-capabilities-Dd0Hoaq2.mjs +1 -0
  33. package/dist/exporter-DjvOtWYJ.mjs +1 -0
  34. package/dist/exporter-logs-DS2AXWnV.mjs +1 -0
  35. package/dist/exporter-metrics-DZYqUo6_.mjs +1 -0
  36. package/dist/geo-D2wa9bGs.mjs +2 -0
  37. package/dist/global-DYq1Z4_H.mjs +1 -0
  38. package/dist/http-span-route-t2gig-KI.mjs +1 -0
  39. package/dist/hydration-BIp2cKhz.mjs +1 -0
  40. package/dist/index-DBsXraeJ.d.mts +4 -0
  41. package/dist/initial-navigation-YeK6UUHX.mjs +1 -0
  42. package/dist/{instrumentations-Bgm2EazU.d.mts → instrumentations-BuccMAMj.d.mts} +8 -1
  43. package/dist/instrumentations-CY8NcP_M.mjs +1 -0
  44. package/dist/internal/{activity.d.mts → activity/activity.d.mts} +1 -1
  45. package/dist/internal/activity/activity.mjs +1 -0
  46. package/dist/internal/browser-context.mjs +1 -1
  47. package/dist/internal/capture-boundary.d.mts +1 -1
  48. package/dist/internal/capture-boundary.mjs +1 -1
  49. package/dist/internal/capture.d.mts +1 -1
  50. package/dist/internal/capture.mjs +1 -1
  51. package/dist/internal/config.d.mts +2 -28
  52. package/dist/internal/config.mjs +1 -1
  53. package/dist/internal/consent.mjs +1 -1
  54. package/dist/internal/console-patch.mjs +1 -1
  55. package/dist/internal/device-metadata.d.mts +41 -0
  56. package/dist/internal/device-metadata.mjs +1 -0
  57. package/dist/internal/dom/actionable.d.mts +4 -13
  58. package/dist/internal/dom/actionable.mjs +1 -1
  59. package/dist/internal/dom/privacy.d.mts +2 -0
  60. package/dist/internal/dom/privacy.mjs +1 -0
  61. package/dist/internal/environment.d.mts +2 -0
  62. package/dist/internal/environment.mjs +1 -0
  63. package/dist/internal/event-capabilities.d.mts +3 -0
  64. package/dist/internal/event-capabilities.mjs +1 -0
  65. package/dist/internal/hydration.mjs +1 -1
  66. package/dist/internal/kernel-registry.d.mts +1 -1
  67. package/dist/internal/kernel-registry.mjs +1 -1
  68. package/dist/internal/kernel.d.mts +5 -3
  69. package/dist/internal/kernel.mjs +1 -1
  70. package/dist/internal/otel/exporter-logs.mjs +1 -1
  71. package/dist/internal/otel/exporter-metrics.mjs +1 -1
  72. package/dist/internal/otel/exporter.mjs +1 -1
  73. package/dist/internal/otel/http-span-route.mjs +1 -1
  74. package/dist/internal/otel/index.d.mts +3 -3
  75. package/dist/internal/otel/index.mjs +1 -1
  76. package/dist/internal/otel/initial-navigation.d.mts +1 -0
  77. package/dist/internal/otel/initial-navigation.mjs +1 -1
  78. package/dist/internal/otel/instrumentations.d.mts +1 -1
  79. package/dist/internal/otel/instrumentations.mjs +1 -1
  80. package/dist/internal/otel/navigation.mjs +1 -1
  81. package/dist/internal/otel/normalize-path.mjs +1 -1
  82. package/dist/internal/otel/page-scope-context-manager.mjs +1 -1
  83. package/dist/internal/otel/propagation.mjs +1 -1
  84. package/dist/internal/otel/provider.d.mts +1 -1
  85. package/dist/internal/otel/provider.mjs +1 -1
  86. package/dist/internal/otel/url-attrs.mjs +1 -1
  87. package/dist/internal/otel/web-vitals.mjs +1 -1
  88. package/dist/internal/{page-lifecycle.d.mts → page-lifecycle/page-lifecycle.d.mts} +1 -1
  89. package/dist/internal/page-lifecycle/page-lifecycle.mjs +1 -0
  90. package/dist/internal/plugins/plugin-runtime.d.mts +2 -0
  91. package/dist/internal/plugins/plugin-runtime.mjs +1 -0
  92. package/dist/internal/react-context.d.mts +1 -1
  93. package/dist/internal/react-context.mjs +1 -1
  94. package/dist/internal/server-digest.mjs +1 -1
  95. package/dist/internal/third-party-hosts.mjs +1 -1
  96. package/dist/internal/version.mjs +1 -1
  97. package/dist/internal/wrapper-singleton.d.mts +1 -1
  98. package/dist/internal/wrapper-singleton.mjs +1 -1
  99. package/dist/kernel-BD57JxiH.mjs +1 -0
  100. package/dist/kernel-registry-6f-3VCIy.mjs +1 -0
  101. package/dist/loader-BGwWwN2n.mjs +1 -0
  102. package/dist/log-D6Ht--tv.mjs +1 -0
  103. package/dist/navigation-DwkvuhFR.mjs +1 -0
  104. package/dist/normalize-path-BChqP8pA.mjs +1 -0
  105. package/dist/page-events-config-CiJvdAaJ.d.mts +12 -0
  106. package/dist/{internal/page-lifecycle.mjs → page-lifecycle-BhSFqjlK.mjs} +1 -1
  107. package/dist/page-scope-context-manager-DhArvVJ_.mjs +1 -0
  108. package/dist/plugin-runtime-CnFVGbJw.mjs +1 -0
  109. package/dist/plugins/device.d.mts +1 -1
  110. package/dist/plugins/device.mjs +1 -1
  111. package/dist/plugins/errors.d.mts +1 -1
  112. package/dist/plugins/errors.mjs +1 -1
  113. package/dist/plugins/lib/loader.d.mts +1 -1
  114. package/dist/plugins/lib/loader.mjs +1 -1
  115. package/dist/plugins/lib/types.d.mts +1 -1
  116. package/dist/plugins/logs.d.mts +1 -1
  117. package/dist/plugins/logs.mjs +1 -1
  118. package/dist/plugins/page-events-config.d.mts +2 -0
  119. package/dist/plugins/page-events-config.mjs +1 -0
  120. package/dist/plugins/page-events.d.mts +1 -1
  121. package/dist/plugins/rage-clicks.d.mts +1 -1
  122. package/dist/plugins/rage-clicks.mjs +1 -1
  123. package/dist/plugins/replay/buffer.d.mts +1 -1
  124. package/dist/plugins/replay/buffer.mjs +1 -1
  125. package/dist/plugins/replay/chunking.d.mts +2 -38
  126. package/dist/plugins/replay/chunking.mjs +1 -2
  127. package/dist/plugins/replay/compressor-host.d.mts +2 -8
  128. package/dist/plugins/replay/compressor-host.mjs +1 -1
  129. package/dist/plugins/replay/config.d.mts +1 -1
  130. package/dist/plugins/replay/config.mjs +1 -1
  131. package/dist/plugins/replay/delivery.d.mts +4 -4
  132. package/dist/plugins/replay/delivery.mjs +1 -1
  133. package/dist/plugins/replay/index.d.mts +1 -1
  134. package/dist/plugins/replay/index.mjs +1 -1
  135. package/dist/plugins/replay/recorder.d.mts +1 -1
  136. package/dist/plugins/replay/recorder.mjs +1 -1
  137. package/dist/plugins/replay/redact-urls.d.mts +6 -0
  138. package/dist/plugins/replay/redact-urls.mjs +1 -0
  139. package/dist/plugins/replay/sequence.mjs +1 -1
  140. package/dist/plugins/replay/upload.d.mts +1 -1
  141. package/dist/plugins/replay/upload.mjs +1 -1
  142. package/dist/privacy-CPKosXDP.d.mts +31 -0
  143. package/dist/privacy-CRuL0X8r.mjs +1 -0
  144. package/dist/propagation-DVcqCu_E.mjs +1 -0
  145. package/dist/{provider-DWgb6tn9.d.mts → provider-C68KiG80.d.mts} +55 -39
  146. package/dist/provider-NuAexTzU.mjs +1 -0
  147. package/dist/{provider-2LrbA-ld.d.mts → provider-VZtcX6ZS.d.mts} +4 -1
  148. package/dist/provider.d.mts +4 -3
  149. package/dist/provider.mjs +1 -1
  150. package/dist/react-context-c1uTUJfB.mjs +1 -0
  151. package/dist/react-error-handler.d.mts +1 -1
  152. package/dist/react-error-handler.mjs +1 -1
  153. package/dist/recorder-CM6Ae_0S.mjs +1 -0
  154. package/dist/redact-urls-CwFod9d4.mjs +1 -0
  155. package/dist/sequence-B4dYChb0.mjs +1 -0
  156. package/dist/server-digest-CzGdvjW1.mjs +1 -0
  157. package/dist/session-C30CtCVv.mjs +1 -0
  158. package/dist/session-retry-DJHvfDaO.mjs +1 -0
  159. package/dist/stringify-DvuHsAT4.mjs +1 -0
  160. package/dist/third-party-hosts-BoJNL3xG.mjs +1 -0
  161. package/dist/tracking/api.d.mts +1 -1
  162. package/dist/tracking/api.mjs +1 -1
  163. package/dist/tracking/device.mjs +1 -1
  164. package/dist/tracking/geo.mjs +1 -2
  165. package/dist/tracking/registration.fixture.d.mts +119 -109
  166. package/dist/tracking/registration.fixture.mjs +148 -26
  167. package/dist/tracking/session-retry.mjs +1 -1
  168. package/dist/tracking/session.mjs +1 -1
  169. package/dist/upload-BPaD3YcA.mjs +1 -0
  170. package/dist/url-attrs-BdcyE2n6.mjs +1 -0
  171. package/dist/util/bot.d.mts +1 -0
  172. package/dist/util/bot.mjs +1 -1
  173. package/dist/util/global.mjs +1 -1
  174. package/dist/util/log.mjs +1 -1
  175. package/dist/util/stringify.mjs +1 -1
  176. package/dist/{version-CsfyuVoF.mjs → version-BuN6IItu.mjs} +1 -1
  177. package/dist/web-vitals-CxXDUgpl.mjs +1 -0
  178. package/package.json +6 -6
  179. package/dist/index-DvFfO2V9.d.mts +0 -4
  180. package/dist/internal/activity.mjs +0 -1
  181. package/dist/internal/plugin-runtime.d.mts +0 -2
  182. package/dist/internal/plugin-runtime.mjs +0 -1
@@ -1,12 +1,13 @@
1
- import { t as SessionTracker } from "../api-DEVCOKkJ.mjs";
2
- //#region ../../../../node_modules/.bun/vitest@5.0.1+3a20bcfa24daf8e9/node_modules/vitest/optional-runtime-types.d.ts
3
- /* eslint-disable ts/ban-ts-comment */
1
+ import { t as SessionTracker } from "../api-CMPV9rgU.mjs";
2
+ import { InterfereClient } from "@interfere/javascript";
3
+ //#region ../../../../node_modules/.bun/vitest@5.0.5+68042dbef16394d8/node_modules/vitest/optional-runtime-types.d.ts
4
+ /* oxlint-disable typescript/ban-ts-comment */
4
5
  interface Disposable {
5
6
  // @ts-ignore -- Symbol.dispose might not be in user types
6
7
  [Symbol.dispose]: () => void;
7
8
  }
8
9
  //#endregion
9
- //#region ../../../../node_modules/.bun/tinybench@6.1.4/node_modules/tinybench/dist/index.d.ts
10
+ //#region ../../../../node_modules/.bun/tinybench@6.2.2/node_modules/tinybench/dist/index.d.ts
10
11
  //#region src/task.d.ts
11
12
  /**
12
13
  * A class that represents each benchmark task in Tinybench. It keeps track of the
@@ -17,15 +18,13 @@ declare class Task$1 extends EventTarget {
17
18
  addEventListener: (<K extends TaskEvents>(type: K, listener: EventListener<K, 'task'> | EventListenerObject<K, 'task'> | null, options?: AddEventListenerOptionsArgument) => void) & EventTarget['addEventListener'];
18
19
  removeEventListener: (<K extends TaskEvents>(type: K, listener: EventListener<K, 'task'> | EventListenerObject<K, 'task'> | null, options?: RemoveEventListenerOptionsArgument) => void) & EventTarget['removeEventListener'];
19
20
  /**
20
- * The estimated effective timer resolution observed during the last run,
21
- * computed as the smallest strictly positive latency sample that repeats
22
- * among the timer-measured samples, or the smallest strictly positive
23
- * sample when none repeats (samples supplied via `overriddenDuration` are
24
- * excluded). When `subtractTimerOverhead` is enabled the value is derived
25
- * from the overhead-corrected samples rather than the raw timer grain.
26
- * @returns The resolution in milliseconds, or `undefined` when no
27
- * timer-measured strictly positive sample was observed (e.g. every
28
- * sample was supplied via `overriddenDuration`)
21
+ * Sample-based timer-resolution heuristic for the last run. Returns the
22
+ * smallest positive latency repeated at least twice, otherwise the minimum
23
+ * positive latency. Uses timer-measured samples after overhead correction;
24
+ * samples supplied via `overriddenDuration` are excluded. This does not
25
+ * guarantee a bound on the timer's resolution.
26
+ * @returns The estimate in milliseconds, or `undefined` when no eligible
27
+ * sample remains positive after correction.
29
28
  */
30
29
  get detectedResolution(): number | undefined;
31
30
  /**
@@ -39,13 +38,17 @@ declare class Task$1 extends EventTarget {
39
38
  */
40
39
  get result(): TaskResult$1 & TaskResultRuntimeInfo & TaskResultTimestampProviderInfo;
41
40
  /**
42
- * The number of times the task function has been executed.
43
- * @returns The total number of executions performed
41
+ * The recorded sample count from run statistics or task-concurrent execution.
42
+ * Task-concurrent warmup also updates this counter; other warmup and
43
+ * async-detection calls do not.
44
+ * @returns The recorded sample count.
44
45
  */
45
46
  get runs(): number;
46
47
  constructor(bench: BenchLike, name: string, fn: Fn, fnOpts?: FnOptions);
47
48
  /**
48
- * Resets the task to make the `Task.runs` a zero-value and remove the `Task.result` object property.
49
+ * Clears the run count, statistics and diagnostics. The result becomes
50
+ * `not-started`, or stays `aborted` if a signal has aborted. Does not rearm
51
+ * an aborted signal.
49
52
  * @param emit - whether to emit the `reset` event or not
50
53
  */
51
54
  reset(emit?: boolean): void;
@@ -70,11 +73,12 @@ declare class Task$1 extends EventTarget {
70
73
  }
71
74
  //#endregion
72
75
  //#region src/event.d.ts
76
+ declare const EventBase: new (type: string) => Omit<Event, 'type'>;
73
77
  /**
74
78
  * The BenchEvent class represents events that occur during the benchmarking
75
79
  * process.
76
80
  */
77
- declare class BenchEvent<K extends BenchEvents = BenchEvents, M extends 'bench' | 'task' = 'bench'> extends globalThis.Event {
81
+ declare class BenchEvent<K extends BenchEvents = BenchEvents, M extends 'bench' | 'task' = 'bench'> extends EventBase {
78
82
  #private;
79
83
  type: K;
80
84
  /**
@@ -91,9 +95,11 @@ declare class BenchEvent<K extends BenchEvents = BenchEvents, M extends 'bench'
91
95
  get reason(): K extends 'warning' ? TimerSaturationReason | undefined : undefined;
92
96
  /**
93
97
  * The task associated with the event.
94
- * @returns The task if the event type is one that includes a task; otherwise, undefined
98
+ * @returns The task for task-scoped events and bench events that require one;
99
+ * for bench `abort`, the relayed task or `undefined` for a global abort.
100
+ * Other bench events return `undefined`.
95
101
  */
96
- get task(): M extends 'task' ? Task$1 : K extends BenchEventsWithTask ? Task$1 : undefined;
102
+ get task(): M extends 'task' ? Task$1 : K extends BenchEventsWithTask ? Task$1 : K extends 'abort' ? Task$1 | undefined : undefined;
97
103
  constructor(type: 'warning', task: Task$1, reason?: TimerSaturationReason);
98
104
  constructor(type: BenchEventsWithError, task: Task$1, error: Error);
99
105
  constructor(type: BenchEventsWithTask, task: Task$1);
@@ -138,7 +144,7 @@ interface BenchLike extends EventTarget {
138
144
  */
139
145
  concurrency: Concurrency;
140
146
  /**
141
- * The amount of executions per task.
147
+ * The iteration limit per task; see {@link BenchOptions.iterations}.
142
148
  */
143
149
  iterations: number;
144
150
  /**
@@ -162,7 +168,7 @@ interface BenchLike extends EventTarget {
162
168
  */
163
169
  runtimeVersion: string;
164
170
  /**
165
- * A setup function that runs before each task execution.
171
+ * A setup function called once per task and phase.
166
172
  */
167
173
  setup: (task: Task$1, mode: HookMode) => Promise<void> | void;
168
174
  /**
@@ -170,11 +176,11 @@ interface BenchLike extends EventTarget {
170
176
  */
171
177
  signal?: AbortSignal;
172
178
  /**
173
- * A teardown function that runs after each task execution.
179
+ * A teardown function called once per task and phase.
174
180
  */
175
181
  teardown: (task: Task$1, mode: HookMode) => Promise<void> | void;
176
182
  /**
177
- * The maximum number of concurrent tasks to run
183
+ * The maximum concurrent iterations within a task; only for `concurrency: 'task'`.
178
184
  */
179
185
  threshold: number;
180
186
  /**
@@ -182,7 +188,7 @@ interface BenchLike extends EventTarget {
182
188
  */
183
189
  throws: boolean;
184
190
  /**
185
- * The amount of time to run each task.
191
+ * The time budget per task in milliseconds; see {@link BenchOptions.time}.
186
192
  */
187
193
  time: number;
188
194
  /**
@@ -201,11 +207,11 @@ interface BenchLike extends EventTarget {
201
207
  */
202
208
  warmup: boolean;
203
209
  /**
204
- * The amount of warmup iterations per task.
210
+ * The warmup iteration limit per task; see {@link BenchOptions.warmupIterations}.
205
211
  */
206
212
  warmupIterations: number;
207
213
  /**
208
- * The amount of time to warmup each task.
214
+ * The warmup time budget in milliseconds; see {@link BenchOptions.warmupTime}.
209
215
  */
210
216
  warmupTime: number;
211
217
  }
@@ -222,7 +228,11 @@ interface BenchOptions$1 {
222
228
  */
223
229
  concurrency?: Concurrency;
224
230
  /**
225
- * The number of times that a task should run if even the time option is finished.
231
+ * Minimum iterations per task in sequential modes (`null` and `'bench'`).
232
+ * With `concurrency: 'task'`, a positive value instead caps scheduled
233
+ * iterations; scheduling stops when either positive iteration or time limit
234
+ * is reached. Zero disables this limit in that mode and requires a finite
235
+ * `threshold` (for example, `threshold: 10`), not the default `Infinity`.
226
236
  * @default 64
227
237
  */
228
238
  iterations?: number;
@@ -258,25 +268,16 @@ interface BenchOptions$1 {
258
268
  * {@link calibrateTimerOverhead}, and `max(0, raw_sample - Ĉ)` is used
259
269
  * in place of each non-overridden sample before statistics are computed.
260
270
  *
261
- * **Statistics after correction.** All fields of {@link Statistics} are
262
- * derived from the clamped corrected samples, not from the raw
263
- * distribution. With `M` denoting the raw-sample mean:
264
- *
265
- * - **Clean-shift regime (`X >> Ĉ`).** The clamp `max(0, …)` rarely
266
- * triggers, so the correction acts as a translation by `Ĉ`. Location
267
- * statistics (`mean`, `min`, `max`, all percentiles) decrease by `Ĉ`;
268
- * absolute-unit dispersion (`vr`, `sd`, `sem`, `moe`, `mad`, `aad`)
269
- * is essentially unchanged. Because `rme = moe / mean`, it inflates
270
- * by the deterministic factor `M / (M − Ĉ)` whenever `Ĉ > 0`.
271
- * - **Sub-overhead regime (`X ≈ Ĉ`).** A non-trivial fraction of
272
- * samples clamp to `0`, biasing the corrected mean upward,
273
- * contracting `vr`/`sd`/`sem`/`moe`/`aad`, and compounding the
274
- * `M / (M − Ĉ)` factor in `rme`. Once the cumulative mass of raw
275
- * samples at or below `Ĉ` reaches a given quantile, that percentile
276
- * collapses to `0`; in particular `p50` collapses once at least half
277
- * of the raw samples satisfy `raw_sample ≤ Ĉ`, which then forces
278
- * `mad` and `aad` toward `0`. Prefer `overriddenDuration` for
279
- * sub-overhead measurements.
271
+ * **Statistics after correction.** Statistics use the final samples, after
272
+ * correction and any duration overrides. When all latency samples are
273
+ * timer-measured and exceed `Ĉ`, subtracting the constant shifts location
274
+ * statistics by `Ĉ` while leaving variance and absolute dispersion unchanged
275
+ * apart from rounding. Relative error can increase as the mean decreases.
276
+ *
277
+ * When samples clamp to zero, these translation rules no longer hold.
278
+ * Quantiles are interpolated: exactly half zero samples need not give a
279
+ * zero median, and a zero median does not imply zero mean absolute deviation.
280
+ * Prefer `overriddenDuration` for sub-overhead measurements.
280
281
  *
281
282
  * **Three observable consequences of the clamp.**
282
283
  *
@@ -300,8 +301,8 @@ interface BenchOptions$1 {
300
301
  * are never modified by the correction. They are also excluded from
301
302
  * {@link Task.detectedResolution} and from timer-saturation detection.
302
303
  *
303
- * On runtimes with a coarse timer (resolution >= 1 ms), the
304
- * calibration returns `0` and this option becomes a no-op.
304
+ * If fewer than half of the calibration pairs have positive deltas, the
305
+ * estimate is `0` and the correction is a no-op.
305
306
  * @default false
306
307
  */
307
308
  subtractTimerOverhead?: boolean;
@@ -310,7 +311,10 @@ interface BenchOptions$1 {
310
311
  */
311
312
  teardown?: Hook;
312
313
  /**
313
- * The maximum number of concurrent tasks to run
314
+ * Maximum concurrent iterations within a task. Only applies with
315
+ * `concurrency: 'task'`; does not limit concurrent benchmark tasks.
316
+ * A finite value is required for a task-concurrent cycle with a zero
317
+ * iteration limit (`iterations` for run or `warmupIterations` for warmup).
314
318
  * @default Number.POSITIVE_INFINITY
315
319
  */
316
320
  threshold?: number;
@@ -320,7 +324,10 @@ interface BenchOptions$1 {
320
324
  */
321
325
  throws?: boolean;
322
326
  /**
323
- * Time needed for running a benchmark task in milliseconds.
327
+ * Time budget per task in milliseconds. Sequential modes keep running
328
+ * until both this budget and the minimum iteration count are met. With
329
+ * `concurrency: 'task'`, a positive finite value instead limits scheduling
330
+ * by elapsed time; reaching either positive limit stops new iterations.
324
331
  * @default 1000
325
332
  */
326
333
  time?: number;
@@ -335,12 +342,16 @@ interface BenchOptions$1 {
335
342
  */
336
343
  warmup?: boolean;
337
344
  /**
338
- * Warmup iterations.
345
+ * Warmup iteration limit. {@link Task.warmup} uses the mode-dependent
346
+ * semantics of {@link iterations}; {@link Task.warmupSync} always treats
347
+ * this as a minimum.
339
348
  * @default 16
340
349
  */
341
350
  warmupIterations?: number;
342
351
  /**
343
- * Warmup time in milliseconds.
352
+ * Warmup time budget in milliseconds. {@link Task.warmup} uses the
353
+ * mode-dependent semantics of {@link time}; {@link Task.warmupSync}
354
+ * always uses the sequential budget.
344
355
  * @default 250
345
356
  */
346
357
  warmupTime?: number;
@@ -372,12 +383,19 @@ interface EventListenerObject<E extends BenchEvents, M extends 'bench' | 'task'
372
383
  * If you need to provide a custom duration for the task (e.g.: because
373
384
  * you want to measure a specific part of its execution), you can return an
374
385
  * object with a `overriddenDuration` field. You should still use
375
- * `bench.opts.now()` to measure that duration.
386
+ * `bench.now()` to measure that duration. When the task function batches
387
+ * several inner calls, also return `overriddenIterationCost` so the `time`
388
+ * budget reflects the whole iteration while samples record batch means.
389
+ *
390
+ * Task results are unrestricted. See {@link FnReturnedObject} for explicit
391
+ * compile-time checks of measurement fields.
376
392
  */
377
- type Fn = () => FnReturnedObject | Promise<FnReturnedObject | unknown> | unknown;
393
+ type Fn = () => unknown;
378
394
  /**
379
395
  * The task hook function signature.
380
- * If warmup is enabled, the hook will be called twice, once for the warmup and once for the run.
396
+ * Hooks apply to both run and warmup phases when warmup is enabled.
397
+ * `beforeAll`/`afterAll` run once per task and phase; `beforeEach`/`afterEach`
398
+ * run once per iteration.
381
399
  * @param mode the mode where the hook is being called
382
400
  */
383
401
  type FnHook = (this: Task$1, mode?: HookMode) => Promise<void> | void;
@@ -386,11 +404,11 @@ type FnHook = (this: Task$1, mode?: HookMode) => Promise<void> | void;
386
404
  */
387
405
  interface FnOptions {
388
406
  /**
389
- * An optional function that is run after all iterations of this task end
407
+ * Runs once after all iterations of a task phase (warmup or run).
390
408
  */
391
409
  afterAll?: FnHook;
392
410
  /**
393
- * An optional function that is run after each iteration of this task
411
+ * Runs after each iteration in both warmup and run phases.
394
412
  */
395
413
  afterEach?: FnHook;
396
414
  /**
@@ -403,11 +421,11 @@ interface FnOptions {
403
421
  */
404
422
  async?: boolean;
405
423
  /**
406
- * An optional function that is run before iterations of this task begin
424
+ * Runs once before the iterations of a task phase (warmup or run).
407
425
  */
408
426
  beforeAll?: FnHook;
409
427
  /**
410
- * An optional function that is run before each iteration of this task
428
+ * Runs before each iteration in both warmup and run phases.
411
429
  */
412
430
  beforeEach?: FnHook;
413
431
  /**
@@ -421,23 +439,9 @@ interface FnOptions {
421
439
  */
422
440
  signal?: AbortSignal;
423
441
  }
424
- /**
425
- * A possible object returned by task functions to override default behaviors,
426
- * like the duration of the function itself.
427
- */
428
- interface FnReturnedObject {
429
- /**
430
- * An overridden duration for the task function, to be used instead of the
431
- * duration measured by tinybench when running the benchmark.
432
- *
433
- * This can be useful to measure parts of the execution of a function that are
434
- * hard to execute independently.
435
- */
436
- overriddenDuration?: number;
437
- }
438
442
  /**
439
443
  * The hook function signature.
440
- * If warmup is enabled, the hook will be called twice, once for the warmup and once for the run.
444
+ * Called once per task and phase: warmup (if enabled), then run.
441
445
  * @param task the task instance
442
446
  * @param mode the mode where the hook is being called
443
447
  */
@@ -470,7 +474,9 @@ type SortedSamples = Samples & {
470
474
  readonly __sorted__: unique symbol;
471
475
  };
472
476
  /**
473
- * The statistics object
477
+ * Location and dispersion statistics use the samples' units (ms for latency,
478
+ * ops/s for throughput), except variance (squared units). Relative margin of
479
+ * error is a percentage; counts and critical values are dimensionless.
474
480
  */
475
481
  interface Statistics {
476
482
  /**
@@ -478,7 +484,8 @@ interface Statistics {
478
484
  */
479
485
  aad: number;
480
486
  /**
481
- * critical value
487
+ * two-sided 95% critical value of Student's t for {@link Statistics.df},
488
+ * approached from above as {@link Statistics.df} grows
482
489
  */
483
490
  critical: number;
484
491
  /**
@@ -526,7 +533,8 @@ interface Statistics {
526
533
  */
527
534
  p999: number;
528
535
  /**
529
- * relative margin of error
536
+ * Relative margin of error in percent: `100 * moe / abs(mean)`.
537
+ * Infinity when the mean is zero.
530
538
  */
531
539
  rme: number;
532
540
  /**
@@ -546,7 +554,7 @@ interface Statistics {
546
554
  */
547
555
  sem: number;
548
556
  /**
549
- * variance
557
+ * Sample variance, in squared sample units.
550
558
  */
551
559
  variance: number;
552
560
  }
@@ -643,24 +651,27 @@ interface TaskResultTimestampProviderInfo {
643
651
  */
644
652
  interface TaskResultWithStatistics {
645
653
  /**
646
- * the task latency statistics
654
+ * Statistics of final latency samples in milliseconds.
647
655
  */
648
656
  latency: Statistics;
649
657
  /**
650
- * how long each operation takes (ms)
658
+ * Mean final latency in milliseconds: `totalTime / runs`.
651
659
  */
652
660
  period: number;
653
661
  /**
654
- * the task throughput statistics
662
+ * Throughput statistics in operations per second.
655
663
  */
656
664
  throughput: Statistics;
657
665
  /**
658
- * the time to run the task benchmark cycle (ms)
666
+ * Sum of final latency samples in milliseconds, after overrides and overhead
667
+ * correction; not elapsed wall time or the consumed iteration-cost budget.
659
668
  */
660
669
  totalTime: number;
661
670
  }
662
671
  /**
663
672
  * Reason a sample set is classified as timer-saturated.
673
+ * Classification requires at least 10 samples. For task diagnostics these are
674
+ * timer-measured samples after correction; overridden samples are excluded.
664
675
  *
665
676
  * - `'zero-dominated'` — more than half of the samples are exactly zero.
666
677
  * - `'low-distinct'` — distinct sample count is below
@@ -715,7 +726,7 @@ type TimestampProviderName = (string & {}) | TimestampFns;
715
726
  */
716
727
  type TimestampValue = bigint | number;
717
728
  //#endregion
718
- //#region ../../../../node_modules/.bun/vitest@5.0.1+3a20bcfa24daf8e9/node_modules/vitest/dist/chunks/config.d.CU_b-wJj.d.ts
729
+ //#region ../../../../node_modules/.bun/vitest@5.0.5+68042dbef16394d8/node_modules/vitest/dist/chunks/config.d.QBNYCgFU.d.ts
719
730
  /**
720
731
  * Copyright (c) Meta Platforms, Inc. and affiliates.
721
732
  *
@@ -1029,6 +1040,7 @@ declare class SnapshotState {
1029
1040
  private _inlineSnapshotStacks;
1030
1041
  private _testIdToKeys;
1031
1042
  private _rawSnapshots;
1043
+ private _rawSnapshotFiles;
1032
1044
  private _uncheckedKeys;
1033
1045
  private _snapshotFormat;
1034
1046
  private _environment;
@@ -1064,6 +1076,10 @@ declare class SnapshotState {
1064
1076
  probeExpectedSnapshot(options: Pick<SnapshotMatchOptions, "testName" | "testId" | "isInline" | "inlineSnapshot">): ExpectedSnapshot;
1065
1077
  match({ testId, testName, received, key, inlineSnapshot, isInline, error, rawSnapshot, assertionName }: SnapshotMatchOptions): SnapshotReturnOptions;
1066
1078
  processDomainSnapshot({ testId, received, expectedSnapshot, matchResult, isInline, error, assertionName }: ProcessDomainSnapshotOptions): SnapshotReturnOptions;
1079
+ /**
1080
+ * The snapshot file, if the test file stores snapshots in it, and every asserted file snapshot.
1081
+ */
1082
+ getSnapshotFiles(): string[];
1067
1083
  pack(): Promise<SnapshotResult>;
1068
1084
  }
1069
1085
  type SnapshotUpdateState = "all" | "new" | "none";
@@ -1169,7 +1185,7 @@ interface UserConsoleLog {
1169
1185
  interface MockResultReturn<T> {
1170
1186
  type: "return";
1171
1187
  /**
1172
- * The value that was returned from the function. If function returned a Promise, then this will be a resolved value.
1188
+ * The value that was returned from the function. If the function returned a Promise, then this will be the Promise, not its resolved value.
1173
1189
  */
1174
1190
  value: T;
1175
1191
  }
@@ -1219,12 +1235,12 @@ interface MockContext<T extends Procedure | Constructable = Procedure> {
1219
1235
  */
1220
1236
  calls: MockParameters<T>[];
1221
1237
  /**
1222
- * This is an array containing all instances that were instantiated when mock was called with a `new` keyword. Note that this is an actual context (`this`) of the function, not a return value.
1238
+ * An array with one value for each call: the object returned by `new`, or the context (`this`) of the call if the mock was called without `new`.
1223
1239
  * @see https://vitest.dev/api/mock#mock-instances
1224
1240
  */
1225
1241
  instances: MockProcedureContext<T>[];
1226
1242
  /**
1227
- * An array of `this` values that were used during each call to the mock function.
1243
+ * An array of `this` values that were used during each call to the mock function. If the mock was called with `new`, the value is the same as in `instances`.
1228
1244
  * @see https://vitest.dev/api/mock#mock-contexts
1229
1245
  */
1230
1246
  contexts: MockProcedureContext<T>[];
@@ -1277,7 +1293,7 @@ interface MockContext<T extends Procedure | Constructable = Procedure> {
1277
1293
  /**
1278
1294
  * An array containing all values that were `resolved` or `rejected` from the function.
1279
1295
  *
1280
- * This array will be empty if the function was never resolved or rejected.
1296
+ * Until the value is resolved or rejected, the type will be `incomplete`.
1281
1297
  *
1282
1298
  * @see https://vitest.dev/api/mock#mock-settledresults
1283
1299
  * @example
@@ -1315,11 +1331,11 @@ interface MockContext<T extends Procedure | Constructable = Procedure> {
1315
1331
  lastCall: MockParameters<T> | undefined;
1316
1332
  }
1317
1333
  type Procedure = (...args: any[]) => any;
1318
- type NormalizedProcedure<T extends Procedure | Constructable> = T extends Constructable ? ({
1334
+ type NormalizedProcedure<T extends Procedure | Constructable> = T extends Constructable ? {
1319
1335
  new (...args: ConstructorParameters<T>): InstanceType<T>;
1320
- }) | ({
1336
+ } | {
1321
1337
  (this: InstanceType<T>, ...args: ConstructorParameters<T>): void;
1322
- }) : T extends Procedure ? (...args: Parameters<T>) => ReturnType<T> : never;
1338
+ } : T extends Procedure ? (...args: Parameters<T>) => ReturnType<T> : never;
1323
1339
  interface MockInstance<T extends Procedure | Constructable = Procedure> extends Disposable {
1324
1340
  /**
1325
1341
  * Use it to return the name assigned to the mock with the `.mockName(name)` method. By default, it will return `vi.fn()`.
@@ -1358,7 +1374,7 @@ interface MockInstance<T extends Procedure | Constructable = Procedure> extends
1358
1374
  */
1359
1375
  mockRestore(): void;
1360
1376
  /**
1361
- * Returns current permanent mock implementation if there is one.
1377
+ * Returns current mock implementation if there is one. If an implementation was queued with `mockImplementationOnce`, it returns the first queued implementation instead.
1362
1378
  *
1363
1379
  * If mock was created with `vi.fn`, it will consider passed down method as a mock implementation.
1364
1380
  *
@@ -1417,7 +1433,7 @@ interface MockInstance<T extends Procedure | Constructable = Procedure> extends
1417
1433
  */
1418
1434
  mockReturnValue(value: MockReturnType<T>): this;
1419
1435
  /**
1420
- * Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
1436
+ * Accepts a value that will be returned during the next function call. TypeScript will only accept values that match the return type of the original function. If chained, each consecutive call will return the specified value.
1421
1437
  *
1422
1438
  * When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
1423
1439
  * @example
@@ -1493,15 +1509,6 @@ interface MockInstance<T extends Procedure | Constructable = Procedure> extends
1493
1509
  */
1494
1510
  mockRejectedValueOnce(error: unknown): this;
1495
1511
  }
1496
- type Mock<T extends Procedure | Constructable = Procedure> = MockInstance<T> & (T extends Constructable ? (T extends Procedure ? {
1497
- new (...args: ConstructorParameters<T>): InstanceType<T>;
1498
- (...args: Parameters<T>): ReturnType<T>;
1499
- } : {
1500
- new (...args: ConstructorParameters<T>): InstanceType<T>;
1501
- }) : {
1502
- new (...args: MockParameters<T>): MockReturnType<T>;
1503
- (...args: MockParameters<T>): MockReturnType<T>;
1504
- }) & { [P in keyof T]: T[P]; };
1505
1512
  interface Constructable {
1506
1513
  new (...args: any[]): any;
1507
1514
  }
@@ -2551,13 +2558,11 @@ interface TaskResult {
2551
2558
  */
2552
2559
  hooks?: Partial<Record<keyof SuiteHooks, TaskState>>;
2553
2560
  /**
2554
- * The amount of times the task was retried. The task is retried only if it
2555
- * failed and `retry` option is set.
2561
+ * The number of times the task has been retried across all repeats.
2556
2562
  */
2557
2563
  retryCount?: number;
2558
2564
  /**
2559
- * The amount of times the task was repeated. The task is repeated only if
2560
- * `repeats` option is set. This number also contains `retryCount`.
2565
+ * The zero-based index of the current repeat.
2561
2566
  */
2562
2567
  repeatCount?: number;
2563
2568
  }
@@ -2984,7 +2989,7 @@ interface TestArtifactRegistry {}
2984
2989
  */
2985
2990
  type TestArtifact = BrowserTraceArtifact | FailureScreenshotArtifact | TestAnnotationArtifact | VisualRegressionArtifact | TestArtifactRegistry[keyof TestArtifactRegistry];
2986
2991
  //#endregion
2987
- //#region ../../../../node_modules/.bun/vitest@5.0.1+3a20bcfa24daf8e9/node_modules/vitest/dist/chunks/task-utils.d.BZm4GSQD.d.ts
2992
+ //#region ../../../../node_modules/.bun/vitest@5.0.5+68042dbef16394d8/node_modules/vitest/dist/chunks/task-utils.d.PFh2BV6Q.d.ts
2988
2993
  interface SnapshotMatcher<R extends void | Promise<void>, T = unknown> {
2989
2994
  <U extends { [P in keyof T]: any; }>(snapshot: Partial<U>, hint?: string): R;
2990
2995
  (hint?: string): R;
@@ -3105,8 +3110,13 @@ declare module "vitest" {
3105
3110
  }
3106
3111
  //#endregion
3107
3112
  //#region src/tracking/registration.fixture.d.ts
3108
- export declare function registration(): {
3109
- fetcher: Mock<typeof fetch>;
3113
+ export declare const sessionEndpoint = "https://registration.invalid/v3/session";
3114
+ interface RegistrationFixture {
3115
+ arrived: (count: number) => Promise<void>;
3116
+ registrations: MockInstance<InterfereClient["sessions"]["createSession"]>;
3117
+ requests: Request[];
3118
+ settle: () => Promise<void>;
3110
3119
  tracker: SessionTracker;
3111
- };
3120
+ }
3121
+ export declare function registration(): Promise<RegistrationFixture>;
3112
3122
  //#endregion