Make tab width 2 spaces (#445)

This commit is contained in:
Francesco Stasi
2021-07-09 10:14:42 +02:00
committed by GitHub
parent 40a73af82b
commit e10f0f1683
205 changed files with 19676 additions and 20141 deletions

View File

@@ -1,87 +1,79 @@
import { injectable } from 'inversify';
import {
NotificationServiceServer,
NotificationServiceClient,
AttachedBoardsChangeEvent,
BoardsPackage,
LibraryPackage,
Config,
Sketch,
NotificationServiceServer,
NotificationServiceClient,
AttachedBoardsChangeEvent,
BoardsPackage,
LibraryPackage,
Config,
Sketch,
} from '../common/protocol';
@injectable()
export class NotificationServiceServerImpl
implements NotificationServiceServer
implements NotificationServiceServer
{
protected readonly clients: NotificationServiceClient[] = [];
protected readonly clients: NotificationServiceClient[] = [];
notifyIndexUpdated(): void {
this.clients.forEach((client) => client.notifyIndexUpdated());
}
notifyIndexUpdated(): void {
this.clients.forEach((client) => client.notifyIndexUpdated());
}
notifyDaemonStarted(): void {
this.clients.forEach((client) => client.notifyDaemonStarted());
}
notifyDaemonStarted(): void {
this.clients.forEach((client) => client.notifyDaemonStarted());
}
notifyDaemonStopped(): void {
this.clients.forEach((client) => client.notifyDaemonStopped());
}
notifyDaemonStopped(): void {
this.clients.forEach((client) => client.notifyDaemonStopped());
}
notifyPlatformInstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformInstalled(event));
}
notifyPlatformInstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformInstalled(event));
}
notifyPlatformUninstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) =>
client.notifyPlatformUninstalled(event)
);
}
notifyPlatformUninstalled(event: { item: BoardsPackage }): void {
this.clients.forEach((client) => client.notifyPlatformUninstalled(event));
}
notifyLibraryInstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryInstalled(event));
}
notifyLibraryInstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryInstalled(event));
}
notifyLibraryUninstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) =>
client.notifyLibraryUninstalled(event)
);
}
notifyLibraryUninstalled(event: { item: LibraryPackage }): void {
this.clients.forEach((client) => client.notifyLibraryUninstalled(event));
}
notifyAttachedBoardsChanged(event: AttachedBoardsChangeEvent): void {
this.clients.forEach((client) =>
client.notifyAttachedBoardsChanged(event)
);
}
notifyAttachedBoardsChanged(event: AttachedBoardsChangeEvent): void {
this.clients.forEach((client) => client.notifyAttachedBoardsChanged(event));
}
notifyConfigChanged(event: { config: Config | undefined }): void {
this.clients.forEach((client) => client.notifyConfigChanged(event));
}
notifyConfigChanged(event: { config: Config | undefined }): void {
this.clients.forEach((client) => client.notifyConfigChanged(event));
}
notifyRecentSketchesChanged(event: { sketches: Sketch[] }): void {
this.clients.forEach((client) =>
client.notifyRecentSketchesChanged(event)
);
}
notifyRecentSketchesChanged(event: { sketches: Sketch[] }): void {
this.clients.forEach((client) => client.notifyRecentSketchesChanged(event));
}
setClient(client: NotificationServiceClient): void {
this.clients.push(client);
}
setClient(client: NotificationServiceClient): void {
this.clients.push(client);
}
disposeClient(client: NotificationServiceClient): void {
const index = this.clients.indexOf(client);
if (index === -1) {
console.warn(
'Could not dispose notification service client. It was not registered.'
);
return;
}
this.clients.splice(index, 1);
disposeClient(client: NotificationServiceClient): void {
const index = this.clients.indexOf(client);
if (index === -1) {
console.warn(
'Could not dispose notification service client. It was not registered.'
);
return;
}
this.clients.splice(index, 1);
}
dispose(): void {
for (const client of this.clients) {
this.disposeClient(client);
}
this.clients.length = 0;
dispose(): void {
for (const client of this.clients) {
this.disposeClient(client);
}
this.clients.length = 0;
}
}