fix(core): update

This commit is contained in:
Philipp Kunz 2024-05-23 15:28:41 +02:00
parent 9968dda0fa
commit 360766d8b4
7 changed files with 19 additions and 16 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedserver',
version: '3.0.40',
version: '3.0.41',
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
}

View File

@ -2,7 +2,10 @@
import * as env from './env.js';
declare var self: env.ServiceWindow;
import { LosslessServiceWorker } from './serviceworker.classes.serviceworker.js';
import { ServiceWorker } from './serviceworker.classes.serviceworker.js';
const losslessServiceWorkerInstance = new LosslessServiceWorker(self);
export const getServiceWorkerInstance = () => {
const sw = new ServiceWorker(self);
return sw;
}

View File

@ -1,16 +1,16 @@
import * as plugins from './plugins.js';
import * as interfaces from './env.js';
import { logger } from './serviceworker.logging.js';
import { LosslessServiceWorker } from './serviceworker.classes.serviceworker.js';
import { ServiceWorker } from './serviceworker.classes.serviceworker.js';
export class CacheManager {
public losslessServiceWorkerRef: LosslessServiceWorker;
public losslessServiceWorkerRef: ServiceWorker;
public usedCacheNames = {
runtimeCacheName: 'runtime'
};
constructor(losslessServiceWorkerRefArg: LosslessServiceWorker) {
constructor(losslessServiceWorkerRefArg: ServiceWorker) {
this.losslessServiceWorkerRef = losslessServiceWorkerRefArg;
this._setupCache();
}

View File

@ -1,13 +1,13 @@
import * as plugins from './plugins.js';
import { LosslessServiceWorker } from './serviceworker.classes.serviceworker.js';
import { ServiceWorker } from './serviceworker.classes.serviceworker.js';
export class NetworkManager {
public serviceWorkerRef: LosslessServiceWorker;
public serviceWorkerRef: ServiceWorker;
public webRequest: plugins.webrequest.WebRequest;
public previousState: string;
constructor(serviceWorkerRefArg: LosslessServiceWorker) {
constructor(serviceWorkerRefArg: ServiceWorker) {
this.serviceWorkerRef = serviceWorkerRefArg;
this.webRequest = new plugins.webrequest.WebRequest();
this.getConnection()?.addEventListener('change', () => {

View File

@ -13,7 +13,7 @@ import { NetworkManager } from './serviceworker.classes.networkmanager.js';
import { TaskManager } from './serviceworker.classes.taskmanager.js';
import { ServiceworkerBackend } from './classes.backend.js';
export class LosslessServiceWorker {
export class ServiceWorker {
// STATIC
// INSTANCE

View File

@ -1,14 +1,14 @@
import * as plugins from './plugins.js';
import { LosslessServiceWorker } from './serviceworker.classes.serviceworker.js';
import { ServiceWorker } from './serviceworker.classes.serviceworker.js';
/**
* Taskmanager
* should use times allocated by browser
*/
export class TaskManager {
public serviceworkerRef: LosslessServiceWorker;
public serviceworkerRef: ServiceWorker;
constructor(serviceWorkerRefArg: LosslessServiceWorker) {
constructor(serviceWorkerRefArg: ServiceWorker) {
this.serviceworkerRef = serviceWorkerRefArg;
}

View File

@ -1,6 +1,6 @@
import * as plugins from './plugins.js';
import * as interfaces from '../dist_ts_interfaces/index.js';
import { LosslessServiceWorker } from './serviceworker.classes.serviceworker.js';
import { ServiceWorker } from './serviceworker.classes.serviceworker.js';
import { logger } from './serviceworker.logging.js';
import { CacheManager } from './serviceworker.classes.cachemanager.js';
@ -8,9 +8,9 @@ export class UpdateManager {
public lastUpdateCheck: number = 0;
public lastVersionInfo: interfaces.serviceworker.IRequest_Serviceworker_Backend_VersionInfo['response'];
public serviceworkerRef: LosslessServiceWorker;
public serviceworkerRef: ServiceWorker;
constructor(serviceWorkerRefArg: LosslessServiceWorker) {
constructor(serviceWorkerRefArg: ServiceWorker) {
this.serviceworkerRef = serviceWorkerRefArg;
}