Skip to content

Commit 38215b3

Browse files
committed
Add StepEnums
1 parent 052c567 commit 38215b3

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

examples/typescript/ts-step_shotgun_surgery-01_base/src/Domain/QuizStep.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Step from "./Step";
22
import StepId from "./StepId";
3+
import {STEP_TYPE_QUIZ} from "./StepEnums";
34

45
class QuizStep extends Step {
56
constructor(
@@ -10,7 +11,7 @@ class QuizStep extends Step {
1011
}
1112

1213
type(): string {
13-
return 'quiz'
14+
return STEP_TYPE_QUIZ
1415
}
1516
}
1617

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const STEP_TYPE_VIDEO = 'video';
2+
export const STEP_TYPE_QUIZ = 'quiz';
3+
4+
export const STEP_DURATION_MULTIPLIER_VIDEO = 1.1;
5+
export const STEP_DURATION_MULTIPLIER_QUIZ = 1.5;
6+
7+
export const QUIZ_QUESTION_DURATION = 5;
8+
9+
// Important: don't forget to add here the type!!
10+
export const STEP_TYPES = [
11+
STEP_TYPE_VIDEO,
12+
STEP_TYPE_QUIZ
13+
];

examples/typescript/ts-step_shotgun_surgery-01_base/src/Domain/VideoStep.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import StepId from "./StepId";
22
import Step from "./Step";
3+
import {STEP_TYPE_VIDEO} from "./StepEnums";
34

45
class VideoStep extends Step {
56
constructor(
@@ -10,7 +11,7 @@ class VideoStep extends Step {
1011
}
1112

1213
type(): string {
13-
return 'video'
14+
return STEP_TYPE_VIDEO
1415
}
1516

1617
getVideoDuration(): number {

0 commit comments

Comments
 (0)