1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import { Strategy, StrategyOptions } from './Strategy.js';
- import { StrategyHandler } from './StrategyHandler.js';
- import './_version.js';
- export interface NetworkFirstOptions extends StrategyOptions {
- networkTimeoutSeconds?: number;
- }
- declare class NetworkFirst extends Strategy {
- private readonly _networkTimeoutSeconds;
-
- constructor(options?: NetworkFirstOptions);
- /**
- * @private
- * @param {Request|string} request A request to run this strategy for.
- * @param {workbox-strategies.StrategyHandler} handler The event that
- * triggered the request.
- * @return {Promise<Response>}
- */
- _handle(request: Request, handler: StrategyHandler): Promise<Response>;
- /**
- * @param {Object} options
- * @param {Request} options.request
- * @param {Array} options.logs A reference to the logs array
- * @param {Event} options.event
- * @return {Promise<Response>}
- *
- * @private
- */
- private _getTimeoutPromise;
- /**
- * @param {Object} options
- * @param {number|undefined} options.timeoutId
- * @param {Request} options.request
- * @param {Array} options.logs A reference to the logs Array.
- * @param {Event} options.event
- * @return {Promise<Response>}
- *
- * @private
- */
- _getNetworkPromise({ timeoutId, request, logs, handler, }: {
- request: Request;
- logs: any[];
- timeoutId?: number;
- handler: StrategyHandler;
- }): Promise<Response | undefined>;
- }
- export { NetworkFirst };
|