Class Service
Implements
- Service
Constructors
constructor
-
Parameters
- options: ServiceOptions
Returns Service
Accessors
fetches
-
Returns Record<string, BackgroundFetchRegistration>
options
-
get options(): ServiceOptions
Get service options
Returns ServiceOptions
registration
-
get registration(): ExtendedServiceWorkerRegistration | undefined
Get service worker registration
Returns ExtendedServiceWorkerRegistration | undefined
Methods
fetch
-
Fetches a list of URLs into the kernel's filesystem with the Background Fetch API.
Parameters
- id: string
the fetch id (the directory name for the files)
- urls: string[]
the URLs to fetch
- options: object
fetch options
Returns Promise<BackgroundFetchRegistration>
the fetch registration
- id: string
message
-
Send a message to the Service Worker.
Parameters
- message: string
The message to send.
Returns Promise<void>
- message: string
register
-
Register the Service Worker.
Returns Promise<ServiceWorkerRegistration>
unregister
-
Unregister the Service Worker.
Returns Promise<void>
update
-
Update the Service Worker.
Returns Promise<void>
wire
-
Supply the subsystems
Serviceneeds but that don't exist at construction time. Must be called beforefetch()is used (background-fetch completion writes to the shell's cwd and reports to the terminal).Parameters
- wiring: ServiceWiring
Returns void
Get background fetches