Skip to content

Commit 5e5b979

Browse files
committed
restructure typings
1 parent 3f1c9f9 commit 5e5b979

File tree

12 files changed

+39
-120
lines changed

12 files changed

+39
-120
lines changed

lib/modules/route/actions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var types_1 = require('./types');
33
function routeSet(route) {
44
return function (dispatch, getState) {
5-
if (getState.route !== route) {
5+
if (getState().route !== route) {
66
dispatch({ type: types_1.ROUTE_SET, payload: { route: route } });
77
}
88
return;

src/modules/route/actions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {ROUTE_SET} from './types';
22

33
export function routeSet(route: string): Redux.ThunkAction<any, any, {}> {
44
return (dispatch, getState) => {
5-
if (getState.route !== route) {
5+
if (getState().route !== route) {
66
dispatch({ type: ROUTE_SET, payload: { route } });
77
}
88
return;
File renamed without changes.
File renamed without changes.

src/typings/common/action.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface Action {
2+
type: string;
3+
payload?;
4+
error?: boolean;
5+
meta?;
6+
filter?: string;
7+
}

src/typings/cr/globals.d.ts renamed to src/typings/common/index.d.ts

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
1-
interface Action {
2-
type: string;
3-
payload?;
4-
error?: boolean;
5-
meta?;
6-
filter?: string;
7-
}
8-
9-
interface PackageJson {
10-
name: string;
11-
main: string;
12-
version: string;
13-
dependencies?: Object;
14-
devDependencies?: Object;
15-
config: Tutorial.Config;
16-
bugs?: {
17-
url: string;
18-
};
19-
repo?: {
20-
url: string;
21-
};
22-
}
1+
import { Action } from './action.d.ts';
2+
import { PackageJson } from './package-json.d.ts';
233

244
interface ObjectConstructor {
255
assign(target: any, ...sources: any[]): any;

src/typings/common/package-json.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export interface PackageJson {
2+
name: string;
3+
main: string;
4+
version: string;
5+
dependencies?: Object;
6+
devDependencies?: Object;
7+
config: Tutorial.Config;
8+
bugs?: {
9+
url: string;
10+
};
11+
repo?: {
12+
url: string;
13+
};
14+
}

src/typings/cr/core.d.ts

-81
This file was deleted.

src/typings/index.d.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
/// <reference path="globals/text-buffer/index.d.ts" />
1818

1919
// Custom
20+
/// <reference path="cli/index.d.ts" />
2021
/// <reference path="globals/node-file-exists/index.d.ts" />
2122
/// <reference path="globals/redux-throttle-actions/index.d.ts" />
2223
/// <reference path="globals/sort-package-json/index.d.ts" />
2324

2425
// Local
25-
/// <reference path="cr/cli.d.ts" />
26-
/// <reference path="cr/core.d.ts" />
27-
/// <reference path="cr/cr.d.ts" />
28-
/// <reference path="cr/globals.d.ts" />
29-
/// <reference path="cr/test.d.ts" />
30-
/// <reference path="cr/tutorial.d.ts" />
26+
/// <reference path="common/index.d.ts" />
27+
/// <reference path="coderoad/index.d.ts" />
28+
/// <reference path="tests/index.d.ts" />
29+
/// <reference path="tutorial/index.d.ts" />

src/typings/cr/test.d.ts renamed to src/typings/tests/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare namespace Test {
2-
interface Result {
2+
export interface Result {
33
pass: boolean;
44
taskPosition: number;
55
msg?: string;
@@ -8,13 +8,13 @@ declare namespace Test {
88
completed: boolean;
99
}
1010

11-
interface Config {
11+
export interface Config {
1212
dir: string;
1313
tutorialDir: string;
1414
taskPosition: number;
1515
}
1616

17-
interface Log {
17+
export interface Log {
1818
type: string;
1919
output: any;
2020
}
File renamed without changes.

src/typings/cr/tutorial.d.ts renamed to src/typings/tutorial/index.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
declare namespace Tutorial {
2-
interface Item {
2+
export interface Item {
33
name: string;
44
version: string;
55
latest?: boolean;
66
}
77

8-
interface Info {
8+
export interface Info {
99
title: string;
1010
description?: string;
1111
keywords?: string[];
1212
version?: string;
1313
}
1414

15-
interface Config {
15+
export interface Config {
1616
language?: string;
1717
dir: string;
1818
runner: string;
@@ -25,12 +25,12 @@ declare namespace Tutorial {
2525
edit?: boolean;
2626
}
2727

28-
interface Output {
28+
export interface Output {
2929
info: CR.Info;
3030
pages: CR.Page[];
3131
}
3232

33-
interface PJ {
33+
export interface PJ {
3434
name: string;
3535
repository?: Object;
3636
bugs?: Object;
@@ -54,6 +54,6 @@ declare namespace Tutorial {
5454
contributers?: string[];
5555
}
5656

57-
interface RunnerOptions { }
57+
export interface RunnerOptions { }
5858

5959
}

0 commit comments

Comments
 (0)