source: frontend/node_modules/workbox-routing/Route.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: 1.4 KB
RevLine 
[9af201e]1import { HTTPMethod } from './utils/constants.js';
2import { RouteHandler, RouteHandlerObject, RouteMatchCallback } from 'workbox-core/types.js';
3import './_version.js';
4/**
5 * A `Route` consists of a pair of callback functions, "match" and "handler".
6 * The "match" callback determine if a route should be used to "handle" a
7 * request by returning a non-falsy value if it can. The "handler" callback
8 * is called when there is a match and should return a Promise that resolves
9 * to a `Response`.
10 *
11 * @memberof workbox-routing
12 */
13declare class Route {
14 handler: RouteHandlerObject;
15 match: RouteMatchCallback;
16 method: HTTPMethod;
17 catchHandler?: RouteHandlerObject;
18 /**
19 * Constructor for Route class.
20 *
21 * @param {workbox-routing~matchCallback} match
22 * A callback function that determines whether the route matches a given
23 * `fetch` event by returning a non-falsy value.
24 * @param {workbox-routing~handlerCallback} handler A callback
25 * function that returns a Promise resolving to a Response.
26 * @param {string} [method='GET'] The HTTP method to match the Route
27 * against.
28 */
29 constructor(match: RouteMatchCallback, handler: RouteHandler, method?: HTTPMethod);
30 /**
31 *
32 * @param {workbox-routing-handlerCallback} handler A callback
33 * function that returns a Promise resolving to a Response
34 */
35 setCatchHandler(handler: RouteHandler): void;
36}
37export { Route };
Note: See TracBrowser for help on using the repository browser.