Enable TS strict mode in all templates and generally clean up TS references

This commit is contained in:
Steve Sanderson
2017-07-13 10:11:59 +01:00
parent b8c006a3e9
commit 9528dd7432
14 changed files with 27 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
import * as ko from 'knockout';
import * as $ from 'jquery';
import * as History from 'history';
import crossroads = require('crossroads');
import * as crossroads from 'crossroads';
// This module configures crossroads.js, a routing library. If you prefer, you
// can use any other routing library (or none at all) as Knockout is designed to
@@ -20,7 +20,7 @@ export class Router {
// Reset and configure Crossroads so it matches routes and updates this.currentRoute
crossroads.removeAllRoutes();
crossroads.resetState();
crossroads.normalizeFn = crossroads.NORM_AS_OBJECT;
(crossroads as any).normalizeFn = crossroads.NORM_AS_OBJECT;
routes.forEach(route => {
crossroads.addRoute(route.url, (requestParams: any) => {
this.currentRoute(ko.utils.extend(requestParams, route.params));