-
Notifications
You must be signed in to change notification settings - Fork 161
Add WindowOrWorkerGlobalScope #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
armanbilge
merged 7 commits into
scala-js:series/1.x
from
japgolly:WindowOrWorkerGlobalScope
Aug 22, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7dfe04f
Add WindowOrWorkerGlobalScope
japgolly 2f21022
Merge exoego's WindowOrWorkerGlobalScope PR #416
japgolly db424e9
Run `sbt prePR`
japgolly e2cc047
Merge branch 'series/1.x' into WindowOrWorkerGlobalScope
japgolly eb0fd94
Restore backwards bincompat
japgolly 27ce299
Present deprecated type aliases in api reports, nicely
japgolly ffd1916
Mark members as deprecated when their parents are in api reports
japgolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/scala/org/scalajs/dom/experimental/cachestorage/CacheStorage.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package org.scalajs.dom.experimental.cachestorage | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation._ | ||
import org.scalajs.dom.experimental._ | ||
|
||
/** | ||
* See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] | ||
* of ServiceWorker whatwg spec. | ||
*/ | ||
@js.native | ||
trait CacheQueryOptions extends js.Object { | ||
var ignoreSearch: Boolean = js.native // false | ||
|
||
var ignoreMethod: Boolean = js.native // false | ||
|
||
var ignoreVary: Boolean = js.native //false | ||
|
||
var cacheName: String = js.native | ||
} | ||
|
||
/** | ||
* See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache-storage ¶5.5 cache]] | ||
* of ServiceWorker whatwg spec. | ||
*/ | ||
@js.native | ||
trait CacheStorage extends js.Object { | ||
def `match`(request: RequestInfo, | ||
options: CacheQueryOptions = js.native): js.Promise[js.Any] = js.native | ||
|
||
def has(cacheName: String): js.Promise[Boolean] = js.native | ||
|
||
def open(cacheName: String): js.Promise[Cache] = js.native | ||
|
||
def delete(cacheName: String): js.Promise[Boolean] = js.native | ||
|
||
def keys(): js.Promise[js.Array[String]] = js.native | ||
} | ||
|
||
/** | ||
* See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] | ||
* of ServiceWorker whatwg spec. | ||
*/ | ||
@js.native | ||
@JSGlobal | ||
abstract class Cache extends js.Object { | ||
def `match`(request: RequestInfo, | ||
options: js.UndefOr[ | ||
CacheQueryOptions] = js.native): js.Promise[js.UndefOr[Response]] = js.native | ||
|
||
def matchAll(request: RequestInfo = js.native, | ||
options: js.UndefOr[ | ||
CacheQueryOptions] = js.native): js.Promise[js.Array[Response]] = js.native | ||
|
||
def add(request: RequestInfo): js.Promise[Unit] = js.native | ||
|
||
def addAll(requests: js.Array[RequestInfo]): js.Promise[Unit] = js.native | ||
|
||
def put(request: RequestInfo, | ||
response: Response): js.Promise[Unit] = js.native | ||
|
||
def delete(request: RequestInfo, | ||
options: js.UndefOr[ | ||
CacheQueryOptions] = js.native): js.Promise[Boolean] = js.native | ||
|
||
def keys(request: js.UndefOr[RequestInfo] = js.native, | ||
options: js.UndefOr[ | ||
CacheQueryOptions] = js.native): js.Promise[js.Array[Request]] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.