You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Fix various type definitions
This commit is contained in:
@@ -18,13 +18,14 @@ import SettingController from "./SettingController";
|
|||||||
import dis from "../../dispatcher/dispatcher";
|
import dis from "../../dispatcher/dispatcher";
|
||||||
import { UpdateFontSizePayload } from "../../dispatcher/payloads/UpdateFontSizePayload";
|
import { UpdateFontSizePayload } from "../../dispatcher/payloads/UpdateFontSizePayload";
|
||||||
import { Action } from "../../dispatcher/actions";
|
import { Action } from "../../dispatcher/actions";
|
||||||
|
import { SettingLevel } from "../SettingLevel";
|
||||||
|
|
||||||
export default class FontSizeController extends SettingController {
|
export default class FontSizeController extends SettingController {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange(level, roomId, newValue) {
|
public onChange(level: SettingLevel, roomId: string, newValue: any) {
|
||||||
// Dispatch font size change so that everything open responds to the change.
|
// Dispatch font size change so that everything open responds to the change.
|
||||||
dis.dispatch<UpdateFontSizePayload>({
|
dis.dispatch<UpdateFontSizePayload>({
|
||||||
action: Action.UpdateFontSize,
|
action: Action.UpdateFontSize,
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export class NotificationsEnabledController extends SettingController {
|
|||||||
return calculatedValue;
|
return calculatedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public onChange(level: SettingLevel, roomId: string, newValue) {
|
public onChange(level: SettingLevel, roomId: string, newValue: any) {
|
||||||
if (getNotifier().supportsDesktopNotifications()) {
|
if (getNotifier().supportsDesktopNotifications()) {
|
||||||
getNotifier().setEnabled(newValue);
|
getNotifier().setEnabled(newValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,13 +19,14 @@ import SettingsStore from "../SettingsStore";
|
|||||||
import dis from "../../dispatcher/dispatcher";
|
import dis from "../../dispatcher/dispatcher";
|
||||||
import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
|
import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
|
||||||
import { Action } from "../../dispatcher/actions";
|
import { Action } from "../../dispatcher/actions";
|
||||||
|
import { SettingLevel } from "../SettingLevel";
|
||||||
|
|
||||||
export default class SystemFontController extends SettingController {
|
export default class SystemFontController extends SettingController {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public onChange(level, roomId, newValue) {
|
public onChange(level: SettingLevel, roomId: string, newValue: any) {
|
||||||
// Dispatch font size change so that everything open responds to the change.
|
// Dispatch font size change so that everything open responds to the change.
|
||||||
dis.dispatch<UpdateSystemFontPayload>({
|
dis.dispatch<UpdateSystemFontPayload>({
|
||||||
action: Action.UpdateSystemFont,
|
action: Action.UpdateSystemFont,
|
||||||
|
|||||||
@@ -19,13 +19,14 @@ import SettingsStore from "../SettingsStore";
|
|||||||
import dis from "../../dispatcher/dispatcher";
|
import dis from "../../dispatcher/dispatcher";
|
||||||
import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
|
import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
|
||||||
import { Action } from "../../dispatcher/actions";
|
import { Action } from "../../dispatcher/actions";
|
||||||
|
import { SettingLevel } from "../SettingLevel";
|
||||||
|
|
||||||
export default class UseSystemFontController extends SettingController {
|
export default class UseSystemFontController extends SettingController {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public onChange(level, roomId, newValue) {
|
public onChange(level: SettingLevel, roomId: string, newValue: any) {
|
||||||
// Dispatch font size change so that everything open responds to the change.
|
// Dispatch font size change so that everything open responds to the change.
|
||||||
dis.dispatch<UpdateSystemFontPayload>({
|
dis.dispatch<UpdateSystemFontPayload>({
|
||||||
action: Action.UpdateSystemFont,
|
action: Action.UpdateSystemFont,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default class DefaultSettingsHandler extends SettingsHandler {
|
|||||||
* @param {object} defaults The default setting values, keyed by setting name.
|
* @param {object} defaults The default setting values, keyed by setting name.
|
||||||
* @param {object} invertedDefaults The default inverted setting values, keyed by setting name.
|
* @param {object} invertedDefaults The default inverted setting values, keyed by setting name.
|
||||||
*/
|
*/
|
||||||
constructor(private defaults: any, private invertedDefaults: any) { // TODO: [TS] Appropriate types
|
constructor(private defaults: Record<string, any>, private invertedDefaults: Record<string, any>) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export default class LocalEchoWrapper extends SettingsHandler {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public canSetValue(settingName, roomId): boolean {
|
public canSetValue(settingName: string, roomId: string): boolean {
|
||||||
return this.handler.canSetValue(settingName, roomId);
|
return this.handler.canSetValue(settingName, roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user