Skip to content

Commit 5a977fc

Browse files
committed
repair typings
1 parent 16b35dc commit 5a977fc

File tree

16 files changed

+84
-86
lines changed

16 files changed

+84
-86
lines changed

lib/components/Page/EditPage/index.js

-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +0,0 @@
1-
"use strict";
2-
var path_1 = require('path');
3-
var React = require('react');
4-
var mode_edit_1 = require('material-ui/svg-icons/editor/mode-edit');
5-
var editStyle = {
6-
position: 'absolute',
7-
top: '10px',
8-
right: '10px',
9-
};
10-
var EditPage = function (_a) {
11-
var tutorial = _a.tutorial;
12-
if (tutorial && tutorial.edit && tutorial.repo) {
13-
var repoPath = path_1.join(tutorial.repo, 'edit', 'master', tutorial.repo);
14-
return (React.createElement("a", {href: repoPath},
15-
React.createElement(mode_edit_1.default, {style: editStyle})
16-
));
17-
}
18-
};
19-
Object.defineProperty(exports, "__esModule", { value: true });
20-
exports.default = EditPage;

lib/components/Page/Hints/HintButton.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ var __extends = (this && this.__extends) || function (d, b) {
55
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
66
};
77
var React = require('react');
8-
var react_redux_1 = require('react-redux');
9-
var actions_1 = require('../../../actions');
10-
var selectors_1 = require('../../../selectors');
118
var FlatButton_1 = require('material-ui/FlatButton');
129
var HintButton = (function (_super) {
1310
__extends(HintButton, _super);
@@ -27,10 +24,5 @@ var HintButton = (function (_super) {
2724
};
2825
return HintButton;
2926
}(React.Component));
30-
var mapStateToProps = function (state) { return ({
31-
hintPosition: state.hintPosition,
32-
hintsLength: selectors_1.hintsSelector(state).length,
33-
}); };
34-
var mapDispatchToProps = { hintPositionSet: actions_1.hintPositionSet };
3527
Object.defineProperty(exports, "__esModule", { value: true });
36-
exports.default = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(HintButton);
28+
exports.default = HintButton;

lib/components/Page/Hints/index.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var index_1 = require('../../index');
1111
var HintButton_1 = require('./HintButton');
1212
var Card_1 = require('material-ui/Card');
1313
var help_1 = require('material-ui/svg-icons/action/help');
14+
var actions_1 = require('../../../actions');
15+
var selectors_2 = require('../../../selectors');
1416
var styles = {
1517
position: 'relative',
1618
margin: '5px auto 10px',
@@ -23,23 +25,26 @@ var Hints = (function (_super) {
2325
_super.apply(this, arguments);
2426
}
2527
Hints.prototype.render = function () {
26-
var hint = this.props.hint;
28+
var _a = this.props, hint = _a.hint, hintPosition = _a.hintPosition, hintsLength = _a.hintsLength, hintPositionSet = _a.hintPositionSet;
2729
if (!hint) {
2830
return null;
2931
}
3032
return (React.createElement(Card_1.Card, {style: styles},
3133
React.createElement(Card_1.CardHeader, {title: 'Hints', avatar: React.createElement(help_1.default, null), actAsExpander: true, showExpandableButton: true}),
3234
React.createElement(Card_1.CardText, {className: 'cr-task-hint', expandable: true},
33-
React.createElement(index_1.Markdown, null, hint)
35+
React.createElement(index_1.Markdown, {children: hint})
3436
),
3537
React.createElement(Card_1.CardActions, {style: { paddingBottom: '30px !important' }, expandable: true, className: 'cr-task-hints-actions'},
36-
React.createElement(HintButton_1.default, {type: 'prev', label: 'Previous'}),
37-
React.createElement(HintButton_1.default, {type: 'next', label: 'Next'}))));
38+
React.createElement(HintButton_1.default, {type: 'prev', label: 'Previous', hintPosition: hintPosition, hintsLength: hintsLength, hintPositionSet: hintPositionSet}),
39+
React.createElement(HintButton_1.default, {type: 'next', label: 'Next', hintPosition: hintPosition, hintsLength: hintsLength, hintPositionSet: hintPositionSet}))));
3840
};
3941
return Hints;
4042
}(React.Component));
4143
var mapStateToProps = function (state) { return ({
4244
hint: selectors_1.hintSelector(state),
45+
hintPosition: state.hintPosition,
46+
hintsLength: selectors_2.hintsSelector(state).length,
4347
}); };
48+
var mapDispatchToProps = { hintPositionSet: actions_1.hintPositionSet };
4449
Object.defineProperty(exports, "__esModule", { value: true });
45-
exports.default = react_redux_1.connect(mapStateToProps)(Hints);
50+
exports.default = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(Hints);

lib/components/common/ContentCard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var ContentCard = function (_a) {
1212
return (React.createElement(Card_1.Card, {style: styles.card},
1313
title ? React.createElement(Card_1.CardHeader, {title: title}) : null,
1414
React.createElement(Card_1.CardText, null,
15-
React.createElement(index_1.Markdown, null, content || '')
15+
React.createElement(index_1.Markdown, {children: content || ''})
1616
)));
1717
};
1818
Object.defineProperty(exports, "__esModule", { value: true });

src/components/AppMenu/MenuLink/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const styles = {
1010
};
1111

1212
class MenuLink extends React.Component<{
13-
route: string, title?: string, routeSet: any
13+
route: string, title?: string, routeSet?: any
1414
}, {}> {
1515
public render() {
1616
const {route, title, routeSet} = this.props;
+25-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
import { join } from 'path';
2-
import * as React from 'react';
1+
// import { join } from 'path';
2+
// import * as React from 'react';
33

4-
import ModeEdit from 'material-ui/svg-icons/editor/mode-edit';
5-
import NavigationClose from 'material-ui/svg-icons/navigation/close';
4+
// import ModeEdit from 'material-ui/svg-icons/editor/mode-edit';
5+
// import NavigationClose from 'material-ui/svg-icons/navigation/close';
66

7-
const editStyle = {
8-
position: 'absolute',
9-
top: '10px',
10-
right: '10px',
11-
};
7+
// const editStyle = {
8+
// position: 'absolute',
9+
// top: '10px',
10+
// right: '10px',
11+
// };
1212

13-
const EditPage: React.StatelessComponent<{
14-
tutorial: Tutorial.Config
15-
}> = ({tutorial}) => {
16-
if (tutorial && tutorial.edit && tutorial.repo) {
17-
const repoPath = join(tutorial.repo, 'edit', 'master', tutorial.repo);
18-
return (
19-
<a href={repoPath}>
20-
<ModeEdit style={editStyle}/>
21-
</a>
22-
);
23-
}
24-
};
25-
export default EditPage;
13+
// class EditPage extends React.Component<{
14+
// tutorial: Tutorial.Config
15+
// }, {}> {
16+
// render() {
17+
// const { tutorial } = this.props;
18+
// if (tutorial && tutorial.edit && tutorial.repo) {
19+
// const repoPath = join(tutorial.repo, 'edit', 'master', tutorial.repo);
20+
// return (
21+
// <a href={repoPath}>
22+
// <ModeEdit style={editStyle}/>
23+
// </a>
24+
// );
25+
// }
26+
// }
27+
// };
28+
// export default EditPage;

src/components/Page/Hints/HintButton.tsx

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import * as React from 'react';
2-
import {connect} from 'react-redux';
3-
4-
import {hintPositionSet} from '../../../actions';
5-
import {hintsSelector} from '../../../selectors';
62
import FlatButton from 'material-ui/FlatButton';
73

84
class HintButton extends React.Component<{
95
hintPosition: number, hintsLength: number, type: 'next'|'prev',
106
label: string, hintPositionSet: any
117
}, {}> {
12-
render() {
8+
public render(): any {
139
const {hintPosition, hintsLength, label, type, hintPositionSet} = this.props;
1410
switch (type) {
1511
case 'next':
@@ -34,11 +30,5 @@ class HintButton extends React.Component<{
3430
}
3531
}
3632

37-
const mapStateToProps = state => ({
38-
hintPosition: state.hintPosition,
39-
hintsLength: hintsSelector(state).length,
40-
});
41-
42-
const mapDispatchToProps = {hintPositionSet};
4333

44-
export default connect(mapStateToProps, mapDispatchToProps)(HintButton);
34+
export default HintButton;

src/components/Page/Hints/index.tsx

+19-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import HintButton from './HintButton';
77
import {Card, CardActions, CardHeader, CardText} from 'material-ui/Card';
88
import Help from 'material-ui/svg-icons/action/help';
99

10+
import {hintPositionSet} from '../../../actions';
11+
import {hintsSelector} from '../../../selectors';
12+
1013
const styles = {
1114
position: 'relative',
1215
margin: '5px auto 10px',
@@ -15,10 +18,10 @@ const styles = {
1518
};
1619

1720
class Hints extends React.Component<{
18-
hintsLength: number, hint: string
21+
hint: string, hintPosition: number, hintsLength: number, hintPositionSet: any,
1922
}, {}> {
20-
public render() {
21-
const {hint} = this.props;
23+
render(): any {
24+
const {hint, hintPosition, hintsLength, hintPositionSet} = this.props;
2225
if (!hint) {
2326
return null;
2427
}
@@ -34,7 +37,7 @@ class Hints extends React.Component<{
3437
className='cr-task-hint'
3538
expandable={true}
3639
>
37-
<Markdown>{hint}</Markdown>
40+
<Markdown children={hint} />
3841
</CardText>
3942
<CardActions
4043
style={{paddingBottom: '30px !important'}}
@@ -44,10 +47,16 @@ class Hints extends React.Component<{
4447
<HintButton
4548
type='prev'
4649
label='Previous'
50+
hintPosition={hintPosition}
51+
hintsLength={hintsLength}
52+
hintPositionSet={hintPositionSet}
4753
/>
4854
<HintButton
4955
type='next'
5056
label='Next'
57+
hintPosition={hintPosition}
58+
hintsLength={hintsLength}
59+
hintPositionSet={hintPositionSet}
5160
/>
5261
</CardActions>
5362
</Card>
@@ -57,6 +66,11 @@ class Hints extends React.Component<{
5766

5867
const mapStateToProps = state => ({
5968
hint: hintSelector(state),
69+
hintPosition: state.hintPosition,
70+
hintsLength: hintsSelector(state).length,
6071
});
6172

62-
export default connect(mapStateToProps)(Hints);
73+
const mapDispatchToProps = {hintPositionSet};
74+
75+
export default connect(mapStateToProps, mapDispatchToProps)(Hints);
76+

src/components/common/ContentCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const ContentCard: React.StatelessComponent<{
1515
<Card style={styles.card}>
1616
{title ? <CardHeader title={title} /> : null}
1717
<CardText>
18-
<Markdown>{content || ''}</Markdown>
18+
<Markdown children={content || ''} />
1919
</CardText>
2020
</Card>
2121
);

src/typings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"jest": "registry:dt/jest#0.9.0+20160706021812",
1010
"jquery": "registry:dt/jquery#1.10.0+20160908203239",
1111
"marked": "registry:dt/marked#0.0.0+20160325085301",
12-
"material-ui": "registry:dt/material-ui#0.15.1+20160824122606",
12+
"material-ui": "registry:dt/material-ui#0.15.1+20160908103128",
1313
"mixto": "registry:dt/mixto#0.0.0+20160317120654",
1414
"node": "registry:dt/node#6.0.0+20160831021119",
1515
"pathwatcher": "registry:dt/pathwatcher#0.0.0+20160317120654",

src/typings/globals/atom/index.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ declare namespace AtomCore {
605605

606606
mini: any;
607607

608+
getElement(): any;
608609
serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;};
610+
setPlaceholderText(text: string): any;
609611
deserializeParams(params:any):any;
610612
subscribeToBuffer():void;
611613
subscribeToDisplayBuffer():void;
@@ -929,10 +931,15 @@ declare namespace AtomCore {
929931
registry: any;
930932
repository: Object;
931933
scopeName: string;
934+
tokenizeLines(text: string): any;
932935
// TBD
933936

934937
}
935938

939+
interface IGrammars {
940+
grammarForScopeName(scope: string): IGrammar;
941+
}
942+
936943
interface IPane /* extends Theorist.Model */ {
937944
itemForURI: (uri:string)=>IEditor;
938945
items:any[];
@@ -1081,7 +1088,7 @@ declare namespace AtomCore {
10811088
addTopPanel(options:IWorkspacePanelOptions):Panel;
10821089
addModalPanel(options:IWorkspacePanelOptions):Panel;
10831090
addOpener(opener: Function): any;
1084-
1091+
buildTextEditor(): IEditor;
10851092
deserializeParams(params:any):any;
10861093
serializeParams():{paneContainer:any;fullScreen:boolean;};
10871094
eachEditor(callback: Function): void;
@@ -1286,6 +1293,7 @@ declare namespace AtomCore {
12861293
deserializers:IDeserializerManager;
12871294
config: IConfig;
12881295
commands: ICommandRegistry;
1296+
grammars: IGrammars;
12891297
keymaps: IKeymapManager;
12901298
keymap: IKeymapManager;
12911299
packages: IPackageManager;
@@ -1402,6 +1410,7 @@ declare namespace AtomCore {
14021410
}
14031411

14041412
interface IToken {
1413+
value: string;
14051414
// TBD
14061415
}
14071416

src/typings/globals/material-ui/index.d.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Generated by typings
2-
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/d0d8127eaa52ec102d65ba7c217ae948d275f8aa/material-ui/material-ui.d.ts
2+
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/facde8c11601788f42a373f06ad0dbf3d9e193c1/material-ui/material-ui.d.ts
33
declare module "material-ui" {
44
export import AppBar = __MaterialUI.AppBar;
55
export import AutoComplete = __MaterialUI.AutoComplete;
@@ -551,7 +551,7 @@ declare namespace __MaterialUI {
551551
errorStyle?: React.CSSProperties;
552552
errorText?: string;
553553
filter?: (searchText: string, key: string, item: AutoCompleteDataItem) => boolean;
554-
floatingLabelText?: string;
554+
floatingLabelText?: React.ReactNode;
555555
fullWidth?: boolean;
556556
hintText?: string;
557557
listStyle?: React.CSSProperties;
@@ -752,6 +752,7 @@ declare namespace __MaterialUI {
752752

753753
interface CardProps extends React.Props<Card> {
754754
actAsExpander?: boolean;
755+
className?: string;
755756
containerStyle?: React.CSSProperties;
756757
expandable?: boolean;
757758
expanded?: boolean;
@@ -765,6 +766,7 @@ declare namespace __MaterialUI {
765766

766767
interface CardActionsProps extends React.Props<CardActions> {
767768
actAsExpander?: boolean;
769+
className?: string;
768770
expandable?: boolean;
769771
showExpandableButton?: boolean;
770772
style?: React.CSSProperties;
@@ -812,6 +814,7 @@ declare namespace __MaterialUI {
812814

813815
interface CardTextProps extends React.Props<CardText> {
814816
actAsExpander?: boolean;
817+
className?: string;
815818
color?: string;
816819
expandable?: boolean;
817820
style?: React.CSSProperties;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"resolution": "main",
33
"tree": {
4-
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/d0d8127eaa52ec102d65ba7c217ae948d275f8aa/material-ui/material-ui.d.ts",
5-
"raw": "registry:dt/material-ui#0.15.1+20160824122606",
6-
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/d0d8127eaa52ec102d65ba7c217ae948d275f8aa/material-ui/material-ui.d.ts"
4+
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/facde8c11601788f42a373f06ad0dbf3d9e193c1/material-ui/material-ui.d.ts",
5+
"raw": "registry:dt/material-ui#0.15.1+20160908103128",
6+
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/facde8c11601788f42a373f06ad0dbf3d9e193c1/material-ui/material-ui.d.ts"
77
}
88
}

src/typings/globals/react-redux/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ declare namespace ReactRedux {
4343
export function connect(): InferableComponentDecorator;
4444

4545
export function connect<TStateProps, TDispatchProps, TOwnProps>(
46-
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>>,
46+
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>> | null,
4747
mapDispatchToProps?: FuncOrSelf<MapDispatchToPropsFunction<TDispatchProps, TOwnProps>|MapDispatchToPropsObject>
4848
): ComponentDecorator<TStateProps & TDispatchProps, TOwnProps>;
4949

5050
export function connect<TStateProps, TDispatchProps, TOwnProps>(
51-
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>>,
51+
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>> | null,
5252
mapDispatchToProps: FuncOrSelf<MapDispatchToPropsFunction<TDispatchProps, TOwnProps>|MapDispatchToPropsObject>,
5353
mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps>,
5454
options?: Options
@@ -57,7 +57,7 @@ declare namespace ReactRedux {
5757
type FuncOrSelf<T> = T | (() => T);
5858

5959
interface MapStateToProps<TStateProps, TOwnProps> {
60-
(state: any, ownProps?: TOwnProps): TStateProps;
60+
(state: any|null, ownProps?: TOwnProps): TStateProps;
6161
}
6262

6363
interface MapDispatchToPropsFunction<TDispatchProps, TOwnProps> {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'react-router-sans-urls';

0 commit comments

Comments
 (0)