Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Updates for TypeScript 2.5 #651

Merged
merged 3 commits into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"jsdom": "^9.5.0",
"sinon": "^1.17.6",
"tslint": "^5.2.0",
"typescript": "~2.4.1"
"typescript": "~2.5.2"
},
"dependencies": {
"maquette": "~2.5.1",
Expand Down
10 changes: 5 additions & 5 deletions src/mixins/Themeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp

const themeable = this;
function classesGetter(this: ClassesFunctionChain) {
const themeClasses = themeable._getThemeClasses(this.classes);
const themeClasses = themeable._getThemeClasses(this.classes as (keyof E)[]);
const fixedClasses = themeable._getFixedClasses(this.fixedClasses);
return assign({}, themeable._allClasses, themeClasses, fixedClasses);
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp
/**
* Get theme class object from classNames
*/
private _getThemeClasses(classNames: string[]): ClassNameFlags {
private _getThemeClasses(classNames: (keyof E)[]): ClassNameFlags {
return classNames
.filter((className) => !!className)
.reduce((appliedClasses: {}, className: string) => {
Expand All @@ -276,7 +276,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp
}
className = this._baseThemeClassesReverseLookup[className];
if (!this._registeredClassesMap.has(className)) {
this._registerThemeClass(className);
this._registerThemeClass(className as keyof E);
}
return assign(appliedClasses, this._registeredClassesMap.get(className));
}, {});
Expand Down Expand Up @@ -306,7 +306,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp
*
* @param className the name of the class to register.
*/
private _registerThemeClass(className: string) {
private _registerThemeClass(className: keyof E) {
const { properties: { extraClasses = {} } } = this;
const themeClass = this._theme[className] ? this._theme[className] : this._getBaseThemeClass(className);
const extraClassesClassNames = extraClasses[className];
Expand Down Expand Up @@ -338,7 +338,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp
return assign(baseTheme, theme[themeKey]);
}, {});

this._registeredClassesMap.forEach((value, key) => {
this._registeredClassesMap.forEach((value, key: keyof E) => {
this._registerThemeClass(key);
});
this._recalculateClasses = false;
Expand Down