Convert SettingController to TS

This commit is contained in:
Travis Ralston 2020-07-28 15:13:38 -06:00
parent 27b81d1e26
commit 6297004957

View File

@ -1,5 +1,6 @@
/*
Copyright 2017 Travis Ralston
Copyright 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.
@ -14,6 +15,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { SettingLevel } from "../SettingLevel";
/**
* Represents a controller for individual settings to alter the reading behaviour
* based upon environmental conditions, or to react to changes and therefore update
@ -34,7 +37,7 @@ export default class SettingController {
* calculated at. May be null.
* @return {*} The value that should be used, or null if no override is applicable.
*/
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
public getValueOverride(level: SettingLevel, roomId: string, calculatedValue: any, calculatedAtLevel: any): any {
return null; // no override
}
@ -44,7 +47,7 @@ export default class SettingController {
* @param {String} roomId The room ID, may be null.
* @param {*} newValue The new value for the setting, may be null.
*/
onChange(level, roomId, newValue) {
public onChange(level: SettingLevel, roomId: string, newValue: any) {
// do nothing by default
}
}