bun-types-no-globals 1.2.23-canary.20250922T140710 → 1.2.23-canary.20250924T140620

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.
package/lib/bun.d.ts CHANGED
@@ -636,7 +636,7 @@ declare module "bun" {
636
636
  * import { YAML } from "bun";
637
637
  *
638
638
  * console.log(YAML.parse("123")) // 123
639
- * console.log(YAML.parse("123")) // null
639
+ * console.log(YAML.parse("null")) // null
640
640
  * console.log(YAML.parse("false")) // false
641
641
  * console.log(YAML.parse("abc")) // "abc"
642
642
  * console.log(YAML.parse("- abc")) // [ "abc" ]
@@ -653,7 +653,10 @@ declare module "bun" {
653
653
  *
654
654
  * @param input The JavaScript value to stringify.
655
655
  * @param replacer Currently not supported.
656
- * @param space A number for how many spaces each level of indentation gets, or a string used as indentation. The number is clamped between 0 and 10, and the first 10 characters of the string are used.
656
+ * @param space A number for how many spaces each level of indentation gets, or a string used as indentation.
657
+ * Without this parameter, outputs flow-style (single-line) YAML.
658
+ * With this parameter, outputs block-style (multi-line) YAML.
659
+ * The number is clamped between 0 and 10, and the first 10 characters of the string are used.
657
660
  * @returns A string containing the YAML document.
658
661
  *
659
662
  * @example
@@ -661,19 +664,24 @@ declare module "bun" {
661
664
  * import { YAML } from "bun";
662
665
  *
663
666
  * const input = {
664
- * abc: "def"
667
+ * abc: "def",
668
+ * num: 123
665
669
  * };
670
+ *
671
+ * // Without space - flow style (single-line)
666
672
  * console.log(YAML.stringify(input));
667
- * // # output
673
+ * // {abc: def,num: 123}
674
+ *
675
+ * // With space - block style (multi-line)
676
+ * console.log(YAML.stringify(input, null, 2));
668
677
  * // abc: def
678
+ * // num: 123
669
679
  *
670
680
  * const cycle = {};
671
681
  * cycle.obj = cycle;
672
- * console.log(YAML.stringify(cycle));
673
- * // # output
674
- * // &root
675
- * // obj:
676
- * // *root
682
+ * console.log(YAML.stringify(cycle, null, 2));
683
+ * // &1
684
+ * // obj: *1
677
685
  */
678
686
  export function stringify(input: unknown, replacer?: undefined | null, space?: string | number): string;
679
687
  }
package/lib/test.d.ts CHANGED
@@ -91,6 +91,7 @@ declare module "bun:test" {
91
91
  export namespace jest {
92
92
  function restoreAllMocks(): void;
93
93
  function clearAllMocks(): void;
94
+ function resetAllMocks(): void;
94
95
  function fn<T extends (...args: any[]) => any>(func?: T): Mock<T>;
95
96
  function setSystemTime(now?: number | Date): void;
96
97
  function setTimeout(milliseconds: number): void;
@@ -180,6 +181,9 @@ declare module "bun:test" {
180
181
  * Clear all mock state (calls, results, etc.) without restoring original implementation
181
182
  */
182
183
  clearAllMocks: typeof jest.clearAllMocks;
184
+ resetAllMocks: typeof jest.resetAllMocks;
185
+ useFakeTimers: typeof jest.useFakeTimers;
186
+ useRealTimers: typeof jest.useRealTimers;
183
187
  };
184
188
 
185
189
  interface FunctionLike {
@@ -226,6 +230,11 @@ declare module "bun:test" {
226
230
  * Marks this group of tests to be executed concurrently.
227
231
  */
228
232
  concurrent: Describe<T>;
233
+ /**
234
+ * Marks this group of tests to be executed serially (one after another),
235
+ * even when the --concurrent flag is used.
236
+ */
237
+ serial: Describe<T>;
229
238
  /**
230
239
  * Runs this group of tests, only if `condition` is true.
231
240
  *
@@ -423,7 +432,7 @@ declare module "bun:test" {
423
432
  options?: number | TestOptions,
424
433
  ): void;
425
434
  /**
426
- * Skips all other tests, except this test when run with the `--only` option.
435
+ * Skips all other tests, except this test.
427
436
  */
428
437
  only: Test<T>;
429
438
  /**
@@ -455,6 +464,11 @@ declare module "bun:test" {
455
464
  * Runs the test concurrently with other concurrent tests.
456
465
  */
457
466
  concurrent: Test<T>;
467
+ /**
468
+ * Forces the test to run serially (not in parallel),
469
+ * even when the --concurrent flag is used.
470
+ */
471
+ serial: Test<T>;
458
472
  /**
459
473
  * Runs this test, if `condition` is true.
460
474
  *
@@ -487,6 +501,13 @@ declare module "bun:test" {
487
501
  * @param condition if the test should run concurrently
488
502
  */
489
503
  concurrentIf(condition: boolean): Test<T>;
504
+ /**
505
+ * Forces the test to run serially (not in parallel), if `condition` is true.
506
+ * This applies even when the --concurrent flag is used.
507
+ *
508
+ * @param condition if the test should run serially
509
+ */
510
+ serialIf(condition: boolean): Test<T>;
490
511
  /**
491
512
  * Returns a function that runs for each item in `table`.
492
513
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-types-no-globals",
3
- "version": "1.2.23-canary.20250922T140710",
3
+ "version": "1.2.23-canary.20250924T140620",
4
4
  "main": "./generator/index.ts",
5
5
  "types": "./lib/index.d.ts",
6
6
  "description": "TypeScript type definitions for Bun without global types pollution",