bun-types-no-globals 1.2.21-canary.20250824T140615 → 1.2.21-canary.20250827T140618
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 +55 -6
- package/lib/experimental.d.ts +3 -1
- package/lib/shell.d.ts +1 -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
|
*
|
|
@@ -1628,7 +1655,7 @@ declare module "bun" {
|
|
|
1628
1655
|
kind: ImportKind;
|
|
1629
1656
|
}
|
|
1630
1657
|
|
|
1631
|
-
namespace
|
|
1658
|
+
namespace Build {
|
|
1632
1659
|
type Architecture = "x64" | "arm64";
|
|
1633
1660
|
type Libc = "glibc" | "musl";
|
|
1634
1661
|
type SIMD = "baseline" | "modern";
|
|
@@ -1641,6 +1668,7 @@ declare module "bun" {
|
|
|
1641
1668
|
| `bun-windows-x64-${SIMD}`
|
|
1642
1669
|
| `bun-linux-x64-${SIMD}-${Libc}`;
|
|
1643
1670
|
}
|
|
1671
|
+
|
|
1644
1672
|
/**
|
|
1645
1673
|
* @see [Bun.build API docs](https://bun.com/docs/bundler#api)
|
|
1646
1674
|
*/
|
|
@@ -1813,9 +1841,10 @@ declare module "bun" {
|
|
|
1813
1841
|
drop?: string[];
|
|
1814
1842
|
|
|
1815
1843
|
/**
|
|
1816
|
-
* When set to `true`, the returned promise rejects with an AggregateError when a build failure happens.
|
|
1817
|
-
* When set to `false`,
|
|
1818
|
-
*
|
|
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
|
|
1819
1848
|
*/
|
|
1820
1849
|
throw?: boolean;
|
|
1821
1850
|
|
|
@@ -1836,7 +1865,7 @@ declare module "bun" {
|
|
|
1836
1865
|
}
|
|
1837
1866
|
|
|
1838
1867
|
interface CompileBuildOptions {
|
|
1839
|
-
target?:
|
|
1868
|
+
target?: Bun.Build.Target;
|
|
1840
1869
|
execArgv?: string[];
|
|
1841
1870
|
executablePath?: string;
|
|
1842
1871
|
outfile?: string;
|
|
@@ -1878,7 +1907,7 @@ declare module "bun" {
|
|
|
1878
1907
|
* });
|
|
1879
1908
|
* ```
|
|
1880
1909
|
*/
|
|
1881
|
-
compile: boolean |
|
|
1910
|
+
compile: boolean | Bun.Build.Target | CompileBuildOptions;
|
|
1882
1911
|
}
|
|
1883
1912
|
|
|
1884
1913
|
/**
|
|
@@ -5484,6 +5513,7 @@ declare module "bun" {
|
|
|
5484
5513
|
type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined | void;
|
|
5485
5514
|
type OnLoadCallback = (args: OnLoadArgs) => OnLoadResult | Promise<OnLoadResult>;
|
|
5486
5515
|
type OnStartCallback = () => void | Promise<void>;
|
|
5516
|
+
type OnEndCallback = (result: BuildOutput) => void | Promise<void>;
|
|
5487
5517
|
|
|
5488
5518
|
interface OnResolveArgs {
|
|
5489
5519
|
/**
|
|
@@ -5561,6 +5591,25 @@ declare module "bun" {
|
|
|
5561
5591
|
* @returns `this` for method chaining
|
|
5562
5592
|
*/
|
|
5563
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;
|
|
5564
5613
|
onBeforeParse(
|
|
5565
5614
|
constraints: PluginConstraints,
|
|
5566
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/shell.d.ts
CHANGED
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-types-no-globals",
|
|
3
|
-
"version": "1.2.21-canary.
|
|
3
|
+
"version": "1.2.21-canary.20250827T140618",
|
|
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",
|
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
|
-
}
|