You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.3 KiB
32 lines
1.3 KiB
import { RouteHandler } from 'workbox-core/types.js'; |
|
import { HTTPMethod } from './utils/constants.js'; |
|
import { Route } from './Route.js'; |
|
import './_version.js'; |
|
/** |
|
* RegExpRoute makes it easy to create a regular expression based |
|
* {@link workbox-routing.Route}. |
|
* |
|
* For same-origin requests the RegExp only needs to match part of the URL. For |
|
* requests against third-party servers, you must define a RegExp that matches |
|
* the start of the URL. |
|
* |
|
* @memberof workbox-routing |
|
* @extends workbox-routing.Route |
|
*/ |
|
declare class RegExpRoute extends Route { |
|
/** |
|
* If the regular expression contains |
|
* [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references}, |
|
* the captured values will be passed to the |
|
* {@link workbox-routing~handlerCallback} `params` |
|
* argument. |
|
* |
|
* @param {RegExp} regExp The regular expression to match against URLs. |
|
* @param {workbox-routing~handlerCallback} handler A callback |
|
* function that returns a Promise resulting in a Response. |
|
* @param {string} [method='GET'] The HTTP method to match the Route |
|
* against. |
|
*/ |
|
constructor(regExp: RegExp, handler: RouteHandler, method?: HTTPMethod); |
|
} |
|
export { RegExpRoute };
|
|
|