WebWorkersAPI
Types
cache
Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. See Cache on MDN
type cache = {}
cacheQueryOptions
type cacheQueryOptions = { mutable ignoreSearch?: bool, mutable ignoreMethod?: bool, mutable ignoreVary?: bool,}
Record fields
ignoreSearch
ignoreMethod
ignoreVary
cacheStorage
The storage for Cache objects. See CacheStorage on MDN
type cacheStorage = {}
Module
There are methods and helpers defined in CacheStorage .
multiCacheQueryOptions
type multiCacheQueryOptions = { mutable ignoreSearch?: bool, mutable ignoreMethod?: bool, mutable ignoreVary?: bool, mutable cacheName?: string,}
Record fields
ignoreSearch
ignoreMethod
ignoreVary
cacheName
sharedWorkerGlobalScope
The SharedWorkerGlobalScope
object (the SharedWorker
global scope) is
accessible through the self keyword. Some additional global functions,
namespaces objects, and constructors, not typically associated with the worker
global scope, but available on it, are listed in the JavaScript Reference. See
the complete list of functions available to workers.
type sharedWorkerGlobalScope = { caches: cacheStorage, crossOriginIsolated: bool, name: option<string>,}
Record fields
name
Module
There are methods and helpers defined in SharedWorkerGlobalScope .
workerGlobalScope
The WorkerGlobalScope interface of the Web Workers API is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. See WorkerGlobalScope on MDN
type workerGlobalScope = { caches: cacheStorage, crossOriginIsolated: bool,}
Record fields
Module
There are methods and helpers defined in WorkerGlobalScope .
workerOptions
An object containing option properties that can set when creating the object instance.
type workerOptions = { mutable type_?: workerType, mutable credentials?: WebAPI.FetchAPI.requestCredentials, mutable name?: string,}
Record fields
type_
credentials
name
workerType
type workerType = | @as("classic") Classic | @as("module") Module