function updateObjectValues(
defaultSettings: IDefSettings,
userSettings: IUserSettings,
): IViewSettings | IModelSettings {
const c: IViewSettings | IModelSettings = {};
const keys: string[] = Object.getOwnPropertyNames(defaultSettings);
keys.forEach((key) => {
c[key] = key in userSettings
? userSettings[key as keyof IUserSettings]
: defaultSettings[key as keyof IDefSettings];
});
return c;
}
interface IModelSettings {
min: number;
max: number;
from: number;
to: number;
step: number;
stepInPrecents: number;
currentPos: number;
curPosInPoints: number | undefined;
posWithStepInPercents: number;
[index: string]: string | number | undefined;
}
interface IViewSettings {
range: boolean;
scale: boolean;
tooltips: boolean;
vertical: boolean;
confpanel: boolean;
bar: boolean;
thumbMarginFrom: number;
thumbMarginTo: number;
rangeMarginFrom: number;
rangeMarginTo: number;
[index: string]: string | boolean | number;
}