From 1f219d8530bd3d5fbe383a9f4235fd648be872f8 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 18 Jan 2021 17:40:32 -0700 Subject: [PATCH] Simple support for generics off the settings store Ideally the settings store returns the right type, but for now we can feed it the type we need/expect. --- src/settings/SettingsStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts index 1b718a72b3..6dc2a76ae8 100644 --- a/src/settings/SettingsStore.ts +++ b/src/settings/SettingsStore.ts @@ -276,7 +276,7 @@ export default class SettingsStore { * @param {boolean} excludeDefault True to disable using the default value. * @return {*} The value, or null if not found */ - public static getValue(settingName: string, roomId: string = null, excludeDefault = false): any { + public static getValue(settingName: string, roomId: string = null, excludeDefault = false): T { // Verify that the setting is actually a setting if (!SETTINGS[settingName]) { throw new Error("Setting '" + settingName + "' does not appear to be a setting.");