bun-types-no-globals 1.2.21 → 1.2.22-canary.20250829T140616
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 +51 -3
- package/lib/experimental.d.ts +3 -1
- package/lib/test-globals.d.ts +1 -1
- package/lib/test.d.ts +20 -1
- package/package.json +1 -1
- package/lib/ambient.d.ts +0 -31
- package/lib/types.d.ts +0 -36274
package/lib/bun.d.ts
CHANGED
|
@@ -619,6 +619,33 @@ declare module "bun" {
|
|
|
619
619
|
export function parse(input: string): object;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
/**
|
|
623
|
+
* YAML related APIs
|
|
624
|
+
*/
|
|
625
|
+
namespace YAML {
|
|
626
|
+
/**
|
|
627
|
+
* Parse a YAML string into a JavaScript value
|
|
628
|
+
*
|
|
629
|
+
* @category Utilities
|
|
630
|
+
*
|
|
631
|
+
* @param input The YAML string to parse
|
|
632
|
+
* @returns A JavaScript value
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* ```ts
|
|
636
|
+
* import { YAML } from "bun";
|
|
637
|
+
*
|
|
638
|
+
* console.log(YAML.parse("123")) // 123
|
|
639
|
+
* console.log(YAML.parse("123")) // null
|
|
640
|
+
* console.log(YAML.parse("false")) // false
|
|
641
|
+
* console.log(YAML.parse("abc")) // "abc"
|
|
642
|
+
* console.log(YAML.parse("- abc")) // [ "abc" ]
|
|
643
|
+
* console.log(YAML.parse("abc: def")) // { "abc": "def" }
|
|
644
|
+
* ```
|
|
645
|
+
*/
|
|
646
|
+
export function parse(input: string): unknown;
|
|
647
|
+
}
|
|
648
|
+
|
|
622
649
|
/**
|
|
623
650
|
* Synchronously resolve a `moduleId` as though it were imported from `parent`
|
|
624
651
|
*
|
|
@@ -1814,9 +1841,10 @@ declare module "bun" {
|
|
|
1814
1841
|
drop?: string[];
|
|
1815
1842
|
|
|
1816
1843
|
/**
|
|
1817
|
-
* When set to `true`, the returned promise rejects with an AggregateError when a build failure happens.
|
|
1818
|
-
* When set to `false`,
|
|
1819
|
-
*
|
|
1844
|
+
* - When set to `true`, the returned promise rejects with an AggregateError when a build failure happens.
|
|
1845
|
+
* - When set to `false`, returns a {@link BuildOutput} with `{success: false}`
|
|
1846
|
+
*
|
|
1847
|
+
* @default true
|
|
1820
1848
|
*/
|
|
1821
1849
|
throw?: boolean;
|
|
1822
1850
|
|
|
@@ -5485,6 +5513,7 @@ declare module "bun" {
|
|
|
5485
5513
|
type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined | void;
|
|
5486
5514
|
type OnLoadCallback = (args: OnLoadArgs) => OnLoadResult | Promise<OnLoadResult>;
|
|
5487
5515
|
type OnStartCallback = () => void | Promise<void>;
|
|
5516
|
+
type OnEndCallback = (result: BuildOutput) => void | Promise<void>;
|
|
5488
5517
|
|
|
5489
5518
|
interface OnResolveArgs {
|
|
5490
5519
|
/**
|
|
@@ -5562,6 +5591,25 @@ declare module "bun" {
|
|
|
5562
5591
|
* @returns `this` for method chaining
|
|
5563
5592
|
*/
|
|
5564
5593
|
onStart(callback: OnStartCallback): this;
|
|
5594
|
+
/**
|
|
5595
|
+
* Register a callback which will be invoked when bundling ends. This is
|
|
5596
|
+
* called after all modules have been bundled and the build is complete.
|
|
5597
|
+
*
|
|
5598
|
+
* @example
|
|
5599
|
+
* ```ts
|
|
5600
|
+
* const plugin: Bun.BunPlugin = {
|
|
5601
|
+
* name: "my-plugin",
|
|
5602
|
+
* setup(builder) {
|
|
5603
|
+
* builder.onEnd((result) => {
|
|
5604
|
+
* console.log("bundle just finished!!", result);
|
|
5605
|
+
* });
|
|
5606
|
+
* },
|
|
5607
|
+
* };
|
|
5608
|
+
* ```
|
|
5609
|
+
*
|
|
5610
|
+
* @returns `this` for method chaining
|
|
5611
|
+
*/
|
|
5612
|
+
onEnd(callback: OnEndCallback): this;
|
|
5565
5613
|
onBeforeParse(
|
|
5566
5614
|
constraints: PluginConstraints,
|
|
5567
5615
|
callback: {
|
package/lib/experimental.d.ts
CHANGED
|
@@ -191,7 +191,9 @@ declare module "bun" {
|
|
|
191
191
|
* };
|
|
192
192
|
* ```
|
|
193
193
|
*/
|
|
194
|
-
export type SSGPage<Params extends SSGParamsLike = SSGParamsLike> =
|
|
194
|
+
export type SSGPage<Params extends SSGParamsLike = SSGParamsLike> = import("react").ComponentType<
|
|
195
|
+
SSGPageProps<Params>
|
|
196
|
+
>;
|
|
195
197
|
|
|
196
198
|
/**
|
|
197
199
|
* getStaticPaths is Bun's implementation of SSG (Static Site Generation) path determination.
|
package/lib/test-globals.d.ts
CHANGED
package/lib/test.d.ts
CHANGED
|
@@ -262,6 +262,15 @@ declare module "bun:test" {
|
|
|
262
262
|
* @param fn the function that defines the tests
|
|
263
263
|
*/
|
|
264
264
|
export const describe: Describe;
|
|
265
|
+
/**
|
|
266
|
+
* Skips a group of related tests.
|
|
267
|
+
*
|
|
268
|
+
* This is equivalent to calling `describe.skip()`.
|
|
269
|
+
*
|
|
270
|
+
* @param label the label for the tests
|
|
271
|
+
* @param fn the function that defines the tests
|
|
272
|
+
*/
|
|
273
|
+
export const xdescribe: Describe;
|
|
265
274
|
/**
|
|
266
275
|
* Runs a function, once, before all the tests.
|
|
267
276
|
*
|
|
@@ -515,7 +524,17 @@ declare module "bun:test" {
|
|
|
515
524
|
* @param fn the test function
|
|
516
525
|
*/
|
|
517
526
|
export const test: Test;
|
|
518
|
-
export { test as it };
|
|
527
|
+
export { test as it, xtest as xit };
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Skips a test.
|
|
531
|
+
*
|
|
532
|
+
* This is equivalent to calling `test.skip()`.
|
|
533
|
+
*
|
|
534
|
+
* @param label the label for the test
|
|
535
|
+
* @param fn the test function
|
|
536
|
+
*/
|
|
537
|
+
export const xtest: Test;
|
|
519
538
|
|
|
520
539
|
/**
|
|
521
540
|
* Asserts that a value matches some criteria.
|
package/package.json
CHANGED
package/lib/ambient.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare module "*.txt" {
|
|
2
|
-
var text: string;
|
|
3
|
-
export = text;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
declare module "*.toml" {
|
|
7
|
-
var contents: any;
|
|
8
|
-
export = contents;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module "*.jsonc" {
|
|
12
|
-
var contents: any;
|
|
13
|
-
export = contents;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module "*/bun.lock" {
|
|
17
|
-
var contents: import("bun").BunLockFile;
|
|
18
|
-
export = contents;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare module "*.html" {
|
|
22
|
-
// In Bun v1.2, we might change this to Bun.HTMLBundle
|
|
23
|
-
var contents: any;
|
|
24
|
-
export = contents;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
declare module "*.svg" {
|
|
28
|
-
// Bun 1.2.3 added support for frontend dev server
|
|
29
|
-
var contents: `${string}.svg`;
|
|
30
|
-
export = contents;
|
|
31
|
-
}
|