Cache.webidl (1418B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 * You can obtain one at http://mozilla.org/MPL/2.0/. 5 * 6 * The origin of this IDL file is 7 * https://w3c.github.io/ServiceWorker/#cache-interface 8 */ 9 10 [Exposed=(Window,Worker), 11 Func="cache::Cache::CachesEnabled"] 12 interface Cache { 13 [NewObject] 14 Promise<Response> match(RequestInfo request, optional CacheQueryOptions options = {}); 15 [NewObject] 16 Promise<sequence<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options = {}); 17 [NewObject, NeedsCallerType] 18 Promise<undefined> add(RequestInfo request); 19 [NewObject, NeedsCallerType] 20 Promise<undefined> addAll(sequence<RequestInfo> requests); 21 [NewObject] 22 Promise<undefined> put(RequestInfo request, Response response); 23 [NewObject] 24 Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options = {}); 25 [NewObject] 26 Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options = {}); 27 }; 28 29 dictionary CacheQueryOptions { 30 boolean ignoreSearch = false; 31 boolean ignoreMethod = false; 32 boolean ignoreVary = false; 33 }; 34 35 dictionary CacheBatchOperation { 36 DOMString type; 37 Request request; 38 Response response; 39 CacheQueryOptions options; 40 };