0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-07 23:06:50 -05:00

update after @lucacasonato comments

This commit is contained in:
Jo Franchetti 2024-06-27 15:26:01 +01:00
parent 443e877ab8
commit a064691e66
2 changed files with 40 additions and 40 deletions

View file

@ -5,19 +5,19 @@
/// <reference no-default-lib="true" /> /// <reference no-default-lib="true" />
/// <reference lib="esnext" /> /// <reference lib="esnext" />
/** Returns the CacheStorage object /** Returns the CacheStorage object
* associated with the current context. * associated with the current context.
* *
* @category Cache * @category Cache
*/ */
declare var caches: CacheStorage; declare var caches: CacheStorage;
/** Represents the storage for Cache objects. /** Represents the storage for Cache objects.
* The interface maintains a mapping of string names to corresponding * The interface maintains a mapping of string names to corresponding
* Cache objects. * Cache objects.
* *
* Use CacheStorage.open() to obtain a Cache instance. * Use CacheStorage.open() to obtain a Cache instance.
* *
* @category Cache * @category Cache
*/ */
declare interface CacheStorage { declare interface CacheStorage {
@ -29,9 +29,9 @@ declare interface CacheStorage {
delete(cacheName: string): Promise<boolean>; delete(cacheName: string): Promise<boolean>;
} }
/** /**
* Provides a storage mechanism for Request / Response object pairs * Provides a storage mechanism for Request / Response object pairs
* *
* @category Cache * @category Cache
*/ */
declare interface Cache { declare interface Cache {
@ -70,13 +70,13 @@ declare interface Cache {
/** @category Cache */ /** @category Cache */
declare var Cache: { declare var Cache: {
readonly prototype: Cache; readonly prototype: Cache;
new(): never; new (): never;
}; };
/** @category Cache */ /** @category Cache */
declare var CacheStorage: { declare var CacheStorage: {
readonly prototype: CacheStorage; readonly prototype: CacheStorage;
new(): never; new (): never;
}; };
/** @category Cache */ /** @category Cache */

View file

@ -40,7 +40,7 @@ declare interface DOMException extends Error {
/** @category Platform */ /** @category Platform */
declare var DOMException: { declare var DOMException: {
readonly prototype: DOMException; readonly prototype: DOMException;
new(message?: string, name?: string): DOMException; new (message?: string, name?: string): DOMException;
readonly INDEX_SIZE_ERR: 1; readonly INDEX_SIZE_ERR: 1;
readonly DOMSTRING_SIZE_ERR: 2; readonly DOMSTRING_SIZE_ERR: 2;
readonly HIERARCHY_REQUEST_ERR: 3; readonly HIERARCHY_REQUEST_ERR: 3;
@ -145,7 +145,7 @@ declare interface Event {
*/ */
declare var Event: { declare var Event: {
readonly prototype: Event; readonly prototype: Event;
new(type: string, eventInitDict?: EventInit): Event; new (type: string, eventInitDict?: EventInit): Event;
readonly AT_TARGET: number; readonly AT_TARGET: number;
readonly BUBBLING_PHASE: number; readonly BUBBLING_PHASE: number;
readonly CAPTURING_PHASE: number; readonly CAPTURING_PHASE: number;
@ -208,7 +208,7 @@ declare interface EventTarget {
*/ */
declare var EventTarget: { declare var EventTarget: {
readonly prototype: EventTarget; readonly prototype: EventTarget;
new(): EventTarget; new (): EventTarget;
}; };
/** Represents a function type that can be used as an event listener in various /** Represents a function type that can be used as an event listener in various
@ -285,7 +285,7 @@ declare interface ProgressEvent<T extends EventTarget = EventTarget>
*/ */
declare var ProgressEvent: { declare var ProgressEvent: {
readonly prototype: ProgressEvent; readonly prototype: ProgressEvent;
new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent; new (type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
}; };
/** Decodes a string of data which has been encoded using base-64 encoding. /** Decodes a string of data which has been encoded using base-64 encoding.
@ -345,7 +345,7 @@ declare interface TextDecoder {
* @category Encoding */ * @category Encoding */
declare var TextDecoder: { declare var TextDecoder: {
readonly prototype: TextDecoder; readonly prototype: TextDecoder;
new(label?: string, options?: TextDecoderOptions): TextDecoder; new (label?: string, options?: TextDecoderOptions): TextDecoder;
}; };
/** Represents the result of an encoding operation performed by a TextEncoder. /** Represents the result of an encoding operation performed by a TextEncoder.
@ -373,7 +373,7 @@ declare interface TextEncoder {
/** @category Encoding */ /** @category Encoding */
declare var TextEncoder: { declare var TextEncoder: {
readonly prototype: TextEncoder; readonly prototype: TextEncoder;
new(): TextEncoder; new (): TextEncoder;
}; };
/** A stream-based text decoder for efficient processing of large or /** A stream-based text decoder for efficient processing of large or
@ -395,7 +395,7 @@ declare interface TextDecoderStream {
/** @category Encoding */ /** @category Encoding */
declare var TextDecoderStream: { declare var TextDecoderStream: {
readonly prototype: TextDecoderStream; readonly prototype: TextDecoderStream;
new(label?: string, options?: TextDecoderOptions): TextDecoderStream; new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
}; };
/** Stream-based mechanism for encoding text into a stream of UTF-8 encoded data /** Stream-based mechanism for encoding text into a stream of UTF-8 encoded data
@ -412,7 +412,7 @@ declare interface TextEncoderStream {
/** @category Encoding */ /** @category Encoding */
declare var TextEncoderStream: { declare var TextEncoderStream: {
readonly prototype: TextEncoderStream; readonly prototype: TextEncoderStream;
new(): TextEncoderStream; new (): TextEncoderStream;
}; };
/** A controller object that allows you to abort one or more DOM requests as and /** A controller object that allows you to abort one or more DOM requests as and
@ -435,7 +435,7 @@ declare interface AbortController {
*/ */
declare var AbortController: { declare var AbortController: {
readonly prototype: AbortController; readonly prototype: AbortController;
new(): AbortController; new (): AbortController;
}; };
/** @category Platform */ /** @category Platform */
@ -483,7 +483,7 @@ declare interface AbortSignal extends EventTarget {
/** @category Platform */ /** @category Platform */
declare var AbortSignal: { declare var AbortSignal: {
readonly prototype: AbortSignal; readonly prototype: AbortSignal;
new(): never; new (): never;
abort(reason?: any): AbortSignal; abort(reason?: any): AbortSignal;
any(signals: AbortSignal[]): AbortSignal; any(signals: AbortSignal[]): AbortSignal;
timeout(milliseconds: number): AbortSignal; timeout(milliseconds: number): AbortSignal;
@ -512,8 +512,8 @@ declare interface FileReader extends EventTarget {
onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
onloadstart: onloadstart:
| ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | ((this: FileReader, ev: ProgressEvent<FileReader>) => any)
| null; | null;
onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
readonly readyState: number; readonly readyState: number;
readonly result: string | ArrayBuffer | null; readonly result: string | ArrayBuffer | null;
@ -550,7 +550,7 @@ declare interface FileReader extends EventTarget {
/** @category File */ /** @category File */
declare var FileReader: { declare var FileReader: {
readonly prototype: FileReader; readonly prototype: FileReader;
new(): FileReader; new (): FileReader;
readonly DONE: number; readonly DONE: number;
readonly EMPTY: number; readonly EMPTY: number;
readonly LOADING: number; readonly LOADING: number;
@ -590,7 +590,7 @@ declare interface Blob {
*/ */
declare var Blob: { declare var Blob: {
readonly prototype: Blob; readonly prototype: Blob;
new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
}; };
/** @category File */ /** @category File */
@ -615,7 +615,7 @@ declare interface File extends Blob {
*/ */
declare var File: { declare var File: {
readonly prototype: File; readonly prototype: File;
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
}; };
/** The result object from reading a stream when the stream has been fully /** The result object from reading a stream when the stream has been fully
@ -698,7 +698,7 @@ declare interface ReadableStreamBYOBReader {
/** @category Streams */ /** @category Streams */
declare var ReadableStreamBYOBReader: { declare var ReadableStreamBYOBReader: {
readonly prototype: ReadableStreamBYOBReader; readonly prototype: ReadableStreamBYOBReader;
new(stream: ReadableStream<Uint8Array>): ReadableStreamBYOBReader; new (stream: ReadableStream<Uint8Array>): ReadableStreamBYOBReader;
}; };
/** Notify the stream about the amount of data processed and to supply new buffers as needed. /** Notify the stream about the amount of data processed and to supply new buffers as needed.
@ -713,7 +713,7 @@ declare interface ReadableStreamBYOBRequest {
/** @category Streams */ /** @category Streams */
declare var ReadableStreamBYOBRequest: { declare var ReadableStreamBYOBRequest: {
readonly prototype: ReadableStreamBYOBRequest; readonly prototype: ReadableStreamBYOBRequest;
new(): never; new (): never;
}; };
/** A callback function type for managing a readable byte stream. /** A callback function type for managing a readable byte stream.
@ -782,7 +782,7 @@ declare interface ReadableStreamDefaultController<R = any> {
/** @category Streams */ /** @category Streams */
declare var ReadableStreamDefaultController: { declare var ReadableStreamDefaultController: {
readonly prototype: ReadableStreamDefaultController; readonly prototype: ReadableStreamDefaultController;
new(): never; new (): never;
}; };
/** Manage the flow of byte data in a stream, including buffering, closing the stream, and handling errors. /** Manage the flow of byte data in a stream, including buffering, closing the stream, and handling errors.
@ -799,7 +799,7 @@ declare interface ReadableByteStreamController {
/** @category Streams */ /** @category Streams */
declare var ReadableByteStreamController: { declare var ReadableByteStreamController: {
readonly prototype: ReadableByteStreamController; readonly prototype: ReadableByteStreamController;
new(): never; new (): never;
}; };
/** Fine grained control over {@linkcode ReadableStream.pipeTo} operations, allowing for the prevention of stream closing, cancellation, or aborting. /** Fine grained control over {@linkcode ReadableStream.pipeTo} operations, allowing for the prevention of stream closing, cancellation, or aborting.
@ -836,7 +836,7 @@ declare interface CountQueuingStrategy extends QueuingStrategy {
/** @category Streams */ /** @category Streams */
declare var CountQueuingStrategy: { declare var CountQueuingStrategy: {
readonly prototype: CountQueuingStrategy; readonly prototype: CountQueuingStrategy;
new(options: { highWaterMark: number }): CountQueuingStrategy; new (options: { highWaterMark: number }): CountQueuingStrategy;
}; };
/** @category Streams */ /** @category Streams */
@ -849,7 +849,7 @@ declare interface ByteLengthQueuingStrategy
/** @category Streams */ /** @category Streams */
declare var ByteLengthQueuingStrategy: { declare var ByteLengthQueuingStrategy: {
readonly prototype: ByteLengthQueuingStrategy; readonly prototype: ByteLengthQueuingStrategy;
new(options: { highWaterMark: number }): ByteLengthQueuingStrategy; new (options: { highWaterMark: number }): ByteLengthQueuingStrategy;
}; };
/** This Streams API interface represents a readable stream of byte data. The /** This Streams API interface represents a readable stream of byte data. The
@ -880,7 +880,7 @@ declare interface ReadableStream<R = any> {
/** @category Streams */ /** @category Streams */
declare var ReadableStream: { declare var ReadableStream: {
readonly prototype: ReadableStream; readonly prototype: ReadableStream;
new( new (
underlyingSource: UnderlyingByteSource, underlyingSource: UnderlyingByteSource,
strategy?: { highWaterMark?: number; size?: undefined }, strategy?: { highWaterMark?: number; size?: undefined },
): ReadableStream<Uint8Array>; ): ReadableStream<Uint8Array>;
@ -954,7 +954,7 @@ declare interface WritableStreamDefaultController {
/** @category Streams */ /** @category Streams */
declare var WritableStreamDefaultController: { declare var WritableStreamDefaultController: {
readonly prototype: WritableStreamDefaultController; readonly prototype: WritableStreamDefaultController;
new(): never; new (): never;
}; };
/** This Streams API interface is the object returned by /** This Streams API interface is the object returned by
@ -1007,7 +1007,7 @@ declare interface TransformStreamDefaultController<O = any> {
/** @category Streams */ /** @category Streams */
declare var TransformStreamDefaultController: { declare var TransformStreamDefaultController: {
readonly prototype: TransformStreamDefaultController; readonly prototype: TransformStreamDefaultController;
new(): never; new (): never;
}; };
/** Define custom behavior for transforming data in streams /** Define custom behavior for transforming data in streams
@ -1105,7 +1105,7 @@ declare interface MessageChannel {
*/ */
declare var MessageChannel: { declare var MessageChannel: {
readonly prototype: MessageChannel; readonly prototype: MessageChannel;
new(): MessageChannel; new (): MessageChannel;
}; };
/** @category Messaging */ /** @category Messaging */
@ -1172,7 +1172,7 @@ declare interface MessagePort extends EventTarget {
*/ */
declare var MessagePort: { declare var MessagePort: {
readonly prototype: MessagePort; readonly prototype: MessagePort;
new(): never; new (): never;
}; };
/** /**
@ -1245,7 +1245,7 @@ declare var CompressionStream: {
* Throws a `TypeError` if the format passed to the constructor is not * Throws a `TypeError` if the format passed to the constructor is not
* supported. * supported.
*/ */
new(format: string): CompressionStream; new (format: string): CompressionStream;
}; };
/** /**
@ -1292,7 +1292,7 @@ declare var DecompressionStream: {
* Throws a `TypeError` if the format passed to the constructor is not * Throws a `TypeError` if the format passed to the constructor is not
* supported. * supported.
*/ */
new(format: string): DecompressionStream; new (format: string): DecompressionStream;
}; };
/** Dispatch an uncaught exception. Similar to a synchronous version of: /** Dispatch an uncaught exception. Similar to a synchronous version of:
@ -1339,8 +1339,8 @@ declare interface ImageData {
/** @category Platform */ /** @category Platform */
declare var ImageData: { declare var ImageData: {
prototype: ImageData; prototype: ImageData;
new(sw: number, sh: number, settings?: ImageDataSettings): ImageData; new (sw: number, sh: number, settings?: ImageDataSettings): ImageData;
new( new (
data: Uint8ClampedArray, data: Uint8ClampedArray,
sw: number, sw: number,
sh?: number, sh?: number,