2018-09-13 20:04:55 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-03-02 13:12:00 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2022-06-10 18:12:57 +00:00
|
|
|
* https://w3c.github.io/ServiceWorker/#cache-interface
|
2015-03-02 13:12:00 +00:00
|
|
|
*/
|
|
|
|
|
2022-01-10 15:18:28 +00:00
|
|
|
[Exposed=(Window,Worker),
|
2022-06-10 18:12:57 +00:00
|
|
|
Func="nsGlobalWindowInner::CachesEnabled"]
|
2015-03-02 13:12:00 +00:00
|
|
|
interface Cache {
|
2015-05-05 22:45:36 +00:00
|
|
|
[NewObject]
|
2019-07-03 07:52:35 +00:00
|
|
|
Promise<Response> match(RequestInfo request, optional CacheQueryOptions options = {});
|
2015-05-05 22:45:36 +00:00
|
|
|
[NewObject]
|
2019-07-03 07:52:35 +00:00
|
|
|
Promise<sequence<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options = {});
|
2017-02-01 20:43:37 +00:00
|
|
|
[NewObject, NeedsCallerType]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> add(RequestInfo request);
|
2017-02-01 20:43:37 +00:00
|
|
|
[NewObject, NeedsCallerType]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> addAll(sequence<RequestInfo> requests);
|
2015-05-05 22:45:36 +00:00
|
|
|
[NewObject]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> put(RequestInfo request, Response response);
|
2015-05-05 22:45:36 +00:00
|
|
|
[NewObject]
|
2019-07-03 07:52:35 +00:00
|
|
|
Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options = {});
|
2015-05-05 22:45:36 +00:00
|
|
|
[NewObject]
|
2019-07-03 07:52:35 +00:00
|
|
|
Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options = {});
|
2015-03-02 13:12:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary CacheQueryOptions {
|
2015-05-05 22:45:36 +00:00
|
|
|
boolean ignoreSearch = false;
|
|
|
|
boolean ignoreMethod = false;
|
|
|
|
boolean ignoreVary = false;
|
2015-03-02 13:12:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary CacheBatchOperation {
|
2015-05-05 22:45:36 +00:00
|
|
|
DOMString type;
|
|
|
|
Request request;
|
|
|
|
Response response;
|
|
|
|
CacheQueryOptions options;
|
2015-03-02 13:12:00 +00:00
|
|
|
};
|