Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Aug 26, 2023
1 parent 795d913 commit d1c6521
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/runtime/src/polyfills/streams.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
import { def } from '../utils';
import * as streams from 'web-streams-polyfill/ponyfill/es2018';
import type { AbortSignal } from './abort-controller';

for (const k of Object.keys(streams)) {
def(k, streams[k as keyof typeof streams]);
}

export type ReadableStreamController<T> =
| ReadableStreamDefaultController<T>
| ReadableByteStreamController;
export type ReadableStreamReadResult<T> =
| ReadableStreamReadValueResult<T>
| ReadableStreamReadDoneResult<T>;
export type ReadableStreamReader<T> =
| ReadableStreamDefaultReader<T>
| ReadableStreamBYOBReader;

export interface ReadableStreamReadDoneResult<T> {
done: true;
value?: T;
}

export interface ReadableStreamReadValueResult<T> {
done: false;
value: T;
}

export interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: UnderlyingSourceCancelCallback;
Expand Down

0 comments on commit d1c6521

Please sign in to comment.