-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshim-types.ts
More file actions
26 lines (19 loc) · 931 Bytes
/
shim-types.ts
File metadata and controls
26 lines (19 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
/**
* Shims for types that we can't always rely on being available globally.
*
* Note: these only exist at the type-level, there is no corresponding runtime
* version for any of these symbols.
*/
type NeverToAny<T> = T extends never ? any : T;
/** @ts-ignore */
type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
/** @ts-ignore */
type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
type _ConditionalNodeReadableStream<R = any> =
typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream<R>;
type _ReadableStream<R = any> = NeverToAny<
| ([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>)
| ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)
>;
export type { _ReadableStream as ReadableStream };