source: frontend/node_modules/workbox-routing/NavigationRoute.d.ts

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: 2.6 KB
Line 
1import { RouteHandler } from 'workbox-core/types.js';
2import { Route } from './Route.js';
3import './_version.js';
4export interface NavigationRouteMatchOptions {
5 allowlist?: RegExp[];
6 denylist?: RegExp[];
7}
8/**
9 * NavigationRoute makes it easy to create a
10 * {@link workbox-routing.Route} that matches for browser
11 * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
12 *
13 * It will only match incoming Requests whose
14 * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}
15 * is set to `navigate`.
16 *
17 * You can optionally only apply this route to a subset of navigation requests
18 * by using one or both of the `denylist` and `allowlist` parameters.
19 *
20 * @memberof workbox-routing
21 * @extends workbox-routing.Route
22 */
23declare class NavigationRoute extends Route {
24 private readonly _allowlist;
25 private readonly _denylist;
26 /**
27 * If both `denylist` and `allowlist` are provided, the `denylist` will
28 * take precedence and the request will not match this route.
29 *
30 * The regular expressions in `allowlist` and `denylist`
31 * are matched against the concatenated
32 * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
33 * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
34 * portions of the requested URL.
35 *
36 * *Note*: These RegExps may be evaluated against every destination URL during
37 * a navigation. Avoid using
38 * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
39 * or else your users may see delays when navigating your site.
40 *
41 * @param {workbox-routing~handlerCallback} handler A callback
42 * function that returns a Promise resulting in a Response.
43 * @param {Object} options
44 * @param {Array<RegExp>} [options.denylist] If any of these patterns match,
45 * the route will not handle the request (even if a allowlist RegExp matches).
46 * @param {Array<RegExp>} [options.allowlist=[/./]] If any of these patterns
47 * match the URL's pathname and search parameter, the route will handle the
48 * request (assuming the denylist doesn't match).
49 */
50 constructor(handler: RouteHandler, { allowlist, denylist }?: NavigationRouteMatchOptions);
51 /**
52 * Routes match handler.
53 *
54 * @param {Object} options
55 * @param {URL} options.url
56 * @param {Request} options.request
57 * @return {boolean}
58 *
59 * @private
60 */
61 private _match;
62}
63export { NavigationRoute };
Note: See TracBrowser for help on using the repository browser.