Navigate

API reference

pyric/storage/sw

3 published symbols from pyric

Generated from the TypeScript declarations shipped at this import path.

Interfaces

SandboxStorageFetchOptions

Properties

PropertyModifierTypeDescription
origin?readonlystringThe origin serving the sandbox’s byte route. Defaults to the service worker’s own origin.

StorageFetchEvent

The part of a service worker FetchEvent the helper reads and answers.

Properties

PropertyModifierType
requestreadonlyRequest

Methods

respondWith()
respondWith(response: Promise<Response>): void;
Parameters
ParameterType
responsePromise<Response>
Returns

void

Functions

sandboxStorageFetch()

function sandboxStorageFetch(event: StorageFetchEvent, options?: SandboxStorageFetchOptions): boolean;

Answers event from the sandbox when it reads a production Storage object, and returns whether it did. Any other request is left untouched for the browser or the app’s own handlers.

The answer keeps the URL’s token and drops production-only parameters such as generation, as localStorageUrl documents. The request’s method and headers, such as Range, are carried to the byte route.

Parameters

Returns

boolean