0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-09 21:57:40 -04:00

adding explanations to interfaces and functions that dont have them

This commit is contained in:
Jo Franchetti 2024-06-25 14:52:12 +01:00
parent 1e8a6b94b1
commit f445244d5f
4 changed files with 77 additions and 43 deletions

View file

@ -5,10 +5,21 @@
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/** @category Cache */
/** Returns the CacheStorage object
* associated with the current context.
*
* @category Cache
*/
declare var caches: CacheStorage;
/** @category Cache */
/** Represents the storage for Cache objects.
* The interface maintains a mapping of string names to corresponding
* Cache *objects.
*
* Use CacheStorage.open() to obtain a Cache instance.
*
* @category Cache
*/
declare interface CacheStorage {
/** Open a cache storage for the provided name. */
open(cacheName: string): Promise<Cache>;
@ -18,7 +29,12 @@ declare interface CacheStorage {
delete(cacheName: string): Promise<boolean>;
}
/** @category Cache */
/**
* Provides a persistent storage mechanism for Request / Response object pairs
* that are cached in long lived memory.
*
* @category Cache
*/
declare interface Cache {
/**
* Put the provided request/response into the cache.

View file

@ -5,7 +5,11 @@
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/** @category I/O */
/** Provides access to the debugging console.
* The specific set of available methods are determined by the environment in
* which the script is running.
*
* @category I/O */
declare interface Console {
assert(condition?: boolean, ...data: any[]): void;
clear(): void;

View file

@ -5,7 +5,13 @@
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/** @category URL */
/** Defines utility methods to work with the
* query string of a URL. An object implementing URLSearchParams can directly
* be used in a `for...of` structure to iterate over key/value pairs in the
* same order as they appear in the query string
*
* @category URL
*/
declare interface URLSearchParams {
/** Appends a specified key/value pair as a new search parameter.
*

View file

@ -68,7 +68,10 @@ declare var DOMException: {
readonly DATA_CLONE_ERR: 25;
};
/** @category Events */
/** Specifies the options that can be passed to the constructor of an `Event`
* object. The EventInit interface defines three optional properties: `bubbles`, `cancelable`, and `composed`.
*
* @category Events */
declare interface EventInit {
bubbles?: boolean;
cancelable?: boolean;
@ -208,12 +211,17 @@ declare var EventTarget: {
new(): EventTarget;
};
/** @category Events */
/** Represents a function type that can be used as an event listener in various
* contexts. Functions matching this type must accept a single parameter, `evt`.
*
* @category Events */
declare interface EventListener {
(evt: Event): void | Promise<void>;
}
/** @category Events */
/** EventListenerObject interface defines objects that can handle events
*
* @category Events */
declare interface EventListenerObject {
handleEvent(evt: Event): void | Promise<void>;
}