|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | import { RouteHandlerCallback, RouteHandlerCallbackOptions } from 'workbox-core/types.js';
|
|---|
| 2 | import { StreamSource } from './_types.js';
|
|---|
| 3 | import './_version.js';
|
|---|
| 4 | export interface StreamsHandlerCallback {
|
|---|
| 5 | ({ url, request, event, params }: RouteHandlerCallbackOptions): Promise<StreamSource> | StreamSource;
|
|---|
| 6 | }
|
|---|
| 7 | /**
|
|---|
| 8 | * A shortcut to create a strategy that could be dropped-in to Workbox's router.
|
|---|
| 9 | *
|
|---|
| 10 | * On browsers that do not support constructing new `ReadableStream`s, this
|
|---|
| 11 | * strategy will automatically wait for all the `sourceFunctions` to complete,
|
|---|
| 12 | * and create a final response that concatenates their values together.
|
|---|
| 13 | *
|
|---|
| 14 | * @param {Array<function({event, request, url, params})>} sourceFunctions
|
|---|
| 15 | * An array of functions similar to {@link workbox-routing~handlerCallback}
|
|---|
| 16 | * but that instead return a {@link workbox-streams.StreamSource} (or a
|
|---|
| 17 | * Promise which resolves to one).
|
|---|
| 18 | * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,
|
|---|
| 19 | * `'text/html'` will be used by default.
|
|---|
| 20 | * @return {workbox-routing~handlerCallback}
|
|---|
| 21 | * @memberof workbox-streams
|
|---|
| 22 | */
|
|---|
| 23 | declare function strategy(sourceFunctions: StreamsHandlerCallback[], headersInit: HeadersInit): RouteHandlerCallback;
|
|---|
| 24 | export { strategy };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.