diff --git a/src/settings/handlers/SettingsHandler.js b/src/settings/handlers/SettingsHandler.ts similarity index 89% rename from src/settings/handlers/SettingsHandler.js rename to src/settings/handlers/SettingsHandler.ts index 7d987fc136..3be0fa4636 100644 --- a/src/settings/handlers/SettingsHandler.js +++ b/src/settings/handlers/SettingsHandler.ts @@ -1,6 +1,6 @@ /* Copyright 2017 Travis Ralston -Copyright 2019 New Vector Ltd. +Copyright 2019, 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ export default class SettingsHandler { * @param {String} roomId The room ID to read from, may be null. * @returns {*} The setting value, or null if not found. */ - getValue(settingName, roomId) { + public getValue(settingName: string, roomId: string): any { console.error("Invalid operation: getValue was not overridden"); return null; } @@ -44,7 +44,7 @@ export default class SettingsHandler { * @param {*} newValue The new value for the setting, may be null. * @returns {Promise} Resolves when the setting has been saved. */ - setValue(settingName, roomId, newValue) { + public setValue(settingName: string, roomId: string, newValue): Promise { console.error("Invalid operation: setValue was not overridden"); return Promise.reject(); } @@ -56,7 +56,7 @@ export default class SettingsHandler { * @param {String} roomId The room ID to check in, may be null * @returns {boolean} True if the setting can be set by the user, false otherwise. */ - canSetValue(settingName, roomId) { + public canSetValue(settingName: string, roomId: string): boolean { return false; } @@ -64,7 +64,7 @@ export default class SettingsHandler { * Determines if this level is supported on this device. * @returns {boolean} True if this level is supported on the current device. */ - isSupported() { + public isSupported(): boolean { return false; } }