bun-types 1.1.27-canary.20240906T140500 → 1.1.27
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 +15 -0
- package/globals.d.ts +3 -0
- package/package.json +1 -1
package/bun.d.ts
CHANGED
|
@@ -2926,6 +2926,21 @@ declare module "bun" {
|
|
|
2926
2926
|
*/
|
|
2927
2927
|
requestIP(request: Request): SocketAddress | null;
|
|
2928
2928
|
|
|
2929
|
+
/**
|
|
2930
|
+
* Reset the idleTimeout of the given Request to the number in seconds. 0 means no timeout.
|
|
2931
|
+
*
|
|
2932
|
+
* @example
|
|
2933
|
+
* ```js
|
|
2934
|
+
* export default {
|
|
2935
|
+
* async fetch(request, server) {
|
|
2936
|
+
* server.timeout(request, 60);
|
|
2937
|
+
* await Bun.sleep(30000);
|
|
2938
|
+
* return new Response("30 seconds have passed");
|
|
2939
|
+
* }
|
|
2940
|
+
* }
|
|
2941
|
+
* ```
|
|
2942
|
+
*/
|
|
2943
|
+
timeout(request: Request, seconds: number): void;
|
|
2929
2944
|
/**
|
|
2930
2945
|
* Undo a call to {@link Server.unref}
|
|
2931
2946
|
*
|
package/globals.d.ts
CHANGED
|
@@ -2030,6 +2030,9 @@ declare global {
|
|
|
2030
2030
|
* closely to the `BodyMixin` API.
|
|
2031
2031
|
*/
|
|
2032
2032
|
formData(): Promise<FormData>;
|
|
2033
|
+
|
|
2034
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
2035
|
+
|
|
2033
2036
|
/**
|
|
2034
2037
|
* Returns a promise that resolves to the contents of the blob as a Uint8Array (array of bytes) its the same as `new Uint8Array(await blob.arrayBuffer())`
|
|
2035
2038
|
*/
|
package/package.json
CHANGED