diff options
author | 2023-02-16 03:18:01 -0800 | |
---|---|---|
committer | 2023-02-16 03:18:01 -0800 | |
commit | e7cd45d0fa3f381238ea2ebfbba2d9e738376fcc (patch) | |
tree | a3c9b5bd7811be465fd45ab395fefbf6e9fcc2c7 | |
parent | 0e688d62f9374dcb241f961c7ba04cff2c4b6204 (diff) | |
download | bun-e7cd45d0fa3f381238ea2ebfbba2d9e738376fcc.tar.gz bun-e7cd45d0fa3f381238ea2ebfbba2d9e738376fcc.tar.zst bun-e7cd45d0fa3f381238ea2ebfbba2d9e738376fcc.zip |
Update globals.d.ts
Diffstat (limited to '')
-rw-r--r-- | packages/bun-types/globals.d.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts index a4ddd8c41..8848f59e6 100644 --- a/packages/bun-types/globals.d.ts +++ b/packages/bun-types/globals.d.ts @@ -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; } |