Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f58b21

Browse files
committedFeb 29, 2016
type fixes
1 parent 1e7c3d7 commit 4f58b21

File tree

19 files changed

+106
-133
lines changed

19 files changed

+106
-133
lines changed
 

‎lib/actions/tutorials.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function loadRootPackageJson() {
2929
if (exists_1.fileExists(pathToPackageJson)) {
3030
return JSON.parse(fs.readFileSync(pathToPackageJson, 'utf8'));
3131
}
32-
return false;
32+
return null;
3333
}
3434
function isTutorial(name) {
3535
var pathToTutorialPackageJson = path.join(window.coderoad.dir, 'node_modules', name, 'package.json');

‎lib/components/account/account.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ var default_1 = (function (_super) {
1111
_super.apply(this, arguments);
1212
}
1313
default_1.prototype.render = function () {
14-
return (React.createElement("section", {className: 'cr-account'},
15-
React.createElement("h3", null, "Account")
16-
));
14+
return (React.createElement("section", {className: 'cr-account'}, React.createElement("h3", null, "Account")));
1715
};
1816
return default_1;
1917
}(React.Component));

‎lib/components/app/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ var default_1 = (function (_super) {
3030
};
3131
default_1.prototype.render = function () {
3232
var state = this.props.state;
33-
return (React.createElement("section", {className: 'cr'},
34-
React.createElement(_components_1.Menu, {route: state.route, position: state.position}),
35-
React.createElement(_components_1.Router, {state: state}),
36-
React.createElement(_components_1.Alert, {alert: state.alert})));
33+
return (React.createElement("section", {className: 'cr'}, React.createElement(_components_1.Menu, {route: state.route, position: state.position}), React.createElement(_components_1.Router, {state: state}), React.createElement(_components_1.Alert, {alert: state.alert})));
3734
};
3835
default_1.childContextTypes = {
3936
muiTheme: React.PropTypes.object,

‎lib/components/menu/menu.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ var default_1 = (function (_super) {
3939
default_1.prototype.menuOptions = function () {
4040
switch (this.props.route) {
4141
case 'page':
42-
return (React.createElement("div", null,
43-
React.createElement(material_ui_1.MenuItem, {primaryText: 'progress', onClick: this.props.routeToProgress}),
44-
React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects})));
42+
return (React.createElement("div", null, React.createElement(material_ui_1.MenuItem, {primaryText: 'progress', onClick: this.props.routeToProgress}), React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects})));
4543
case 'progress':
4644
return React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects});
4745
default: return null;
@@ -51,17 +49,7 @@ var default_1 = (function (_super) {
5149
render_1.togglePanel();
5250
};
5351
default_1.prototype.render = function () {
54-
return (React.createElement(material_ui_1.AppBar, {title: 'CodeRoad', className: 'cr-menu-bar', iconElementLeft: React.createElement(material_ui_1.IconButton, {onClick: this.closePanel},
55-
React.createElement(NavigationClose, null)
56-
), iconElementRight: React.createElement(material_ui_1.IconMenu, {iconButtonElement: React.createElement(material_ui_1.IconButton, null,
57-
React.createElement(MoreVertIcon, null)
58-
), targetOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'top' }},
59-
this.menuOptions(),
60-
window.coderoad.issuesPath ? React.createElement(material_ui_1.MenuItem, null,
61-
React.createElement("a", {href: window.coderoad.issuesPath}, "post issue")
62-
) : null,
63-
React.createElement(material_ui_1.Divider, null),
64-
React.createElement(material_ui_1.MenuItem, {primaryText: 'quit', onClick: this.props.quit}))}));
52+
return (React.createElement(material_ui_1.AppBar, {title: 'CodeRoad', className: 'cr-menu-bar', iconElementLeft: React.createElement(material_ui_1.IconButton, {onClick: this.closePanel}, React.createElement(NavigationClose, null)), iconElementRight: React.createElement(material_ui_1.IconMenu, {iconButtonElement: React.createElement(material_ui_1.IconButton, null, React.createElement(MoreVertIcon, null)), targetOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'top' }}, this.menuOptions(), window.coderoad.issuesPath ? React.createElement(material_ui_1.MenuItem, null, React.createElement("a", {href: window.coderoad.issuesPath}, "post issue")) : null, React.createElement(material_ui_1.Divider, null), React.createElement(material_ui_1.MenuItem, {primaryText: 'quit', onClick: this.props.quit}))}));
6553
};
6654
default_1 = __decorate([
6755
react_redux_1.connect(null, function (dispatch) {

‎lib/components/page/chapter.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ var _components_1 = require('../_components');
44
Object.defineProperty(exports, "__esModule", { value: true });
55
exports.default = function (_a) {
66
var chapter = _a.chapter;
7-
return (React.createElement("section", {className: 'cr-chapter'},
8-
React.createElement(_components_1.MarkdownText, {text: chapter.title})
9-
));
7+
return (React.createElement("section", {className: 'cr-chapter'}, React.createElement(_components_1.MarkdownText, {text: chapter.title})));
108
};

‎lib/components/page/edit.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
66
exports.default = function (editPath) {
77
if (editPath && window.coderoad.edit) {
88
var repoPath = path.join(window.coderoad.repo, 'edit', 'master', editPath);
9-
return React.createElement("a", {href: repoPath},
10-
React.createElement(Edit, {style: { position: 'absolute', top: '10px', right: '10px' }})
11-
);
9+
return React.createElement("a", {href: repoPath}, React.createElement(Edit, {style: { position: 'absolute', top: '10px', right: '10px' }}));
1210
}
1311
};

‎lib/components/page/page.js

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -95,60 +95,30 @@ var default_1 = (function (_super) {
9595
var taskPosition = this.props.taskPosition;
9696
var currentTask = taskPosition <= tasks.length ? tasks[taskPosition] : null;
9797
var allComplete = taskPosition >= tasks.length;
98-
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-page'},
99-
React.createElement(material_ui_1.Card, null,
100-
React.createElement(material_ui_1.CardHeader, {title: page.title, subtitle: page.description}),
101-
React.createElement(material_ui_1.CardText, null,
102-
React.createElement(_components_1.MarkdownText, {text: page.explanation})
103-
)),
104-
React.createElement(material_ui_1.Divider, null),
105-
React.createElement(material_ui_1.List, {subheader: 'Tasks', className: 'cr-tasks', ref: 'tasks'}, tasks.map(function (task, index) {
106-
var isCurrentTask = index === taskPosition;
107-
var isDisabledTask = index > taskPosition;
108-
var isCompletedTask = index < taskPosition;
109-
var isFinalTask = index >= tasks.length - 1;
110-
var hints = _this.hintsShown(task);
111-
return (React.createElement("div", null,
112-
React.createElement(material_ui_1.ListItem, {ref: 'task' + index, className: classNames({
113-
'cr-task': true,
114-
'isCompletedTask': isCompletedTask,
115-
'isCurrentTask': isCurrentTask,
116-
'isDisabledTask': isDisabledTask
117-
})},
118-
React.createElement("span", {className: 'cr-task-checkbox'}, _this.getIcon(index, taskPosition)),
119-
React.createElement("span", {className: 'cr-task-index'},
120-
index + 1,
121-
"."),
122-
React.createElement("div", {className: 'cr-task-description'},
123-
React.createElement(_components_1.MarkdownText, {text: task.description})
124-
)),
125-
isCurrentTask && hints ?
126-
hints.map(function (hint, indexHint) {
127-
return React.createElement(material_ui_1.ListItem, {className: 'cr-task-hint', ref: 'hint' + indexHint},
128-
React.createElement("div", {class: 'cr-task-hint-box'},
129-
React.createElement("span", {className: 'cr-task-hint-index'},
130-
indexHint + 1,
131-
"."),
132-
React.createElement("div", {className: 'cr-task-hint-description'},
133-
React.createElement(_components_1.MarkdownText, {text: hint})
134-
))
135-
);
136-
})
137-
: null,
138-
isFinalTask ? null : React.createElement(material_ui_1.Divider, null)));
139-
})),
140-
React.createElement("section", {className: 'cr-page-toolbar'},
141-
React.createElement(material_ui_1.LinearProgress, {mode: 'determinate', value: taskProgress(taskPosition, tasks.length), style: { height: '6px' }}),
142-
React.createElement(material_ui_1.Toolbar, null,
143-
currentTask && currentTask.hints && currentTask.hints.length ?
144-
React.createElement(material_ui_1.ToolbarGroup, {float: 'left'}, this.state.hintPos <= currentTask.hints.length - 2 ?
145-
React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint', icon: React.createElement(InfoOutline, null), onClick: this.displayHint.bind(this, currentTask)})
146-
: React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint-disabled', icon: React.createElement(Info, null), disabled: true}))
147-
: null,
148-
React.createElement(material_ui_1.ToolbarGroup, {float: 'right'}, allComplete ?
149-
React.createElement(material_ui_1.RaisedButton, {label: 'Continue', primary: true, onClick: this.props.callNextPage})
150-
:
151-
React.createElement(material_ui_1.RaisedButton, {label: 'Run', secondary: true, onClick: this.props.callRunTests}))))));
98+
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-page'}, React.createElement(material_ui_1.Card, null, React.createElement(material_ui_1.CardHeader, {title: page.title, subtitle: page.description}), React.createElement(material_ui_1.CardText, null, React.createElement(_components_1.MarkdownText, {text: page.explanation}))), React.createElement(material_ui_1.Divider, null), React.createElement(material_ui_1.List, {subheader: 'Tasks', className: 'cr-tasks', ref: 'tasks'}, tasks.map(function (task, index) {
99+
var isCurrentTask = index === taskPosition;
100+
var isDisabledTask = index > taskPosition;
101+
var isCompletedTask = index < taskPosition;
102+
var isFinalTask = index >= tasks.length - 1;
103+
var hints = _this.hintsShown(task);
104+
return (React.createElement("div", null, React.createElement(material_ui_1.ListItem, {ref: 'task' + index, className: classNames({
105+
'cr-task': true,
106+
'isCompletedTask': isCompletedTask,
107+
'isCurrentTask': isCurrentTask,
108+
'isDisabledTask': isDisabledTask
109+
})}, React.createElement("span", {className: 'cr-task-checkbox'}, _this.getIcon(index, taskPosition)), React.createElement("span", {className: 'cr-task-index'}, index + 1, "."), React.createElement("div", {className: 'cr-task-description'}, React.createElement(_components_1.MarkdownText, {text: task.description}))), isCurrentTask && hints ?
110+
hints.map(function (hint, indexHint) {
111+
return React.createElement(material_ui_1.ListItem, {className: 'cr-task-hint', ref: 'hint' + indexHint}, React.createElement("div", {class: 'cr-task-hint-box'}, React.createElement("span", {className: 'cr-task-hint-index'}, indexHint + 1, "."), React.createElement("div", {className: 'cr-task-hint-description'}, React.createElement(_components_1.MarkdownText, {text: hint}))));
112+
})
113+
: null, isFinalTask ? null : React.createElement(material_ui_1.Divider, null)));
114+
})), React.createElement("section", {className: 'cr-page-toolbar'}, React.createElement(material_ui_1.LinearProgress, {mode: 'determinate', value: taskProgress(taskPosition, tasks.length), style: { height: '6px' }}), React.createElement(material_ui_1.Toolbar, null, currentTask && currentTask.hints && currentTask.hints.length ?
115+
React.createElement(material_ui_1.ToolbarGroup, {float: 'left'}, this.state.hintPos <= currentTask.hints.length - 2 ?
116+
React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint', icon: React.createElement(InfoOutline, null), onClick: this.displayHint.bind(this, currentTask)})
117+
: React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint-disabled', icon: React.createElement(Info, null), disabled: true}))
118+
: null, React.createElement(material_ui_1.ToolbarGroup, {float: 'right'}, allComplete ?
119+
React.createElement(material_ui_1.RaisedButton, {label: 'Continue', primary: true, onClick: this.props.callNextPage})
120+
:
121+
React.createElement(material_ui_1.RaisedButton, {label: 'Run', secondary: true, onClick: this.props.callRunTests}))))));
152122
};
153123
default_1 = __decorate([
154124
react_redux_1.connect(null, function (dispatch, state) {

‎lib/components/progress/progress.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var Action = require('../../actions/actions');
1919
var material_ui_1 = require('material-ui');
20+
var classNames = require('classnames');
2021
var Completed = require('material-ui/lib/svg-icons/toggle/check-box');
2122
var Current = require('material-ui/lib/svg-icons/av/play-circle-filled');
2223
var AllCompleted = require('material-ui/lib/svg-icons/action/done-all');
@@ -89,16 +90,14 @@ var style = {
8990
Object.defineProperty(exports, "__esModule", { value: true });
9091
exports.default = function (_a) {
9192
var progress = _a.progress, position = _a.position;
92-
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-progress'},
93-
React.createElement(material_ui_1.List, {subheader: 'Progress'}, progress.chapters.map(function (chapter, chapterIndex) {
94-
var isActive = chapterIndex === position.chapter;
95-
return React.createElement(material_ui_1.ListItem, {primaryText: (chapterIndex + 1) + ". " + chapter.title, className: classNames({
96-
'chapter': true,
97-
'isActive': isActive
98-
}), secondaryText: chapter.description, secondaryTextLines: chapter.description.length > 35 ? 2 : 1, initiallyOpen: chapterIndex === 0, leftIcon: chapter.completed ? React.createElement(AllCompleted, null) : null, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) {
99-
var itemPosition = { chapter: chapterIndex, page: pageIndex };
100-
return React.createElement(ProgressPage, {page: page, itemPosition: itemPosition, position: position});
101-
})});
102-
}))
103-
));
93+
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-progress'}, React.createElement(material_ui_1.List, {subheader: 'Progress'}, progress.chapters.map(function (chapter, chapterIndex) {
94+
var isActive = chapterIndex === position.chapter;
95+
return React.createElement(material_ui_1.ListItem, {primaryText: (chapterIndex + 1) + ". " + chapter.title, className: classNames({
96+
'chapter': true,
97+
'isActive': isActive
98+
}), secondaryText: chapter.description, secondaryTextLines: chapter.description.length > 35 ? 2 : 1, initiallyOpen: chapterIndex === 0, leftIcon: chapter.completed ? React.createElement(AllCompleted, null) : null, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) {
99+
var itemPosition = { chapter: chapterIndex, page: pageIndex };
100+
return React.createElement(ProgressPage, {page: page, itemPosition: itemPosition, position: position});
101+
})});
102+
}))));
104103
};

‎lib/components/projects/projects.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,10 @@ var Projects = (function (_super) {
3636
};
3737
Projects.prototype.render = function () {
3838
var _this = this;
39-
return (React.createElement(material_ui_1.Paper, {className: 'cr-projects'},
40-
React.createElement("div", {className: 'cr-projects-header'},
41-
React.createElement("span", {className: 'title'}, "CodeRoad"),
42-
React.createElement("p", {className: 'tagline'}, "Tutorials in the Editor"),
43-
React.createElement("div", {className: 'cr-tutorials'},
44-
React.createElement(material_ui_1.List, {subheader: 'Tutorials'},
45-
window.coderoad.dir ? null : React.createElement(material_ui_1.ListItem, {primaryText: 'Create an Atom Project', secondaryText: 'File > Open > any older'}),
46-
this.props.tutorials.length > 0 ?
47-
this.props.tutorials.map(function (tutorial) {
48-
return (React.createElement(material_ui_1.ListItem, {primaryText: _this.trim(tutorial), onClick: _this.props.selectProject.bind(_this, tutorial)}));
49-
}) : React.createElement(material_ui_1.ListItem, {primaryText: 'Try a Demo', secondaryText: 'npm i -s coderoad-functional-school'})),
50-
React.createElement("br", null),
51-
React.createElement(material_ui_1.RaisedButton, {label: 'Load Tutorials', secondary: true, onClick: this.load.bind(this)})),
52-
React.createElement("p", {className: 'notes'}, "Beta"))
53-
));
39+
return (React.createElement(material_ui_1.Paper, {className: 'cr-projects'}, React.createElement("div", {className: 'cr-projects-header'}, React.createElement("span", {className: 'title'}, "CodeRoad"), React.createElement("p", {className: 'tagline'}, "Tutorials in the Editor"), React.createElement("div", {className: 'cr-tutorials'}, React.createElement(material_ui_1.List, {subheader: 'Tutorials'}, window.coderoad.dir ? null : React.createElement(material_ui_1.ListItem, {primaryText: 'Create an Atom Project', secondaryText: 'File > Open > any older'}), this.props.tutorials.length > 0 ?
40+
this.props.tutorials.map(function (tutorial) {
41+
return (React.createElement(material_ui_1.ListItem, {primaryText: _this.trim(tutorial), onClick: _this.props.selectProject.bind(_this, tutorial)}));
42+
}) : React.createElement(material_ui_1.ListItem, {primaryText: 'Try a Demo', secondaryText: 'npm i -s coderoad-functional-school'})), React.createElement("br", null), React.createElement(material_ui_1.RaisedButton, {label: 'Load Tutorials', secondary: true, onClick: this.load.bind(this)})), React.createElement("p", {className: 'notes'}, "Beta"))));
5443
};
5544
Projects = __decorate([
5645
react_redux_1.connect(null, function (dispatch) {

‎lib/components/render.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ var app_1 = require('./app/app');
88
require('./remove-later');
99
var rootName = 'crv';
1010
function render(target) {
11-
ReactDOM.render(React.createElement(react_redux_1.Provider, {store: _base_1.store},
12-
React.createElement(app_1.default, null)
13-
), target);
11+
ReactDOM.render(React.createElement(react_redux_1.Provider, {store: _base_1.store}, React.createElement(app_1.default, null)), target);
1412
}
1513
exports.render = render;
1614
function unmount(target) {

‎lib/reducers/run-tests/run-tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
var Type = require('../../actions/actionTypes');
33
var run_1 = require('./run');
44
var pageTimeout = 2000;
5-
var previous = new Date();
5+
var previous = new Date().getTime();
66
function runTestReducer(runTests, action) {
77
if (runTests === void 0) { runTests = false; }
88
switch (action.type) {
99
case Type.RUN_TESTS:
10-
var current = new Date();
10+
var current = new Date().getTime();
1111
if (current - previous > pageTimeout) {
1212
previous = current;
1313
return run_1.runTaskTests();
@@ -18,7 +18,7 @@ function runTestReducer(runTests, action) {
1818
case Type.TEST_COMPLETE:
1919
return false;
2020
case Type.SET_PAGE:
21-
previous = new Date();
21+
previous = new Date().getTime();
2222
return false;
2323
default:
2424
return runTests;

‎src/actions/page-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function setPage(selectedPosition: CR.Position = { chapter: 0, page: 0 })
88
const page: CR.Page = Package.getPage(selectedPosition);
99
const tasks: CR.Task[] = Package.getTasks(selectedPosition);
1010
const taskTests: CR.TaskTest[] = _.flatten(tasks.map((task) => task.tests || []));
11-
const actions: string[] = tasks.map((task) => task.actions || []);
11+
const actions: string[][] = tasks.map((task: CR.Task) => task.actions || []);
1212
return { type: Type.SET_PAGE, payload: { page, tasks, position: selectedPosition, taskTests, actions } };
1313
}
1414

‎src/actions/tutorials.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {fileExists} from '../services/exists';
88
export function loadTutorials(): CR.Action {
99
let tutorials = [];
1010
if (window.coderoad.dir) {
11-
let packageJson: PackageJson|boolean = loadRootPackageJson();
11+
let packageJson: PackageJson = loadRootPackageJson();
1212
if (!packageJson) {
1313
window.coderoad.package = null;
1414
let message = 'No package.json file available. Try running "npm init --y" in terminal';
@@ -24,12 +24,12 @@ export function loadTutorials(): CR.Action {
2424
}
2525

2626

27-
function loadRootPackageJson(): PackageJson|boolean {
27+
function loadRootPackageJson(): PackageJson {
2828
let pathToPackageJson = path.join(window.coderoad.dir, 'package.json');
2929
if (fileExists(pathToPackageJson)) {
3030
return JSON.parse(fs.readFileSync(pathToPackageJson, 'utf8'));
3131
}
32-
return false;
32+
return null;
3333
}
3434

3535
function isTutorial(name): boolean {
@@ -49,7 +49,7 @@ function isTutorial(name): boolean {
4949
return false;
5050
}
5151

52-
function searchForTutorials(location): string[] {
52+
function searchForTutorials(location: Object): string[] {
5353
if (!!location && Object.keys(location).length > 0) {
5454
return Object.keys(location).filter((name) => isTutorial(name));
5555
} else {

‎src/atom/subscriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function onActivateSubscriptions() {
2424
// }
2525

2626
// run tests on save
27-
atom.workspace.observeTextEditors((editor) => {
27+
atom.workspace.observeTextEditors((editor: AtomCore.IEditor) => {
2828
subscriptions.add(
2929
editor.onDidSave(() => {
3030
store.dispatch(Action.runTests());

‎src/reducers/run-tests/run-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const pageTimeout = 2000;
66
/**
77
* Test is running, return true, else false
88
*/
9-
let previous: Date = new Date();
9+
let previous: number = new Date().getTime();
1010

1111
export default function runTestReducer(runTests = false, action: CR.Action): boolean {
1212
switch (action.type) {
1313
case Type.RUN_TESTS:
14-
let current: Date = new Date();
14+
let current = new Date().getTime();
1515
if (current - previous > pageTimeout) {
1616
previous = current;
1717
return runTaskTests();
@@ -21,7 +21,7 @@ export default function runTestReducer(runTests = false, action: CR.Action): boo
2121
case Type.TEST_COMPLETE:
2222
return false;
2323
case Type.SET_PAGE:
24-
previous = new Date();
24+
previous = new Date().getTime();
2525
return false;
2626
default:
2727
return runTests;

‎src/services/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class PackageService {
4444
}
4545
configTaskTests(tasks: CR.Task[]): CR.Task[] {
4646
let config = this.config.config;
47-
return !tasks ? [] : tasks.map((task) => {
47+
return !tasks ? [] : tasks.map((task: CR.Task) => {
4848
if (task.tests) {
4949
task.tests = task.tests.map((tests: string) => {
5050
if (_.isString(tests)) {

‎src/typings/cr/globals.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,17 @@ interface PackageJson {
1111
}
1212

1313
interface ObjectConstructor {
14-
assign(target: any, ...sources: any[]): any;
14+
assign(target: any, ...sources: any[]): any;
15+
}
16+
17+
interface IntrinsicAttributes {
18+
index: number;
19+
style: Object;
20+
className: string;
21+
targetOrigin: string;
22+
anchorOrigin: string;
23+
onClick: () => any;
24+
primaryText: string;
25+
primaryTogglesNestedList: any;
26+
1527
}

‎src/typings/material-ui/material-ui.d.ts

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ declare module "material-ui" {
2424
export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker');
2525
export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog');
2626
export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog');
27+
export import Divider = __MaterialUI.Divider // require('material-ui/lib/divider')
2728
export import DropDownIcon = __MaterialUI.DropDownIcon; // require('material-ui/lib/drop-down-icon');
2829
export import DropDownMenu = __MaterialUI.DropDownMenu; // require('material-ui/lib/drop-down-menu');
2930
export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button');
@@ -112,6 +113,7 @@ declare namespace __MaterialUI {
112113
iconElementRight?: React.ReactElement<any>;
113114
iconStyleRight?: string;
114115
style?: React.CSSProperties;
116+
className?: string;
115117
showMenuIconButton?: boolean;
116118
title?: React.ReactNode;
117119
zDepth?: number;
@@ -197,7 +199,7 @@ declare namespace __MaterialUI {
197199
subtitleStyle?: React.CSSProperties;
198200
textStyle?: React.CSSProperties;
199201
style?: React.CSSProperties;
200-
avatar: React.ReactElement<any> | string;
202+
avatar?: React.ReactElement<any> | string;
201203
}
202204
export class CardHeader extends React.Component<CardHeaderProps, {}> {
203205
}
@@ -454,6 +456,11 @@ declare namespace __MaterialUI {
454456
onTouchTap?: TouchTapEventHandler;
455457
}
456458

459+
interface DividerProps extends React.Props<Divider>{
460+
inset?: boolean;
461+
}
462+
export class Divider extends React.Component<DividerProps, {}> {}
463+
457464
interface EnhancedButtonProps extends SharedEnhancedButtonProps<EnhancedButton> {
458465
touchRippleColor?: string;
459466
focusRippleColor?: string;
@@ -538,6 +545,7 @@ declare namespace __MaterialUI {
538545
value?: number;
539546
min?: number;
540547
max?: number;
548+
style?: React.CSSProperties;
541549
}
542550
export class LinearProgress extends React.Component<LinearProgressProps, {}> {
543551
}
@@ -582,6 +590,7 @@ declare namespace __MaterialUI {
582590
secondaryText?: React.ReactNode;
583591
secondaryTextLines?: number;
584592
style?: React.CSSProperties;
593+
primaryTogglesNestedList?: boolean;
585594
}
586595
export class ListItem extends React.Component<ListItemProps, {}> {
587596
}
@@ -630,7 +639,8 @@ declare namespace __MaterialUI {
630639
}
631640

632641
interface MenuItemProps extends React.Props<MenuItem> {
633-
index: number;
642+
index?: number;
643+
primaryText?: string;
634644
icon?: React.ReactElement<any>;
635645
iconClassName?: string;
636646
iconRightClassName?: string;
@@ -645,6 +655,7 @@ declare namespace __MaterialUI {
645655
selected?: boolean;
646656
active?: boolean;
647657
style?: React.CSSProperties;
658+
onClick?: () => void;
648659
}
649660
export class MenuItem extends React.Component<MenuItemProps, {}> {
650661
static Types: { LINK: string, SUBHEADER: string, NESTED: string, }
@@ -878,7 +889,6 @@ declare namespace __MaterialUI {
878889
desktopSubheaderHeight?: number;
879890
desktopToolbarHeight?: number;
880891
}
881-
export var Spacing: Spacing;
882892

883893
interface ThemePalette {
884894
primary1Color?: string;
@@ -1129,6 +1139,7 @@ declare namespace __MaterialUI {
11291139
}
11301140

11311141
interface SnackbarProps extends React.Props<Snackbar> {
1142+
open: boolean;
11321143
message: string;
11331144
action?: string;
11341145
autoHideDuration?: number;
@@ -1490,6 +1501,9 @@ declare namespace __MaterialUI {
14901501
onKeyboardFocus?: React.FocusEventHandler;
14911502
onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement<any>) => void;
14921503
onChange?: (e: React.FormEvent, value: string | Array<string>) => void;
1504+
1505+
targetOrigin?: { horizontal: string, vertical: string};
1506+
anchorOrigin?: { horizontal: string, vertical: string};
14931507
}
14941508
export class IconMenu extends React.Component<IconMenuProps, {}> {
14951509
}
@@ -1825,7 +1839,7 @@ declare module 'material-ui/lib/svg-icons/navigation/chevron-right' {
18251839
declare module 'material-ui/lib/styles/' {
18261840
export import AutoPrefix = __MaterialUI.Styles.AutoPrefix; // require('material-ui/lib/styles/auto-prefix');
18271841
export import Colors = __MaterialUI.Styles.Colors; // require('material-ui/lib/styles/colors');
1828-
export import Spacing = require('material-ui/lib/styles/spacing');
1842+
export import Spacing = __MaterialUI.Styles.Spacing; // require('material0ui/lib/styles/spacing')
18291843
export import ThemeManager = __MaterialUI.Styles.ThemeManager; // require('material-ui/lib/styles/theme-manager');
18301844
export import Transitions = __MaterialUI.Styles.Transitions; // require('material-ui/lib/styles/transitions');
18311845
export import Typography = __MaterialUI.Styles.Typography; // require('material-ui/lib/styles/typography');
@@ -1840,9 +1854,8 @@ declare module 'material-ui/lib/styles/auto-prefix' {
18401854
}
18411855

18421856
declare module 'material-ui/lib/styles/spacing' {
1843-
type Spacing = __MaterialUI.Styles.Spacing;
1844-
var Spacing: Spacing;
1845-
export = Spacing;
1857+
var Spacing: number;
1858+
export default Spacing;
18461859
}
18471860

18481861
declare module 'material-ui/lib/styles/theme-manager' {
@@ -1875,6 +1888,11 @@ declare module 'material-ui/lib/styles/theme-decorator' {
18751888
export = ThemeDecorator;
18761889
}
18771890

1891+
declare module 'material-ui/lib/styles/zIndex' {
1892+
import ZIndex = __MaterialUI.Styles.ZIndex;
1893+
var zIndex: ZIndex;
1894+
export default zIndex;
1895+
}
18781896

18791897
declare module 'material-ui/lib/snackbar' {
18801898
import Snackbar = __MaterialUI.Snackbar;
@@ -2054,6 +2072,11 @@ declare module "material-ui/lib/menus/menu-divider" {
20542072
export = MenuDivider;
20552073
}
20562074

2075+
declare module "material-ui/lib/divider" {
2076+
import Divider = __MaterialUI.Divider;
2077+
export = Divider;
2078+
}
2079+
20572080
declare module "material-ui/lib/grid-list/grid-list" {
20582081
import GridList = __MaterialUI.GridList.GridList;
20592082
export = GridList;
@@ -2358,6 +2381,8 @@ declare namespace __MaterialUI.Styles {
23582381
lightWhite: string;
23592382
}
23602383
export var Colors: Colors;
2384+
2385+
export type ZIndex = number;
23612386
}
23622387

23632388
declare module "material-ui/lib/svg-icons" {

‎src/typings/react/react.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ declare namespace __React {
323323
children?: ReactNode;
324324
key?: string | number;
325325
ref?: string | ((component: T) => any);
326+
className?: string;
326327
}
327328

328329
interface HTMLProps<T> extends HTMLAttributes, Props<T> {

0 commit comments

Comments
 (0)
Please sign in to comment.