mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Update globals.d.ts
This commit is contained in:
15
packages/bun-types/globals.d.ts
vendored
15
packages/bun-types/globals.d.ts
vendored
@@ -1955,6 +1955,21 @@ interface AbortSignal extends EventTarget {
|
||||
options?: boolean | EventListenerOptions,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Create an AbortSignal which times out after milliseconds
|
||||
*
|
||||
* @param milliseconds the number of milliseconds to delay until {@link AbortSignal.prototype.signal()} is called
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ## Timeout a `fetch()` request
|
||||
*
|
||||
* ```ts
|
||||
* await fetch("https://example.com", {
|
||||
* signal: AbortSignal.timeout(100)
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
timeout(milliseconds: number): AbortSignal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user