Files
SnowLuma/.pnpm-store/v11/files/db/a2d41f3c929e032c0f4377c899b61d234b3390f251b93fcecd73359397e42cd194d1321d39cfc20b42491d928b2ded2a167ce664e4c24917e9ae844bfe45a3
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

33 lines
862 B
Plaintext

//#region src/utils/stream.d.ts
/**
* @module
* Stream utility.
*/
export declare class StreamingApi {
private writer;
private encoder;
private writable;
private abortSubscribers;
responseReadable: ReadableStream;
/**
* Whether the stream has been aborted.
*/
aborted: boolean;
/**
* Whether the stream has been closed normally.
*/
closed: boolean;
constructor(writable: WritableStream, _readable: ReadableStream);
write(input: Uint8Array | string): Promise<StreamingApi>;
writeln(input: string): Promise<StreamingApi>;
sleep(ms: number): Promise<unknown>;
close(): Promise<void>;
pipe(body: ReadableStream): Promise<void>;
onAbort(listener: () => void | Promise<void>): void;
/**
* Abort the stream.
* You can call this method when stream is aborted by external event.
*/
abort(): void;
}
//#endregion