bun-types 1.1.35-canary.20241108T140553 → 1.1.35-canary.20241109T140516
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/bun.d.ts +24 -1
- package/package.json +1 -1
package/bun.d.ts
CHANGED
|
@@ -3946,7 +3946,8 @@ declare module "bun" {
|
|
|
3946
3946
|
| "file"
|
|
3947
3947
|
| "napi"
|
|
3948
3948
|
| "wasm"
|
|
3949
|
-
| "text"
|
|
3949
|
+
| "text"
|
|
3950
|
+
| "css";
|
|
3950
3951
|
|
|
3951
3952
|
interface PluginConstraints {
|
|
3952
3953
|
/**
|
|
@@ -4034,12 +4035,20 @@ declare module "bun" {
|
|
|
4034
4035
|
* The default loader for this file extension
|
|
4035
4036
|
*/
|
|
4036
4037
|
loader: Loader;
|
|
4038
|
+
|
|
4039
|
+
/**
|
|
4040
|
+
* Defer the execution of this callback until all other modules have been parsed.
|
|
4041
|
+
*
|
|
4042
|
+
* @returns Promise which will be resolved when all modules have been parsed
|
|
4043
|
+
*/
|
|
4044
|
+
defer: () => Promise<void>;
|
|
4037
4045
|
}
|
|
4038
4046
|
|
|
4039
4047
|
type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined;
|
|
4040
4048
|
type OnLoadCallback = (
|
|
4041
4049
|
args: OnLoadArgs,
|
|
4042
4050
|
) => OnLoadResult | Promise<OnLoadResult>;
|
|
4051
|
+
type OnStartCallback = () => void | Promise<void>;
|
|
4043
4052
|
|
|
4044
4053
|
interface OnResolveArgs {
|
|
4045
4054
|
/**
|
|
@@ -4123,6 +4132,20 @@ declare module "bun" {
|
|
|
4123
4132
|
constraints: PluginConstraints,
|
|
4124
4133
|
callback: OnResolveCallback,
|
|
4125
4134
|
): void;
|
|
4135
|
+
/**
|
|
4136
|
+
* Register a callback which will be invoked when bundling starts.
|
|
4137
|
+
* @example
|
|
4138
|
+
* ```ts
|
|
4139
|
+
* Bun.plugin({
|
|
4140
|
+
* setup(builder) {
|
|
4141
|
+
* builder.onStart(() => {
|
|
4142
|
+
* console.log("bundle just started!!")
|
|
4143
|
+
* });
|
|
4144
|
+
* },
|
|
4145
|
+
* });
|
|
4146
|
+
* ```
|
|
4147
|
+
*/
|
|
4148
|
+
onStart(callback: OnStartCallback): void;
|
|
4126
4149
|
/**
|
|
4127
4150
|
* The config object passed to `Bun.build` as is. Can be mutated.
|
|
4128
4151
|
*/
|
package/package.json
CHANGED