Files
mudita-center/libs/core/settings/controllers/settings.controller.ts
patryk-sierzega c85ceed34c [CP-2260] Setup Nx (#1607)
Co-authored-by: Daniel Karski <daniel.karski5q@gmail.com>
Co-authored-by: Oskar Michalkiewicz <32848134+OskarMichalkiewicz@users.noreply.github.com>
Co-authored-by: Łukasz Kowalczyk <freelancer.lukasz.kowalczyk@gmail.com>
Co-authored-by: Michał Kurczewski <michalkurczewski94@gmail.com>
Co-authored-by: mkurczewski <michal@kurczewski.dev>
2023-12-12 14:40:04 +01:00

30 lines
922 B
TypeScript

/**
* Copyright (c) Mudita sp. z o.o. All rights reserved.
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md
*/
import { IpcEvent } from "Core/core/decorators"
import { IpcSettingsEvent } from "Core/settings/constants"
import { Settings, SettingsUpdateOption } from "Core/settings/dto"
import { SettingsService } from "Core/settings/services"
import { SettingsValue } from "Core/settings/types"
export class SettingsController {
constructor(private settingsService: SettingsService) {}
@IpcEvent(IpcSettingsEvent.Get)
getSettings(): Settings {
return this.settingsService.getSettings()
}
@IpcEvent(IpcSettingsEvent.Reset)
resetSettings(): Settings {
return this.settingsService.resetSettings()
}
@IpcEvent(IpcSettingsEvent.Update)
updateSettings(option: SettingsUpdateOption): SettingsValue {
return this.settingsService.updateSettings(option)
}
}