mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
a69b4646a0
Updating categories for new sitemap as documented here: https://lucid.app/lucidspark/744b0498-a133-494d-981c-76059dd18885/edit?view_items=jpvBwFdYlNdB&invitationId=inv_50c83415-2aa5-423f-b438-ea156695c08b
72 lines
2 KiB
TypeScript
72 lines
2 KiB
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
// deno-lint-ignore-file no-var
|
|
|
|
/// <reference no-default-lib="true" />
|
|
/// <reference lib="esnext" />
|
|
|
|
/** @category Cache */
|
|
declare var caches: CacheStorage;
|
|
|
|
/** @category Cache */
|
|
declare interface CacheStorage {
|
|
/** Open a cache storage for the provided name. */
|
|
open(cacheName: string): Promise<Cache>;
|
|
/** Check if cache already exists for the provided name. */
|
|
has(cacheName: string): Promise<boolean>;
|
|
/** Delete cache storage for the provided name. */
|
|
delete(cacheName: string): Promise<boolean>;
|
|
}
|
|
|
|
/** @category Cache */
|
|
declare interface Cache {
|
|
/**
|
|
* Put the provided request/response into the cache.
|
|
*
|
|
* How is the API different from browsers?
|
|
* 1. You cannot match cache objects using by relative paths.
|
|
* 2. You cannot pass options like `ignoreVary`, `ignoreMethod`, `ignoreSearch`.
|
|
*/
|
|
put(request: RequestInfo | URL, response: Response): Promise<void>;
|
|
/**
|
|
* Return cache object matching the provided request.
|
|
*
|
|
* How is the API different from browsers?
|
|
* 1. You cannot match cache objects using by relative paths.
|
|
* 2. You cannot pass options like `ignoreVary`, `ignoreMethod`, `ignoreSearch`.
|
|
*/
|
|
match(
|
|
request: RequestInfo | URL,
|
|
options?: CacheQueryOptions,
|
|
): Promise<Response | undefined>;
|
|
/**
|
|
* Delete cache object matching the provided request.
|
|
*
|
|
* How is the API different from browsers?
|
|
* 1. You cannot delete cache objects using by relative paths.
|
|
* 2. You cannot pass options like `ignoreVary`, `ignoreMethod`, `ignoreSearch`.
|
|
*/
|
|
delete(
|
|
request: RequestInfo | URL,
|
|
options?: CacheQueryOptions,
|
|
): Promise<boolean>;
|
|
}
|
|
|
|
/** @category Cache */
|
|
declare var Cache: {
|
|
readonly prototype: Cache;
|
|
new (): never;
|
|
};
|
|
|
|
/** @category Cache */
|
|
declare var CacheStorage: {
|
|
readonly prototype: CacheStorage;
|
|
new (): never;
|
|
};
|
|
|
|
/** @category Cache */
|
|
declare interface CacheQueryOptions {
|
|
ignoreMethod?: boolean;
|
|
ignoreSearch?: boolean;
|
|
ignoreVary?: boolean;
|
|
}
|