Urara-Blog/node_modules/.pnpm-store/v3/files/4a/53d6339819540157f4f1958648e754adaaa27f2b7a2cac13d32caa9d87d8a821be1fc58eb1c9eff8b985ce39c9a1344e3fe718eef3610f69f2229052de8fcf
2022-08-14 01:14:53 +08:00

32 lines
1.3 KiB
Text

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 };