451-tools
Version:
Censorship resilient and distributed publishing: informed by the needs of publishers and their audiences, More Mirrors implements a set of offline fallback strategies for censorship resilient websites.
31 lines (30 loc) • 1.07 kB
TypeScript
export class ServiceWorkerController {
configurationFilePath: string;
modules: any[];
installHandlers: any[];
activateHandlers: any[];
fallbackHandlers: any[];
routes: any[];
fetcher(request: any): Promise<any>;
getConfiguration(): Promise<{}>;
setConfiguration(configuration: any): void;
addInstallHandler(installHandler: any): void;
addActivateHandler(activateHandler: any): void;
addRoute(routeMatcher: any, routeHandler: any, method?: string): void;
addFallbackHandler(fallbackMatcher: any, fallbackHandler: any): void;
handlerDidError(event: any): Promise<any>;
cleanupUnusedCaches(): Promise<void>;
onInstall(): Promise<any[]>;
onActivate(): Promise<[void, ...any[]]>;
init(): Promise<void>;
routeHandler({ event }: {
event: any;
}): Promise<any>;
/**
* Logs a message to the console if the configuration.debugMode flag is set to true.
*
* @param {string} message - The message to log.
*/
logger(message: string): Promise<void>;
#private;
}