Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleanup of linter warnings #3509

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class TreeService {
id: item.id,
item,
children,
toString: function () {
toString: function (): string {
return this.item.toString();
}
};
Expand Down Expand Up @@ -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();
}
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/worker/default-shared-worker.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,15 +22,15 @@ 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);
initControlMessageHandler(broadcast);
}

if ((<any>self).Window && self instanceof (<any>self).Window) {
function broadcast(sender: string, action: string, content?: any) {
function broadcast(sender: string, action: string, content?: any): void {
self.postMessage({ sender, action, content });
}

Expand All @@ -40,7 +40,7 @@ if ((<any>self).Window && self instanceof (<any>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 });
}

Expand Down
6 changes: 3 additions & 3 deletions client/src/app/worker/http/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class WorkerHttpAuth {
this.updateAuthentication();
}

private destroy() {
private destroy(): void {
clearTimeout(this._authTokenRefreshTimeout);
}

Expand Down Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions client/src/app/worker/sw-auth.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/worker/sw-autoupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const openTimeouts = {
};

let debugCommandsRegistered = false;
function registerDebugCommands() {
function registerDebugCommands(): void {
if (debugCommandsRegistered) {
return;
}

debugCommandsRegistered = true;
(<any>self).printAutoupdateState = function () {
(<any>self).printAutoupdateState = function (): void {
console.log(`AU POOL INFO`);
console.log(`Currently open:`, autoupdatePool.activeStreams.length);
console.group(`Streams`);
Expand Down Expand Up @@ -65,7 +65,7 @@ function registerDebugCommands() {
console.groupEnd();
};

(<any>self).disableAutoupdateCompression = function () {
(<any>self).disableAutoupdateCompression = function (): void {
autoupdatePool.disableCompression();
};
}
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/app/worker/sw-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<WorkerMessage>) {
export function controlGeneralMessageHandler(ctx: any, e: MessageEvent<WorkerMessage>): void {
if (e.data?.nonce) {
ctx.postMessage({ sender: `control`, action: `ack`, content: e.data.nonce });
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/worker/sw-icc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading