2024-01-01 19:58:21 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2021-01-14 21:57:19 +00:00
|
|
|
|
|
|
|
// ** Internal Interfaces **
|
|
|
|
|
|
|
|
interface PendingAbortRequest {
|
|
|
|
deferred: Deferred<void>;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
reason: any;
|
|
|
|
wasAlreadyErroring: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
interface ReadRequest<R = any> {
|
|
|
|
chunkSteps: (chunk: R) => void;
|
|
|
|
closeSteps: () => void;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
errorSteps: (error: any) => void;
|
|
|
|
}
|
|
|
|
|
2021-11-03 09:47:40 +00:00
|
|
|
interface ReadIntoRequest {
|
|
|
|
chunkSteps: (chunk: ArrayBufferView) => void;
|
|
|
|
closeSteps: (chunk?: ArrayBufferView) => void;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
errorSteps: (error: any) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PullIntoDescriptor {
|
|
|
|
buffer: ArrayBuffer;
|
|
|
|
bufferByteLength: number;
|
|
|
|
byteOffset: number;
|
|
|
|
byteLength: number;
|
|
|
|
bytesFilled: number;
|
2023-11-24 22:24:41 +00:00
|
|
|
minimumFill: number;
|
2021-11-03 09:47:40 +00:00
|
|
|
elementSize: number;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
viewConstructor: any;
|
2022-01-14 16:34:54 +00:00
|
|
|
readerType: "default" | "byob" | "none";
|
2021-11-03 09:47:40 +00:00
|
|
|
}
|
|
|
|
|
2021-01-14 21:57:19 +00:00
|
|
|
interface ReadableByteStreamQueueEntry {
|
|
|
|
buffer: ArrayBufferLike;
|
|
|
|
byteOffset: number;
|
|
|
|
byteLength: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ReadableStreamGetReaderOptions {
|
|
|
|
mode?: "byob";
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ReadableStreamIteratorOptions {
|
|
|
|
preventCancel?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ValueWithSize<T> {
|
|
|
|
value: T;
|
|
|
|
size: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface VoidFunction {
|
|
|
|
(): void;
|
|
|
|
}
|
|
|
|
|
2021-06-15 11:46:02 +00:00
|
|
|
interface ReadableStreamGenericReader<T> {
|
|
|
|
readonly closed: Promise<void>;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
cancel(reason?: any): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2021-01-14 21:57:19 +00:00
|
|
|
// ** Ambient Definitions and Interfaces not provided by fetch **
|
|
|
|
|
|
|
|
declare function queueMicrotask(callback: VoidFunction): void;
|
|
|
|
|
|
|
|
declare namespace Deno {
|
|
|
|
function inspect(value: unknown, options?: Record<string, unknown>): string;
|
|
|
|
}
|