Skip to content

Commit 046f461

Browse files
committed
add tutorial config typings
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent dc0e70a commit 046f461

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

typings/tutorial.d.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
export type Maybe<T> = T | null;
2+
3+
export type TutorialConfig = {
4+
appVersions: TutorialAppVersions;
5+
testRunner: TestRunnerConfig;
6+
repo: TutorialRepo;
7+
dependencies?: TutorialDependency[];
8+
};
9+
10+
/** Logical groupings of tasks */
11+
export type Level = {
12+
id: string;
13+
title: string;
14+
/** A summary of the level */
15+
summary: string;
16+
/** The lesson content of the level, parsed as markdown */
17+
content: string;
18+
/** Actions run on level start up for configuring setup */
19+
setup?: Maybe<StepActions>;
20+
/** A set of tasks for users linked to unit tests */
21+
steps: Array<Step>;
22+
};
23+
24+
/** A level task */
25+
export type Step = {
26+
id: string;
27+
content: string;
28+
setup: StepActions;
29+
solution: Maybe<StepActions>;
30+
subtasks?: { [testName: string]: boolean };
31+
};
32+
33+
/** A tutorial for use in VSCode CodeRoad */
34+
export type Tutorial = {
35+
id: string;
36+
version: string;
37+
summary: TutorialSummary;
38+
config: TutorialConfig;
39+
levels: Array<Level>;
40+
};
41+
42+
/** Summary of tutorial used when selecting tutorial */
43+
export type TutorialSummary = {
44+
title: string;
45+
description: string;
46+
};
47+
48+
export type StepActions = {
49+
commands?: string[];
50+
commits: string[];
51+
files?: string[];
52+
watchers?: string[];
53+
filter?: string;
54+
subtasks?: boolean;
55+
};
56+
57+
export interface TestRunnerArgs {
58+
filter?: string;
59+
tap: string;
60+
}
61+
62+
export interface TestRunnerConfig {
63+
command: string;
64+
args?: TestRunnerArgs;
65+
directory?: string;
66+
setup?: StepActions;
67+
}
68+
69+
export interface TutorialRepo {
70+
uri: string;
71+
branch: string;
72+
}
73+
74+
export interface TutorialDependency {
75+
name: string;
76+
version: string;
77+
message?: string;
78+
}
79+
80+
export interface TutorialAppVersions {
81+
vscode: string;
82+
}

0 commit comments

Comments
 (0)