Skip to content

Commit 0d67935

Browse files
committed
add core typings
1 parent 0a3aa83 commit 0d67935

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

src/typings/index.d.ts

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
export interface TutorialLevel {
2+
stageList: string[]
3+
content?: {
4+
title?: string
5+
text?: string
6+
}
7+
}
8+
9+
export interface TutorialStage {
10+
stepList: string[]
11+
content?: {
12+
title?: string
13+
text?: string
14+
}
15+
}
16+
17+
export interface TutorialHint {
18+
text: string
19+
displayed?: boolean
20+
}
21+
22+
export interface TutorialAction {
23+
commits: string[]
24+
commands?: string[]
25+
files?: string[]
26+
}
27+
28+
export interface TutorialStepContent {
29+
text: string
30+
title?: string
31+
}
32+
33+
export interface TutorialStep {
34+
content: TutorialStepContent
35+
actions: {
36+
setup: TutorialAction
37+
solution: TutorialAction
38+
}
39+
hints?: TutorialHint[]
40+
}
41+
42+
export interface TutorialData {
43+
summary: TutorialSummary
44+
levels: {
45+
[levelId: string]: TutorialLevel
46+
}
47+
stages: {
48+
[stageId: string]: TutorialStage
49+
}
50+
steps: {
51+
[stepId: string]: TutorialStep
52+
}
53+
}
54+
55+
export interface TutorialMeta {
56+
version: string
57+
repo: string
58+
createdBy: string
59+
createdAt: string
60+
updatedBy: string
61+
updatedAt: string
62+
contributors: string[]
63+
languages: string[]
64+
testRunner: string
65+
}
66+
67+
export interface TutorialSummary {
68+
title: string
69+
description: string
70+
levelList: string[]
71+
}
72+
73+
export interface Tutorial {
74+
id: string
75+
meta: TutorialMeta
76+
data: TutorialData
77+
}
78+
79+
export interface Progress {
80+
levels: {
81+
[levelId: string]: boolean
82+
}
83+
stages: {
84+
[stageId: string]: boolean
85+
}
86+
steps: {
87+
[stepId: string]: boolean
88+
}
89+
complete: boolean
90+
}
91+
92+
// current tutorial position
93+
export interface Position {
94+
levelId: string
95+
stageId: string
96+
stepId: string
97+
complete?: boolean
98+
}
99+
100+
// current tutorial state
101+
102+
export interface Action {
103+
type: string
104+
payload?: any
105+
meta?: any
106+
}

0 commit comments

Comments
 (0)