2023-01-02 16:00:42 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
2021-01-28 15:37:21 -05:00
|
|
|
|
2021-12-09 17:12:21 -05:00
|
|
|
// deno-lint-ignore-file no-explicit-any no-var
|
2021-01-28 15:37:21 -05:00
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
declare var domIterable: {
|
|
|
|
DomIterableMixin(base: any, dataSymbol: symbol): any;
|
|
|
|
};
|
2021-01-28 15:37:21 -05:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_fetch/20_headers.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
class Headers {
|
|
|
|
}
|
|
|
|
type HeaderList = [string, string][];
|
|
|
|
function headersFromHeaderList(
|
|
|
|
list: HeaderList,
|
|
|
|
guard:
|
|
|
|
| "immutable"
|
|
|
|
| "request"
|
|
|
|
| "request-no-cors"
|
|
|
|
| "response"
|
|
|
|
| "none",
|
|
|
|
): Headers;
|
|
|
|
function headerListFromHeaders(headers: Headers): HeaderList;
|
|
|
|
function fillHeaders(headers: Headers, object: HeadersInit): void;
|
|
|
|
function getDecodeSplitHeader(
|
|
|
|
list: HeaderList,
|
|
|
|
name: string,
|
|
|
|
): string[] | null;
|
|
|
|
function guardFromHeaders(
|
|
|
|
headers: Headers,
|
|
|
|
): "immutable" | "request" | "request-no-cors" | "response" | "none";
|
|
|
|
}
|
2021-04-14 16:49:16 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_fetch/21_formdata.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
type FormData = typeof FormData;
|
|
|
|
function formDataToBlob(
|
|
|
|
formData: FormData,
|
|
|
|
): Blob;
|
|
|
|
function parseFormData(
|
|
|
|
body: Uint8Array,
|
|
|
|
boundary: string | undefined,
|
|
|
|
): FormData;
|
|
|
|
function formDataFromEntries(entries: FormDataEntry[]): FormData;
|
|
|
|
}
|
2021-04-20 08:47:22 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_fetch/22_body.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function mixinBody(
|
|
|
|
prototype: any,
|
|
|
|
bodySymbol: symbol,
|
|
|
|
mimeTypeSymbol: symbol,
|
|
|
|
): void;
|
|
|
|
class InnerBody {
|
|
|
|
constructor(stream?: ReadableStream<Uint8Array>);
|
|
|
|
stream: ReadableStream<Uint8Array>;
|
|
|
|
source: null | Uint8Array | Blob | FormData;
|
|
|
|
length: null | number;
|
|
|
|
unusable(): boolean;
|
|
|
|
consume(): Promise<Uint8Array>;
|
|
|
|
clone(): InnerBody;
|
2021-01-28 15:37:21 -05:00
|
|
|
}
|
2023-02-07 14:22:46 -05:00
|
|
|
function extractBody(object: BodyInit): {
|
|
|
|
body: InnerBody;
|
|
|
|
contentType: string | null;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_fetch/26_fetch.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function toInnerRequest(request: Request): InnerRequest;
|
|
|
|
function fromInnerRequest(
|
|
|
|
inner: InnerRequest,
|
|
|
|
signal: AbortSignal | null,
|
|
|
|
guard:
|
|
|
|
| "request"
|
|
|
|
| "immutable"
|
|
|
|
| "request-no-cors"
|
|
|
|
| "response"
|
|
|
|
| "none",
|
|
|
|
skipBody: boolean,
|
|
|
|
flash: boolean,
|
|
|
|
): Request;
|
|
|
|
function redirectStatus(status: number): boolean;
|
|
|
|
function nullBodyStatus(status: number): boolean;
|
|
|
|
function newInnerRequest(
|
|
|
|
method: string,
|
|
|
|
url: any,
|
|
|
|
headerList?: [string, string][],
|
|
|
|
body?: fetchBody.InnerBody,
|
|
|
|
): InnerResponse;
|
|
|
|
function toInnerResponse(response: Response): InnerResponse;
|
|
|
|
function fromInnerResponse(
|
|
|
|
inner: InnerResponse,
|
|
|
|
guard:
|
|
|
|
| "request"
|
|
|
|
| "immutable"
|
|
|
|
| "request-no-cors"
|
|
|
|
| "response"
|
|
|
|
| "none",
|
|
|
|
): Response;
|
|
|
|
function networkError(error: string): InnerResponse;
|
2021-01-28 15:37:21 -05:00
|
|
|
}
|