From 7944b32dc84459e4e52adf589f17fcd2baa5bfc1 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Mon, 8 Apr 2024 13:36:30 +0200 Subject: [PATCH] Some cleanup of linter warnings --- .../sorting/modules/sorting-tree/services/tree.service.ts | 4 ++-- .../vertical-tab-group/vertical-tab-group.component.ts | 2 +- client/src/app/worker/default-shared-worker.worker.ts | 8 ++++---- client/src/app/worker/http/auth.ts | 6 +++--- client/src/app/worker/sw-auth.ts | 4 ++-- client/src/app/worker/sw-autoupdate.ts | 8 ++++---- client/src/app/worker/sw-control.ts | 4 ++-- client/src/app/worker/sw-icc.ts | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts b/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts index c7b084156b..ba2511a016 100644 --- a/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts +++ b/client/src/app/ui/modules/sorting/modules/sorting-tree/services/tree.service.ts @@ -32,7 +32,7 @@ export class TreeService { id: item.id, item, children, - toString: function () { + toString: function (): string { return this.item.toString(); } }; @@ -357,7 +357,7 @@ export class TreeService { expandable: false, id: item.id, position: index + oldMaxPosition + 1, - toString: function () { + toString: function (): string { return this.item.toString(); } })); diff --git a/client/src/app/ui/modules/vertical-tab-group/components/vertical-tab-group/vertical-tab-group.component.ts b/client/src/app/ui/modules/vertical-tab-group/components/vertical-tab-group/vertical-tab-group.component.ts index 45d069a432..e81fa3a1ec 100644 --- a/client/src/app/ui/modules/vertical-tab-group/components/vertical-tab-group/vertical-tab-group.component.ts +++ b/client/src/app/ui/modules/vertical-tab-group/components/vertical-tab-group/vertical-tab-group.component.ts @@ -89,7 +89,7 @@ export class VerticalTabGroupComponent { vp.isMobileSubject.subscribe(isMobile => (this._isMobile = isMobile)); } - public changeTabSelection(index: number) { + public changeTabSelection(index: number): void { if (this.selectedTabLabelIndex !== index) { this.doUpdateCurrentContent(index); } diff --git a/client/src/app/worker/default-shared-worker.worker.ts b/client/src/app/worker/default-shared-worker.worker.ts index 71487000b8..b08f22e926 100644 --- a/client/src/app/worker/default-shared-worker.worker.ts +++ b/client/src/app/worker/default-shared-worker.worker.ts @@ -4,7 +4,7 @@ import { autoupdateMessageHandler, initAutoupdateSw } from './sw-autoupdate'; import { controlGeneralMessageHandler, controlMessageHandler, initControlMessageHandler } from './sw-control'; import { iccMessageHandler, initIccSw } from './sw-icc'; -function registerMessageListener(ctx: any) { +function registerMessageListener(ctx: any): void { const handlers = { autoupdate: autoupdateMessageHandler, icc: iccMessageHandler, @@ -22,7 +22,7 @@ function registerMessageListener(ctx: any) { }); } -function initAll(broadcast: (s: string, a: string, c?: any) => void) { +function initAll(broadcast: (s: string, a: string, c?: any) => void): void { initAuthWorker(broadcast); initAutoupdateSw(broadcast); initIccSw(broadcast); @@ -30,7 +30,7 @@ function initAll(broadcast: (s: string, a: string, c?: any) => void) { } if ((self).Window && self instanceof (self).Window) { - function broadcast(sender: string, action: string, content?: any) { + function broadcast(sender: string, action: string, content?: any): void { self.postMessage({ sender, action, content }); } @@ -40,7 +40,7 @@ if ((self).Window && self instanceof (self).Window) { self.postMessage(`ready`); } else { const broadcastChannel = new BroadcastChannel(SW_BROADCAST_CHANNEL_NAME); - function broadcast(sender: string, action: string, content?: any) { + function broadcast(sender: string, action: string, content?: any): void { broadcastChannel.postMessage({ sender, action, content }); } diff --git a/client/src/app/worker/http/auth.ts b/client/src/app/worker/http/auth.ts index 32dc80f8a9..926181ed49 100644 --- a/client/src/app/worker/http/auth.ts +++ b/client/src/app/worker/http/auth.ts @@ -83,7 +83,7 @@ export class WorkerHttpAuth { this.updateAuthentication(); } - private destroy() { + private destroy(): void { clearTimeout(this._authTokenRefreshTimeout); } @@ -152,11 +152,11 @@ export class WorkerHttpAuth { } } - private notifyTokenChange(subscription: string) { + private notifyTokenChange(subscription: string): void { WorkerHttpAuth.subscriptions.get(subscription)(this.authToken); } - private notifyUserChange(subscription: string) { + private notifyUserChange(subscription: string): void { WorkerHttpAuth.subscriptions.get(subscription)(this.authToken, this.currentUserId); } } diff --git a/client/src/app/worker/sw-auth.ts b/client/src/app/worker/sw-auth.ts index a8332cc8b3..8317743bc3 100644 --- a/client/src/app/worker/sw-auth.ts +++ b/client/src/app/worker/sw-auth.ts @@ -1,10 +1,10 @@ import { Id } from '../domain/definitions/key-types'; import { WorkerHttpAuth } from './http/auth'; -export function initAuthWorker(broadcast: (s: string, a: string, c?: any) => void) { +export function initAuthWorker(broadcast: (s: string, a: string, c?: any) => void): void { WorkerHttpAuth.subscribe(`auth`, (token, uid?) => onAuthUpdate(token, uid)); - function onAuthUpdate(token: string, userId?: Id) { + function onAuthUpdate(token: string, userId?: Id): void { if (userId !== undefined) { broadcast(`auth`, `new-user`, { user: userId, diff --git a/client/src/app/worker/sw-autoupdate.ts b/client/src/app/worker/sw-autoupdate.ts index fc56fcc4ce..64524b6a54 100644 --- a/client/src/app/worker/sw-autoupdate.ts +++ b/client/src/app/worker/sw-autoupdate.ts @@ -29,13 +29,13 @@ const openTimeouts = { }; let debugCommandsRegistered = false; -function registerDebugCommands() { +function registerDebugCommands(): void { if (debugCommandsRegistered) { return; } debugCommandsRegistered = true; - (self).printAutoupdateState = function () { + (self).printAutoupdateState = function (): void { console.log(`AU POOL INFO`); console.log(`Currently open:`, autoupdatePool.activeStreams.length); console.group(`Streams`); @@ -65,7 +65,7 @@ function registerDebugCommands() { console.groupEnd(); }; - (self).disableAutoupdateCompression = function () { + (self).disableAutoupdateCompression = function (): void { autoupdatePool.disableCompression(); }; } @@ -167,7 +167,7 @@ if (!environment.production) { registerDebugCommands(); } -export function initAutoupdateSw(broadcast: (s: string, a: string, c?: any) => void) { +export function initAutoupdateSw(broadcast: (s: string, a: string, c?: any) => void): void { autoupdatePool.registerBroadcast(broadcast); } diff --git a/client/src/app/worker/sw-control.ts b/client/src/app/worker/sw-control.ts index 4eccb5a9d1..fef1497895 100644 --- a/client/src/app/worker/sw-control.ts +++ b/client/src/app/worker/sw-control.ts @@ -4,11 +4,11 @@ const startedAt = Date.now(); const RESTART_LIMIT_TIME = 30 * 1000; let broadcast: (s: string, a: string, c?: any) => void; -export function initControlMessageHandler(b: (s: string, a: string, c?: any) => void) { +export function initControlMessageHandler(b: (s: string, a: string, c?: any) => void): void { broadcast = b; } -export function controlGeneralMessageHandler(ctx: any, e: MessageEvent) { +export function controlGeneralMessageHandler(ctx: any, e: MessageEvent): void { if (e.data?.nonce) { ctx.postMessage({ sender: `control`, action: `ack`, content: e.data.nonce }); } diff --git a/client/src/app/worker/sw-icc.ts b/client/src/app/worker/sw-icc.ts index f2f4225298..f352befa4d 100644 --- a/client/src/app/worker/sw-icc.ts +++ b/client/src/app/worker/sw-icc.ts @@ -7,7 +7,7 @@ const iccPool = new ICCStreamPool({ method: `get` } as AutoupdateSetEndpointParams); -export function initIccSw(broadcast: (s: string, a: string, c?: any) => void) { +export function initIccSw(broadcast: (s: string, a: string, c?: any) => void): void { iccPool.registerBroadcast(broadcast); }