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
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/00_infra.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function collectSequenceOfCodepoints(
|
|
|
|
input: string,
|
|
|
|
position: number,
|
|
|
|
condition: (char: string) => boolean,
|
|
|
|
): {
|
|
|
|
result: string;
|
|
|
|
position: number;
|
|
|
|
};
|
|
|
|
const ASCII_DIGIT: string[];
|
|
|
|
const ASCII_UPPER_ALPHA: string[];
|
|
|
|
const ASCII_LOWER_ALPHA: string[];
|
|
|
|
const ASCII_ALPHA: string[];
|
|
|
|
const ASCII_ALPHANUMERIC: string[];
|
|
|
|
const HTTP_TAB_OR_SPACE: string[];
|
|
|
|
const HTTP_WHITESPACE: string[];
|
|
|
|
const HTTP_TOKEN_CODE_POINT: string[];
|
|
|
|
const HTTP_TOKEN_CODE_POINT_RE: RegExp;
|
|
|
|
const HTTP_QUOTED_STRING_TOKEN_POINT: string[];
|
|
|
|
const HTTP_QUOTED_STRING_TOKEN_POINT_RE: RegExp;
|
|
|
|
const HTTP_TAB_OR_SPACE_PREFIX_RE: RegExp;
|
|
|
|
const HTTP_TAB_OR_SPACE_SUFFIX_RE: RegExp;
|
|
|
|
const HTTP_WHITESPACE_PREFIX_RE: RegExp;
|
|
|
|
const HTTP_WHITESPACE_SUFFIX_RE: RegExp;
|
|
|
|
function httpTrim(s: string): string;
|
|
|
|
function regexMatcher(chars: string[]): string;
|
|
|
|
function byteUpperCase(s: string): string;
|
|
|
|
function byteLowerCase(s: string): string;
|
|
|
|
function collectHttpQuotedString(
|
|
|
|
input: string,
|
|
|
|
position: number,
|
|
|
|
extractValue: boolean,
|
|
|
|
): {
|
|
|
|
result: string;
|
|
|
|
position: number;
|
|
|
|
};
|
|
|
|
function forgivingBase64Encode(data: Uint8Array): string;
|
|
|
|
function forgivingBase64Decode(data: string): Uint8Array;
|
|
|
|
function serializeJSValueToJSONString(value: unknown): string;
|
|
|
|
}
|
2021-07-03 15:32:28 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/01_dom_exception.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
export = DOMException;
|
|
|
|
}
|
2021-04-08 09:05:08 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/01_mimesniff.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
interface MimeType {
|
|
|
|
type: string;
|
|
|
|
subtype: string;
|
|
|
|
parameters: Map<string, string>;
|
|
|
|
}
|
|
|
|
function parseMimeType(input: string): MimeType | null;
|
|
|
|
function essence(mimeType: MimeType): string;
|
|
|
|
function serializeMimeType(mimeType: MimeType): string;
|
|
|
|
function extractMimeType(
|
|
|
|
headerValues: string[] | null,
|
|
|
|
): MimeType | null;
|
|
|
|
}
|
2021-03-01 05:31:13 -05:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/02_event.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
const EventTarget: typeof EventTarget;
|
|
|
|
const Event: typeof event;
|
|
|
|
const ErrorEvent: typeof ErrorEvent;
|
|
|
|
const CloseEvent: typeof CloseEvent;
|
|
|
|
const MessageEvent: typeof MessageEvent;
|
|
|
|
const CustomEvent: typeof CustomEvent;
|
|
|
|
const ProgressEvent: typeof ProgressEvent;
|
|
|
|
const PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
|
|
const reportError: typeof reportError;
|
|
|
|
}
|
2022-10-24 10:14:17 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/12_location.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function getLocationHref(): string | undefined;
|
|
|
|
}
|
2021-04-06 06:55:05 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/05_base64.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function atob(data: string): string;
|
|
|
|
function btoa(data: string): string;
|
|
|
|
}
|
2021-06-10 09:26:10 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/09_file.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function blobFromObjectUrl(url: string): Blob | null;
|
|
|
|
function getParts(blob: Blob): string[];
|
|
|
|
const Blob: typeof Blob;
|
|
|
|
const File: typeof File;
|
|
|
|
}
|
2021-06-14 07:51:02 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/06_streams.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
const ReadableStream: typeof ReadableStream;
|
|
|
|
function isReadableStreamDisturbed(stream: ReadableStream): boolean;
|
|
|
|
function createProxy<T>(stream: ReadableStream<T>): ReadableStream<T>;
|
|
|
|
}
|
2021-06-21 13:53:52 -04:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
declare module "ext:deno_web/13_message_port.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
type Transferable = {
|
|
|
|
kind: "messagePort";
|
|
|
|
data: number;
|
|
|
|
} | {
|
|
|
|
kind: "arrayBuffer";
|
|
|
|
data: number;
|
|
|
|
};
|
|
|
|
interface MessageData {
|
|
|
|
data: Uint8Array;
|
|
|
|
transferables: Transferable[];
|
2021-01-28 15:37:21 -05:00
|
|
|
}
|
|
|
|
}
|