Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f1c9f9

Browse files
committed
update types for new redux-thunk.d.ts
1 parentb399a7f commit3f1c9f9

File tree

13 files changed

+38
-31
lines changed

13 files changed

+38
-31
lines changed

‎lib/modules/alert/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
vartypes_1=require('./types');
33
functionalertOpen(alert){
4-
returnfunction(dispatch,getState){
4+
returnfunction(dispatch){
55
dispatch({type:types_1.ALERT_OPEN,payload:{alert:alert}});
66
};
77
}

‎lib/modules/tests/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function getTestFilter(result) {
7171
}
7272
}
7373
functiontestComplete(result){
74-
returnfunction(dispatch,getState){
74+
returnfunction(dispatch){
7575
switch(true){
7676
caseresult.completed:
7777
dispatch(testResult(result));

‎lib/modules/tutorials/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var types_1 = require('./types');
44
varactions_2=require('../tutorial/actions');
55
exports.tutorialSet=actions_2.tutorialSet;
66
functiontutorialUpdate(title){
7-
returnfunction(dispatch,getState){
7+
returnfunction(dispatch){
88
varalert={
99
message:"run `npm install --save-dev "+title+"`",
1010
action:'note',

‎src/modules/alert/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import{ALERT_CLOSE,ALERT_OPEN,ALERT_REPLAY}from'./types';
22

3-
exportfunctionalertOpen(alert:Object):ReduxThunk.ThunkInterface{
4-
return(dispatch,getState):void=>{
3+
exportfunctionalertOpen(alert:Object):Redux.ThunkAction<any,{},{}>{
4+
return(dispatch):void=>{
55
dispatch({type:ALERT_OPEN,payload:{ alert}});
66
};
77
}

‎src/modules/editor/actions.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export function editorInsert(content: string): Action {
1414
}
1515

1616
// opens file within a directory
17-
exportfunctioneditorOpen(file:string,options:Object){
17+
exportfunctioneditorOpen(file:string,options:Object):
18+
Redux.ThunkAction<any,{dir:string},{}>{
1819
return(dispatch,getState)=>{
1920
file=join(getState().dir,file);
2021
dispatch({type:EDITOR_OPEN,payload:{ file, options}});
@@ -33,7 +34,8 @@ export function editorScroll(content: string): Action {
3334
return{type:EDITOR_SCROLL,payload:{ content}};
3435
}
3536

36-
exportfunctioneditorWriteFileFromContent(to:string,content:string){
37+
exportfunctioneditorWriteFileFromContent(to:string,content:string):
38+
Redux.ThunkAction<any,{dir:string},{}>{
3739
return(dispatch,getState)=>{
3840
const{ dir}=getState();
3941
dispatch({
@@ -43,7 +45,8 @@ export function editorWriteFileFromContent(to: string, content: string) {
4345
};
4446
}
4547

46-
exportfunctioneditorWriteFileFromFile(to:string,from:string){
48+
exportfunctioneditorWriteFileFromFile(to:string,from:string):
49+
Redux.ThunkAction<any,any,{}>{
4750
return(dispatch,getState)=>{
4851
const{ dir, tutorial}=getState();
4952
consttutorialDir=tutorial.config.dir;

‎src/modules/page/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import{hintPositionSet,routeSet,testLoad}from'../../actions';
22
import{PAGE_SET}from'./types';
33

4-
exportfunctionpageNext():ReduxThunk.ThunkInterface|Action{
4+
exportfunctionpageNext():Redux.ThunkAction<any,any,{}>{
55
return(dispatch,getState):void=>{
66
let{pagePosition}=getState();
77
dispatch(pageSet(pagePosition+1));
88
};
99
}
1010

11-
exportfunctionpageSet(pagePosition=0):ReduxThunk.ThunkInterface{
11+
exportfunctionpageSet(pagePosition=0):Redux.ThunkAction<any,any,{}>{
1212
return(dispatch,getState):void=>{
1313
conststate=getState();
1414
const{progress, tutorial, route}=state;

‎src/modules/progress/actions.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
PROGRESS_COMPLETE_PAGE,PROGRESS_COMPLETE_TUTORIAL,PROGRESS_LOAD,PROGRESS_PAGE_POSITION
44
}from'./types';
55

6-
exportfunctionprogressLoad():ReduxThunk.ThunkInterface{
6+
exportfunctionprogressLoad():Redux.ThunkAction<any,any,{}>{
77
return(dispatch,getState)=>{
88
const{tutorial}=getState();
99
dispatch({type:PROGRESS_LOAD,payload:{ tutorial}});
@@ -12,14 +12,15 @@ export function progressLoad(): ReduxThunk.ThunkInterface {
1212
};
1313
}
1414

15-
function_progressPagePosition(){
15+
function_progressPagePosition():Redux.ThunkAction<any,any,{}>{
1616
return(dispatch,getState)=>{
1717
const{progress}=getState();
1818
dispatch({type:PROGRESS_PAGE_POSITION,payload:{ progress}});
1919
};
2020
}
2121

22-
exportfunctionprogressCompletePage(completed=true):ReduxThunk.ThunkInterface{
22+
exportfunctionprogressCompletePage(completed=true):
23+
Redux.ThunkAction<any,any,any>{
2324
return(dispatch,getState)=>{
2425
const{pagePosition, progress, tutorial}=getState();
2526
// all pages are true, tutorial complete
@@ -35,7 +36,8 @@ export function progressCompletePage(completed = true): ReduxThunk.ThunkInterfac
3536
};
3637
}
3738

38-
exportfunctionprogressCompleteTutorial(completed=true):ReduxThunk.ThunkInterface{
39+
exportfunctionprogressCompleteTutorial(completed=true):
40+
Redux.ThunkAction<any,any,any>{
3941
return(dispatch,getState)=>{
4042
const{tutorial}=getState();
4143
dispatch({type:PROGRESS_COMPLETE_TUTORIAL,payload:{ tutorial, completed}});

‎src/modules/route/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{ROUTE_SET}from'./types';
22

3-
exportfunctionrouteSet(route:string):ReduxThunk.ThunkInterface{
3+
exportfunctionrouteSet(route:string):Redux.ThunkAction<any,any,{}>{
44
return(dispatch,getState)=>{
55
if(getState.route!==route){
66
dispatch({type:ROUTE_SET,payload:{ route}});

‎src/modules/setup/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import{SETUP_PACKAGE,SETUP_VERIFY}from'./types';
22

3-
exportfunctionsetupVerify():ReduxThunk.ThunkInterface{
3+
exportfunctionsetupVerify():Redux.ThunkAction<any,any,{}>{
44
return(dispatch,getState):void=>{
55
dispatch(setupPackage());
66
const{dir, packageJson}=getState();
77
dispatch({type:SETUP_VERIFY,payload:{ dir, packageJson}});
88
};
99
}
1010

11-
exportfunctionsetupPackage():ReduxThunk.ThunkInterface{
11+
exportfunctionsetupPackage():Redux.ThunkAction<any,{dir:string},{}>{
1212
return(dispatch,getState):void=>{
1313
const{dir}=getState();
1414
dispatch({type:SETUP_PACKAGE,payload:{ dir}});

‎src/modules/tests/actions.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import {alertOpen, hintPositionSet, progressCompletePage} from '../../actions';
22
importgetTestNamefrom'./test-run/testName';
33
import{TEST_COMPLETE,TEST_LOAD,TEST_RESULT,TEST_RUN}from'./types';
44

5-
exportfunctiontestLoad(){
5+
exportfunctiontestLoad():Redux.ThunkAction<any,any,{}>{
66
return(dispatch,getState):void=>{
77
const{ dir, pagePosition, tutorial, taskTests}=getState();
88
consttestFile=getTestName({tutorial, pagePosition});
9-
109
dispatch({
1110
type:TEST_LOAD,payload:{
1211
dir,
@@ -18,7 +17,7 @@ export function testLoad() {
1817
};
1918
}
2019

21-
exportfunctiontestRun():ReduxThunk.ThunkInterface{
20+
exportfunctiontestRun():Redux.ThunkAction<any,any,{}>{
2221
return(dispatch,getState):void=>{
2322
// less than a second since the last test run, skip
2423
consttimeSinceLastTestRun=performance.now()-getState().testRun.time;
@@ -35,7 +34,8 @@ export function testRun(): ReduxThunk.ThunkInterface {
3534
};
3635
}
3736

38-
exportfunctiontestResult(result:Test.Result):ReduxThunk.ThunkInterface{
37+
exportfunctiontestResult(result:Test.Result):
38+
Redux.ThunkAction<any,any,{}>{
3939
return(dispatch,getState):void=>{
4040
const{taskActions, progress, pagePosition}=getState();
4141
constfilter:string=getTestFilter(result);
@@ -76,8 +76,9 @@ function getTestFilter(result: Test.Result): string {
7676
}
7777
}
7878

79-
exportfunctiontestComplete(result:Test.Result){
80-
return(dispatch,getState):void=>{
79+
exportfunctiontestComplete(result:Test.Result):
80+
Redux.ThunkAction<any,any,{}>{
81+
return(dispatch):void=>{
8182
switch(true){
8283
// all complete
8384
caseresult.completed:

‎src/modules/tutorial/actions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import{routeSet}from'../../actions';
22
import{TUTORIAL_SET}from'./types';
33

4-
exportfunctiontutorialSet({name, version}):ReduxThunk.ThunkInterface{
4+
exportfunctiontutorialSet({name, version}):
5+
Redux.ThunkAction<any,{dir:string},{}>{
56
return(dispatch,getState)=>{
67
const{dir}=getState();
78
dispatch({type:TUTORIAL_SET,payload:{name, dir, version}});

‎src/modules/tutorials/actions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import {alertOpen} from '../alert/actions';
22
import{TUTORIALS_FIND,TUTORIAL_UPDATE}from'./types';
33
export{tutorialSet}from'../tutorial/actions';
44

5-
exportfunctiontutorialUpdate(title:string):ReduxThunk.ThunkInterface{
6-
return(dispatch,getState)=>{
5+
exportfunctiontutorialUpdate(title:string):
6+
Redux.ThunkAction<any,{},{}>{
7+
return(dispatch)=>{
78
constalert={
89
message:`run \`npm install --save-dev${title}\``,
910
action:'note',
@@ -14,7 +15,7 @@ export function tutorialUpdate(title: string): ReduxThunk.ThunkInterface {
1415
};
1516
}
1617

17-
exportfunctiontutorialsFind():ReduxThunk.ThunkInterface{
18+
exportfunctiontutorialsFind():Redux.ThunkAction<any,{dir:string},{}>{
1819
return(dispatch,getState)=>{
1920
const{dir}=getState();
2021
dispatch({type:TUTORIALS_FIND,payload:{ dir}});

‎src/typings/index.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// Globals
22
/// <reference path="globals/atom/index.d.ts" />
33
/// <reference path="globals/es6-promise/index.d.ts" />
4-
/// <reference path="globals/node/index.d.ts" />
5-
/// <reference path="globals/react-dom/index.d.ts" />
6-
/// <reference path="globals/react/index.d.ts" />
7-
/// <reference path="globals/es6-promise/index.d.ts" />
84
/// <reference path="globals/marked/index.d.ts" />
95
/// <reference path="globals/material-ui/index.d.ts" />
6+
/// <reference path="globals/node/index.d.ts" />
7+
/// <reference path="globals/react/index.d.ts" />
8+
/// <reference path="globals/react-dom/index.d.ts" />
109
/// <reference path="globals/react-redux/index.d.ts" />
1110
/// <reference path="globals/react-tap-event-plugin/index.d.ts" />
1211
/// <reference path="globals/redux/index.d.ts" />

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp