2024-05-11 10:51:20 +00:00
|
|
|
// types
|
2024-05-14 00:18:42 +00:00
|
|
|
import type * as interfaces from '../dist_ts_interfaces/index.js';
|
2024-05-11 10:51:20 +00:00
|
|
|
export type {
|
|
|
|
interfaces
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====================================
|
|
|
|
// imports
|
|
|
|
// ====================================
|
|
|
|
|
2024-05-24 23:28:56 +00:00
|
|
|
import { logger } from './logging.js';
|
2024-05-11 10:51:20 +00:00
|
|
|
logger.log('note', 'mainthread console initialized!');
|
|
|
|
|
2024-05-24 23:28:56 +00:00
|
|
|
import { ServiceworkerClient } from './classes.serviceworkerclient.js';
|
2024-05-11 10:51:20 +00:00
|
|
|
|
|
|
|
export type {
|
2024-05-25 00:35:23 +00:00
|
|
|
ServiceworkerClient
|
2024-05-11 10:51:20 +00:00
|
|
|
}
|
|
|
|
|
2024-05-25 00:34:43 +00:00
|
|
|
export const getServiceworkerClient = async () => {
|
|
|
|
const swClient = await ServiceworkerClient.createServiceWorker(); // lets setup the service worker
|
2024-05-11 10:51:20 +00:00
|
|
|
logger.log('ok', 'service worker ready!'); // and wait for it to be ready
|
2024-05-25 00:34:43 +00:00
|
|
|
return swClient;
|
2024-05-11 10:51:20 +00:00
|
|
|
};
|