Skip to content

Commit 958f83c

Browse files
committed
add local version of typings
1 parent de65aa2 commit 958f83c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+21000
-1
lines changed

src/typings.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="../node_modules/core-coderoad/src/typings/index.d.ts" />
1+
/// <reference path="./typings/index.d.ts" />
22
// load typings from core-coderoad
33
// this requires that the module be declared first
44
declare module 'core-coderoad';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Type definitions for assertion-error 1.0.0
2+
// Project: https://github.com/chaijs/assertion-error
3+
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare module 'assertion-error' {
7+
class AssertionError implements Error {
8+
constructor(message: string, props?: any, ssf?: Function);
9+
name: string;
10+
message: string;
11+
showDiff: boolean;
12+
stack: string;
13+
}
14+
export = AssertionError;
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'atom-plugin-command-line' {
2+
export default function commandLine(root: string, commands?: string): Promise<string>;
3+
}

src/typings/atom/atom.d.ts

+1,888
Large diffs are not rendered by default.

src/typings/cr/cli.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
declare module 'coderoad-cli' {
2+
3+
export function build(
4+
dir: string, filePath: string, output?: string
5+
): boolean;
6+
7+
export function create(
8+
dir: string, name: string
9+
): boolean | Promise<boolean>;
10+
11+
export function tutorials(dir: string): Tutorial.Info[];
12+
13+
export function validatePacakgeJson(): Validation.Object;
14+
}

src/typings/cr/core.d.ts

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import * as React from 'react';
2+
3+
declare module 'core-coderoad' {
4+
5+
interface ConfiguredStore {
6+
reducer: Redux.Reducer;
7+
devMode?: boolean;
8+
throttle?: Object;
9+
}
10+
11+
// store
12+
export function configureStore(config: ConfiguredStore): Redux.Store;
13+
14+
// polyfills
15+
export function loadPolyfills(): void;
16+
17+
// options
18+
export const tutorialConfigOptions: Object;
19+
20+
// selectors
21+
export function hintsSelector(state: CR.State): string[];
22+
export function hintSelector(state: CR.State): string;
23+
export function pageSelector(state: CR.State): CR.Page;
24+
export function pageCompletedSelector(state: CR.State): boolean;
25+
export function tasksSelector(state: CR.State): CR.Task[];
26+
export function currentTaskSelector(state: CR.State): CR.Task;
27+
export function visibleTasksSelector(state: CR.State): CR.Task[];
28+
export function taskProgressSelector(state: CR.State): number;
29+
export function taskByIndexSelector(state: CR.State, props: { index: number }): CR.Task;
30+
export function configSelector(state: CR.State): Tutorial.Config;
31+
32+
// modules
33+
34+
// alert
35+
export function alertReducer(open: boolean, action: Action): boolean;
36+
export function alertOpen(alert: Object);
37+
export function alertReplay();
38+
export function alertClose();
39+
40+
// editor
41+
export function dirReducer(name: string): string;
42+
export function editorReducer(name: string, action: Action): string;
43+
export function editorDevToolsToggle();
44+
export function editorOpen(file: string, options?: Object);
45+
export function editorInsert(content: string);
46+
export function editorSet(content: string);
47+
export function editorSave();
48+
export function editorScroll(content: string);
49+
export function save();
50+
export function open(file: string, options?: Object);
51+
export function openFolder();
52+
export function set(content: string);
53+
export function insert(content: string);
54+
export function openDevTools();
55+
export function toggleDevTools();
56+
export function clearConsole();
57+
export function openTerminal();
58+
export function closeAllPanels();
59+
export function quit();
60+
61+
// route
62+
export function routeReducer(route: string, action: Action): string;
63+
export function routeSet(route: string);
64+
65+
// window
66+
export function quit();
67+
export function windowToggle();
68+
export function windowReducer(open: boolean, action: Action): boolean;
69+
70+
// components
71+
72+
export function render(app: React.Component<any, any>, target: HTMLElement): void;
73+
74+
export function highlight(text: string, lang: string): string;
75+
76+
export const Alert: React.Component<any, any>;
77+
export const Markdown: React.Component<any, any>;
78+
// export const RouteButton: React.Component<any, any>;
79+
// export const MenuLink: React.Component<any, any>;
80+
81+
}

src/typings/cr/cr.d.ts

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
declare namespace CR {
2+
3+
interface Info {
4+
title: string;
5+
description: string;
6+
}
7+
8+
interface Page extends Info {
9+
tasks?: Task[];
10+
onPageComplete?: string;
11+
}
12+
interface Task {
13+
description: string;
14+
tests?: string[];
15+
hints?: string[];
16+
actions?: string[];
17+
completed?: boolean;
18+
}
19+
20+
interface State {
21+
dir: string;
22+
route: string;
23+
tutorialInfo: Tutorial.Info;
24+
windowToggle: boolean;
25+
pagePosition: PagePosition;
26+
package: PackageJson;
27+
page: Page;
28+
progress: Progress;
29+
tasks: Task[];
30+
taskTests: string[];
31+
taskPosition: number;
32+
hintPosition: number;
33+
taskActions: string[];
34+
alert: Alert;
35+
tutorial: Tutorial;
36+
tutorials: Tutorial.Info[];
37+
testRun: boolean;
38+
checks: Checks;
39+
}
40+
41+
interface Tutorial {
42+
name: string;
43+
info: Tutorial.Info;
44+
pages: CR.Page[];
45+
packageJson: PackageJson;
46+
config: Tutorial.Config;
47+
}
48+
49+
type PagePosition = number;
50+
51+
interface Progress {
52+
completed: boolean;
53+
pages: boolean[];
54+
}
55+
56+
type TaskTest = string[];
57+
58+
interface Alert {
59+
message: string;
60+
action: string;
61+
open?: boolean;
62+
duration?: number;
63+
color: string;
64+
}
65+
66+
interface Checks {
67+
passed?: boolean;
68+
system: {
69+
passed?: boolean;
70+
node: boolean;
71+
npm: boolean;
72+
xcode: boolean;
73+
};
74+
setup: {
75+
passed?: boolean;
76+
hasDir: boolean;
77+
hasPackageJson: boolean;
78+
hasTutorial: boolean;
79+
};
80+
}
81+
82+
}

src/typings/cr/globals.d.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
}
23+
24+
interface ObjectConstructor {
25+
assign(target: any, ...sources: any[]): any;
26+
values(obj: Object): any[];
27+
}
28+
29+
interface IntrinsicAttributes {
30+
index: number;
31+
style: Object;
32+
className: string;
33+
targetOrigin: string;
34+
anchorOrigin: string;
35+
onClick: () => any;
36+
primaryText: string;
37+
primaryTogglesNestedList: any;
38+
}
39+
40+
type fileType = 'js'|'jsx'|'ts'|'py';
41+
42+
interface Process {
43+
resourcesPath: string;
44+
}

src/typings/cr/test.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
declare namespace Test {
2+
interface Result {
3+
pass: boolean;
4+
taskPosition: number;
5+
msg?: string;
6+
timedOut?: boolean;
7+
change: number;
8+
completed: boolean;
9+
}
10+
11+
interface Config {
12+
dir: string;
13+
tutorialDir: string;
14+
taskPosition: number;
15+
}
16+
17+
interface Log {
18+
type: string;
19+
output: any;
20+
}
21+
}

src/typings/cr/tutorial.d.ts

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
declare namespace Tutorial {
2+
interface Item {
3+
name: string;
4+
version: string;
5+
latest?: boolean;
6+
}
7+
8+
interface Info {
9+
title: string;
10+
description?: string;
11+
keywords?: string[];
12+
version?: string;
13+
}
14+
15+
interface Config {
16+
language?: string;
17+
dir: string;
18+
runner: string;
19+
runnerOptions?: Object;
20+
run: any;
21+
testSuffix?: string;
22+
issuesPath?: string;
23+
repo?: string;
24+
edit?: boolean;
25+
}
26+
27+
interface Output {
28+
info: CR.Info;
29+
pages: CR.Page[];
30+
}
31+
32+
interface PJ {
33+
name: string;
34+
repository?: Object;
35+
bugs?: Object;
36+
config: {
37+
language: string;
38+
runner: string;
39+
runnerOptions: RunnerOptions;
40+
};
41+
engines: Object;
42+
keywords: string[];
43+
files: string[];
44+
main: string;
45+
description: string;
46+
version: string;
47+
author?: string;
48+
authors?: string;
49+
dependencies?: Object;
50+
devDependencies?: Object;
51+
peerDependencies?: Object;
52+
license?: string;
53+
contributers?: string[];
54+
}
55+
56+
interface RunnerOptions { }
57+
58+
}

src/typings/cr/validation.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
declare namespace Validation {
2+
interface Object {
3+
errors: Errors[];
4+
warnings: Errors[];
5+
}
6+
7+
interface Errors {
8+
name: string;
9+
msg: string;
10+
example?: string;
11+
}
12+
}

0 commit comments

Comments
 (0)