From c9f6e3b1f663c8c39c10774388610a40abb49df1 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 19 Feb 2024 11:58:32 +0100 Subject: [PATCH] Update typescript imports --- ts/WoltLabSuite/Core/BootstrapFrontend.ts | 6 +++--- ts/WoltLabSuite/Core/Notification/ServiceWorker.ts | 3 ++- .../files/js/WoltLabSuite/Core/BootstrapFrontend.js | 5 ++--- .../js/WoltLabSuite/Core/Notification/ServiceWorker.js | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ts/WoltLabSuite/Core/BootstrapFrontend.ts b/ts/WoltLabSuite/Core/BootstrapFrontend.ts index 8c71dc6dd0..be6881d2a1 100644 --- a/ts/WoltLabSuite/Core/BootstrapFrontend.ts +++ b/ts/WoltLabSuite/Core/BootstrapFrontend.ts @@ -12,13 +12,13 @@ import * as UiUserIgnore from "./Ui/User/Ignore"; import * as UiPageHeaderMenu from "./Ui/Page/Header/Menu"; import * as UiMessageUserConsent from "./Ui/Message/UserConsent"; import * as UiMessageShareDialog from "./Ui/Message/Share/Dialog"; -import { ShareProvider, addShareProviders } from "./Ui/Message/Share/Providers"; +import { addShareProviders, ShareProvider } from "./Ui/Message/Share/Providers"; import * as UiFeedDialog from "./Ui/Feed/Dialog"; import User from "./User"; import UiPageMenuMainFrontend from "./Ui/Page/Menu/Main/Frontend"; import { whenFirstSeen } from "./LazyLoader"; import { prepareRequest } from "./Ajax/Backend"; -import * as ServiceWorker from "./Notification/ServiceWorker"; +import { setup as serviceWorkerSetup } from "./Notification/ServiceWorker"; interface BootstrapOptions { backgroundQueue: { @@ -110,7 +110,7 @@ export function setup(options: BootstrapOptions): void { if (User.userId) { UiFeedDialog.setup(); if (options.serviceWorker) { - ServiceWorker.init( + serviceWorkerSetup( options.serviceWorker.publicKey, options.serviceWorker.serviceWorkerJsUrl, options.serviceWorker.registerUrl, diff --git a/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts b/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts index bfae391f4a..e3bc116d3c 100644 --- a/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts +++ b/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts @@ -2,6 +2,7 @@ * @author Olaf Braun * @copyright 2001-2024 WoltLab GmbH * @license GNU Lesser General Public License + * @since 6.1 * @woltlabExcludeBundle tiny */ @@ -119,7 +120,7 @@ function serviceWorkerSupported(): boolean { return true; } -export function init(publicKey: string, serviceWorkerJsUrl: string, registerUrl: string): void { +export function setup(publicKey: string, serviceWorkerJsUrl: string, registerUrl: string): void { if (!serviceWorkerSupported()) { return; } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/BootstrapFrontend.js b/wcfsetup/install/files/js/WoltLabSuite/Core/BootstrapFrontend.js index 307c8eebc7..349aad4c33 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/BootstrapFrontend.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/BootstrapFrontend.js @@ -5,7 +5,7 @@ * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License */ -define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Ui/User/Ignore", "./Ui/Page/Header/Menu", "./Ui/Message/UserConsent", "./Ui/Message/Share/Dialog", "./Ui/Message/Share/Providers", "./Ui/Feed/Dialog", "./User", "./Ui/Page/Menu/Main/Frontend", "./LazyLoader", "./Ajax/Backend", "./Notification/ServiceWorker"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent, UiMessageShareDialog, Providers_1, UiFeedDialog, User_1, Frontend_1, LazyLoader_1, Backend_1, ServiceWorker) { +define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Ui/User/Ignore", "./Ui/Page/Header/Menu", "./Ui/Message/UserConsent", "./Ui/Message/Share/Dialog", "./Ui/Message/Share/Providers", "./Ui/Feed/Dialog", "./User", "./Ui/Page/Menu/Main/Frontend", "./LazyLoader", "./Ajax/Backend", "./Notification/ServiceWorker"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent, UiMessageShareDialog, Providers_1, UiFeedDialog, User_1, Frontend_1, LazyLoader_1, Backend_1, ServiceWorker_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setup = void 0; @@ -18,7 +18,6 @@ define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Ui UiFeedDialog = tslib_1.__importStar(UiFeedDialog); User_1 = tslib_1.__importDefault(User_1); Frontend_1 = tslib_1.__importDefault(Frontend_1); - ServiceWorker = tslib_1.__importStar(ServiceWorker); /** * Initializes user profile popover. */ @@ -79,7 +78,7 @@ define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Ui if (User_1.default.userId) { UiFeedDialog.setup(); if (options.serviceWorker) { - ServiceWorker.init(options.serviceWorker.publicKey, options.serviceWorker.serviceWorkerJsUrl, options.serviceWorker.registerUrl); + (0, ServiceWorker_1.setup)(options.serviceWorker.publicKey, options.serviceWorker.serviceWorkerJsUrl, options.serviceWorker.registerUrl); } } (0, LazyLoader_1.whenFirstSeen)("woltlab-core-reaction-summary", () => { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js index c82cebd4ec..dc8c905250 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js @@ -2,12 +2,13 @@ * @author Olaf Braun * @copyright 2001-2024 WoltLab GmbH * @license GNU Lesser General Public License + * @since 6.1 * @woltlabExcludeBundle tiny */ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend"], function (require, exports, Backend_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.registerServiceWorker = exports.init = void 0; + exports.registerServiceWorker = exports.setup = void 0; let _serviceWorker = null; class ServiceWorker { publicKey; @@ -104,7 +105,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend"], function (requi } return true; } - function init(publicKey, serviceWorkerJsUrl, registerUrl) { + function setup(publicKey, serviceWorkerJsUrl, registerUrl) { if (!serviceWorkerSupported()) { return; } @@ -113,7 +114,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend"], function (requi registerServiceWorker(); } } - exports.init = init; + exports.setup = setup; function registerServiceWorker() { void _serviceWorker?.register(); } -- 2.20.1