Skip to content

Instantly share code, notes, and snippets.

@homam
Last active September 24, 2016 17:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save homam/acc88353734f73a4e678843cfe8427c8 to your computer and use it in GitHub Desktop.
Save homam/acc88353734f73a4e678843cfe8427c8 to your computer and use it in GitHub Desktop.
/* @flow */
declare class CacheOptions {
ignoreSearch: ?bool;
ignoreMethod: ?bool;
ignoreVary: ?bool;
cacheName: ?bool;
}
declare interface Cache {
add(url: string): Promise<void>;
addAll(urls: [Request | string]): Promise<void>;
delete(request: Request | string, options?: CacheOptions): Promise<bool>;
keys(): Promise<[Request]>;
match(request: Request | string, options?: CacheOptions): Promise<Response>;
matchAll(request: Request | String, options?: CacheOptions): Promise<[Request]>;
put(request: Request | string): Promise<void>;
}
declare interface Caches {
delete(key: string): Promise<bool>;
has(key: string): Promise<bool>;
keys(): Promise<[string]>;
match(request: Request | String, options?: CacheOptions): Promise<Response>;
open(cacheName: string): Promise<Cache>;
}
declare var caches: Caches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment